From eb7f79c35866720705cb15f8311d77c72f353d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 22 Dec 2022 20:21:39 -0800 Subject: [PATCH 01/86] D3D12: Fixed setting draw scissor. --- src/renderer_d3d12.cpp | 129 ++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 71 deletions(-) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index e48b973d3..36d23cb5a 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -6787,68 +6787,54 @@ namespace bgfx { namespace d3d12 } } - const uint64_t newFlags = draw.m_stateFlags; - uint64_t changedFlags = currentState.m_stateFlags ^ draw.m_stateFlags; - currentState.m_stateFlags = newFlags; - - if (0 != (BGFX_STATE_PT_MASK & changedFlags) ) - { - primIndex = uint8_t( (newFlags&BGFX_STATE_PT_MASK)>>BGFX_STATE_PT_SHIFT); - } - - const uint64_t newStencil = draw.m_stencil; - uint64_t changedStencil = (currentState.m_stencil ^ draw.m_stencil) & BGFX_STENCIL_FUNC_REF_MASK; - currentState.m_stencil = newStencil; - - if (resetState) - { - wasCompute = false; - - currentState.clear(); - currentState.m_scissor = !draw.m_scissor; - changedFlags = BGFX_STATE_MASK; - changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK); - currentState.m_stateFlags = newFlags; - currentState.m_stencil = newStencil; - - currentBind.clear(); - - commandListChanged = true; - } - - if (commandListChanged) - { - commandListChanged = false; - - m_commandList->SetGraphicsRootSignature(m_rootSignature); - ID3D12DescriptorHeap* heaps[] = { - m_samplerAllocator.getHeap(), - scratchBuffer.getHeap(), - }; - m_commandList->SetDescriptorHeaps(BX_COUNTOF(heaps), heaps); - - currentPso = NULL; - currentBindHash = 0; - currentSamplerStateIdx = kInvalidHandle; - currentProgram = BGFX_INVALID_HANDLE; - currentState.clear(); - currentState.m_scissor = !draw.m_scissor; - changedFlags = BGFX_STATE_MASK; - changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK); - currentState.m_stateFlags = newFlags; - currentState.m_stencil = newStencil; - - currentBind.clear(); - - const uint64_t pt = newFlags&BGFX_STATE_PT_MASK; - primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); - } - - bool constantsChanged = draw.m_uniformBegin < draw.m_uniformEnd; - rendererUpdateUniforms(this, _render->m_uniformBuffer[draw.m_uniformIdx], draw.m_uniformBegin, draw.m_uniformEnd); - if (0 != draw.m_streamMask) { + const uint64_t newFlags = draw.m_stateFlags; + uint64_t changedFlags = currentState.m_stateFlags ^ draw.m_stateFlags; + currentState.m_stateFlags = newFlags; + + if (0 != (BGFX_STATE_PT_MASK & changedFlags) ) + { + primIndex = uint8_t( (newFlags&BGFX_STATE_PT_MASK)>>BGFX_STATE_PT_SHIFT); + } + + const uint64_t newStencil = draw.m_stencil; + uint64_t changedStencil = (currentState.m_stencil ^ draw.m_stencil) & BGFX_STENCIL_FUNC_REF_MASK; + currentState.m_stencil = newStencil; + + if (resetState + || commandListChanged) + { + wasCompute = false; + commandListChanged = false; + + m_commandList->SetGraphicsRootSignature(m_rootSignature); + ID3D12DescriptorHeap* heaps[] = { + m_samplerAllocator.getHeap(), + scratchBuffer.getHeap(), + }; + m_commandList->SetDescriptorHeaps(BX_COUNTOF(heaps), heaps); + + currentPso = NULL; + currentBindHash = 0; + currentSamplerStateIdx = kInvalidHandle; + currentProgram = BGFX_INVALID_HANDLE; + currentState.clear(); + currentState.m_scissor = !draw.m_scissor; + changedFlags = BGFX_STATE_MASK; + changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK); + currentState.m_stateFlags = newFlags; + currentState.m_stencil = newStencil; + + currentBind.clear(); + + const uint64_t pt = newFlags&BGFX_STATE_PT_MASK; + primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + } + + bool constantsChanged = draw.m_uniformBegin < draw.m_uniformEnd; + rendererUpdateUniforms(this, _render->m_uniformBuffer[draw.m_uniformIdx], draw.m_uniformBegin, draw.m_uniformEnd); + currentState.m_streamMask = draw.m_streamMask; currentState.m_instanceDataBuffer.idx = draw.m_instanceDataBuffer.idx; currentState.m_instanceDataOffset = draw.m_instanceDataOffset; @@ -6891,23 +6877,23 @@ namespace bgfx { namespace d3d12 } } - ID3D12PipelineState* pso = - getPipelineState(state - , draw.m_stencil - , numStreams - , layouts - , key.m_program - , uint8_t(draw.m_instanceDataStride/16) - ); + ID3D12PipelineState* pso = getPipelineState( + state + , draw.m_stencil + , numStreams + , layouts + , key.m_program + , uint8_t(draw.m_instanceDataStride/16) + ); + + const uint32_t bindHash = bx::hash(renderBind.m_bind, sizeof(renderBind.m_bind) ); - uint16_t scissor = draw.m_scissor; - uint32_t bindHash = bx::hash(renderBind.m_bind, sizeof(renderBind.m_bind) ); if (currentBindHash != bindHash || 0 != changedStencil || (hasFactor && blendFactor != draw.m_rgba) || (0 != (BGFX_STATE_PT_MASK & changedFlags) || prim.m_topology != s_primInfo[primIndex].m_topology) - || currentState.m_scissor != scissor + || currentState.m_scissor != draw.m_scissor || pso != currentPso || hasOcclusionQuery) { @@ -7053,6 +7039,7 @@ namespace bgfx { namespace d3d12 m_commandList->IASetPrimitiveTopology(prim.m_topology); } + const uint16_t scissor = draw.m_scissor; if (currentState.m_scissor != scissor) { currentState.m_scissor = scissor; From a93a714632b79b5ddbf5c86ac323fa9b76ed3433 Mon Sep 17 00:00:00 2001 From: Bryan McNett <50128843+bryanmcnett@users.noreply.github.com> Date: Fri, 23 Dec 2022 23:00:26 -0800 Subject: [PATCH 02/86] fix for save file dialog in windows (#3003) the save file dialog in windows was an open file dialog, by mistake Co-authored-by: Bryan McNett --- examples/common/entry/dialog.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/examples/common/entry/dialog.cpp b/examples/common/entry/dialog.cpp index 76c84108a..8c1bf9731 100644 --- a/examples/common/entry/dialog.cpp +++ b/examples/common/entry/dialog.cpp @@ -42,6 +42,7 @@ struct OPENFILENAMEA }; extern "C" bool __stdcall GetOpenFileNameA(OPENFILENAMEA* _ofn); +extern "C" bool __stdcall GetSaveFileNameA(OPENFILENAMEA * _ofn); extern "C" void* __stdcall GetModuleHandleA(const char* _moduleName); extern "C" uint32_t __stdcall GetModuleFileNameA(void* _module, char* _outFilePath, uint32_t _size); extern "C" void* __stdcall ShellExecuteA(void* _hwnd, void* _operation, void* _file, void* _parameters, void* _directory, int32_t _showCmd); @@ -104,6 +105,17 @@ private: char m_ch; }; +#if BX_PLATFORM_WINDOWS +extern "C" typedef bool(__stdcall* OPENFILENAMEFUNCTION)(OPENFILENAMEA* _ofn); +static const struct { OPENFILENAMEFUNCTION m_function; uint32_t m_flags; } +s_getFileNameA[] = +{ + { GetOpenFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 | /* OFN_FILEMUSTEXIST */ 0x00001000 }, + { GetSaveFileNameA, /* OFN_EXPLORER */ 0x00080000 | /* OFN_DONTADDTORECENT */ 0x02000000 }, +}; +BX_STATIC_ASSERT(BX_COUNTOF(s_getFileNameA) == FileSelectionDialogType::Count); +#endif + #if !BX_PLATFORM_OSX bool openFileSelectionDialog( bx::FilePath& _inOutFilePath @@ -156,7 +168,8 @@ bool openFileSelectionDialog( } } #elif BX_PLATFORM_WINDOWS - BX_UNUSED(_type); + if (_type < 0 || _type >= BX_COUNTOF(s_getFileNameA)) + return false; char out[bx::kMaxFilePath] = { '\0' }; @@ -166,11 +179,7 @@ bool openFileSelectionDialog( ofn.initialDir = _inOutFilePath.getCPtr(); ofn.file = out; ofn.maxFile = sizeof(out); - ofn.flags = 0 - | /* OFN_EXPLORER */ 0x00080000 - | /* OFN_FILEMUSTEXIST */ 0x00001000 - | /* OFN_DONTADDTORECENT */ 0x02000000 - ; + ofn.flags = s_getFileNameA[_type].m_flags; char tmp[4096]; bx::StaticMemoryBlockWriter writer(tmp, sizeof(tmp) ); @@ -220,7 +229,7 @@ bool openFileSelectionDialog( bx::write(&writer, '\0', &err); if (err.isOk() - && GetOpenFileNameA(&ofn) ) + && s_getFileNameA[_type].m_function(&ofn)) { _inOutFilePath.set(ofn.file); return true; From 877cdb8b1f88eed6461622616ae7e3fa77b9b39a Mon Sep 17 00:00:00 2001 From: Ali Seyedof Date: Wed, 28 Dec 2022 18:16:37 +0000 Subject: [PATCH 03/86] shaderc HLSL profile switch fix (#3005) * shaderc HLSL profile switch fix * shader makefiles changed to match new hlsl profile switches Co-authored-by: Ali Seyedof --- scripts/shader-embeded.mk | 16 ++++++++-------- scripts/shader.mk | 10 +++++----- tools/shaderc/shaderc_hlsl.cpp | 10 +++++++--- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/scripts/shader-embeded.mk b/scripts/shader-embeded.mk index 5fe1fcd07..99760f167 100644 --- a/scripts/shader-embeded.mk +++ b/scripts/shader-embeded.mk @@ -30,11 +30,11 @@ vs_%.bin.h : vs_%.sc -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform linux -p spirv -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_spv -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p vs_3_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx9 + -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p s_3_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx9 -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p vs_4_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 + -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p s_5_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl + -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl -@cat "$(SHADER_TMP)" >> $(@) -@printf "extern const uint8_t* $(basename $(<))_pssl;\n" | tr -d '\015' >> $(@) -@printf "extern const uint32_t $(basename $(<))_pssl_size;\n" | tr -d '\015' >> $(@) @@ -47,24 +47,24 @@ fs_%.bin.h : fs_%.sc -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform linux -p spirv -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_spv -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p ps_3_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx9 + -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p s_3_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx9 -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p ps_4_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 + -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p s_5_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl + -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl -@cat "$(SHADER_TMP)" >> $(@) -@printf "extern const uint8_t* $(basename $(<))_pssl;\n" | tr -d '\015' >> $(@) -@printf "extern const uint32_t $(basename $(<))_pssl_size;\n" | tr -d '\015' >> $(@) cs_%.bin.h : cs_%.sc @echo [$(<)] - $(SILENT) $(SHADERC) $(CS_FLAGS) --platform linux -p 430 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_glsl + $(SILENT) $(SHADERC) $(CS_FLAGS) --platform linux -p 430 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_glsl @cat "$(SHADER_TMP)" > $(@) -$(SILENT) $(SHADERC) $(CS_FLAGS) --platform android -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl -@cat "$(SHADER_TMP)" >> $(@) -$(SILENT) $(SHADERC) $(CS_FLAGS) --platform linux -p spirv -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_spv -@cat "$(SHADER_TMP)" >> $(@) - -$(SILENT) $(SHADERC) $(CS_FLAGS) --platform windows -p cs_5_0 -O 1 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 + -$(SILENT) $(SHADERC) $(CS_FLAGS) --platform windows -p s_5_0 -O 1 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11 -@cat "$(SHADER_TMP)" >> $(@) -@printf "extern const uint8_t* $(basename $(<))_pssl;\n" | tr -d '\015' >> $(@) -@printf "extern const uint32_t $(basename $(<))_pssl_size;\n" | tr -d '\015' >> $(@) diff --git a/scripts/shader.mk b/scripts/shader.mk index d1ddbf2b0..0a46cfaa0 100644 --- a/scripts/shader.mk +++ b/scripts/shader.mk @@ -53,14 +53,14 @@ else ADDITIONAL_INCLUDES?= ifeq ($(TARGET), 0) -VS_FLAGS=--platform windows -p vs_3_0 -O 3 -FS_FLAGS=--platform windows -p ps_3_0 -O 3 +VS_FLAGS=--platform windows -p s_3_0 -O 3 +FS_FLAGS=--platform windows -p s_3_0 -O 3 SHADER_PATH=shaders/dx9 else ifeq ($(TARGET), 1) -VS_FLAGS=--platform windows -p vs_5_0 -O 3 -FS_FLAGS=--platform windows -p ps_5_0 -O 3 -CS_FLAGS=--platform windows -p cs_5_0 -O 1 +VS_FLAGS=--platform windows -p s_5_0 -O 3 +FS_FLAGS=--platform windows -p s_5_0 -O 3 +CS_FLAGS=--platform windows -p s_5_0 -O 1 SHADER_PATH=shaders/dx11 else ifeq ($(TARGET), 2) diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 7671c03f3..739a250fa 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -563,6 +563,10 @@ namespace bgfx { namespace hlsl return false; } + char profileAndType[100] = {0}; + profileAndType[0] = (_options.shaderType == 'f') ? 'p' : _options.shaderType; + bx::strCat(profileAndType, 100, profile); + s_compiler = load(); bool result = false; @@ -618,7 +622,7 @@ namespace bgfx { namespace hlsl , NULL , NULL , "main" - , profile + , profileAndType , flags , 0 , &code @@ -677,7 +681,7 @@ namespace bgfx { namespace hlsl else { UniformNameList unusedUniforms; - if (!getReflectionDataD3D11(code, profile[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms) ) + if (!getReflectionDataD3D11(code, profileAndType[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms) ) { bx::printf("Error: Unable to get D3D11 reflection data.\n"); goto error; @@ -736,7 +740,7 @@ namespace bgfx { namespace hlsl uint16_t count = (uint16_t)uniforms.size(); bx::write(_writer, count, &err); - uint32_t fragmentBit = profile[0] == 'p' ? kUniformFragmentBit : 0; + uint32_t fragmentBit = profileAndType[0] == 'p' ? kUniformFragmentBit : 0; for (UniformArray::const_iterator it = uniforms.begin(); it != uniforms.end(); ++it) { const Uniform& un = *it; From 5f435ea56b29c3dd3ebdf9fab1a8f408681ff919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 28 Dec 2022 10:26:39 -0800 Subject: [PATCH 04/86] Cleanup. --- tools/shaderc/shaderc_hlsl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 739a250fa..67aebe9ef 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -563,9 +563,9 @@ namespace bgfx { namespace hlsl return false; } - char profileAndType[100] = {0}; + char profileAndType[8] = {}; profileAndType[0] = (_options.shaderType == 'f') ? 'p' : _options.shaderType; - bx::strCat(profileAndType, 100, profile); + bx::strCat(profileAndType, BX_COUNTOF(profileAndType), profile); s_compiler = load(); From e33efb8b42491a6687e98e4e55615bf524b8aea4 Mon Sep 17 00:00:00 2001 From: pheonix Date: Sat, 7 Jan 2023 09:07:15 -0800 Subject: [PATCH 05/86] shaderc updates (#3018) - add support for Vulkan 1.3 using SPIR-V 1.6 as a profile target - move ordering of help information of SPIR-V block - update SPIR-V to Vulkan mapping documentation --- tools/shaderc/shaderc.cpp | 6 ++++-- tools/shaderc/shaderc_spirv.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index a8c284c14..61bbb7491 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -85,6 +85,7 @@ namespace bgfx // 1.3 | 1.1 | 1311 // 1.4 | 1.1 | 1411 // 1.5 | 1.2 | 1512 + // 1.6 | 1.3 | 1613 struct Profile { @@ -104,11 +105,12 @@ namespace bgfx { ShadingLang::HLSL, 500, "s_5_0" }, { ShadingLang::Metal, 1000, "metal" }, { ShadingLang::PSSL, 1000, "pssl" }, + { ShadingLang::SpirV, 1010, "spirv" }, + { ShadingLang::SpirV, 1010, "spirv10-10" }, { ShadingLang::SpirV, 1311, "spirv13-11" }, { ShadingLang::SpirV, 1411, "spirv14-11" }, { ShadingLang::SpirV, 1512, "spirv15-12" }, - { ShadingLang::SpirV, 1010, "spirv10-10" }, - { ShadingLang::SpirV, 1010, "spirv" }, + { ShadingLang::SpirV, 1613, "spirv16-13" }, { ShadingLang::GLSL, 120, "120" }, { ShadingLang::GLSL, 130, "130" }, { ShadingLang::GLSL, 140, "140" }, diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp index 657cb1015..a2e951f66 100644 --- a/tools/shaderc/shaderc_spirv.cpp +++ b/tools/shaderc/shaderc_spirv.cpp @@ -385,6 +385,8 @@ namespace bgfx { namespace spirv return SPV_ENV_VULKAN_1_1_SPIRV_1_4; case 1512: return SPV_ENV_VULKAN_1_2; + case 1613: + return SPV_ENV_VULKAN_1_3; default: BX_ASSERT(0, "Unknown SPIR-V version requested. Returning SPV_ENV_VULKAN_1_0 as default."); return SPV_ENV_VULKAN_1_0; @@ -402,6 +404,8 @@ namespace bgfx { namespace spirv return glslang::EShTargetVulkan_1_1; case 1512: return glslang::EShTargetVulkan_1_2; + case 1613: + return glslang::EShTargetVulkan_1_3; default: BX_ASSERT(0, "Unknown SPIR-V version requested. Returning EShTargetVulkan_1_0 as default."); return glslang::EShTargetVulkan_1_0; @@ -420,6 +424,8 @@ namespace bgfx { namespace spirv return glslang::EShTargetSpv_1_4; case 1512: return glslang::EShTargetSpv_1_5; + case 1613: + return glslang::EShTargetSpv_1_6; default: BX_ASSERT(0, "Unknown SPIR-V version requested. Returning EShTargetSpv_1_0 as default."); return glslang::EShTargetSpv_1_0; From 4f3ce6abcb05f0bf154ef447136793bfe2a7da92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 13 Jan 2023 07:08:51 -0800 Subject: [PATCH 06/86] Entry: Resize window before calling init. --- examples/common/entry/entry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index 58a671e6a..e5ce4d77c 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -530,11 +530,11 @@ BX_PRAGMA_DIAGNOSTIC_POP(); int runApp(AppI* _app, int _argc, const char* const* _argv) { + setWindowSize(kDefaultWindowHandle, s_width, s_height); + _app->init(_argc, _argv, s_width, s_height); bgfx::frame(); - setWindowSize(kDefaultWindowHandle, s_width, s_height); - #if BX_PLATFORM_EMSCRIPTEN s_app = _app; emscripten_set_main_loop(&updateApp, -1, 1); From 14b82682991b09ebfa626ee43dcd913f0c67f220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 13 Jan 2023 09:08:59 -0800 Subject: [PATCH 07/86] CI: We only care about Android ARM64. --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63772b046..2c55b2755 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -211,10 +211,7 @@ jobs: fail-fast: true matrix: include: [ - { platform: arm }, { platform: arm64 }, - { platform: x86 }, - { platform: x86_64 }, ] name: android-${{ matrix.platform }} runs-on: ubuntu-22.04 From 466c6a4e95f6c2ebd61040d6fe2f6418e45b7e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 10:05:12 -0800 Subject: [PATCH 08/86] Happy New Year! --- LICENSE | 2 +- README.md | 2 +- docs/license.rst | 2 +- examples/00-helloworld/helloworld.cpp | 2 +- examples/01-cubes/cubes.cpp | 2 +- examples/01-cubes/fs_cubes.sc | 2 +- examples/01-cubes/makefile | 2 +- examples/01-cubes/vs_cubes.sc | 2 +- examples/02-metaballs/fs_metaballs.sc | 2 +- examples/02-metaballs/makefile | 2 +- examples/02-metaballs/metaballs.cpp | 2 +- examples/02-metaballs/vs_metaballs.sc | 2 +- examples/03-raymarch/fs_raymarching.sc | 2 +- examples/03-raymarch/makefile | 2 +- examples/03-raymarch/raymarch.cpp | 2 +- examples/03-raymarch/vs_raymarching.sc | 2 +- examples/04-mesh/fs_mesh.sc | 2 +- examples/04-mesh/makefile | 2 +- examples/04-mesh/mesh.cpp | 2 +- examples/04-mesh/vs_mesh.sc | 2 +- examples/05-instancing/fs_instancing.sc | 2 +- examples/05-instancing/instancing.cpp | 2 +- examples/05-instancing/makefile | 2 +- examples/05-instancing/vs_instancing.sc | 2 +- examples/06-bump/bump.cpp | 2 +- examples/06-bump/fs_bump.sc | 2 +- examples/06-bump/makefile | 2 +- examples/06-bump/vs_bump.sc | 2 +- examples/06-bump/vs_bump_instanced.sc | 2 +- examples/07-callback/callback.cpp | 2 +- examples/07-callback/fs_callback.sc | 2 +- examples/07-callback/makefile | 2 +- examples/07-callback/vs_callback.sc | 2 +- examples/08-update/fs_update.sc | 2 +- examples/08-update/fs_update_3d.sc | 2 +- examples/08-update/fs_update_cmp.sc | 2 +- examples/08-update/makefile | 2 +- examples/08-update/update.cpp | 2 +- examples/08-update/vs_update.sc | 2 +- examples/09-hdr/common.sh | 2 +- examples/09-hdr/fs_hdr_blur.sc | 2 +- examples/09-hdr/fs_hdr_bright.sc | 2 +- examples/09-hdr/fs_hdr_lum.sc | 2 +- examples/09-hdr/fs_hdr_lumavg.sc | 2 +- examples/09-hdr/fs_hdr_mesh.sc | 2 +- examples/09-hdr/fs_hdr_skybox.sc | 2 +- examples/09-hdr/fs_hdr_tonemap.sc | 2 +- examples/09-hdr/hdr.cpp | 2 +- examples/09-hdr/makefile | 2 +- examples/09-hdr/vs_hdr_blur.sc | 2 +- examples/09-hdr/vs_hdr_bright.sc | 2 +- examples/09-hdr/vs_hdr_lum.sc | 2 +- examples/09-hdr/vs_hdr_lumavg.sc | 2 +- examples/09-hdr/vs_hdr_mesh.sc | 2 +- examples/09-hdr/vs_hdr_skybox.sc | 2 +- examples/09-hdr/vs_hdr_tonemap.sc | 2 +- examples/12-lod/makefile | 2 +- examples/13-stencil/makefile | 2 +- examples/14-shadowvolumes/makefile | 2 +- examples/15-shadowmaps-simple/makefile | 2 +- examples/16-shadowmaps/makefile | 2 +- examples/16-shadowmaps/vs_shadowmaps_hblur.sc | 2 +- examples/17-drawstress/drawstress.cpp | 2 +- examples/17-drawstress/fs_drawstress.sc | 2 +- examples/17-drawstress/makefile | 2 +- examples/17-drawstress/vs_drawstress.sc | 2 +- examples/18-ibl/makefile | 2 +- examples/19-oit/fs_oit.sc | 2 +- examples/19-oit/fs_oit_wb.sc | 2 +- examples/19-oit/fs_oit_wb_blit.sc | 2 +- examples/19-oit/fs_oit_wb_separate.sc | 2 +- examples/19-oit/fs_oit_wb_separate_blit.sc | 2 +- examples/19-oit/makefile | 2 +- examples/19-oit/oit.cpp | 2 +- examples/19-oit/vs_oit.sc | 2 +- examples/19-oit/vs_oit_blit.sc | 2 +- examples/20-nanovg/nanovg.cpp | 2 +- examples/21-deferred/common.sh | 2 +- examples/21-deferred/deferred.cpp | 2 +- examples/21-deferred/fs_deferred_clear_uav.sc | 2 +- examples/21-deferred/fs_deferred_combine.sc | 2 +- examples/21-deferred/fs_deferred_combine_ta.sc | 2 +- examples/21-deferred/fs_deferred_debug.sc | 2 +- examples/21-deferred/fs_deferred_debug_line.sc | 2 +- examples/21-deferred/fs_deferred_debug_ta.sc | 2 +- examples/21-deferred/fs_deferred_geom.sc | 2 +- examples/21-deferred/fs_deferred_light.sc | 2 +- examples/21-deferred/fs_deferred_light_ta.sc | 2 +- examples/21-deferred/fs_deferred_light_uav.sc | 2 +- examples/21-deferred/makefile | 2 +- examples/21-deferred/vs_deferred_combine.sc | 2 +- examples/21-deferred/vs_deferred_debug.sc | 2 +- examples/21-deferred/vs_deferred_debug_line.sc | 2 +- examples/21-deferred/vs_deferred_geom.sc | 2 +- examples/21-deferred/vs_deferred_light.sc | 2 +- examples/22-windows/windows.cpp | 2 +- examples/23-vectordisplay/makefile | 2 +- examples/24-nbody/makefile | 2 +- examples/26-occlusion/occlusion.cpp | 2 +- examples/27-terrain/makefile | 2 +- examples/28-wireframe/makefile | 2 +- examples/29-debugdraw/debugdraw.cpp | 2 +- examples/30-picking/fs_picking_id.sc | 2 +- examples/30-picking/fs_picking_shaded.sc | 2 +- examples/30-picking/makefile | 2 +- examples/30-picking/vs_picking_shaded.sc | 2 +- examples/31-rsm/makefile | 2 +- examples/32-particles/particles.cpp | 2 +- examples/33-pom/makefile | 2 +- examples/33-pom/pom.cpp | 2 +- examples/34-mvs/mvs.cpp | 2 +- examples/35-dynamic/dynamic.cpp | 2 +- examples/36-sky/makefile | 2 +- examples/36-sky/vs_sky_landscape.sc | 2 +- examples/37-gpudrivenrendering/makefile | 2 +- examples/38-bloom/fs_bloom_combine.sc | 2 +- examples/38-bloom/makefile | 2 +- examples/38-bloom/vs_deferred_combine.sc | 2 +- examples/39-assao/makefile | 2 +- examples/40-svt/fs_vt_mip.sc | 2 +- examples/40-svt/fs_vt_unlit.sc | 2 +- examples/40-svt/makefile | 2 +- examples/40-svt/virtualtexture.sh | 2 +- examples/40-svt/vs_vt_generic.sc | 2 +- examples/41-tess/makefile | 2 +- examples/42-bunnylod/bunnylod.cpp | 2 +- examples/42-bunnylod/fs_bunnylod.sc | 2 +- examples/42-bunnylod/makefile | 2 +- examples/42-bunnylod/vs_bunnylod.sc | 2 +- examples/46-fsr/makefile | 2 +- examples/47-pixelformats/makefile | 2 +- examples/48-drawindirect/makefile | 2 +- examples/49-hextile/makefile | 2 +- examples/common/aviwriter.h | 2 +- examples/common/bgfx_utils.cpp | 2 +- examples/common/bgfx_utils.h | 2 +- examples/common/common.h | 2 +- examples/common/common.sh | 2 +- examples/common/debugdraw/debugdraw.cpp | 2 +- examples/common/debugdraw/debugdraw.h | 2 +- examples/common/debugdraw/fs_debugdraw_fill.sc | 2 +- examples/common/debugdraw/fs_debugdraw_fill_lit.sc | 2 +- examples/common/debugdraw/fs_debugdraw_fill_texture.sc | 2 +- examples/common/debugdraw/fs_debugdraw_lines.sc | 2 +- examples/common/debugdraw/fs_debugdraw_lines_stipple.sc | 2 +- examples/common/debugdraw/makefile | 2 +- examples/common/debugdraw/vs_debugdraw_fill.sc | 2 +- examples/common/debugdraw/vs_debugdraw_fill_lit.sc | 2 +- examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc | 2 +- examples/common/debugdraw/vs_debugdraw_fill_mesh.sc | 2 +- examples/common/debugdraw/vs_debugdraw_fill_texture.sc | 2 +- examples/common/debugdraw/vs_debugdraw_lines.sc | 2 +- examples/common/debugdraw/vs_debugdraw_lines_stipple.sc | 2 +- examples/common/entry/cmd.cpp | 2 +- examples/common/entry/cmd.h | 2 +- examples/common/entry/dbg.h | 2 +- examples/common/entry/dialog.cpp | 2 +- examples/common/entry/dialog.h | 2 +- examples/common/entry/entry.cpp | 2 +- examples/common/entry/entry.h | 2 +- examples/common/entry/entry_android.cpp | 2 +- examples/common/entry/entry_glfw.cpp | 2 +- examples/common/entry/entry_html5.cpp | 2 +- examples/common/entry/entry_ios.mm | 2 +- examples/common/entry/entry_noop.cpp | 2 +- examples/common/entry/entry_osx.mm | 2 +- examples/common/entry/entry_p.h | 2 +- examples/common/entry/entry_sdl.cpp | 2 +- examples/common/entry/entry_windows.cpp | 2 +- examples/common/entry/entry_x11.cpp | 2 +- examples/common/entry/input.cpp | 2 +- examples/common/entry/input.h | 2 +- examples/common/example-glue.cpp | 2 +- examples/common/font/makefile | 2 +- examples/common/imgui/imgui.h | 2 +- examples/common/imgui/makefile | 2 +- examples/common/nanovg/makefile | 2 +- examples/common/nanovg/nanovg_bgfx.cpp | 2 +- examples/common/nanovg/nanovg_bgfx.h | 2 +- examples/common/packrect.h | 2 +- examples/common/ps/fs_particle.sc | 2 +- examples/common/ps/makefile | 2 +- examples/common/ps/particle_system.cpp | 2 +- examples/common/ps/particle_system.h | 2 +- examples/common/ps/vs_particle.sc | 2 +- examples/common/shaderlib.sh | 2 +- examples/makefile | 2 +- include/bgfx/bgfx.h | 2 +- include/bgfx/c99/bgfx.h | 2 +- include/bgfx/defines.h | 2 +- include/bgfx/embedded_shader.h | 2 +- include/bgfx/platform.h | 2 +- makefile | 2 +- scripts/bgfx.lua | 2 +- scripts/bindings-bf.lua | 2 +- scripts/bindings-cs.lua | 4 ++-- scripts/bindings-zig.lua | 2 +- scripts/example-common.lua | 2 +- scripts/genie.lua | 4 ++-- scripts/geometryc.lua | 2 +- scripts/shader-embeded.mk | 2 +- scripts/shader.mk | 2 +- scripts/shaderc.lua | 2 +- scripts/temp.bgfx.h | 2 +- scripts/temp.bgfx.idl.inl | 2 +- scripts/temp.defines.h | 2 +- scripts/texturec.lua | 2 +- scripts/tools.mk | 2 +- src/amalgamated.cpp | 2 +- src/amalgamated.mm | 2 +- src/bgfx.cpp | 2 +- src/bgfx.idl.inl | 2 +- src/bgfx_compute.sh | 2 +- src/bgfx_p.h | 2 +- src/bgfx_shader.sh | 2 +- src/charset.h | 2 +- src/config.h | 2 +- src/debug_renderdoc.cpp | 2 +- src/debug_renderdoc.h | 2 +- src/dxgi.cpp | 2 +- src/dxgi.h | 2 +- src/emscripten.h | 2 +- src/fs_clear0.sc | 2 +- src/fs_clear1.sc | 2 +- src/fs_clear2.sc | 2 +- src/fs_clear3.sc | 2 +- src/fs_clear4.sc | 2 +- src/fs_clear5.sc | 2 +- src/fs_clear6.sc | 2 +- src/fs_clear7.sc | 2 +- src/fs_debugfont.sc | 2 +- src/glcontext_eagl.h | 2 +- src/glcontext_eagl.mm | 2 +- src/glcontext_egl.cpp | 2 +- src/glcontext_egl.h | 2 +- src/glcontext_glx.cpp | 2 +- src/glcontext_glx.h | 2 +- src/glcontext_html5.cpp | 2 +- src/glcontext_html5.h | 2 +- src/glcontext_nsgl.h | 2 +- src/glcontext_nsgl.mm | 2 +- src/glcontext_wgl.cpp | 2 +- src/glcontext_wgl.h | 2 +- src/glimports.h | 2 +- src/makefile | 2 +- src/nvapi.cpp | 2 +- src/nvapi.h | 2 +- src/renderer.h | 2 +- src/renderer_agc.cpp | 2 +- src/renderer_d3d.h | 2 +- src/renderer_d3d11.cpp | 2 +- src/renderer_d3d11.h | 2 +- src/renderer_d3d12.cpp | 2 +- src/renderer_d3d12.h | 2 +- src/renderer_d3d9.cpp | 2 +- src/renderer_d3d9.h | 2 +- src/renderer_gl.cpp | 2 +- src/renderer_gl.h | 2 +- src/renderer_gnm.cpp | 2 +- src/renderer_noop.cpp | 2 +- src/renderer_nvn.cpp | 2 +- src/renderer_vk.cpp | 2 +- src/renderer_vk.h | 2 +- src/shader.cpp | 2 +- src/shader.h | 2 +- src/shader_dx9bc.cpp | 2 +- src/shader_dx9bc.h | 2 +- src/shader_dxbc.cpp | 4 ++-- src/shader_dxbc.h | 4 ++-- src/shader_spirv.cpp | 2 +- src/shader_spirv.h | 2 +- src/topology.cpp | 2 +- src/topology.h | 2 +- src/version.h | 2 +- src/vertexlayout.cpp | 2 +- src/vertexlayout.h | 2 +- src/vs_clear.sc | 2 +- src/vs_debugfont.sc | 2 +- tools/geometryc/geometryc.cpp | 4 ++-- tools/shaderc/shaderc.cpp | 4 ++-- tools/shaderc/shaderc.h | 2 +- tools/shaderc/shaderc_glsl.cpp | 2 +- tools/shaderc/shaderc_hlsl.cpp | 2 +- tools/shaderc/shaderc_metal.cpp | 2 +- tools/shaderc/shaderc_pssl.cpp | 2 +- tools/shaderc/shaderc_spirv.cpp | 2 +- tools/texturev/common.sh | 2 +- tools/texturev/fs_texture.sc | 2 +- tools/texturev/fs_texture_3d.sc | 2 +- tools/texturev/fs_texture_array.sc | 2 +- tools/texturev/fs_texture_cube.sc | 2 +- tools/texturev/fs_texture_cube2.sc | 2 +- tools/texturev/fs_texture_msdf.sc | 2 +- tools/texturev/fs_texture_sdf.sc | 2 +- tools/texturev/makefile | 2 +- tools/texturev/texturev.cpp | 6 +++--- tools/texturev/vs_texture.sc | 2 +- tools/texturev/vs_texture_cube.sc | 2 +- 298 files changed, 306 insertions(+), 306 deletions(-) diff --git a/LICENSE b/LICENSE index e21e5d5f3..f8393b901 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2010-2022 Branimir Karadzic +Copyright 2010-2023 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index e11cb4dbc..99aed723b 100644 --- a/README.md +++ b/README.md @@ -537,7 +537,7 @@ https://github.com/astrofra/demo-marine-melodies - Copyright 2010-2022 Branimir Karadzic + Copyright 2010-2023 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/docs/license.rst b/docs/license.rst index 130b994d2..47f48e7bb 100644 --- a/docs/license.rst +++ b/docs/license.rst @@ -6,7 +6,7 @@ License :: - Copyright 2010-2022 Branimir Karadzic + Copyright 2010-2023 Branimir Karadzic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/examples/00-helloworld/helloworld.cpp b/examples/00-helloworld/helloworld.cpp index 97a794633..884a9ab0a 100644 --- a/examples/00-helloworld/helloworld.cpp +++ b/examples/00-helloworld/helloworld.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/01-cubes/cubes.cpp b/examples/01-cubes/cubes.cpp index de4566739..4f8084001 100644 --- a/examples/01-cubes/cubes.cpp +++ b/examples/01-cubes/cubes.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/01-cubes/fs_cubes.sc b/examples/01-cubes/fs_cubes.sc index 8ea959c83..6f31cbe23 100644 --- a/examples/01-cubes/fs_cubes.sc +++ b/examples/01-cubes/fs_cubes.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/01-cubes/makefile b/examples/01-cubes/makefile index 19c81e436..dd0194e12 100644 --- a/examples/01-cubes/makefile +++ b/examples/01-cubes/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/01-cubes/vs_cubes.sc b/examples/01-cubes/vs_cubes.sc index d80005d46..a9637c800 100644 --- a/examples/01-cubes/vs_cubes.sc +++ b/examples/01-cubes/vs_cubes.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/02-metaballs/fs_metaballs.sc b/examples/02-metaballs/fs_metaballs.sc index 9173da91f..9f36e3010 100644 --- a/examples/02-metaballs/fs_metaballs.sc +++ b/examples/02-metaballs/fs_metaballs.sc @@ -1,7 +1,7 @@ $input v_normal, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/02-metaballs/makefile b/examples/02-metaballs/makefile index efdae05bf..38377fb80 100644 --- a/examples/02-metaballs/makefile +++ b/examples/02-metaballs/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/02-metaballs/metaballs.cpp b/examples/02-metaballs/metaballs.cpp index 305bf53b3..95ca1dbe0 100644 --- a/examples/02-metaballs/metaballs.cpp +++ b/examples/02-metaballs/metaballs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/02-metaballs/vs_metaballs.sc b/examples/02-metaballs/vs_metaballs.sc index 1470977f1..0312e7b73 100644 --- a/examples/02-metaballs/vs_metaballs.sc +++ b/examples/02-metaballs/vs_metaballs.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_color0 $output v_normal, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/03-raymarch/fs_raymarching.sc b/examples/03-raymarch/fs_raymarching.sc index 39a0972fe..41ba85166 100644 --- a/examples/03-raymarch/fs_raymarching.sc +++ b/examples/03-raymarch/fs_raymarching.sc @@ -1,7 +1,7 @@ $input v_color0, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/03-raymarch/makefile b/examples/03-raymarch/makefile index 19c81e436..dd0194e12 100644 --- a/examples/03-raymarch/makefile +++ b/examples/03-raymarch/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/03-raymarch/raymarch.cpp b/examples/03-raymarch/raymarch.cpp index 6fb30b91a..c84039762 100644 --- a/examples/03-raymarch/raymarch.cpp +++ b/examples/03-raymarch/raymarch.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/03-raymarch/vs_raymarching.sc b/examples/03-raymarch/vs_raymarching.sc index ab32d2a2f..94eac94f4 100644 --- a/examples/03-raymarch/vs_raymarching.sc +++ b/examples/03-raymarch/vs_raymarching.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_texcoord0 $output v_color0, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/04-mesh/fs_mesh.sc b/examples/04-mesh/fs_mesh.sc index 93991561e..4e3444720 100644 --- a/examples/04-mesh/fs_mesh.sc +++ b/examples/04-mesh/fs_mesh.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/04-mesh/makefile b/examples/04-mesh/makefile index 19c81e436..dd0194e12 100644 --- a/examples/04-mesh/makefile +++ b/examples/04-mesh/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/04-mesh/mesh.cpp b/examples/04-mesh/mesh.cpp index 59c6c0706..dd5837198 100644 --- a/examples/04-mesh/mesh.cpp +++ b/examples/04-mesh/mesh.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/04-mesh/vs_mesh.sc b/examples/04-mesh/vs_mesh.sc index 8ca8dbf55..6c8b2cb56 100644 --- a/examples/04-mesh/vs_mesh.sc +++ b/examples/04-mesh/vs_mesh.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/05-instancing/fs_instancing.sc b/examples/05-instancing/fs_instancing.sc index 8ea959c83..6f31cbe23 100644 --- a/examples/05-instancing/fs_instancing.sc +++ b/examples/05-instancing/fs_instancing.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/05-instancing/instancing.cpp b/examples/05-instancing/instancing.cpp index 6b066c16d..307f56fb0 100644 --- a/examples/05-instancing/instancing.cpp +++ b/examples/05-instancing/instancing.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/05-instancing/makefile b/examples/05-instancing/makefile index 19c81e436..dd0194e12 100644 --- a/examples/05-instancing/makefile +++ b/examples/05-instancing/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/05-instancing/vs_instancing.sc b/examples/05-instancing/vs_instancing.sc index 5d952e65c..5fdf63990 100644 --- a/examples/05-instancing/vs_instancing.sc +++ b/examples/05-instancing/vs_instancing.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, i_data0, i_data1, i_data2, i_data3, i_data4 $output v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index bbfe793fe..ca9cfc7b6 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/06-bump/fs_bump.sc b/examples/06-bump/fs_bump.sc index 7d56dbd0f..b0636e96a 100644 --- a/examples/06-bump/fs_bump.sc +++ b/examples/06-bump/fs_bump.sc @@ -1,7 +1,7 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0// in... /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/06-bump/makefile b/examples/06-bump/makefile index 19c81e436..dd0194e12 100644 --- a/examples/06-bump/makefile +++ b/examples/06-bump/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/06-bump/vs_bump.sc b/examples/06-bump/vs_bump.sc index 325c98710..292192cb5 100644 --- a/examples/06-bump/vs_bump.sc +++ b/examples/06-bump/vs_bump.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_tangent, a_texcoord0 $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/06-bump/vs_bump_instanced.sc b/examples/06-bump/vs_bump_instanced.sc index 7e45b313a..0b903b8f1 100644 --- a/examples/06-bump/vs_bump_instanced.sc +++ b/examples/06-bump/vs_bump_instanced.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_tangent, a_texcoord0, i_data0, i_data1, i_data2, $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/07-callback/callback.cpp b/examples/07-callback/callback.cpp index 418b2a96e..0f6097d9f 100644 --- a/examples/07-callback/callback.cpp +++ b/examples/07-callback/callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/07-callback/fs_callback.sc b/examples/07-callback/fs_callback.sc index 3e8f850e3..07feb33b9 100644 --- a/examples/07-callback/fs_callback.sc +++ b/examples/07-callback/fs_callback.sc @@ -1,7 +1,7 @@ $input v_world, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/07-callback/makefile b/examples/07-callback/makefile index 19c81e436..dd0194e12 100644 --- a/examples/07-callback/makefile +++ b/examples/07-callback/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/07-callback/vs_callback.sc b/examples/07-callback/vs_callback.sc index aba775fd4..cf5a0ed63 100644 --- a/examples/07-callback/vs_callback.sc +++ b/examples/07-callback/vs_callback.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_world, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/08-update/fs_update.sc b/examples/08-update/fs_update.sc index 41e24ed1f..76d5f0e36 100644 --- a/examples/08-update/fs_update.sc +++ b/examples/08-update/fs_update.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/08-update/fs_update_3d.sc b/examples/08-update/fs_update_3d.sc index 8986846d5..213d85408 100644 --- a/examples/08-update/fs_update_3d.sc +++ b/examples/08-update/fs_update_3d.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/08-update/fs_update_cmp.sc b/examples/08-update/fs_update_cmp.sc index 076d8965e..a06f4bedb 100644 --- a/examples/08-update/fs_update_cmp.sc +++ b/examples/08-update/fs_update_cmp.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/08-update/makefile b/examples/08-update/makefile index 19c81e436..dd0194e12 100644 --- a/examples/08-update/makefile +++ b/examples/08-update/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index 9e9f63fcb..2f3497da3 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/08-update/vs_update.sc b/examples/08-update/vs_update.sc index 545369275..0483c189a 100644 --- a/examples/08-update/vs_update.sc +++ b/examples/08-update/vs_update.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/common.sh b/examples/09-hdr/common.sh index 056d9d608..18c3b6eb9 100644 --- a/examples/09-hdr/common.sh +++ b/examples/09-hdr/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/fs_hdr_blur.sc b/examples/09-hdr/fs_hdr_blur.sc index d6130d77d..049f8b38f 100644 --- a/examples/09-hdr/fs_hdr_blur.sc +++ b/examples/09-hdr/fs_hdr_blur.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/fs_hdr_bright.sc b/examples/09-hdr/fs_hdr_bright.sc index 321fac73a..246d532ce 100644 --- a/examples/09-hdr/fs_hdr_bright.sc +++ b/examples/09-hdr/fs_hdr_bright.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/fs_hdr_lum.sc b/examples/09-hdr/fs_hdr_lum.sc index 392ab7483..691b28128 100644 --- a/examples/09-hdr/fs_hdr_lum.sc +++ b/examples/09-hdr/fs_hdr_lum.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/fs_hdr_lumavg.sc b/examples/09-hdr/fs_hdr_lumavg.sc index 4c682a98c..fc1e27e9b 100644 --- a/examples/09-hdr/fs_hdr_lumavg.sc +++ b/examples/09-hdr/fs_hdr_lumavg.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/fs_hdr_mesh.sc b/examples/09-hdr/fs_hdr_mesh.sc index 760a0928d..093d3d3e7 100644 --- a/examples/09-hdr/fs_hdr_mesh.sc +++ b/examples/09-hdr/fs_hdr_mesh.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/fs_hdr_skybox.sc b/examples/09-hdr/fs_hdr_skybox.sc index c2880f57c..2eea2fbd3 100644 --- a/examples/09-hdr/fs_hdr_skybox.sc +++ b/examples/09-hdr/fs_hdr_skybox.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/fs_hdr_tonemap.sc b/examples/09-hdr/fs_hdr_tonemap.sc index 44f3df9b4..978607188 100644 --- a/examples/09-hdr/fs_hdr_tonemap.sc +++ b/examples/09-hdr/fs_hdr_tonemap.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/hdr.cpp b/examples/09-hdr/hdr.cpp index 6184611b4..3d0af4346 100644 --- a/examples/09-hdr/hdr.cpp +++ b/examples/09-hdr/hdr.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/makefile b/examples/09-hdr/makefile index 19c81e436..dd0194e12 100644 --- a/examples/09-hdr/makefile +++ b/examples/09-hdr/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/09-hdr/vs_hdr_blur.sc b/examples/09-hdr/vs_hdr_blur.sc index e4dad0170..80bb703d6 100644 --- a/examples/09-hdr/vs_hdr_blur.sc +++ b/examples/09-hdr/vs_hdr_blur.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/vs_hdr_bright.sc b/examples/09-hdr/vs_hdr_bright.sc index 545369275..0483c189a 100644 --- a/examples/09-hdr/vs_hdr_bright.sc +++ b/examples/09-hdr/vs_hdr_bright.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/vs_hdr_lum.sc b/examples/09-hdr/vs_hdr_lum.sc index 545369275..0483c189a 100644 --- a/examples/09-hdr/vs_hdr_lum.sc +++ b/examples/09-hdr/vs_hdr_lum.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/vs_hdr_lumavg.sc b/examples/09-hdr/vs_hdr_lumavg.sc index 545369275..0483c189a 100644 --- a/examples/09-hdr/vs_hdr_lumavg.sc +++ b/examples/09-hdr/vs_hdr_lumavg.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/vs_hdr_mesh.sc b/examples/09-hdr/vs_hdr_mesh.sc index a10d55992..6204caa4e 100644 --- a/examples/09-hdr/vs_hdr_mesh.sc +++ b/examples/09-hdr/vs_hdr_mesh.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_pos, v_view, v_normal /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/vs_hdr_skybox.sc b/examples/09-hdr/vs_hdr_skybox.sc index 545369275..0483c189a 100644 --- a/examples/09-hdr/vs_hdr_skybox.sc +++ b/examples/09-hdr/vs_hdr_skybox.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/09-hdr/vs_hdr_tonemap.sc b/examples/09-hdr/vs_hdr_tonemap.sc index e7fea0c3e..9d50c792e 100644 --- a/examples/09-hdr/vs_hdr_tonemap.sc +++ b/examples/09-hdr/vs_hdr_tonemap.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/12-lod/makefile b/examples/12-lod/makefile index 19c81e436..dd0194e12 100644 --- a/examples/12-lod/makefile +++ b/examples/12-lod/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/13-stencil/makefile b/examples/13-stencil/makefile index 19c81e436..dd0194e12 100644 --- a/examples/13-stencil/makefile +++ b/examples/13-stencil/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/14-shadowvolumes/makefile b/examples/14-shadowvolumes/makefile index 19c81e436..dd0194e12 100644 --- a/examples/14-shadowvolumes/makefile +++ b/examples/14-shadowvolumes/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/15-shadowmaps-simple/makefile b/examples/15-shadowmaps-simple/makefile index 19c81e436..dd0194e12 100644 --- a/examples/15-shadowmaps-simple/makefile +++ b/examples/15-shadowmaps-simple/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/16-shadowmaps/makefile b/examples/16-shadowmaps/makefile index 19c81e436..dd0194e12 100644 --- a/examples/16-shadowmaps/makefile +++ b/examples/16-shadowmaps/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/16-shadowmaps/vs_shadowmaps_hblur.sc b/examples/16-shadowmaps/vs_shadowmaps_hblur.sc index 99ddaf2c5..0af78acd2 100644 --- a/examples/16-shadowmaps/vs_shadowmaps_hblur.sc +++ b/examples/16-shadowmaps/vs_shadowmaps_hblur.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/17-drawstress/drawstress.cpp b/examples/17-drawstress/drawstress.cpp index 5dd17370c..aa9c6ecf6 100644 --- a/examples/17-drawstress/drawstress.cpp +++ b/examples/17-drawstress/drawstress.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/17-drawstress/fs_drawstress.sc b/examples/17-drawstress/fs_drawstress.sc index 8ea959c83..6f31cbe23 100644 --- a/examples/17-drawstress/fs_drawstress.sc +++ b/examples/17-drawstress/fs_drawstress.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/17-drawstress/makefile b/examples/17-drawstress/makefile index efdae05bf..38377fb80 100644 --- a/examples/17-drawstress/makefile +++ b/examples/17-drawstress/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/17-drawstress/vs_drawstress.sc b/examples/17-drawstress/vs_drawstress.sc index d80005d46..a9637c800 100644 --- a/examples/17-drawstress/vs_drawstress.sc +++ b/examples/17-drawstress/vs_drawstress.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/18-ibl/makefile b/examples/18-ibl/makefile index 19c81e436..dd0194e12 100644 --- a/examples/18-ibl/makefile +++ b/examples/18-ibl/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/19-oit/fs_oit.sc b/examples/19-oit/fs_oit.sc index a087e5f3a..e3cc677ef 100644 --- a/examples/19-oit/fs_oit.sc +++ b/examples/19-oit/fs_oit.sc @@ -1,7 +1,7 @@ $input v_pos /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/19-oit/fs_oit_wb.sc b/examples/19-oit/fs_oit_wb.sc index 9cb69a52e..f8d77f4d3 100644 --- a/examples/19-oit/fs_oit_wb.sc +++ b/examples/19-oit/fs_oit_wb.sc @@ -1,7 +1,7 @@ $input v_pos /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/19-oit/fs_oit_wb_blit.sc b/examples/19-oit/fs_oit_wb_blit.sc index f6f45c820..b4bcf5153 100644 --- a/examples/19-oit/fs_oit_wb_blit.sc +++ b/examples/19-oit/fs_oit_wb_blit.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/19-oit/fs_oit_wb_separate.sc b/examples/19-oit/fs_oit_wb_separate.sc index 3e4c6d8ce..2a6a9364d 100644 --- a/examples/19-oit/fs_oit_wb_separate.sc +++ b/examples/19-oit/fs_oit_wb_separate.sc @@ -1,7 +1,7 @@ $input v_pos /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/19-oit/fs_oit_wb_separate_blit.sc b/examples/19-oit/fs_oit_wb_separate_blit.sc index 58c888aaa..cfff5f7d3 100644 --- a/examples/19-oit/fs_oit_wb_separate_blit.sc +++ b/examples/19-oit/fs_oit_wb_separate_blit.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/19-oit/makefile b/examples/19-oit/makefile index 19c81e436..dd0194e12 100644 --- a/examples/19-oit/makefile +++ b/examples/19-oit/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/19-oit/oit.cpp b/examples/19-oit/oit.cpp index 576cd091f..4d4fc4bef 100644 --- a/examples/19-oit/oit.cpp +++ b/examples/19-oit/oit.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/19-oit/vs_oit.sc b/examples/19-oit/vs_oit.sc index b38d28fda..f2296d524 100644 --- a/examples/19-oit/vs_oit.sc +++ b/examples/19-oit/vs_oit.sc @@ -2,7 +2,7 @@ $input a_position $output v_pos /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/19-oit/vs_oit_blit.sc b/examples/19-oit/vs_oit_blit.sc index 545369275..0483c189a 100644 --- a/examples/19-oit/vs_oit_blit.sc +++ b/examples/19-oit/vs_oit_blit.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/20-nanovg/nanovg.cpp b/examples/20-nanovg/nanovg.cpp index 144d21b8b..51b21b936 100644 --- a/examples/20-nanovg/nanovg.cpp +++ b/examples/20-nanovg/nanovg.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/common.sh b/examples/21-deferred/common.sh index 14dd727bb..8589a431d 100644 --- a/examples/21-deferred/common.sh +++ b/examples/21-deferred/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/deferred.cpp b/examples/21-deferred/deferred.cpp index 6c379fd3f..47adbabfc 100644 --- a/examples/21-deferred/deferred.cpp +++ b/examples/21-deferred/deferred.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_clear_uav.sc b/examples/21-deferred/fs_deferred_clear_uav.sc index bf355703e..e8e4f4d34 100644 --- a/examples/21-deferred/fs_deferred_clear_uav.sc +++ b/examples/21-deferred/fs_deferred_clear_uav.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_combine.sc b/examples/21-deferred/fs_deferred_combine.sc index 31318e331..31c3872b5 100644 --- a/examples/21-deferred/fs_deferred_combine.sc +++ b/examples/21-deferred/fs_deferred_combine.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_combine_ta.sc b/examples/21-deferred/fs_deferred_combine_ta.sc index ce18dcc1e..9ede7b86b 100644 --- a/examples/21-deferred/fs_deferred_combine_ta.sc +++ b/examples/21-deferred/fs_deferred_combine_ta.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_debug.sc b/examples/21-deferred/fs_deferred_debug.sc index 1d3b0951a..9ee68140f 100644 --- a/examples/21-deferred/fs_deferred_debug.sc +++ b/examples/21-deferred/fs_deferred_debug.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_debug_line.sc b/examples/21-deferred/fs_deferred_debug_line.sc index 8ea959c83..6f31cbe23 100644 --- a/examples/21-deferred/fs_deferred_debug_line.sc +++ b/examples/21-deferred/fs_deferred_debug_line.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_debug_ta.sc b/examples/21-deferred/fs_deferred_debug_ta.sc index e69f2fcda..9766ef90e 100644 --- a/examples/21-deferred/fs_deferred_debug_ta.sc +++ b/examples/21-deferred/fs_deferred_debug_ta.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_geom.sc b/examples/21-deferred/fs_deferred_geom.sc index 0466d720a..18006e749 100644 --- a/examples/21-deferred/fs_deferred_geom.sc +++ b/examples/21-deferred/fs_deferred_geom.sc @@ -1,7 +1,7 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_light.sc b/examples/21-deferred/fs_deferred_light.sc index 680b5a8e0..892d384e9 100644 --- a/examples/21-deferred/fs_deferred_light.sc +++ b/examples/21-deferred/fs_deferred_light.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_light_ta.sc b/examples/21-deferred/fs_deferred_light_ta.sc index 19102eff0..e400115bd 100644 --- a/examples/21-deferred/fs_deferred_light_ta.sc +++ b/examples/21-deferred/fs_deferred_light_ta.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/fs_deferred_light_uav.sc b/examples/21-deferred/fs_deferred_light_uav.sc index 084423338..e789e1a77 100644 --- a/examples/21-deferred/fs_deferred_light_uav.sc +++ b/examples/21-deferred/fs_deferred_light_uav.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/makefile b/examples/21-deferred/makefile index 19c81e436..dd0194e12 100644 --- a/examples/21-deferred/makefile +++ b/examples/21-deferred/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/21-deferred/vs_deferred_combine.sc b/examples/21-deferred/vs_deferred_combine.sc index 545369275..0483c189a 100644 --- a/examples/21-deferred/vs_deferred_combine.sc +++ b/examples/21-deferred/vs_deferred_combine.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/vs_deferred_debug.sc b/examples/21-deferred/vs_deferred_debug.sc index 545369275..0483c189a 100644 --- a/examples/21-deferred/vs_deferred_debug.sc +++ b/examples/21-deferred/vs_deferred_debug.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/vs_deferred_debug_line.sc b/examples/21-deferred/vs_deferred_debug_line.sc index d80005d46..a9637c800 100644 --- a/examples/21-deferred/vs_deferred_debug_line.sc +++ b/examples/21-deferred/vs_deferred_debug_line.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/vs_deferred_geom.sc b/examples/21-deferred/vs_deferred_geom.sc index 5c4e5bf3f..2886bd753 100644 --- a/examples/21-deferred/vs_deferred_geom.sc +++ b/examples/21-deferred/vs_deferred_geom.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_tangent, a_texcoord0 $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/21-deferred/vs_deferred_light.sc b/examples/21-deferred/vs_deferred_light.sc index 545369275..0483c189a 100644 --- a/examples/21-deferred/vs_deferred_light.sc +++ b/examples/21-deferred/vs_deferred_light.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/22-windows/windows.cpp b/examples/22-windows/windows.cpp index 03a5259e9..fa3577355 100644 --- a/examples/22-windows/windows.cpp +++ b/examples/22-windows/windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/23-vectordisplay/makefile b/examples/23-vectordisplay/makefile index 19c81e436..dd0194e12 100644 --- a/examples/23-vectordisplay/makefile +++ b/examples/23-vectordisplay/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/24-nbody/makefile b/examples/24-nbody/makefile index 19c81e436..dd0194e12 100644 --- a/examples/24-nbody/makefile +++ b/examples/24-nbody/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/26-occlusion/occlusion.cpp b/examples/26-occlusion/occlusion.cpp index d0149838d..929fff42a 100644 --- a/examples/26-occlusion/occlusion.cpp +++ b/examples/26-occlusion/occlusion.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/27-terrain/makefile b/examples/27-terrain/makefile index 19c81e436..dd0194e12 100644 --- a/examples/27-terrain/makefile +++ b/examples/27-terrain/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/28-wireframe/makefile b/examples/28-wireframe/makefile index 19c81e436..dd0194e12 100644 --- a/examples/28-wireframe/makefile +++ b/examples/28-wireframe/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/29-debugdraw/debugdraw.cpp b/examples/29-debugdraw/debugdraw.cpp index fb13bb7e3..f274246da 100644 --- a/examples/29-debugdraw/debugdraw.cpp +++ b/examples/29-debugdraw/debugdraw.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/30-picking/fs_picking_id.sc b/examples/30-picking/fs_picking_id.sc index 8a2293100..723265fcc 100644 --- a/examples/30-picking/fs_picking_id.sc +++ b/examples/30-picking/fs_picking_id.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/30-picking/fs_picking_shaded.sc b/examples/30-picking/fs_picking_shaded.sc index 05c873e96..74cc160b2 100644 --- a/examples/30-picking/fs_picking_shaded.sc +++ b/examples/30-picking/fs_picking_shaded.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/30-picking/makefile b/examples/30-picking/makefile index 19c81e436..dd0194e12 100644 --- a/examples/30-picking/makefile +++ b/examples/30-picking/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/30-picking/vs_picking_shaded.sc b/examples/30-picking/vs_picking_shaded.sc index f4ba4f35f..1458070d0 100644 --- a/examples/30-picking/vs_picking_shaded.sc +++ b/examples/30-picking/vs_picking_shaded.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/31-rsm/makefile b/examples/31-rsm/makefile index 19c81e436..dd0194e12 100644 --- a/examples/31-rsm/makefile +++ b/examples/31-rsm/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/32-particles/particles.cpp b/examples/32-particles/particles.cpp index d5642b4b8..0d573a9dc 100644 --- a/examples/32-particles/particles.cpp +++ b/examples/32-particles/particles.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/33-pom/makefile b/examples/33-pom/makefile index 19c81e436..dd0194e12 100644 --- a/examples/33-pom/makefile +++ b/examples/33-pom/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/33-pom/pom.cpp b/examples/33-pom/pom.cpp index 71e7e1d85..f655f7143 100644 --- a/examples/33-pom/pom.cpp +++ b/examples/33-pom/pom.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/34-mvs/mvs.cpp b/examples/34-mvs/mvs.cpp index bbe469b95..8782f7f48 100644 --- a/examples/34-mvs/mvs.cpp +++ b/examples/34-mvs/mvs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/35-dynamic/dynamic.cpp b/examples/35-dynamic/dynamic.cpp index 76544852f..8d5f2191c 100644 --- a/examples/35-dynamic/dynamic.cpp +++ b/examples/35-dynamic/dynamic.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/36-sky/makefile b/examples/36-sky/makefile index 19c81e436..dd0194e12 100644 --- a/examples/36-sky/makefile +++ b/examples/36-sky/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/36-sky/vs_sky_landscape.sc b/examples/36-sky/vs_sky_landscape.sc index 8a22e90e0..6bc0868b9 100644 --- a/examples/36-sky/vs_sky_landscape.sc +++ b/examples/36-sky/vs_sky_landscape.sc @@ -2,7 +2,7 @@ $input a_position, a_normal, a_texcoord0 $output v_normal, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/37-gpudrivenrendering/makefile b/examples/37-gpudrivenrendering/makefile index 19c81e436..dd0194e12 100644 --- a/examples/37-gpudrivenrendering/makefile +++ b/examples/37-gpudrivenrendering/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/38-bloom/fs_bloom_combine.sc b/examples/38-bloom/fs_bloom_combine.sc index 6b9073b8f..b3ad7a16c 100644 --- a/examples/38-bloom/fs_bloom_combine.sc +++ b/examples/38-bloom/fs_bloom_combine.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/38-bloom/makefile b/examples/38-bloom/makefile index 19c81e436..dd0194e12 100644 --- a/examples/38-bloom/makefile +++ b/examples/38-bloom/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/38-bloom/vs_deferred_combine.sc b/examples/38-bloom/vs_deferred_combine.sc index 545369275..0483c189a 100644 --- a/examples/38-bloom/vs_deferred_combine.sc +++ b/examples/38-bloom/vs_deferred_combine.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/39-assao/makefile b/examples/39-assao/makefile index 19c81e436..dd0194e12 100644 --- a/examples/39-assao/makefile +++ b/examples/39-assao/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/40-svt/fs_vt_mip.sc b/examples/40-svt/fs_vt_mip.sc index 31f0b2b6f..5d79b6c6c 100644 --- a/examples/40-svt/fs_vt_mip.sc +++ b/examples/40-svt/fs_vt_mip.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/40-svt/fs_vt_unlit.sc b/examples/40-svt/fs_vt_unlit.sc index a079bc11d..1ee16116c 100644 --- a/examples/40-svt/fs_vt_unlit.sc +++ b/examples/40-svt/fs_vt_unlit.sc @@ -1,7 +1,7 @@ $input v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/40-svt/makefile b/examples/40-svt/makefile index 19c81e436..dd0194e12 100644 --- a/examples/40-svt/makefile +++ b/examples/40-svt/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/40-svt/virtualtexture.sh b/examples/40-svt/virtualtexture.sh index 32a3381c6..f0ffde2e9 100644 --- a/examples/40-svt/virtualtexture.sh +++ b/examples/40-svt/virtualtexture.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/40-svt/vs_vt_generic.sc b/examples/40-svt/vs_vt_generic.sc index 1f39a8738..997b86987 100644 --- a/examples/40-svt/vs_vt_generic.sc +++ b/examples/40-svt/vs_vt_generic.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0 $output v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/41-tess/makefile b/examples/41-tess/makefile index 19c81e436..dd0194e12 100644 --- a/examples/41-tess/makefile +++ b/examples/41-tess/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/42-bunnylod/bunnylod.cpp b/examples/42-bunnylod/bunnylod.cpp index bd44b1f8e..0af3ba0f1 100644 --- a/examples/42-bunnylod/bunnylod.cpp +++ b/examples/42-bunnylod/bunnylod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/42-bunnylod/fs_bunnylod.sc b/examples/42-bunnylod/fs_bunnylod.sc index 3e8f850e3..07feb33b9 100644 --- a/examples/42-bunnylod/fs_bunnylod.sc +++ b/examples/42-bunnylod/fs_bunnylod.sc @@ -1,7 +1,7 @@ $input v_world, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/42-bunnylod/makefile b/examples/42-bunnylod/makefile index 19c81e436..dd0194e12 100644 --- a/examples/42-bunnylod/makefile +++ b/examples/42-bunnylod/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/42-bunnylod/vs_bunnylod.sc b/examples/42-bunnylod/vs_bunnylod.sc index 74209e352..d40fc67ce 100644 --- a/examples/42-bunnylod/vs_bunnylod.sc +++ b/examples/42-bunnylod/vs_bunnylod.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_world, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/46-fsr/makefile b/examples/46-fsr/makefile index 19c81e436..dd0194e12 100644 --- a/examples/46-fsr/makefile +++ b/examples/46-fsr/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/47-pixelformats/makefile b/examples/47-pixelformats/makefile index 19c81e436..dd0194e12 100644 --- a/examples/47-pixelformats/makefile +++ b/examples/47-pixelformats/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/48-drawindirect/makefile b/examples/48-drawindirect/makefile index 19c81e436..dd0194e12 100644 --- a/examples/48-drawindirect/makefile +++ b/examples/48-drawindirect/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/49-hextile/makefile b/examples/49-hextile/makefile index 19c81e436..dd0194e12 100644 --- a/examples/49-hextile/makefile +++ b/examples/49-hextile/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/common/aviwriter.h b/examples/common/aviwriter.h index 32eb49f69..016e01226 100644 --- a/examples/common/aviwriter.h +++ b/examples/common/aviwriter.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/bgfx_utils.cpp b/examples/common/bgfx_utils.cpp index 209e3ea7f..c48add461 100644 --- a/examples/common/bgfx_utils.cpp +++ b/examples/common/bgfx_utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/bgfx_utils.h b/examples/common/bgfx_utils.h index 7146293f3..03c48f652 100644 --- a/examples/common/bgfx_utils.h +++ b/examples/common/bgfx_utils.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/common.h b/examples/common/common.h index c15209bbc..225352e2d 100644 --- a/examples/common/common.h +++ b/examples/common/common.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/common.sh b/examples/common/common.sh index fab6caf17..6c649febb 100644 --- a/examples/common/common.sh +++ b/examples/common/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/debugdraw.cpp b/examples/common/debugdraw/debugdraw.cpp index eee5aef08..9e6256d99 100644 --- a/examples/common/debugdraw/debugdraw.cpp +++ b/examples/common/debugdraw/debugdraw.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/debugdraw.h b/examples/common/debugdraw/debugdraw.h index 7770ed15e..71dd57460 100644 --- a/examples/common/debugdraw/debugdraw.h +++ b/examples/common/debugdraw/debugdraw.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/fs_debugdraw_fill.sc b/examples/common/debugdraw/fs_debugdraw_fill.sc index 85f9bc7d0..80f3c1a0c 100644 --- a/examples/common/debugdraw/fs_debugdraw_fill.sc +++ b/examples/common/debugdraw/fs_debugdraw_fill.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/fs_debugdraw_fill_lit.sc b/examples/common/debugdraw/fs_debugdraw_fill_lit.sc index 0ed3fa609..9489c9d5a 100644 --- a/examples/common/debugdraw/fs_debugdraw_fill_lit.sc +++ b/examples/common/debugdraw/fs_debugdraw_fill_lit.sc @@ -1,7 +1,7 @@ $input v_view, v_world /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/fs_debugdraw_fill_texture.sc b/examples/common/debugdraw/fs_debugdraw_fill_texture.sc index 67adb209f..9a6415144 100644 --- a/examples/common/debugdraw/fs_debugdraw_fill_texture.sc +++ b/examples/common/debugdraw/fs_debugdraw_fill_texture.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/fs_debugdraw_lines.sc b/examples/common/debugdraw/fs_debugdraw_lines.sc index 1e1a40202..bb9c0d4f8 100644 --- a/examples/common/debugdraw/fs_debugdraw_lines.sc +++ b/examples/common/debugdraw/fs_debugdraw_lines.sc @@ -1,7 +1,7 @@ $input v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc b/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc index e48817214..4140391c8 100644 --- a/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc +++ b/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc @@ -1,7 +1,7 @@ $input v_color0, v_stipple /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/makefile b/examples/common/debugdraw/makefile index 554063e58..9fe95f713 100644 --- a/examples/common/debugdraw/makefile +++ b/examples/common/debugdraw/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/common/debugdraw/vs_debugdraw_fill.sc b/examples/common/debugdraw/vs_debugdraw_fill.sc index db5c3498f..bee7f33df 100644 --- a/examples/common/debugdraw/vs_debugdraw_fill.sc +++ b/examples/common/debugdraw/vs_debugdraw_fill.sc @@ -1,7 +1,7 @@ $input a_position, a_indices /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/vs_debugdraw_fill_lit.sc b/examples/common/debugdraw/vs_debugdraw_fill_lit.sc index 0964f5929..9d6f483ec 100644 --- a/examples/common/debugdraw/vs_debugdraw_fill_lit.sc +++ b/examples/common/debugdraw/vs_debugdraw_fill_lit.sc @@ -2,7 +2,7 @@ $input a_position, a_indices $output v_view, v_world /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc b/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc index 7083351a3..25e555470 100644 --- a/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc +++ b/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc @@ -2,7 +2,7 @@ $input a_position $output v_view, v_world /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc b/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc index 44901d090..1b3e38073 100644 --- a/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc +++ b/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc @@ -1,7 +1,7 @@ $input a_position /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/vs_debugdraw_fill_texture.sc b/examples/common/debugdraw/vs_debugdraw_fill_texture.sc index 073c7de47..7c72921ad 100644 --- a/examples/common/debugdraw/vs_debugdraw_fill_texture.sc +++ b/examples/common/debugdraw/vs_debugdraw_fill_texture.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0, a_color0 $output v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/vs_debugdraw_lines.sc b/examples/common/debugdraw/vs_debugdraw_lines.sc index 50143cf91..850384f67 100644 --- a/examples/common/debugdraw/vs_debugdraw_lines.sc +++ b/examples/common/debugdraw/vs_debugdraw_lines.sc @@ -2,7 +2,7 @@ $input a_position, a_color0 $output v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc b/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc index 121d7120a..cc5590961 100644 --- a/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc +++ b/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_texcoord0 $output v_color0, v_stipple /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/cmd.cpp b/examples/common/entry/cmd.cpp index 51742b8eb..17ecea97d 100644 --- a/examples/common/entry/cmd.cpp +++ b/examples/common/entry/cmd.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. + * Copyright 2010-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/cmd.h b/examples/common/entry/cmd.h index fe219424e..cd1e611b3 100644 --- a/examples/common/entry/cmd.h +++ b/examples/common/entry/cmd.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. + * Copyright 2010-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/dbg.h b/examples/common/entry/dbg.h index bafe4a514..6ac2c417b 100644 --- a/examples/common/entry/dbg.h +++ b/examples/common/entry/dbg.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/dialog.cpp b/examples/common/entry/dialog.cpp index 8c1bf9731..913cc8a17 100644 --- a/examples/common/entry/dialog.cpp +++ b/examples/common/entry/dialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. + * Copyright 2010-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/dialog.h b/examples/common/entry/dialog.h index 8c13d2be6..2ea7e0090 100644 --- a/examples/common/entry/dialog.h +++ b/examples/common/entry/dialog.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. + * Copyright 2010-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index e5ce4d77c..2a13b7db2 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry.h b/examples/common/entry/entry.h index 2dc7acc7b..8be3ea071 100644 --- a/examples/common/entry/entry.h +++ b/examples/common/entry/entry.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_android.cpp b/examples/common/entry/entry_android.cpp index 3a6ac8561..1c5e4c738 100644 --- a/examples/common/entry/entry_android.cpp +++ b/examples/common/entry/entry_android.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_glfw.cpp b/examples/common/entry/entry_glfw.cpp index da1550240..82336fbc9 100644 --- a/examples/common/entry/entry_glfw.cpp +++ b/examples/common/entry/entry_glfw.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_html5.cpp b/examples/common/entry/entry_html5.cpp index 884a563b7..eb83904c8 100644 --- a/examples/common/entry/entry_html5.cpp +++ b/examples/common/entry/entry_html5.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_ios.mm b/examples/common/entry/entry_ios.mm index f123b6684..ee5f39674 100644 --- a/examples/common/entry/entry_ios.mm +++ b/examples/common/entry/entry_ios.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_noop.cpp b/examples/common/entry/entry_noop.cpp index 22d160f59..be0b4595c 100644 --- a/examples/common/entry/entry_noop.cpp +++ b/examples/common/entry/entry_noop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_osx.mm b/examples/common/entry/entry_osx.mm index 948483ca9..5db8db7b0 100644 --- a/examples/common/entry/entry_osx.mm +++ b/examples/common/entry/entry_osx.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_p.h b/examples/common/entry/entry_p.h index 59307c2f0..ef77cce47 100644 --- a/examples/common/entry/entry_p.h +++ b/examples/common/entry/entry_p.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index 8744b98e7..afbf569c3 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/examples/common/entry/entry_sdl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index 5d60573d0..114d36d38 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/entry_x11.cpp b/examples/common/entry/entry_x11.cpp index a5f4b3fa6..7347af489 100644 --- a/examples/common/entry/entry_x11.cpp +++ b/examples/common/entry/entry_x11.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/input.cpp b/examples/common/entry/input.cpp index 770922d6f..01c941fbf 100644 --- a/examples/common/entry/input.cpp +++ b/examples/common/entry/input.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. + * Copyright 2010-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/entry/input.h b/examples/common/entry/input.h index d51a7f338..00d7bfc6c 100644 --- a/examples/common/entry/input.h +++ b/examples/common/entry/input.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. + * Copyright 2010-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/example-glue.cpp b/examples/common/example-glue.cpp index 74ff3719f..bcc40033b 100644 --- a/examples/common/example-glue.cpp +++ b/examples/common/example-glue.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/font/makefile b/examples/common/font/makefile index 554063e58..9fe95f713 100644 --- a/examples/common/font/makefile +++ b/examples/common/font/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/common/imgui/imgui.h b/examples/common/imgui/imgui.h index 980727775..ac1bafc03 100644 --- a/examples/common/imgui/imgui.h +++ b/examples/common/imgui/imgui.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/imgui/makefile b/examples/common/imgui/makefile index 1979d957d..7e77033b2 100644 --- a/examples/common/imgui/makefile +++ b/examples/common/imgui/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/common/nanovg/makefile b/examples/common/nanovg/makefile index 554063e58..9fe95f713 100644 --- a/examples/common/nanovg/makefile +++ b/examples/common/nanovg/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/common/nanovg/nanovg_bgfx.cpp b/examples/common/nanovg/nanovg_bgfx.cpp index fccee88db..8eeb8570a 100644 --- a/examples/common/nanovg/nanovg_bgfx.cpp +++ b/examples/common/nanovg/nanovg_bgfx.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/nanovg/nanovg_bgfx.h b/examples/common/nanovg/nanovg_bgfx.h index ca7a4f202..78257930a 100644 --- a/examples/common/nanovg/nanovg_bgfx.h +++ b/examples/common/nanovg/nanovg_bgfx.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/packrect.h b/examples/common/packrect.h index bdc4c1f83..f1a95b308 100644 --- a/examples/common/packrect.h +++ b/examples/common/packrect.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/ps/fs_particle.sc b/examples/common/ps/fs_particle.sc index f8fc5f277..6e731a14d 100644 --- a/examples/common/ps/fs_particle.sc +++ b/examples/common/ps/fs_particle.sc @@ -1,7 +1,7 @@ $input v_color0, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/ps/makefile b/examples/common/ps/makefile index 554063e58..9fe95f713 100644 --- a/examples/common/ps/makefile +++ b/examples/common/ps/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/examples/common/ps/particle_system.cpp b/examples/common/ps/particle_system.cpp index 721779f11..6fafd7661 100644 --- a/examples/common/ps/particle_system.cpp +++ b/examples/common/ps/particle_system.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/ps/particle_system.h b/examples/common/ps/particle_system.h index 38c124ed9..13206e82d 100644 --- a/examples/common/ps/particle_system.h +++ b/examples/common/ps/particle_system.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/ps/vs_particle.sc b/examples/common/ps/vs_particle.sc index 446ac1d97..3a6bd43a0 100644 --- a/examples/common/ps/vs_particle.sc +++ b/examples/common/ps/vs_particle.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_texcoord0 $output v_color0, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/common/shaderlib.sh b/examples/common/shaderlib.sh index d4953d044..389a1ec6f 100644 --- a/examples/common/shaderlib.sh +++ b/examples/common/shaderlib.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/examples/makefile b/examples/makefile index 225ee641b..667ba6560 100644 --- a/examples/makefile +++ b/examples/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index 844337d8f..2b62fbbaf 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index 04d9bcebe..ae34f49c9 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index c5f136b4e..809efff0d 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/include/bgfx/embedded_shader.h b/include/bgfx/embedded_shader.h index c4ddca0c3..525f47c1f 100644 --- a/include/bgfx/embedded_shader.h +++ b/include/bgfx/embedded_shader.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/include/bgfx/platform.h b/include/bgfx/platform.h index dfce6c943..f7843b062 100644 --- a/include/bgfx/platform.h +++ b/include/bgfx/platform.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/makefile b/makefile index d95106b1e..70c61f259 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/scripts/bgfx.lua b/scripts/bgfx.lua index e9fecc97d..8516ed80e 100644 --- a/scripts/bgfx.lua +++ b/scripts/bgfx.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2022 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2023 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- diff --git a/scripts/bindings-bf.lua b/scripts/bindings-bf.lua index 393242d96..dda9adb42 100644 --- a/scripts/bindings-bf.lua +++ b/scripts/bindings-bf.lua @@ -3,7 +3,7 @@ local idl = codegen.idl "bgfx.idl" local beef_template = [[ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/scripts/bindings-cs.lua b/scripts/bindings-cs.lua index 93ca57bc0..476666312 100644 --- a/scripts/bindings-cs.lua +++ b/scripts/bindings-cs.lua @@ -3,7 +3,7 @@ local idl = codegen.idl "bgfx.idl" local csharp_template = [[ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -29,7 +29,7 @@ public static partial class bgfx local csharp_dllname_template = [[ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/scripts/bindings-zig.lua b/scripts/bindings-zig.lua index ad385ecd3..9e7f02f71 100644 --- a/scripts/bindings-zig.lua +++ b/scripts/bindings-zig.lua @@ -2,7 +2,7 @@ local codegen = require "codegen" local idl = codegen.idl "bgfx.idl" local zig_template = [[ -// Copyright 2011-2022 Branimir Karadzic. All rights reserved. +// Copyright 2011-2023 Branimir Karadzic. All rights reserved. // License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE diff --git a/scripts/example-common.lua b/scripts/example-common.lua index c6ddb81fd..4aaa056c1 100644 --- a/scripts/example-common.lua +++ b/scripts/example-common.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2022 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2023 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- diff --git a/scripts/genie.lua b/scripts/genie.lua index 645ed3a21..4bedaeab0 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2022 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2023 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- @@ -111,7 +111,7 @@ newaction { f:close() io.output(path.join(MODULE_DIR, "src/version.h")) io.write("/*\n") - io.write(" * Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n") + io.write(" * Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n") io.write(" * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n") io.write(" */\n") io.write("\n") diff --git a/scripts/geometryc.lua b/scripts/geometryc.lua index 84b646705..a12a54fe4 100644 --- a/scripts/geometryc.lua +++ b/scripts/geometryc.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2022 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2023 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- diff --git a/scripts/shader-embeded.mk b/scripts/shader-embeded.mk index 99760f167..360ac3e51 100644 --- a/scripts/shader-embeded.mk +++ b/scripts/shader-embeded.mk @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/scripts/shader.mk b/scripts/shader.mk index 0a46cfaa0..48fa75bc5 100644 --- a/scripts/shader.mk +++ b/scripts/shader.mk @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/scripts/shaderc.lua b/scripts/shaderc.lua index 00fff6740..abdeaba5e 100644 --- a/scripts/shaderc.lua +++ b/scripts/shaderc.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2022 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2023 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- diff --git a/scripts/temp.bgfx.h b/scripts/temp.bgfx.h index 47161c771..9eec1b454 100644 --- a/scripts/temp.bgfx.h +++ b/scripts/temp.bgfx.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/scripts/temp.bgfx.idl.inl b/scripts/temp.bgfx.idl.inl index 66e62cb0a..6cfa60344 100644 --- a/scripts/temp.bgfx.idl.inl +++ b/scripts/temp.bgfx.idl.inl @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/scripts/temp.defines.h b/scripts/temp.defines.h index 6d462d645..a3b6b4179 100644 --- a/scripts/temp.defines.h +++ b/scripts/temp.defines.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/scripts/texturec.lua b/scripts/texturec.lua index e0b240755..50d1ba531 100644 --- a/scripts/texturec.lua +++ b/scripts/texturec.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2022 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2023 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE -- diff --git a/scripts/tools.mk b/scripts/tools.mk index e0dd882e2..738bbfadd 100644 --- a/scripts/tools.mk +++ b/scripts/tools.mk @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/src/amalgamated.cpp b/src/amalgamated.cpp index aa88b1c48..e68c15662 100644 --- a/src/amalgamated.cpp +++ b/src/amalgamated.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/amalgamated.mm b/src/amalgamated.mm index e3746e68d..589af6f0a 100644 --- a/src/amalgamated.mm +++ b/src/amalgamated.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/bgfx.cpp b/src/bgfx.cpp index f9ef0a6e2..b27ec2d8a 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/bgfx.idl.inl b/src/bgfx.idl.inl index 2c3b16fe4..704f51d61 100644 --- a/src/bgfx.idl.inl +++ b/src/bgfx.idl.inl @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/bgfx_compute.sh b/src/bgfx_compute.sh index 59dda85e0..c23361f14 100644 --- a/src/bgfx_compute.sh +++ b/src/bgfx_compute.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 31ede49d0..3db3b6116 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/bgfx_shader.sh b/src/bgfx_shader.sh index dde910ab7..3dd755682 100644 --- a/src/bgfx_shader.sh +++ b/src/bgfx_shader.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/charset.h b/src/charset.h index b76f23d15..159d38e76 100644 --- a/src/charset.h +++ b/src/charset.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/config.h b/src/config.h index a492f0006..9112fc981 100644 --- a/src/config.h +++ b/src/config.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/debug_renderdoc.cpp b/src/debug_renderdoc.cpp index 1671014ff..8f2ec27e4 100644 --- a/src/debug_renderdoc.cpp +++ b/src/debug_renderdoc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/debug_renderdoc.h b/src/debug_renderdoc.h index 0ec59309f..e3305f983 100644 --- a/src/debug_renderdoc.h +++ b/src/debug_renderdoc.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/dxgi.cpp b/src/dxgi.cpp index 649de9021..06ed02cf0 100644 --- a/src/dxgi.cpp +++ b/src/dxgi.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/dxgi.h b/src/dxgi.h index cd01d6bf9..0a2623adb 100644 --- a/src/dxgi.h +++ b/src/dxgi.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/emscripten.h b/src/emscripten.h index 1e1e0aea0..97da99407 100644 --- a/src/emscripten.h +++ b/src/emscripten.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear0.sc b/src/fs_clear0.sc index 29bb11271..31966bfb8 100644 --- a/src/fs_clear0.sc +++ b/src/fs_clear0.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear1.sc b/src/fs_clear1.sc index 29b965b3f..34546a133 100644 --- a/src/fs_clear1.sc +++ b/src/fs_clear1.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear2.sc b/src/fs_clear2.sc index cbc9837ee..14c2e8ca2 100644 --- a/src/fs_clear2.sc +++ b/src/fs_clear2.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear3.sc b/src/fs_clear3.sc index 824480226..cba45458c 100644 --- a/src/fs_clear3.sc +++ b/src/fs_clear3.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear4.sc b/src/fs_clear4.sc index f8569702d..a49204d68 100644 --- a/src/fs_clear4.sc +++ b/src/fs_clear4.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear5.sc b/src/fs_clear5.sc index 84784fbfb..9c1c24061 100644 --- a/src/fs_clear5.sc +++ b/src/fs_clear5.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear6.sc b/src/fs_clear6.sc index 953eb2b76..af5dcbbdf 100644 --- a/src/fs_clear6.sc +++ b/src/fs_clear6.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_clear7.sc b/src/fs_clear7.sc index 3fca086f2..0abe6e3a1 100644 --- a/src/fs_clear7.sc +++ b/src/fs_clear7.sc @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/fs_debugfont.sc b/src/fs_debugfont.sc index d641b90d9..ca6f2165b 100644 --- a/src/fs_debugfont.sc +++ b/src/fs_debugfont.sc @@ -1,7 +1,7 @@ $input v_color0, v_color1, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_eagl.h b/src/glcontext_eagl.h index 7449f8532..7de2210f5 100644 --- a/src/glcontext_eagl.h +++ b/src/glcontext_eagl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_eagl.mm b/src/glcontext_eagl.mm index 86d1df42e..7926e0720 100644 --- a/src/glcontext_eagl.mm +++ b/src/glcontext_eagl.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_egl.cpp b/src/glcontext_egl.cpp index fabddd5c6..d543880cf 100644 --- a/src/glcontext_egl.cpp +++ b/src/glcontext_egl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_egl.h b/src/glcontext_egl.h index b2edb67ab..5adf60081 100644 --- a/src/glcontext_egl.h +++ b/src/glcontext_egl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_glx.cpp b/src/glcontext_glx.cpp index 4dd21ca01..2d815ecbf 100644 --- a/src/glcontext_glx.cpp +++ b/src/glcontext_glx.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_glx.h b/src/glcontext_glx.h index df87406db..67fb8815e 100644 --- a/src/glcontext_glx.h +++ b/src/glcontext_glx.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_html5.cpp b/src/glcontext_html5.cpp index 016b7c189..e1a76d987 100644 --- a/src/glcontext_html5.cpp +++ b/src/glcontext_html5.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_html5.h b/src/glcontext_html5.h index 3c3f457d3..26018ae9e 100644 --- a/src/glcontext_html5.h +++ b/src/glcontext_html5.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_nsgl.h b/src/glcontext_nsgl.h index 560808b0f..03a93d690 100644 --- a/src/glcontext_nsgl.h +++ b/src/glcontext_nsgl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_nsgl.mm b/src/glcontext_nsgl.mm index acb190076..eb8e8d092 100644 --- a/src/glcontext_nsgl.mm +++ b/src/glcontext_nsgl.mm @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_wgl.cpp b/src/glcontext_wgl.cpp index f09a23d87..9018b00d3 100644 --- a/src/glcontext_wgl.cpp +++ b/src/glcontext_wgl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glcontext_wgl.h b/src/glcontext_wgl.h index 7289a1234..0560fbf65 100644 --- a/src/glcontext_wgl.h +++ b/src/glcontext_wgl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/glimports.h b/src/glimports.h index 5a687bbf4..21f8c834b 100644 --- a/src/glimports.h +++ b/src/glimports.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/makefile b/src/makefile index 086dfe637..d8380dc7f 100644 --- a/src/makefile +++ b/src/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/src/nvapi.cpp b/src/nvapi.cpp index 0103b0c0c..462600d5d 100644 --- a/src/nvapi.cpp +++ b/src/nvapi.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/nvapi.h b/src/nvapi.h index 0f03f4aa8..0a13dfc2b 100644 --- a/src/nvapi.h +++ b/src/nvapi.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer.h b/src/renderer.h index b62c485bc..e81b7a996 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_agc.cpp b/src/renderer_agc.cpp index f393b3b44..b8c994f47 100644 --- a/src/renderer_agc.cpp +++ b/src/renderer_agc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_d3d.h b/src/renderer_d3d.h index d0ec4ebda..ae54f56d7 100644 --- a/src/renderer_d3d.h +++ b/src/renderer_d3d.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index b15f0a128..c4899f287 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_d3d11.h b/src/renderer_d3d11.h index 3fc0849ac..f193c2ccb 100644 --- a/src/renderer_d3d11.h +++ b/src/renderer_d3d11.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 36d23cb5a..47b72f82a 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_d3d12.h b/src/renderer_d3d12.h index f578f1a38..703f9393a 100644 --- a/src/renderer_d3d12.h +++ b/src/renderer_d3d12.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index ff1a2cf0a..4ee0c9b8c 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_d3d9.h b/src/renderer_d3d9.h index 0080c474e..9eefdc8b2 100644 --- a/src/renderer_d3d9.h +++ b/src/renderer_d3d9.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 6fdf64225..a289fc4ce 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 4c2942a03..24a963820 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_gnm.cpp b/src/renderer_gnm.cpp index 82f76593b..640dfd706 100644 --- a/src/renderer_gnm.cpp +++ b/src/renderer_gnm.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_noop.cpp b/src/renderer_noop.cpp index ee051ee90..408da38c4 100644 --- a/src/renderer_noop.cpp +++ b/src/renderer_noop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_nvn.cpp b/src/renderer_nvn.cpp index fedfc6c4e..4cfa7344e 100644 --- a/src/renderer_nvn.cpp +++ b/src/renderer_nvn.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index 30c7b99f1..a3c8aa243 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/renderer_vk.h b/src/renderer_vk.h index f14e60fc7..f34a4ba54 100644 --- a/src/renderer_vk.h +++ b/src/renderer_vk.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/shader.cpp b/src/shader.cpp index 2629569e3..98b6626ab 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/shader.h b/src/shader.h index 5ddc1cdbe..0a2f507eb 100644 --- a/src/shader.h +++ b/src/shader.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/shader_dx9bc.cpp b/src/shader_dx9bc.cpp index adf833283..4501435c6 100644 --- a/src/shader_dx9bc.cpp +++ b/src/shader_dx9bc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/shader_dx9bc.h b/src/shader_dx9bc.h index dec16858a..ca239a7c5 100644 --- a/src/shader_dx9bc.h +++ b/src/shader_dx9bc.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/shader_dxbc.cpp b/src/shader_dxbc.cpp index 6f27ff7d2..33cf7eb26 100644 --- a/src/shader_dxbc.cpp +++ b/src/shader_dxbc.cpp @@ -1,6 +1,6 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #include "bgfx_p.h" diff --git a/src/shader_dxbc.h b/src/shader_dxbc.h index ba0e2862a..5bd16641c 100644 --- a/src/shader_dxbc.h +++ b/src/shader_dxbc.h @@ -1,6 +1,6 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #ifndef BGFX_SHADER_DXBC_H diff --git a/src/shader_spirv.cpp b/src/shader_spirv.cpp index 739256546..87a22b281 100644 --- a/src/shader_spirv.cpp +++ b/src/shader_spirv.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/shader_spirv.h b/src/shader_spirv.h index 0ab2c4ff3..f94422a7f 100644 --- a/src/shader_spirv.h +++ b/src/shader_spirv.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/topology.cpp b/src/topology.cpp index 0457ab624..5d48092df 100644 --- a/src/topology.cpp +++ b/src/topology.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/topology.h b/src/topology.h index e26f3bb1e..e4d5e32a0 100644 --- a/src/topology.h +++ b/src/topology.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/version.h b/src/version.h index 84767bc8e..3b3f87df8 100644 --- a/src/version.h +++ b/src/version.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/vertexlayout.cpp b/src/vertexlayout.cpp index 4cebdb4a2..c75f6be79 100644 --- a/src/vertexlayout.cpp +++ b/src/vertexlayout.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/vertexlayout.h b/src/vertexlayout.h index afb649a0b..74c909837 100644 --- a/src/vertexlayout.h +++ b/src/vertexlayout.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/vs_clear.sc b/src/vs_clear.sc index 809f32be0..0ffc73681 100644 --- a/src/vs_clear.sc +++ b/src/vs_clear.sc @@ -1,7 +1,7 @@ $input a_position /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/src/vs_debugfont.sc b/src/vs_debugfont.sc index c344b7161..7737cab40 100644 --- a/src/vs_debugfont.sc +++ b/src/vs_debugfont.sc @@ -2,7 +2,7 @@ $input a_position, a_color0, a_color1, a_texcoord0 $output v_color0, v_color1, v_texcoord0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/geometryc/geometryc.cpp b/tools/geometryc/geometryc.cpp index ba0d0274d..971c8a7ed 100644 --- a/tools/geometryc/geometryc.cpp +++ b/tools/geometryc/geometryc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -931,7 +931,7 @@ void help(const char* _error = NULL) bx::printf( "geometryc, bgfx geometry compiler tool, version %d.%d.%d.\n" - "Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n\n" , BGFX_GEOMETRYC_VERSION_MAJOR , BGFX_GEOMETRYC_VERSION_MINOR diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index 61bbb7491..05c8b6325 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -992,7 +992,7 @@ namespace bgfx bx::printf( "shaderc, bgfx shader compiler tool, version %d.%d.%d.\n" - "Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n\n" , BGFX_SHADERC_VERSION_MAJOR , BGFX_SHADERC_VERSION_MINOR diff --git a/tools/shaderc/shaderc.h b/tools/shaderc/shaderc.h index 0da24d24b..bf2657a72 100644 --- a/tools/shaderc/shaderc.h +++ b/tools/shaderc/shaderc.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/shaderc/shaderc_glsl.cpp b/tools/shaderc/shaderc_glsl.cpp index 269c58fd0..33df30946 100644 --- a/tools/shaderc/shaderc_glsl.cpp +++ b/tools/shaderc/shaderc_glsl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 67aebe9ef..37a6bc9c8 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/shaderc/shaderc_metal.cpp b/tools/shaderc/shaderc_metal.cpp index edb3e6a5a..670314f35 100644 --- a/tools/shaderc/shaderc_metal.cpp +++ b/tools/shaderc/shaderc_metal.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/shaderc/shaderc_pssl.cpp b/tools/shaderc/shaderc_pssl.cpp index 20e45bb21..4856edd59 100644 --- a/tools/shaderc/shaderc_pssl.cpp +++ b/tools/shaderc/shaderc_pssl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp index a2e951f66..4b436ad16 100644 --- a/tools/shaderc/shaderc_spirv.cpp +++ b/tools/shaderc/shaderc_spirv.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/common.sh b/tools/texturev/common.sh index 7f91a6efd..e3e41902c 100644 --- a/tools/texturev/common.sh +++ b/tools/texturev/common.sh @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/fs_texture.sc b/tools/texturev/fs_texture.sc index c4211343f..4ac9dfe4b 100644 --- a/tools/texturev/fs_texture.sc +++ b/tools/texturev/fs_texture.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/fs_texture_3d.sc b/tools/texturev/fs_texture_3d.sc index ae959c492..d7b2cb265 100644 --- a/tools/texturev/fs_texture_3d.sc +++ b/tools/texturev/fs_texture_3d.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/fs_texture_array.sc b/tools/texturev/fs_texture_array.sc index 94f2be60f..c7724e0dd 100644 --- a/tools/texturev/fs_texture_array.sc +++ b/tools/texturev/fs_texture_array.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/fs_texture_cube.sc b/tools/texturev/fs_texture_cube.sc index 8bd4fddbe..b8abb0113 100644 --- a/tools/texturev/fs_texture_cube.sc +++ b/tools/texturev/fs_texture_cube.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/fs_texture_cube2.sc b/tools/texturev/fs_texture_cube2.sc index 6623595fa..51a90ac6e 100644 --- a/tools/texturev/fs_texture_cube2.sc +++ b/tools/texturev/fs_texture_cube2.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/fs_texture_msdf.sc b/tools/texturev/fs_texture_msdf.sc index 4adbe3d19..89b429eeb 100644 --- a/tools/texturev/fs_texture_msdf.sc +++ b/tools/texturev/fs_texture_msdf.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/fs_texture_sdf.sc b/tools/texturev/fs_texture_sdf.sc index 4f5aff3bd..0bca90c13 100644 --- a/tools/texturev/fs_texture_sdf.sc +++ b/tools/texturev/fs_texture_sdf.sc @@ -1,7 +1,7 @@ $input v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/makefile b/tools/texturev/makefile index cf80177ea..3d0316ede 100644 --- a/tools/texturev/makefile +++ b/tools/texturev/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2022 Branimir Karadzic. All rights reserved. +# Copyright 2011-2023 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE # diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 5a26388c8..dc6b8281f 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ @@ -1263,7 +1263,7 @@ void help(const char* _error = NULL) bx::printf( "texturev, bgfx texture viewer tool, version %d.%d.%d.\n" - "Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n\n" , BGFX_TEXTUREV_VERSION_MAJOR , BGFX_TEXTUREV_VERSION_MINOR @@ -1929,7 +1929,7 @@ int _main_(int _argc, char** _argv) ImGui::Text( "texturev, bgfx texture viewer tool " ICON_KI_WRENCH ", version %d.%d.%d.\n" - "Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n" + "Copyright 2011-2023 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n" , BGFX_TEXTUREV_VERSION_MAJOR , BGFX_TEXTUREV_VERSION_MINOR diff --git a/tools/texturev/vs_texture.sc b/tools/texturev/vs_texture.sc index 542679517..db0f113d9 100644 --- a/tools/texturev/vs_texture.sc +++ b/tools/texturev/vs_texture.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0, a_color0 $output v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/tools/texturev/vs_texture_cube.sc b/tools/texturev/vs_texture_cube.sc index 073c7de47..7c72921ad 100644 --- a/tools/texturev/vs_texture_cube.sc +++ b/tools/texturev/vs_texture_cube.sc @@ -2,7 +2,7 @@ $input a_position, a_texcoord0, a_color0 $output v_texcoord0, v_color0 /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ From 3d65c8d8a168b66c3cf9d249f6048412b914bf13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 18:26:29 -0800 Subject: [PATCH 09/86] Updated glslang. --- .../glslang/OGLCompilersDLL/InitializeDll.cpp | 6 +- 3rdparty/glslang/SPIRV/GLSL.ext.ARM.h | 35 + 3rdparty/glslang/SPIRV/GLSL.ext.NV.h | 3 + 3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 377 +- 3rdparty/glslang/SPIRV/SpvBuilder.cpp | 46 +- 3rdparty/glslang/SPIRV/SpvBuilder.h | 4 +- 3rdparty/glslang/SPIRV/SpvPostProcess.cpp | 1 + 3rdparty/glslang/SPIRV/SpvTools.cpp | 53 +- 3rdparty/glslang/SPIRV/SpvTools.h | 19 + 3rdparty/glslang/SPIRV/disassemble.cpp | 61 + 3rdparty/glslang/SPIRV/doc.cpp | 234 +- 3rdparty/glslang/SPIRV/doc.h | 4 +- 3rdparty/glslang/SPIRV/spirv.hpp | 42 + .../glslang/StandAlone/ResourceLimits.cpp | 2 + 3rdparty/glslang/StandAlone/StandAlone.cpp | 14 +- 3rdparty/glslang/StandAlone/spirv-remap.cpp | 4 +- 3rdparty/glslang/build_info.h | 2 +- .../glslang/glslang/GenericCodeGen/Link.cpp | 2 +- 3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp | 2 +- .../glslang/glslang/HLSL/hlslParseHelper.cpp | 10 +- .../glslang/glslang/HLSL/hlslParseHelper.h | 8 +- 3rdparty/glslang/glslang/Include/BaseTypes.h | 10 + 3rdparty/glslang/glslang/Include/PoolAlloc.h | 8 +- 3rdparty/glslang/glslang/Include/ShHandle.h | 16 +- 3rdparty/glslang/glslang/Include/Types.h | 62 +- 3rdparty/glslang/glslang/Include/arrays.h | 19 +- .../glslang/Include/glslang_c_interface.h | 8 +- .../glslang/glslang/Include/intermediate.h | 89 +- .../glslang/MachineIndependent/Constant.cpp | 10 +- .../glslang/MachineIndependent/Initialize.cpp | 256 +- .../MachineIndependent/Intermediate.cpp | 7 +- .../MachineIndependent/ParseContextBase.cpp | 6 +- .../MachineIndependent/ParseHelper.cpp | 352 +- .../glslang/MachineIndependent/ParseHelper.h | 8 +- .../glslang/MachineIndependent/PoolAlloc.cpp | 10 +- .../glslang/MachineIndependent/Scan.cpp | 17 + .../glslang/MachineIndependent/ShaderLang.cpp | 60 +- .../MachineIndependent/SymbolTable.cpp | 3 +- .../glslang/MachineIndependent/SymbolTable.h | 33 +- .../glslang/MachineIndependent/Versions.cpp | 31 +- .../glslang/MachineIndependent/Versions.h | 5 + .../glslang/MachineIndependent/glslang.m4 | 17 +- .../glslang/MachineIndependent/glslang.y | 19 +- .../MachineIndependent/glslang_tab.cpp | 10396 ++++++++-------- .../MachineIndependent/glslang_tab.cpp.h | 588 +- .../glslang/MachineIndependent/intermOut.cpp | 34 +- .../MachineIndependent/linkValidate.cpp | 49 +- .../MachineIndependent/localintermediate.h | 79 +- .../glslang/MachineIndependent/parseConst.cpp | 2 +- .../MachineIndependent/parseVersions.h | 3 +- .../preprocessor/PpContext.cpp | 2 +- .../preprocessor/PpTokens.cpp | 2 +- .../propagateNoContraction.cpp | 2 +- .../glslang/MachineIndependent/reflection.cpp | 2 +- .../glslang/OSDependent/Unix/ossource.cpp | 2 +- .../glslang/OSDependent/Windows/ossource.cpp | 4 +- .../glslang/glslang/OSDependent/osinclude.h | 2 +- 57 files changed, 7433 insertions(+), 5709 deletions(-) create mode 100644 3rdparty/glslang/SPIRV/GLSL.ext.ARM.h diff --git a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp index abea9108b..9d81f5787 100644 --- a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp +++ b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp @@ -102,7 +102,7 @@ bool InitThread() return false; } - if (OS_GetTLSValue(ThreadInitializeIndex) != 0) + if (OS_GetTLSValue(ThreadInitializeIndex) != nullptr) return true; if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) { @@ -130,8 +130,8 @@ bool DetachThread() // // Function is re-entrant and this thread may not have been initialized. // - if (OS_GetTLSValue(ThreadInitializeIndex) != 0) { - if (!OS_SetTLSValue(ThreadInitializeIndex, (void *)0)) { + if (OS_GetTLSValue(ThreadInitializeIndex) != nullptr) { + if (!OS_SetTLSValue(ThreadInitializeIndex, nullptr)) { assert(0 && "DetachThread(): Unable to clear init flag."); success = false; } diff --git a/3rdparty/glslang/SPIRV/GLSL.ext.ARM.h b/3rdparty/glslang/SPIRV/GLSL.ext.ARM.h new file mode 100644 index 000000000..14425be1e --- /dev/null +++ b/3rdparty/glslang/SPIRV/GLSL.ext.ARM.h @@ -0,0 +1,35 @@ +/* +** Copyright (c) 2022 ARM Limited +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextARM_H +#define GLSLextARM_H + +static const int GLSLextARMVersion = 100; +static const int GLSLextARMRevision = 1; + +static const char * const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins"; + +#endif // #ifndef GLSLextARM_H diff --git a/3rdparty/glslang/SPIRV/GLSL.ext.NV.h b/3rdparty/glslang/SPIRV/GLSL.ext.NV.h index 93c98bf62..5b0f7eb17 100644 --- a/3rdparty/glslang/SPIRV/GLSL.ext.NV.h +++ b/3rdparty/glslang/SPIRV/GLSL.ext.NV.h @@ -81,4 +81,7 @@ const char* const E_SPV_NV_cooperative_matrix = "SPV_NV_cooperative_matrix"; //SPV_NV_shader_sm_builtins const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins"; +//SPV_NV_shader_execution_reorder +const char* const E_SPV_NV_shader_invocation_reorder = "SPV_NV_shader_invocation_reorder"; + #endif // #ifndef GLSLextNV_H diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index 842221cba..378f79248 100644 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -49,6 +49,7 @@ namespace spv { #include "GLSL.ext.EXT.h" #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" #include "NonSemanticDebugPrintf.h" } @@ -277,12 +278,10 @@ protected: // requiring local translation to and from SPIR-V type on every access. // Maps AST-required-type-id> std::unordered_map forceType; - - // Used later for generating OpTraceKHR/OpExecuteCallableKHR - std::unordered_map locationToSymbol[2]; - // Used by Task shader while generating opearnds for OpEmitMeshTasksEXT spv::Id taskPayloadID; + // Used later for generating OpTraceKHR/OpExecuteCallableKHR/OpHitObjectRecordHit*/OpHitObjectGetShaderBindingTableData + std::unordered_map locationToSymbol[4]; }; // @@ -391,6 +390,7 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto case glslang::EvqHitAttr: return spv::DecorationBlock; case glslang::EvqCallableData: return spv::DecorationBlock; case glslang::EvqCallableDataIn: return spv::DecorationBlock; + case glslang::EvqHitObjectAttrNV: return spv::DecorationBlock; #endif default: assert(0); @@ -468,6 +468,7 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T case glslang::EvqHitAttr: case glslang::EvqCallableData: case glslang::EvqCallableDataIn: + case glslang::EvqHitObjectAttrNV: return spv::DecorationMax; #endif default: @@ -1106,6 +1107,28 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addExtension(spv::E_SPV_NV_shader_sm_builtins); builder.addCapability(spv::CapabilityShaderSMBuiltinsNV); return spv::BuiltInSMIDNV; + + // ARM builtins + case glslang::EbvCoreCountARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::CapabilityCoreBuiltinsARM); + return spv::BuiltInCoreCountARM; + case glslang::EbvCoreIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::CapabilityCoreBuiltinsARM); + return spv::BuiltInCoreIDARM; + case glslang::EbvCoreMaxIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::CapabilityCoreBuiltinsARM); + return spv::BuiltInCoreMaxIDARM; + case glslang::EbvWarpIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::CapabilityCoreBuiltinsARM); + return spv::BuiltInWarpIDARM; + case glslang::EbvWarpMaxIDARM: + builder.addExtension(spv::E_SPV_ARM_core_builtins); + builder.addCapability(spv::CapabilityCoreBuiltinsARM); + return spv::BuiltInWarpMaxIDARM; #endif default: @@ -1276,7 +1299,7 @@ spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang: // Translate glslang type to SPIR-V storage class. spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::TType& type) { - if (type.getBasicType() == glslang::EbtRayQuery) + if (type.getBasicType() == glslang::EbtRayQuery || type.getBasicType() == glslang::EbtHitObjectNV) return spv::StorageClassPrivate; #ifndef GLSLANG_WEB if (type.getQualifier().isSpirvByReference()) { @@ -1293,7 +1316,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T type.getQualifier().storage == glslang::EvqUniform) { if (type.isAtomic()) return spv::StorageClassAtomicCounter; - if (type.containsOpaque()) + if (type.containsOpaque() && !glslangIntermediate->getBindlessMode()) return spv::StorageClassUniformConstant; } @@ -1333,6 +1356,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T case glslang::EvqCallableData: return spv::StorageClassCallableDataKHR; case glslang::EvqCallableDataIn: return spv::StorageClassIncomingCallableDataKHR; case glslang::EvqtaskPayloadSharedEXT : return spv::StorageClassTaskPayloadWorkgroupEXT; + case glslang::EvqHitObjectAttrNV: return spv::StorageClassHitObjectAttributeNV; case glslang::EvqSpirvStorageClass: return static_cast(type.getQualifier().spirvStorageClass); #endif default: @@ -2559,6 +2583,35 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags; + const auto hitObjectOpsWithLvalue = [](glslang::TOperator op) { + switch(op) { + case glslang::EOpReorderThreadNV: + case glslang::EOpHitObjectGetCurrentTimeNV: + case glslang::EOpHitObjectGetHitKindNV: + case glslang::EOpHitObjectGetPrimitiveIndexNV: + case glslang::EOpHitObjectGetGeometryIndexNV: + case glslang::EOpHitObjectGetInstanceIdNV: + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + case glslang::EOpHitObjectGetObjectRayDirectionNV: + case glslang::EOpHitObjectGetObjectRayOriginNV: + case glslang::EOpHitObjectGetWorldRayDirectionNV: + case glslang::EOpHitObjectGetWorldRayOriginNV: + case glslang::EOpHitObjectGetWorldToObjectNV: + case glslang::EOpHitObjectGetObjectToWorldNV: + case glslang::EOpHitObjectGetRayTMaxNV: + case glslang::EOpHitObjectGetRayTMinNV: + case glslang::EOpHitObjectIsEmptyNV: + case glslang::EOpHitObjectIsHitNV: + case glslang::EOpHitObjectIsMissNV: + case glslang::EOpHitObjectRecordEmptyNV: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + return true; + default: + return false; + } + }; + #ifndef GLSLANG_WEB if (node->getOp() == glslang::EOpAtomicCounterIncrement || node->getOp() == glslang::EOpAtomicCounterDecrement || @@ -2573,7 +2626,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI node->getOp() == glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque || node->getOp() == glslang::EOpRayQueryTerminate || node->getOp() == glslang::EOpRayQueryConfirmIntersection || - (node->getOp() == glslang::EOpSpirvInst && operandNode->getAsTyped()->getQualifier().isSpirvByReference())) { + (node->getOp() == glslang::EOpSpirvInst && operandNode->getAsTyped()->getQualifier().isSpirvByReference()) || + hitObjectOpsWithLvalue(node->getOp())) { operand = builder.accessChainGetLValue(); // Special case l-value operands lvalueCoherentFlags = builder.getAccessChain().coherentFlags; lvalueCoherentFlags |= TranslateCoherent(operandNode->getAsTyped()->getType()); @@ -2708,6 +2762,12 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI case glslang::EOpRayQueryConfirmIntersection: builder.createNoResultOp(spv::OpRayQueryConfirmIntersectionKHR, operand); return false; + case glslang::EOpReorderThreadNV: + builder.createNoResultOp(spv::OpReorderThreadWithHitObjectNV, operand); + return false; + case glslang::EOpHitObjectRecordEmptyNV: + builder.createNoResultOp(spv::OpHitObjectRecordEmptyNV, operand); + return false; #endif default: @@ -3199,6 +3259,43 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.addExtension(spv::E_SPV_EXT_fragment_shader_interlock); noReturnValue = true; break; + + case glslang::EOpHitObjectTraceRayNV: + case glslang::EOpHitObjectTraceRayMotionNV: + case glslang::EOpHitObjectGetAttributesNV: + case glslang::EOpHitObjectExecuteShaderNV: + case glslang::EOpHitObjectRecordEmptyNV: + case glslang::EOpHitObjectRecordMissNV: + case glslang::EOpHitObjectRecordMissMotionNV: + case glslang::EOpHitObjectRecordHitNV: + case glslang::EOpHitObjectRecordHitMotionNV: + case glslang::EOpHitObjectRecordHitWithIndexNV: + case glslang::EOpHitObjectRecordHitWithIndexMotionNV: + case glslang::EOpReorderThreadNV: + noReturnValue = true; + //Fallthrough + case glslang::EOpHitObjectIsEmptyNV: + case glslang::EOpHitObjectIsMissNV: + case glslang::EOpHitObjectIsHitNV: + case glslang::EOpHitObjectGetRayTMinNV: + case glslang::EOpHitObjectGetRayTMaxNV: + case glslang::EOpHitObjectGetObjectRayOriginNV: + case glslang::EOpHitObjectGetObjectRayDirectionNV: + case glslang::EOpHitObjectGetWorldRayOriginNV: + case glslang::EOpHitObjectGetWorldRayDirectionNV: + case glslang::EOpHitObjectGetObjectToWorldNV: + case glslang::EOpHitObjectGetWorldToObjectNV: + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + case glslang::EOpHitObjectGetInstanceIdNV: + case glslang::EOpHitObjectGetGeometryIndexNV: + case glslang::EOpHitObjectGetPrimitiveIndexNV: + case glslang::EOpHitObjectGetHitKindNV: + case glslang::EOpHitObjectGetCurrentTimeNV: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + builder.addExtension(spv::E_SPV_NV_shader_invocation_reorder); + builder.addCapability(spv::CapabilityShaderInvocationReorderNV); + break; #endif case glslang::EOpDebugPrintf: @@ -3256,6 +3353,22 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt lvalue = true; break; + + + case glslang::EOpHitObjectRecordHitNV: + case glslang::EOpHitObjectRecordHitMotionNV: + case glslang::EOpHitObjectRecordHitWithIndexNV: + case glslang::EOpHitObjectRecordHitWithIndexMotionNV: + case glslang::EOpHitObjectTraceRayNV: + case glslang::EOpHitObjectTraceRayMotionNV: + case glslang::EOpHitObjectExecuteShaderNV: + case glslang::EOpHitObjectRecordMissNV: + case glslang::EOpHitObjectRecordMissMotionNV: + case glslang::EOpHitObjectGetAttributesNV: + if (arg == 0) + lvalue = true; + break; + case glslang::EOpRayQueryInitialize: case glslang::EOpRayQueryTerminate: case glslang::EOpRayQueryConfirmIntersection: @@ -3356,6 +3469,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvByReference()) lvalue = true; break; + case glslang::EOpReorderThreadNV: + //Three variants of reorderThreadNV, two of them use hitObjectNV + if (arg == 0 && glslangOperands.size() != 2) + lvalue = true; + break; #endif default: break; @@ -3412,7 +3530,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt } else if (arg == 2) { continue; } - } + } #endif // for l-values, pass the address, for r-values, pass the value @@ -3454,11 +3572,23 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt operands.push_back(builder.makeIntConstant(cond ? 1 : 0)); } else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) || (arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) || - (arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR)) { - const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : (glslangOp == glslang::EOpTraceRayMotionNV ? 11 : 1); + (arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR) || + (arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderNV) || + (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) || + (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV)) { const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0; - - const int location = glslangOperands[opdNum]->getAsConstantUnion()->getConstArray()[0].getUConst(); + const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst(); + auto itNode = locationToSymbol[set].find(location); + visitSymbol(itNode->second); + spv::Id symId = getSymbolId(itNode->second); + operands.push_back(symId); + } else if ((arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitNV) || + (arg == 13 && glslangOp == glslang::EOpHitObjectRecordHitMotionNV) || + (arg == 11 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexNV) || + (arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexMotionNV) || + (arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesNV)) { + const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst(); + const int set = 2; auto itNode = locationToSymbol[set].find(location); visitSymbol(itNode->second); spv::Id symId = getSymbolId(itNode->second); @@ -4284,6 +4414,13 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtString: // no type used for OpString return 0; + + case glslang::EbtHitObjectNV: { + builder.addExtension(spv::E_SPV_NV_shader_invocation_reorder); + builder.addCapability(spv::CapabilityShaderInvocationReorderNV); + spvType = builder.makeHitObjectNVType(); + } + break; #ifndef GLSLANG_WEB case glslang::EbtSpirvType: { // GL_EXT_spirv_intrinsics @@ -4703,6 +4840,9 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, // Decorate the structure builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); + + if (qualifier.hasHitObjectShaderRecordNV()) + builder.addDecoration(spvType, spv::DecorationHitObjectShaderRecordBufferNV); } // Turn the expression forming the array size into an id. @@ -5083,7 +5223,7 @@ bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier, return true; if (glslangIntermediate->getSource() == glslang::EShSourceHlsl) return paramType.getBasicType() == glslang::EbtBlock; - return paramType.containsOpaque() || // sampler, etc. + return (paramType.containsOpaque() && !glslangIntermediate->getBindlessMode()) || // sampler, etc. #ifndef GLSLANG_WEB paramType.getQualifier().isSpirvByReference() || // spirv_by_reference #endif @@ -5230,6 +5370,10 @@ void TGlslangToSpvTraverser::collectRayTracingLinkerObjects() set = 1; break; + case glslang::EvqHitObjectAttrNV: + set = 2; + break; + default: set = -1; } @@ -6874,6 +7018,83 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe case glslang::EOpConvUvec2ToAccStruct: unaryOp = spv::OpConvertUToAccelerationStructureKHR; break; + + case glslang::EOpHitObjectIsEmptyNV: + unaryOp = spv::OpHitObjectIsEmptyNV; + break; + + case glslang::EOpHitObjectIsMissNV: + unaryOp = spv::OpHitObjectIsMissNV; + break; + + case glslang::EOpHitObjectIsHitNV: + unaryOp = spv::OpHitObjectIsHitNV; + break; + + case glslang::EOpHitObjectGetObjectRayOriginNV: + unaryOp = spv::OpHitObjectGetObjectRayOriginNV; + break; + + case glslang::EOpHitObjectGetObjectRayDirectionNV: + unaryOp = spv::OpHitObjectGetObjectRayDirectionNV; + break; + + case glslang::EOpHitObjectGetWorldRayOriginNV: + unaryOp = spv::OpHitObjectGetWorldRayOriginNV; + break; + + case glslang::EOpHitObjectGetWorldRayDirectionNV: + unaryOp = spv::OpHitObjectGetWorldRayDirectionNV; + break; + + case glslang::EOpHitObjectGetObjectToWorldNV: + unaryOp = spv::OpHitObjectGetObjectToWorldNV; + break; + + case glslang::EOpHitObjectGetWorldToObjectNV: + unaryOp = spv::OpHitObjectGetWorldToObjectNV; + break; + + case glslang::EOpHitObjectGetRayTMinNV: + unaryOp = spv::OpHitObjectGetRayTMinNV; + break; + + case glslang::EOpHitObjectGetRayTMaxNV: + unaryOp = spv::OpHitObjectGetRayTMaxNV; + break; + + case glslang::EOpHitObjectGetPrimitiveIndexNV: + unaryOp = spv::OpHitObjectGetPrimitiveIndexNV; + break; + + case glslang::EOpHitObjectGetInstanceIdNV: + unaryOp = spv::OpHitObjectGetInstanceIdNV; + break; + + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + unaryOp = spv::OpHitObjectGetInstanceCustomIndexNV; + break; + + case glslang::EOpHitObjectGetGeometryIndexNV: + unaryOp = spv::OpHitObjectGetGeometryIndexNV; + break; + + case glslang::EOpHitObjectGetHitKindNV: + unaryOp = spv::OpHitObjectGetHitKindNV; + break; + + case glslang::EOpHitObjectGetCurrentTimeNV: + unaryOp = spv::OpHitObjectGetCurrentTimeNV; + break; + + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + unaryOp = spv::OpHitObjectGetShaderBindingTableRecordIndexNV; + break; + + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + unaryOp = spv::OpHitObjectGetShaderRecordBufferHandleNV; + break; + #endif case glslang::EOpCopyObject: @@ -8615,6 +8836,122 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpCooperativeMatrixMulAdd: opCode = spv::OpCooperativeMatrixMulAddNV; break; + case glslang::EOpHitObjectTraceRayNV: + builder.createNoResultOp(spv::OpHitObjectTraceRayNV, operands); + return 0; + case glslang::EOpHitObjectTraceRayMotionNV: + builder.createNoResultOp(spv::OpHitObjectTraceRayMotionNV, operands); + return 0; + case glslang::EOpHitObjectRecordHitNV: + builder.createNoResultOp(spv::OpHitObjectRecordHitNV, operands); + return 0; + case glslang::EOpHitObjectRecordHitMotionNV: + builder.createNoResultOp(spv::OpHitObjectRecordHitMotionNV, operands); + return 0; + case glslang::EOpHitObjectRecordHitWithIndexNV: + builder.createNoResultOp(spv::OpHitObjectRecordHitWithIndexNV, operands); + return 0; + case glslang::EOpHitObjectRecordHitWithIndexMotionNV: + builder.createNoResultOp(spv::OpHitObjectRecordHitWithIndexMotionNV, operands); + return 0; + case glslang::EOpHitObjectRecordMissNV: + builder.createNoResultOp(spv::OpHitObjectRecordMissNV, operands); + return 0; + case glslang::EOpHitObjectRecordMissMotionNV: + builder.createNoResultOp(spv::OpHitObjectRecordMissMotionNV, operands); + return 0; + case glslang::EOpHitObjectExecuteShaderNV: + builder.createNoResultOp(spv::OpHitObjectExecuteShaderNV, operands); + return 0; + case glslang::EOpHitObjectIsEmptyNV: + typeId = builder.makeBoolType(); + opCode = spv::OpHitObjectIsEmptyNV; + break; + case glslang::EOpHitObjectIsMissNV: + typeId = builder.makeBoolType(); + opCode = spv::OpHitObjectIsMissNV; + break; + case glslang::EOpHitObjectIsHitNV: + typeId = builder.makeBoolType(); + opCode = spv::OpHitObjectIsHitNV; + break; + case glslang::EOpHitObjectGetRayTMinNV: + typeId = builder.makeFloatType(32); + opCode = spv::OpHitObjectGetRayTMinNV; + break; + case glslang::EOpHitObjectGetRayTMaxNV: + typeId = builder.makeFloatType(32); + opCode = spv::OpHitObjectGetRayTMaxNV; + break; + case glslang::EOpHitObjectGetObjectRayOriginNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpHitObjectGetObjectRayOriginNV; + break; + case glslang::EOpHitObjectGetObjectRayDirectionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpHitObjectGetObjectRayDirectionNV; + break; + case glslang::EOpHitObjectGetWorldRayOriginNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpHitObjectGetWorldRayOriginNV; + break; + case glslang::EOpHitObjectGetWorldRayDirectionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpHitObjectGetWorldRayDirectionNV; + break; + case glslang::EOpHitObjectGetWorldToObjectNV: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::OpHitObjectGetWorldToObjectNV; + break; + case glslang::EOpHitObjectGetObjectToWorldNV: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::OpHitObjectGetObjectToWorldNV; + break; + case glslang::EOpHitObjectGetInstanceCustomIndexNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::OpHitObjectGetInstanceCustomIndexNV; + break; + case glslang::EOpHitObjectGetInstanceIdNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::OpHitObjectGetInstanceIdNV; + break; + case glslang::EOpHitObjectGetGeometryIndexNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::OpHitObjectGetGeometryIndexNV; + break; + case glslang::EOpHitObjectGetPrimitiveIndexNV: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::OpHitObjectGetPrimitiveIndexNV; + break; + case glslang::EOpHitObjectGetHitKindNV: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::OpHitObjectGetHitKindNV; + break; + case glslang::EOpHitObjectGetCurrentTimeNV: + typeId = builder.makeFloatType(32); + opCode = spv::OpHitObjectGetCurrentTimeNV; + break; + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::OpHitObjectGetShaderBindingTableRecordIndexNV; + return 0; + case glslang::EOpHitObjectGetAttributesNV: + builder.createNoResultOp(spv::OpHitObjectGetAttributesNV, operands); + return 0; + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: + typeId = builder.makeVectorType(builder.makeUintType(32), 2); + opCode = spv::OpHitObjectGetShaderRecordBufferHandleNV; + break; + case glslang::EOpReorderThreadNV: { + if (operands.size() == 2) { + builder.createNoResultOp(spv::OpReorderThreadWithHintNV, operands); + } else { + builder.createNoResultOp(spv::OpReorderThreadWithHitObjectNV, operands); + } + return 0; + + } + break; #endif // GLSLANG_WEB default: return 0; @@ -8924,13 +9261,17 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } if (symbol->getQualifier().hasLocation()) { - if (!(glslangIntermediate->isRayTracingStage() && glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing) + if (!(glslangIntermediate->isRayTracingStage() && + (glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing) || + glslangIntermediate->IsRequestedExtension(glslang::E_GL_NV_shader_invocation_reorder)) && (builder.getStorageClass(id) == spv::StorageClassRayPayloadKHR || builder.getStorageClass(id) == spv::StorageClassIncomingRayPayloadKHR || builder.getStorageClass(id) == spv::StorageClassCallableDataKHR || - builder.getStorageClass(id) == spv::StorageClassIncomingCallableDataKHR))) { - // Location values are used to link TraceRayKHR and ExecuteCallableKHR to corresponding variables - // but are not valid in SPIRV since they are supported only for Input/Output Storage classes. + builder.getStorageClass(id) == spv::StorageClassIncomingCallableDataKHR || + builder.getStorageClass(id) == spv::StorageClassHitObjectAttributeNV))) { + // Location values are used to link TraceRayKHR/ExecuteCallableKHR/HitObjectGetAttributesNV + // to corresponding variables but are not valid in SPIRV since they are supported only + // for Input/Output Storage classes. builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); } } @@ -9615,7 +9956,7 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector& { TIntermNode* root = intermediate.getTreeRoot(); - if (root == 0) + if (root == nullptr) return; SpvOptions defaultOptions; diff --git a/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/3rdparty/glslang/SPIRV/SpvBuilder.cpp index 7c5ea874b..764a88602 100644 --- a/3rdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -71,9 +71,9 @@ Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogg addressModel(AddressingModelLogical), memoryModel(MemoryModelGLSL450), builderNumber(magicNumber), - buildPoint(0), + buildPoint(nullptr), uniqueId(0), - entryPointFunction(0), + entryPointFunction(nullptr), generatingOpCodeForSpecConst(false), logger(buildLogger) { @@ -650,8 +650,12 @@ Id Builder::makeDebugFunctionType(Id returnType, const std::vector& paramTyp type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); type->addIdOperand(debugId[returnType]); for (auto const paramType : paramTypes) { - assert(isPointerType(paramType) || isArrayType(paramType)); - type->addIdOperand(debugId[getContainedTypeId(paramType)]); + if (isPointerType(paramType) || isArrayType(paramType)) { + type->addIdOperand(debugId[getContainedTypeId(paramType)]); + } + else { + type->addIdOperand(debugId[paramType]); + } } constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); @@ -1176,6 +1180,21 @@ Id Builder::makeRayQueryType() return type->getResultId(); } + +Id Builder::makeHitObjectNVType() +{ + Instruction *type; + if (groupedTypes[OpTypeHitObjectNV].size() == 0) { + type = new Instruction(getUniqueId(), NoType, OpTypeHitObjectNV); + groupedTypes[OpTypeHitObjectNV].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + } else { + type = groupedTypes[OpTypeHitObjectNV].back(); + } + + return type->getResultId(); +} #endif Id Builder::getDerefTypeId(Id resultId) const @@ -1675,7 +1694,7 @@ Id Builder::importNonSemanticShaderDebugInfoInstructions() Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector& comps) { - Instruction* constant = 0; + Instruction* constant = nullptr; bool found = false; for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) { constant = groupedConstants[typeClass][i]; @@ -1702,7 +1721,7 @@ Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector Id Builder::findStructConstant(Id typeId, const std::vector& comps) { - Instruction* constant = 0; + Instruction* constant = nullptr; bool found = false; for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) { constant = groupedStructConstants[typeId][i]; @@ -2047,11 +2066,16 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const assert(paramTypes.size() == paramNames.size()); for(size_t p = 0; p < paramTypes.size(); ++p) { - auto const& paramType = paramTypes[p]; - assert(isPointerType(paramType) || isArrayType(paramType)); - assert(debugId[getContainedTypeId(paramType)] != 0); + auto getParamTypeId = [this](Id const& typeId) { + if (isPointerType(typeId) || isArrayType(typeId)) { + return getContainedTypeId(typeId); + } + else { + return typeId; + } + }; auto const& paramName = paramNames[p]; - auto const debugLocalVariableId = createDebugLocalVariable(debugId[getContainedTypeId(paramType)], paramName, p+1); + auto const debugLocalVariableId = createDebugLocalVariable(debugId[getParamTypeId(paramTypes[p])], paramName, p+1); debugId[firstParamId + p] = debugLocalVariableId; makeDebugDeclare(debugLocalVariableId, firstParamId + p); @@ -3332,7 +3356,7 @@ Builder::If::If(Id cond, unsigned int ctrl, Builder& gb) : builder(gb), condition(cond), control(ctrl), - elseBlock(0) + elseBlock(nullptr) { function = &builder.getBuildPoint()->getParent(); diff --git a/3rdparty/glslang/SPIRV/SpvBuilder.h b/3rdparty/glslang/SPIRV/SpvBuilder.h index f7fdc6ad8..02e9cf400 100644 --- a/3rdparty/glslang/SPIRV/SpvBuilder.h +++ b/3rdparty/glslang/SPIRV/SpvBuilder.h @@ -240,6 +240,8 @@ public: Id makeAccelerationStructureType(); // rayQueryEXT type Id makeRayQueryType(); + // hitObjectNV type + Id makeHitObjectNVType(); // For querying about types. Id getTypeId(Id resultId) const { return module.getTypeId(resultId); } @@ -414,7 +416,7 @@ public: // The returned pointer is only valid for the lifetime of this builder. Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, const std::vector& paramTypes, const std::vector& paramNames, - const std::vector>& precisions, Block **entry = 0); + const std::vector>& precisions, Block **entry = nullptr); // Create a return. An 'implicit' return is one not appearing in the source // code. In the case of an implicit return, no post-return block is inserted. diff --git a/3rdparty/glslang/SPIRV/SpvPostProcess.cpp b/3rdparty/glslang/SPIRV/SpvPostProcess.cpp index dd6dabce0..b185f61bb 100644 --- a/3rdparty/glslang/SPIRV/SpvPostProcess.cpp +++ b/3rdparty/glslang/SPIRV/SpvPostProcess.cpp @@ -52,6 +52,7 @@ namespace spv { #include "GLSL.ext.EXT.h" #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" } namespace spv { diff --git a/3rdparty/glslang/SPIRV/SpvTools.cpp b/3rdparty/glslang/SPIRV/SpvTools.cpp index 25299937a..ff04f4f96 100644 --- a/3rdparty/glslang/SPIRV/SpvTools.cpp +++ b/3rdparty/glslang/SPIRV/SpvTools.cpp @@ -212,8 +212,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass()); if (options->optimizeSize) { optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass()); - if (intermediate.getStage() == EShLanguage::EShLangVertex) - optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass()); + optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsSafePass()); } optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); optimizer.RegisterPass(spvtools::CreateCFGCleanupPass()); @@ -224,6 +223,56 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); } +bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*) +{ + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + optimizer.RegisterPass(spvtools::CreateAnalyzeLiveInputPass(live_locs, live_builtins)); + + spvtools::OptimizerOptions spvOptOptions; + optimizer.SetTargetEnv(target_env); + spvOptOptions.set_run_validator(false); + return optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); +} + +void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*) +{ + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputStoresPass(live_locs, live_builtins)); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true)); + optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputComponentsPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true)); + + spvtools::OptimizerOptions spvOptOptions; + optimizer.SetTargetEnv(target_env); + spvOptOptions.set_run_validator(false); + optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); +} + +void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector& spirv, + spv::SpvBuildLogger*) +{ + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer(OptimizerMesssageConsumer); + + optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + + spvtools::OptimizerOptions spvOptOptions; + optimizer.SetTargetEnv(target_env); + spvOptOptions.set_run_validator(false); + optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); +} + // Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by // SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if // optimization is disabled. diff --git a/3rdparty/glslang/SPIRV/SpvTools.h b/3rdparty/glslang/SPIRV/SpvTools.h index 5386048ab..6fc4e40b0 100644 --- a/3rdparty/glslang/SPIRV/SpvTools.h +++ b/3rdparty/glslang/SPIRV/SpvTools.h @@ -65,6 +65,9 @@ struct SpvOptions { #if ENABLE_OPT +// Translate glslang's view of target versioning to what SPIRV-Tools uses. +spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger); + // Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment. void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv); @@ -80,6 +83,22 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector< void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector& spirv, spv::SpvBuildLogger*, const SpvOptions*); +// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|. +void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector& spirv, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools AnalyzeDeadOutputStores pass to generated SPIR-V. Put result in |live_locs|. +// Return true if the result is valid. +bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools EliminateDeadOutputStores and AggressiveDeadCodeElimination passes to generated SPIR-V using +// |live_locs|. Put result in |spirv|. +void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, spv::SpvBuildLogger*); + // Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by // SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if // optimization is disabled. diff --git a/3rdparty/glslang/SPIRV/disassemble.cpp b/3rdparty/glslang/SPIRV/disassemble.cpp index 74dd60540..f943fd564 100644 --- a/3rdparty/glslang/SPIRV/disassemble.cpp +++ b/3rdparty/glslang/SPIRV/disassemble.cpp @@ -54,6 +54,8 @@ namespace spv { #include "GLSL.std.450.h" #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" + #include "NonSemanticShaderDebugInfo100.h" } } const char* GlslStd450DebugNames[spv::GLSLstd450Count]; @@ -62,6 +64,7 @@ namespace spv { static const char* GLSLextAMDGetDebugNames(const char*, unsigned); static const char* GLSLextNVGetDebugNames(const char*, unsigned); +static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned); static void Kill(std::ostream& out, const char* message) { @@ -76,6 +79,7 @@ enum ExtInstSet { GLSLextNVInst, OpenCLExtInst, NonSemanticDebugPrintfExtInst, + NonSemanticShaderDebugInfo100 }; // Container class for a single instance of a SPIR-V stream, with methods for disassembly. @@ -501,6 +505,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, extInstSet = OpenCLExtInst; } else if (strcmp("NonSemantic.DebugPrintf", name) == 0) { extInstSet = NonSemanticDebugPrintfExtInst; + } else if (strcmp("NonSemantic.Shader.DebugInfo.100", name) == 0) { + extInstSet = NonSemanticShaderDebugInfo100; } else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 || strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 || strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 || @@ -526,6 +532,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")"; } else if (extInstSet == NonSemanticDebugPrintfExtInst) { out << "(DebugPrintf)"; + } else if (extInstSet == NonSemanticShaderDebugInfo100) { + out << "(" << NonSemanticShaderDebugInfo100GetDebugNames(entrypoint) << ")"; } } break; @@ -749,6 +757,59 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) return "Bad"; } +static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned entrypoint) +{ + switch (entrypoint) { + case NonSemanticShaderDebugInfo100DebugInfoNone: return "DebugInfoNone"; + case NonSemanticShaderDebugInfo100DebugCompilationUnit: return "DebugCompilationUnit"; + case NonSemanticShaderDebugInfo100DebugTypeBasic: return "DebugTypeBasic"; + case NonSemanticShaderDebugInfo100DebugTypePointer: return "DebugTypePointer"; + case NonSemanticShaderDebugInfo100DebugTypeQualifier: return "DebugTypeQualifier"; + case NonSemanticShaderDebugInfo100DebugTypeArray: return "DebugTypeArray"; + case NonSemanticShaderDebugInfo100DebugTypeVector: return "DebugTypeVector"; + case NonSemanticShaderDebugInfo100DebugTypedef: return "DebugTypedef"; + case NonSemanticShaderDebugInfo100DebugTypeFunction: return "DebugTypeFunction"; + case NonSemanticShaderDebugInfo100DebugTypeEnum: return "DebugTypeEnum"; + case NonSemanticShaderDebugInfo100DebugTypeComposite: return "DebugTypeComposite"; + case NonSemanticShaderDebugInfo100DebugTypeMember: return "DebugTypeMember"; + case NonSemanticShaderDebugInfo100DebugTypeInheritance: return "DebugTypeInheritance"; + case NonSemanticShaderDebugInfo100DebugTypePtrToMember: return "DebugTypePtrToMember"; + case NonSemanticShaderDebugInfo100DebugTypeTemplate: return "DebugTypeTemplate"; + case NonSemanticShaderDebugInfo100DebugTypeTemplateParameter: return "DebugTypeTemplateParameter"; + case NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter: return "DebugTypeTemplateTemplateParameter"; + case NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack: return "DebugTypeTemplateParameterPack"; + case NonSemanticShaderDebugInfo100DebugGlobalVariable: return "DebugGlobalVariable"; + case NonSemanticShaderDebugInfo100DebugFunctionDeclaration: return "DebugFunctionDeclaration"; + case NonSemanticShaderDebugInfo100DebugFunction: return "DebugFunction"; + case NonSemanticShaderDebugInfo100DebugLexicalBlock: return "DebugLexicalBlock"; + case NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator: return "DebugLexicalBlockDiscriminator"; + case NonSemanticShaderDebugInfo100DebugScope: return "DebugScope"; + case NonSemanticShaderDebugInfo100DebugNoScope: return "DebugNoScope"; + case NonSemanticShaderDebugInfo100DebugInlinedAt: return "DebugInlinedAt"; + case NonSemanticShaderDebugInfo100DebugLocalVariable: return "DebugLocalVariable"; + case NonSemanticShaderDebugInfo100DebugInlinedVariable: return "DebugInlinedVariable"; + case NonSemanticShaderDebugInfo100DebugDeclare: return "DebugDeclare"; + case NonSemanticShaderDebugInfo100DebugValue: return "DebugValue"; + case NonSemanticShaderDebugInfo100DebugOperation: return "DebugOperation"; + case NonSemanticShaderDebugInfo100DebugExpression: return "DebugExpression"; + case NonSemanticShaderDebugInfo100DebugMacroDef: return "DebugMacroDef"; + case NonSemanticShaderDebugInfo100DebugMacroUndef: return "DebugMacroUndef"; + case NonSemanticShaderDebugInfo100DebugImportedEntity: return "DebugImportedEntity"; + case NonSemanticShaderDebugInfo100DebugSource: return "DebugSource"; + case NonSemanticShaderDebugInfo100DebugFunctionDefinition: return "DebugFunctionDefinition"; + case NonSemanticShaderDebugInfo100DebugSourceContinued: return "DebugSourceContinued"; + case NonSemanticShaderDebugInfo100DebugLine: return "DebugLine"; + case NonSemanticShaderDebugInfo100DebugNoLine: return "DebugNoLine"; + case NonSemanticShaderDebugInfo100DebugBuildIdentifier: return "DebugBuildIdentifier"; + case NonSemanticShaderDebugInfo100DebugStoragePath: return "DebugStoragePath"; + case NonSemanticShaderDebugInfo100DebugEntryPoint: return "DebugEntryPoint"; + case NonSemanticShaderDebugInfo100DebugTypeMatrix: return "DebugTypeMatrix"; + default: return "Bad"; + } + + return "Bad"; +} + void Disassemble(std::ostream& out, const std::vector& stream) { SpirvStream SpirvStream(out, stream); diff --git a/3rdparty/glslang/SPIRV/doc.cpp b/3rdparty/glslang/SPIRV/doc.cpp index b7fe3e742..87ab12032 100644 --- a/3rdparty/glslang/SPIRV/doc.cpp +++ b/3rdparty/glslang/SPIRV/doc.cpp @@ -53,6 +53,7 @@ namespace spv { #include "GLSL.ext.EXT.h" #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" + #include "GLSL.ext.ARM.h" } } @@ -245,6 +246,7 @@ const char* StorageClassString(int StorageClass) case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT"; case StorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case StorageClassHitObjectAttributeNV: return "HitObjectAttributeNV"; default: return "Bad"; } } @@ -319,6 +321,8 @@ const char* DecorationString(int decoration) case DecorationHlslSemanticGOOGLE: return "DecorationHlslSemanticGOOGLE"; case DecorationRestrictPointerEXT: return "DecorationRestrictPointerEXT"; case DecorationAliasedPointerEXT: return "DecorationAliasedPointerEXT"; + + case DecorationHitObjectShaderRecordBufferNV: return "DecorationHitObjectShaderRecordBufferNV"; } } @@ -439,6 +443,11 @@ const char* BuiltInString(int builtIn) case BuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; case BuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; case BuiltInCullPrimitiveEXT: return "CullPrimitiveEXT"; + case BuiltInCoreCountARM: return "CoreCountARM"; + case BuiltInCoreIDARM: return "CoreIDARM"; + case BuiltInCoreMaxIDARM: return "CoreMaxIDARM"; + case BuiltInWarpIDARM: return "WarpIDARM"; + case BuiltInWarpMaxIDARM: return "BuiltInWarpMaxIDARM"; default: return "Bad"; } @@ -998,7 +1007,9 @@ const char* CapabilityString(int info) case CapabilityWorkgroupMemoryExplicitLayoutKHR: return "CapabilityWorkgroupMemoryExplicitLayoutKHR"; case CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR"; case CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR"; + case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM"; + case CapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; default: return "Bad"; } } @@ -1453,6 +1464,40 @@ const char* OpcodeString(int op) case OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; case OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case OpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case OpHitObjectGetHitKindNV: return "OpHitObjectGetFrontFaceNV"; + case OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case OpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case OpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + default: return "Bad"; } @@ -1607,7 +1652,7 @@ void Parameterize() DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'"); DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'"); - OperandClassParams[OperandSource].set(0, SourceString, 0); + OperandClassParams[OperandSource].set(0, SourceString, nullptr); OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr); OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr); OperandClassParams[OperandMemory].set(0, MemoryString, nullptr); @@ -1639,7 +1684,7 @@ void Parameterize() OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr); OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true); OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr); - OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, 0); + OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, nullptr); // set name of operator, an initial set of style operands, and the description @@ -3030,6 +3075,191 @@ void Parameterize() InstructionDesc[OpDemoteToHelperInvocationEXT].setResultAndType(false, false); InstructionDesc[OpReadClockKHR].operands.push(OperandScope, "'Scope'"); + + InstructionDesc[OpTypeHitObjectNV].setResultAndType(true, false); + + InstructionDesc[OpHitObjectGetShaderRecordBufferHandleNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetShaderRecordBufferHandleNV].setResultAndType(true, true); + + InstructionDesc[OpReorderThreadWithHintNV].operands.push(OperandId, "'Hint'"); + InstructionDesc[OpReorderThreadWithHintNV].operands.push(OperandId, "'Bits'"); + InstructionDesc[OpReorderThreadWithHintNV].setResultAndType(false, false); + + InstructionDesc[OpReorderThreadWithHitObjectNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpReorderThreadWithHitObjectNV].operands.push(OperandId, "'Hint'"); + InstructionDesc[OpReorderThreadWithHitObjectNV].operands.push(OperandId, "'Bits'"); + InstructionDesc[OpReorderThreadWithHitObjectNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectGetCurrentTimeNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetCurrentTimeNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetHitKindNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetHitKindNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetPrimitiveIndexNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetPrimitiveIndexNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetGeometryIndexNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetGeometryIndexNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetInstanceIdNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetInstanceIdNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetInstanceCustomIndexNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetInstanceCustomIndexNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetObjectRayDirectionNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetObjectRayDirectionNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetObjectRayOriginNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetObjectRayOriginNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetWorldRayDirectionNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetWorldRayDirectionNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetWorldRayOriginNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetWorldRayOriginNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetWorldToObjectNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetWorldToObjectNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetObjectToWorldNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetObjectToWorldNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetRayTMaxNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetRayTMaxNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetRayTMinNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetRayTMinNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetShaderBindingTableRecordIndexNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetShaderBindingTableRecordIndexNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectIsEmptyNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectIsEmptyNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectIsHitNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectIsHitNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectIsMissNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectIsMissNV].setResultAndType(true, true); + + InstructionDesc[OpHitObjectGetAttributesNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectGetAttributesNV].operands.push(OperandId, "'HitObjectAttribute'"); + InstructionDesc[OpHitObjectGetAttributesNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectExecuteShaderNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectExecuteShaderNV].operands.push(OperandId, "'Payload'"); + InstructionDesc[OpHitObjectExecuteShaderNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'HitKind'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[OpHitObjectRecordHitNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'HitKind'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Current Time'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[OpHitObjectRecordHitMotionNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'HitKind'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[OpHitObjectRecordHitWithIndexNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'InstanceId'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'PrimitiveId'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'GeometryIndex'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'HitKind'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Current Time'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'HitObject Attribute'"); + InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectRecordMissNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'Current Time'"); + InstructionDesc[OpHitObjectRecordMissMotionNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectRecordEmptyNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectRecordEmptyNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Payload'"); + InstructionDesc[OpHitObjectTraceRayNV].setResultAndType(false, false); + + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'HitObject'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Time'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Payload'"); + InstructionDesc[OpHitObjectTraceRayMotionNV].setResultAndType(false, false); } }; // end spv namespace diff --git a/3rdparty/glslang/SPIRV/doc.h b/3rdparty/glslang/SPIRV/doc.h index 2a0b28c6b..7e1559950 100644 --- a/3rdparty/glslang/SPIRV/doc.h +++ b/3rdparty/glslang/SPIRV/doc.h @@ -190,7 +190,7 @@ protected: // Parameterize an enumerant class EnumParameters { public: - EnumParameters() : desc(0) { } + EnumParameters() : desc(nullptr) { } const char* desc; }; @@ -198,7 +198,7 @@ public: class EnumDefinition : public EnumParameters { public: EnumDefinition() : - ceiling(0), bitmask(false), getName(0), enumParams(0), operandParams(0) { } + ceiling(0), bitmask(false), getName(nullptr), enumParams(nullptr), operandParams(nullptr) { } void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false) { ceiling = ceil; diff --git a/3rdparty/glslang/SPIRV/spirv.hpp b/3rdparty/glslang/SPIRV/spirv.hpp index f85469d44..768a6f564 100644 --- a/3rdparty/glslang/SPIRV/spirv.hpp +++ b/3rdparty/glslang/SPIRV/spirv.hpp @@ -223,6 +223,7 @@ enum StorageClass { StorageClassShaderRecordBufferNV = 5343, StorageClassPhysicalStorageBuffer = 5349, StorageClassPhysicalStorageBufferEXT = 5349, + StorageClassHitObjectAttributeNV = 5385, StorageClassTaskPayloadWorkgroupEXT = 5402, StorageClassCodeSectionINTEL = 5605, StorageClassDeviceOnlyINTEL = 5936, @@ -518,6 +519,7 @@ enum Decoration { DecorationRestrictPointerEXT = 5355, DecorationAliasedPointer = 5356, DecorationAliasedPointerEXT = 5356, + DecorationHitObjectShaderRecordBufferNV = 5386, DecorationBindlessSamplerNV = 5398, DecorationBindlessImageNV = 5399, DecorationBoundSamplerNV = 5400, @@ -607,6 +609,11 @@ enum BuiltIn { BuiltInSubgroupLocalInvocationId = 41, BuiltInVertexIndex = 42, BuiltInInstanceIndex = 43, + BuiltInCoreCountARM = 4161, + BuiltInCoreIDARM = 4160, + BuiltInCoreMaxIDARM = 4162, + BuiltInWarpIDARM = 4163, + BuiltInWarpMaxIDARM = 4164, BuiltInSubgroupEqMask = 4416, BuiltInSubgroupEqMaskKHR = 4416, BuiltInSubgroupGeMask = 4417, @@ -946,6 +953,7 @@ enum Capability { CapabilityShaderLayer = 69, CapabilityShaderViewportIndex = 70, CapabilityUniformDecoration = 71, + CapabilityCoreBuiltinsARM = 4165, CapabilityFragmentShadingRateKHR = 4422, CapabilitySubgroupBallotKHR = 4423, CapabilityDrawParameters = 4427, @@ -1042,6 +1050,7 @@ enum Capability { CapabilityFragmentShaderPixelInterlockEXT = 5378, CapabilityDemoteToHelperInvocation = 5379, CapabilityDemoteToHelperInvocationEXT = 5379, + CapabilityShaderInvocationReorderNV = 5383, CapabilityBindlessTextureNV = 5390, CapabilitySubgroupShuffleINTEL = 5568, CapabilitySubgroupBufferBlockIOINTEL = 5569, @@ -1588,6 +1597,39 @@ enum Op { OpFragmentMaskFetchAMD = 5011, OpFragmentFetchAMD = 5012, OpReadClockKHR = 5056, + OpHitObjectRecordHitMotionNV = 5249, + OpHitObjectRecordHitWithIndexMotionNV = 5250, + OpHitObjectRecordMissMotionNV = 5251, + OpHitObjectGetWorldToObjectNV = 5252, + OpHitObjectGetObjectToWorldNV = 5253, + OpHitObjectGetObjectRayDirectionNV = 5254, + OpHitObjectGetObjectRayOriginNV = 5255, + OpHitObjectTraceRayMotionNV = 5256, + OpHitObjectGetShaderRecordBufferHandleNV = 5257, + OpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + OpHitObjectRecordEmptyNV = 5259, + OpHitObjectTraceRayNV = 5260, + OpHitObjectRecordHitNV = 5261, + OpHitObjectRecordHitWithIndexNV = 5262, + OpHitObjectRecordMissNV = 5263, + OpHitObjectExecuteShaderNV = 5264, + OpHitObjectGetCurrentTimeNV = 5265, + OpHitObjectGetAttributesNV = 5266, + OpHitObjectGetHitKindNV = 5267, + OpHitObjectGetPrimitiveIndexNV = 5268, + OpHitObjectGetGeometryIndexNV = 5269, + OpHitObjectGetInstanceIdNV = 5270, + OpHitObjectGetInstanceCustomIndexNV = 5271, + OpHitObjectGetWorldRayDirectionNV = 5272, + OpHitObjectGetWorldRayOriginNV = 5273, + OpHitObjectGetRayTMaxNV = 5274, + OpHitObjectGetRayTMinNV = 5275, + OpHitObjectIsEmptyNV = 5276, + OpHitObjectIsHitNV = 5277, + OpHitObjectIsMissNV = 5278, + OpReorderThreadWithHitObjectNV = 5279, + OpReorderThreadWithHintNV = 5280, + OpTypeHitObjectNV = 5281, OpImageSampleFootprintNV = 5283, OpEmitMeshTasksEXT = 5294, OpSetMeshOutputsEXT = 5295, diff --git a/3rdparty/glslang/StandAlone/ResourceLimits.cpp b/3rdparty/glslang/StandAlone/ResourceLimits.cpp index 6e1a3d85c..0e9d1b548 100644 --- a/3rdparty/glslang/StandAlone/ResourceLimits.cpp +++ b/3rdparty/glslang/StandAlone/ResourceLimits.cpp @@ -505,6 +505,8 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config) resources->maxTaskWorkGroupSizeZ_EXT = value; else if (tokenStr == "MaxMeshViewCountEXT") resources->maxMeshViewCountEXT = value; + else if (tokenStr == "MaxDualSourceDrawBuffersEXT") + resources->maxDualSourceDrawBuffersEXT = value; else if (tokenStr == "nonInductiveForLoops") resources->limits.nonInductiveForLoops = (value != 0); else if (tokenStr == "whileLoops") diff --git a/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/glslang/StandAlone/StandAlone.cpp index 53a6b9c2f..e02628562 100644 --- a/3rdparty/glslang/StandAlone/StandAlone.cpp +++ b/3rdparty/glslang/StandAlone/StandAlone.cpp @@ -504,7 +504,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi if (set) { errno = 0; - int setVal = ::strtol(argv[curArg], NULL, 10); + int setVal = ::strtol(argv[curArg], nullptr, 10); if (errno || setVal < 0) { printf("%s: invalid set\n", argv[curArg]); usage(); @@ -516,7 +516,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi if (binding) { errno = 0; - int bindingVal = ::strtol(argv[curArg], NULL, 10); + int bindingVal = ::strtol(argv[curArg], nullptr, 10); if (errno || bindingVal < 0) { printf("%s: invalid binding\n", argv[curArg]); usage(); @@ -594,12 +594,12 @@ void ProcessArguments(std::vector>& workItem const auto getUniformOverride = [getStringOperand]() { const char *arg = getStringOperand("-u:"); const char *split = strchr(arg, ':'); - if (split == NULL) { + if (split == nullptr) { printf("%s: missing location\n", arg); exit(EFailUsage); } errno = 0; - int location = ::strtol(split + 1, NULL, 10); + int location = ::strtol(split + 1, nullptr, 10); if (errno) { printf("%s: invalid location\n", arg); exit(EFailUsage); @@ -626,7 +626,7 @@ void ProcessArguments(std::vector>& workItem } else if (lowerword == "uniform-base") { if (argc <= 1) Error("no provided", lowerword.c_str()); - uniformBase = ::strtol(argv[1], NULL, 10); + uniformBase = ::strtol(argv[1], nullptr, 10); bumpArg(); break; } else if (lowerword == "client") { @@ -1161,7 +1161,7 @@ void CompileShaders(glslang::TWorklist& worklist) } else { while (worklist.remove(workItem)) { ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), Options); - if (compiler == 0) + if (compiler == nullptr) return; CompileFile(workItem->name.c_str(), compiler); @@ -1297,7 +1297,7 @@ void CompileAndLinkShaderUnits(std::vector compUnits) sources.push_back(compUnit.fileNameList[i]); } glslang::TShader* shader = new glslang::TShader(compUnit.stage); - shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, compUnit.count); + shader->setStringsWithLengthsAndNames(compUnit.text, nullptr, compUnit.fileNameList, compUnit.count); if (entryPointName) shader->setEntryPoint(entryPointName); if (sourceEntryPointName) { diff --git a/3rdparty/glslang/StandAlone/spirv-remap.cpp b/3rdparty/glslang/StandAlone/spirv-remap.cpp index 15c3ac513..301bb0cb5 100644 --- a/3rdparty/glslang/StandAlone/spirv-remap.cpp +++ b/3rdparty/glslang/StandAlone/spirv-remap.cpp @@ -157,7 +157,7 @@ namespace { } // Print helpful usage message to stdout, and exit - void usage(const char* const name, const char* const msg = 0) + void usage(const char* const name, const char* const msg = nullptr) { if (msg) std::cout << msg << std::endl << std::endl; @@ -245,7 +245,7 @@ namespace { verbosity = 1; if (a < argc) { - char* end_ptr = 0; + char* end_ptr = nullptr; int verb = ::strtol(argv[a], &end_ptr, 10); // If we have not read to the end of the string or // the string contained no elements, then we do not want to diff --git a/3rdparty/glslang/build_info.h b/3rdparty/glslang/build_info.h index e711b2095..3ab3fbaed 100644 --- a/3rdparty/glslang/build_info.h +++ b/3rdparty/glslang/build_info.h @@ -35,7 +35,7 @@ #define GLSLANG_BUILD_INFO #define GLSLANG_VERSION_MAJOR 11 -#define GLSLANG_VERSION_MINOR 12 +#define GLSLANG_VERSION_MINOR 13 #define GLSLANG_VERSION_PATCH 0 #define GLSLANG_VERSION_FLAVOR "" diff --git a/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp b/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp index c38db0f69..5e28405f0 100644 --- a/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp +++ b/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp @@ -82,7 +82,7 @@ void DeleteUniformMap(TUniformMap* map) TShHandleBase* ConstructBindings() { - return 0; + return nullptr; } void DeleteBindingList(TShHandleBase* bindingList) diff --git a/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp b/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp index a01f24035..19a792b98 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp +++ b/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp @@ -3794,7 +3794,7 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttri parseContext.unnestLooping(); --parseContext.controlFlowNestingLevel; - loopNode = intermediate.addLoop(statement, condition, 0, false, loc); + loopNode = intermediate.addLoop(statement, condition, nullptr, false, loc); statement = loopNode; break; diff --git a/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp b/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp index 62e46a093..6e0d314ae 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp +++ b/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp @@ -1596,7 +1596,7 @@ void HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction // bool builtIn; TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn); - const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0; + const TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; if (prototype) { // All built-in functions are defined, even though they don't have a body. @@ -2472,7 +2472,7 @@ TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermT void HlslParseContext::handleFunctionArgument(TFunction* function, TIntermTyped*& arguments, TIntermTyped* newArg) { - TParameter param = { 0, new TType, nullptr }; + TParameter param = { nullptr, new TType, nullptr }; param.type->shallowCopy(newArg->getType()); function->addParameter(param); @@ -7790,18 +7790,18 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction // Handle aggregates: put all args into the new function call for (int arg = 0; arg < int(args->getAsAggregate()->getSequence().size()); ++arg) { // TODO: But for constness, we could avoid the new & shallowCopy, and use the pointer directly. - TParameter param = { 0, new TType, nullptr }; + TParameter param = { nullptr, new TType, nullptr }; param.type->shallowCopy(args->getAsAggregate()->getSequence()[arg]->getAsTyped()->getType()); convertedCall.addParameter(param); } } else if (args->getAsUnaryNode()) { // Handle unaries: put all args into the new function call - TParameter param = { 0, new TType, nullptr }; + TParameter param = { nullptr, new TType, nullptr }; param.type->shallowCopy(args->getAsUnaryNode()->getOperand()->getAsTyped()->getType()); convertedCall.addParameter(param); } else if (args->getAsTyped()) { // Handle bare e.g, floats, not in an aggregate. - TParameter param = { 0, new TType, nullptr }; + TParameter param = { nullptr, new TType, nullptr }; param.type->shallowCopy(args->getAsTyped()->getType()); convertedCall.addParameter(param); } else { diff --git a/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h b/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h index 96d85f434..97c52d453 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h +++ b/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h @@ -147,14 +147,14 @@ public: void declareTypedef(const TSourceLoc&, const TString& identifier, const TType&); void declareStruct(const TSourceLoc&, TString& structName, TType&); TSymbol* lookupUserType(const TString&, TType&); - TIntermNode* declareVariable(const TSourceLoc&, const TString& identifier, TType&, TIntermTyped* initializer = 0); + TIntermNode* declareVariable(const TSourceLoc&, const TString& identifier, TType&, TIntermTyped* initializer = nullptr); void lengthenList(const TSourceLoc&, TIntermSequence& list, int size, TIntermTyped* scalarInit); TIntermTyped* handleConstructor(const TSourceLoc&, TIntermTyped*, const TType&); TIntermTyped* addConstructor(const TSourceLoc&, TIntermTyped*, const TType&); TIntermTyped* convertArray(TIntermTyped*, const TType&); TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); - void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0); + void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = nullptr); void declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); void fixXfbOffsets(TQualifier&, TTypeList&); @@ -171,10 +171,10 @@ public: void unnestAnnotations() { --annotationNestingLevel; } int getAnnotationNestingLevel() { return annotationNestingLevel; } void pushScope() { symbolTable.push(); } - void popScope() { symbolTable.pop(0); } + void popScope() { symbolTable.pop(nullptr); } void pushThisScope(const TType&, const TVector&); - void popThisScope() { symbolTable.pop(0); } + void popThisScope() { symbolTable.pop(nullptr); } void pushImplicitThis(TVariable* thisParameter) { implicitThisStack.push_back(thisParameter); } void popImplicitThis() { implicitThisStack.pop_back(); } diff --git a/3rdparty/glslang/glslang/Include/BaseTypes.h b/3rdparty/glslang/glslang/Include/BaseTypes.h index 156d98b9a..cf93193d3 100644 --- a/3rdparty/glslang/glslang/Include/BaseTypes.h +++ b/3rdparty/glslang/glslang/Include/BaseTypes.h @@ -65,6 +65,7 @@ enum TBasicType { EbtAccStruct, EbtReference, EbtRayQuery, + EbtHitObjectNV, #ifndef GLSLANG_WEB // SPIR-V type defined by spirv_type EbtSpirvType, @@ -104,6 +105,7 @@ enum TStorageQualifier { EvqHitAttr, EvqCallableData, EvqCallableDataIn, + EvqHitObjectAttrNV, EvqtaskPayloadSharedEXT, @@ -316,6 +318,13 @@ enum TBuiltInVariable { EbvByteAddressBuffer, EbvRWByteAddressBuffer, + // ARM specific core builtins + EbvCoreCountARM, + EbvCoreIDARM, + EbvCoreMaxIDARM, + EbvWarpIDARM, + EbvWarpMaxIDARM, + EbvLast }; @@ -368,6 +377,7 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q) case EvqCallableData: return "callableDataNV"; break; case EvqCallableDataIn: return "callableDataInNV"; break; case EvqtaskPayloadSharedEXT: return "taskPayloadSharedEXT"; break; + case EvqHitObjectAttrNV:return "hitObjectAttributeNV"; break; default: return "unknown qualifier"; } } diff --git a/3rdparty/glslang/glslang/Include/PoolAlloc.h b/3rdparty/glslang/glslang/Include/PoolAlloc.h index 1f5cac76d..3e67d6edf 100644 --- a/3rdparty/glslang/glslang/Include/PoolAlloc.h +++ b/3rdparty/glslang/glslang/Include/PoolAlloc.h @@ -37,7 +37,7 @@ #ifndef _POOLALLOC_INCLUDED_ #define _POOLALLOC_INCLUDED_ -#ifdef _DEBUG +#ifndef NDEBUG # define GUARD_BLOCKS // define to enable guard block sanity checking #endif @@ -74,7 +74,7 @@ namespace glslang { class TAllocation { public: - TAllocation(size_t size, unsigned char* mem, TAllocation* prev = 0) : + TAllocation(size_t size, unsigned char* mem, TAllocation* prev = nullptr) : size(size), mem(mem), prevAlloc(prev) { // Allocations are bracketed: // [allocationHeader][initialGuardBlock][userData][finalGuardBlock] @@ -171,7 +171,7 @@ public: void popAll(); // - // Call allocate() to actually acquire memory. Returns 0 if no memory + // Call allocate() to actually acquire memory. Returns nullptr if no memory // available, otherwise a properly aligned pointer to 'numBytes' of memory. // void* allocate(size_t numBytes); @@ -189,7 +189,7 @@ protected: struct tHeader { tHeader(tHeader* nextPage, size_t pageCount) : #ifdef GUARD_BLOCKS - lastAllocation(0), + lastAllocation(nullptr), #endif nextPage(nextPage), pageCount(pageCount) { } diff --git a/3rdparty/glslang/glslang/Include/ShHandle.h b/3rdparty/glslang/glslang/Include/ShHandle.h index df07bd8ed..dee47c0df 100644 --- a/3rdparty/glslang/glslang/Include/ShHandle.h +++ b/3rdparty/glslang/glslang/Include/ShHandle.h @@ -58,9 +58,9 @@ class TShHandleBase { public: TShHandleBase() { pool = new glslang::TPoolAllocator; } virtual ~TShHandleBase() { delete pool; } - virtual TCompiler* getAsCompiler() { return 0; } - virtual TLinker* getAsLinker() { return 0; } - virtual TUniformMap* getAsUniformMap() { return 0; } + virtual TCompiler* getAsCompiler() { return nullptr; } + virtual TLinker* getAsLinker() { return nullptr; } + virtual TUniformMap* getAsUniformMap() { return nullptr; } virtual glslang::TPoolAllocator* getPool() const { return pool; } private: glslang::TPoolAllocator* pool; @@ -123,11 +123,11 @@ public: infoSink(iSink), executable(e), haveReturnableObjectCode(false), - appAttributeBindings(0), - fixedAttributeBindings(0), - excludedAttributes(0), + appAttributeBindings(nullptr), + fixedAttributeBindings(nullptr), + excludedAttributes(nullptr), excludedCount(0), - uniformBindings(0) { } + uniformBindings(nullptr) { } virtual TLinker* getAsLinker() { return this; } virtual ~TLinker() { } virtual bool link(TCompilerList&, TUniformMap*) = 0; @@ -137,7 +137,7 @@ public: virtual void getAttributeBindings(ShBindingTable const **t) const = 0; virtual void setExcludedAttributes(const int* attributes, int count) { excludedAttributes = attributes; excludedCount = count; } virtual ShBindingTable* getUniformBindings() const { return uniformBindings; } - virtual const void* getObjectCode() const { return 0; } // a real compiler would be returning object code here + virtual const void* getObjectCode() const { return nullptr; } // a real compiler would be returning object code here virtual TInfoSink& getInfoSink() { return infoSink; } TInfoSink& infoSink; protected: diff --git a/3rdparty/glslang/glslang/Include/Types.h b/3rdparty/glslang/glslang/Include/Types.h index a6f47e847..59a447c91 100644 --- a/3rdparty/glslang/glslang/Include/Types.h +++ b/3rdparty/glslang/glslang/Include/Types.h @@ -429,6 +429,12 @@ enum TLayoutFormat { ElfR16ui, ElfR8ui, ElfR64ui, + ElfExtSizeGuard, // to help with comparisons + ElfSize1x8, + ElfSize1x16, + ElfSize1x32, + ElfSize2x32, + ElfSize4x32, ElfCount }; @@ -863,6 +869,9 @@ public: bool isAnyCallable() const { return storage == EvqCallableData || storage == EvqCallableDataIn; } + bool isHitObjectAttrNV() const { + return storage == EvqHitObjectAttrNV; + } // True if this type of IO is supposed to be arrayed with extra level for per-vertex data bool isArrayedIo(EShLanguage language) const @@ -898,6 +907,9 @@ public: // -2048 as the default value indicating layoutSecondaryViewportRelative is not set layoutSecondaryViewportRelativeOffset = -2048; layoutShaderRecord = false; + layoutHitObjectShaderRecordNV = false; + layoutBindlessSampler = false; + layoutBindlessImage = false; layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd; layoutFormat = ElfNone; #endif @@ -997,10 +1009,14 @@ public: bool layoutViewportRelative; int layoutSecondaryViewportRelativeOffset; bool layoutShaderRecord; + bool layoutHitObjectShaderRecordNV; // GL_EXT_spirv_intrinsics int spirvStorageClass; TSpirvDecorate* spirvDecorate; + + bool layoutBindlessSampler; + bool layoutBindlessImage; #endif bool hasUniformLayout() const @@ -1123,6 +1139,7 @@ public: TLayoutFormat getFormat() const { return layoutFormat; } bool isPushConstant() const { return layoutPushConstant; } bool isShaderRecord() const { return layoutShaderRecord; } + bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; } bool hasBufferReference() const { return layoutBufferReference; } bool hasBufferReferenceAlign() const { @@ -1132,6 +1149,14 @@ public: { return nonUniform; } + bool isBindlessSampler() const + { + return layoutBindlessSampler; + } + bool isBindlessImage() const + { + return layoutBindlessImage; + } // GL_EXT_spirv_intrinsics bool hasSprivDecorate() const { return spirvDecorate != nullptr; } @@ -1241,6 +1266,11 @@ public: case ElfR8ui: return "r8ui"; case ElfR64ui: return "r64ui"; case ElfR64i: return "r64i"; + case ElfSize1x8: return "size1x8"; + case ElfSize1x16: return "size1x16"; + case ElfSize1x32: return "size1x32"; + case ElfSize2x32: return "size2x32"; + case ElfSize4x32: return "size4x32"; default: return "none"; } } @@ -1864,9 +1894,11 @@ public: virtual bool isArray() const { return arraySizes != nullptr; } virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); } virtual bool isUnsizedArray() const { return isArray() && !arraySizes->isSized(); } + virtual bool isImplicitlySizedArray() const { return isArray() && arraySizes->isImplicitlySized(); } virtual bool isArrayVariablyIndexed() const { assert(isArray()); return arraySizes->isVariablyIndexed(); } virtual void setArrayVariablyIndexed() { assert(isArray()); arraySizes->setVariablyIndexed(); } virtual void updateImplicitArraySize(int size) { assert(isArray()); arraySizes->updateImplicitSize(size); } + virtual void setImplicitlySized(bool isImplicitSized) { arraySizes->setImplicitlySized(isImplicitSized); } virtual bool isStruct() const { return basicType == EbtStruct || basicType == EbtBlock; } virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; } virtual bool isIntegerDomain() const @@ -1889,7 +1921,8 @@ public: } virtual bool isOpaque() const { return basicType == EbtSampler #ifndef GLSLANG_WEB - || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery + || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery + || basicType == EbtHitObjectNV #endif ; } virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } @@ -1898,6 +1931,8 @@ public: virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); } virtual bool isTexture() const { return basicType == EbtSampler && getSampler().isTexture(); } + virtual bool isBindlessImage() const { return isImage() && qualifier.layoutBindlessImage; } + virtual bool isBindlessTexture() const { return isTexture() && qualifier.layoutBindlessSampler; } // Check the block-name convention of creating a block without populating it's members: virtual bool isUnusableName() const { return isStruct() && structure == nullptr; } virtual bool isParameterized() const { return typeParameters != nullptr; } @@ -1954,6 +1989,11 @@ public: return contains([](const TType* t) { return t->isOpaque(); } ); } + virtual bool containsSampler() const + { + return contains([](const TType* t) { return t->isTexture() || t->isImage(); }); + } + // Recursively checks if the type contains a built-in variable virtual bool containsBuiltIn() const { @@ -2087,8 +2127,12 @@ public: // an explicit array. void adoptImplicitArraySizes(bool skipNonvariablyIndexed) { - if (isUnsizedArray() && !(skipNonvariablyIndexed || isArrayVariablyIndexed())) + if (isUnsizedArray() && + (qualifier.builtIn == EbvSampleMask || + !(skipNonvariablyIndexed || isArrayVariablyIndexed()))) { changeOuterArraySize(getImplicitArraySize()); + setImplicitlySized(true); + } // For multi-dim per-view arrays, set unsized inner dimension size to 1 if (qualifier.isPerView() && arraySizes && arraySizes->isInnerUnsized()) arraySizes->clearInnerUnsized(); @@ -2283,8 +2327,16 @@ public: appendStr(" layoutSecondaryViewportRelativeOffset="); appendInt(qualifier.layoutSecondaryViewportRelativeOffset); } + if (qualifier.layoutShaderRecord) appendStr(" shaderRecordNV"); + if (qualifier.layoutHitObjectShaderRecordNV) + appendStr(" hitobjectshaderrecordnv"); + + if (qualifier.layoutBindlessSampler) + appendStr(" layoutBindlessSampler"); + if (qualifier.layoutBindlessImage) + appendStr(" layoutBindlessImage"); appendStr(")"); } @@ -2544,6 +2596,7 @@ public: void setStruct(TTypeList* s) { assert(isStruct()); structure = s; } TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads void setBasicType(const TBasicType& t) { basicType = t; } + void setVectorSize(int s) { vectorSize = s; } int computeNumComponents() const { @@ -2711,7 +2764,10 @@ public: bool sameArrayness(const TType& right) const { return ((arraySizes == nullptr && right.arraySizes == nullptr) || - (arraySizes != nullptr && right.arraySizes != nullptr && *arraySizes == *right.arraySizes)); + (arraySizes != nullptr && right.arraySizes != nullptr && + (*arraySizes == *right.arraySizes || + (arraySizes->isImplicitlySized() && right.arraySizes->isDefaultImplicitlySized()) || + (right.arraySizes->isImplicitlySized() && arraySizes->isDefaultImplicitlySized())))); } // See if two type's arrayness match in everything except their outer dimension diff --git a/3rdparty/glslang/glslang/Include/arrays.h b/3rdparty/glslang/glslang/Include/arrays.h index 7f047d9fb..1da14d09c 100644 --- a/3rdparty/glslang/glslang/Include/arrays.h +++ b/3rdparty/glslang/glslang/Include/arrays.h @@ -222,7 +222,7 @@ protected: struct TArraySizes { POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TArraySizes() : implicitArraySize(1), variablyIndexed(false) { } + TArraySizes() : implicitArraySize(0), implicitlySized(true), variablyIndexed(false){ } // For breaking into two non-shared copies, independently modifiable. TArraySizes& operator=(const TArraySizes& from) @@ -230,6 +230,7 @@ struct TArraySizes { implicitArraySize = from.implicitArraySize; variablyIndexed = from.variablyIndexed; sizes = from.sizes; + implicitlySized = from.implicitlySized; return *this; } @@ -256,11 +257,17 @@ struct TArraySizes { void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); } void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); + implicitlySized = false; } void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); } - void changeOuterSize(int s) { sizes.changeFront((unsigned)s); } - int getImplicitSize() const { return implicitArraySize; } - void updateImplicitSize(int s) { implicitArraySize = std::max(implicitArraySize, s); } + void changeOuterSize(int s) { + sizes.changeFront((unsigned)s); + implicitlySized = false; + } + int getImplicitSize() const { return implicitArraySize > 0 ? implicitArraySize : 1; } + void updateImplicitSize(int s) { + implicitArraySize = (std::max)(implicitArraySize, s); + } bool isInnerUnsized() const { for (int d = 1; d < sizes.size(); ++d) { @@ -295,6 +302,9 @@ struct TArraySizes { bool hasUnsized() const { return getOuterSize() == UnsizedArraySize || isInnerUnsized(); } bool isSized() const { return getOuterSize() != UnsizedArraySize; } + bool isImplicitlySized() const { return implicitlySized; } + bool isDefaultImplicitlySized() const { return implicitlySized && implicitArraySize == 0; } + void setImplicitlySized(bool isImplicitSizing) { implicitlySized = isImplicitSizing; } void dereference() { sizes.pop_front(); } void copyDereferenced(const TArraySizes& rhs) { @@ -333,6 +343,7 @@ protected: // the implicit size of the array, if not variably indexed and // otherwise legal. int implicitArraySize; + bool implicitlySized; bool variablyIndexed; // true if array is indexed with a non compile-time constant }; diff --git a/3rdparty/glslang/glslang/Include/glslang_c_interface.h b/3rdparty/glslang/glslang/Include/glslang_c_interface.h index f540f26d6..28d52330e 100644 --- a/3rdparty/glslang/glslang/Include/glslang_c_interface.h +++ b/3rdparty/glslang/glslang/Include/glslang_c_interface.h @@ -157,7 +157,13 @@ typedef struct glslang_resource_s { int max_task_work_group_size_y_ext; int max_task_work_group_size_z_ext; int max_mesh_view_count_ext; - int maxDualSourceDrawBuffersEXT; + union + { + int max_dual_source_draw_buffers_ext; + + /* Incorrectly capitalized name retained for backward compatibility */ + int maxDualSourceDrawBuffersEXT; + }; glslang_limits_t limits; } glslang_resource_t; diff --git a/3rdparty/glslang/glslang/Include/intermediate.h b/3rdparty/glslang/glslang/Include/intermediate.h index a0240028d..ec2b28a9b 100644 --- a/3rdparty/glslang/glslang/Include/intermediate.h +++ b/3rdparty/glslang/glslang/Include/intermediate.h @@ -968,7 +968,42 @@ enum TOperator { EOpRayQueryGetIntersectionObjectToWorld, EOpRayQueryGetIntersectionWorldToObject, + // + // GL_NV_shader_invocation_reorder // + + EOpHitObjectTraceRayNV, + EOpHitObjectTraceRayMotionNV, + EOpHitObjectRecordHitNV, + EOpHitObjectRecordHitMotionNV, + EOpHitObjectRecordHitWithIndexNV, + EOpHitObjectRecordHitWithIndexMotionNV, + EOpHitObjectRecordMissNV, + EOpHitObjectRecordMissMotionNV, + EOpHitObjectRecordEmptyNV, + EOpHitObjectExecuteShaderNV, + EOpHitObjectIsEmptyNV, + EOpHitObjectIsMissNV, + EOpHitObjectIsHitNV, + EOpHitObjectGetRayTMinNV, + EOpHitObjectGetRayTMaxNV, + EOpHitObjectGetObjectRayOriginNV, + EOpHitObjectGetObjectRayDirectionNV, + EOpHitObjectGetWorldRayOriginNV, + EOpHitObjectGetWorldRayDirectionNV, + EOpHitObjectGetWorldToObjectNV, + EOpHitObjectGetObjectToWorldNV, + EOpHitObjectGetInstanceCustomIndexNV, + EOpHitObjectGetInstanceIdNV, + EOpHitObjectGetGeometryIndexNV, + EOpHitObjectGetPrimitiveIndexNV, + EOpHitObjectGetHitKindNV, + EOpHitObjectGetShaderBindingTableRecordIndexNV, + EOpHitObjectGetShaderRecordBufferHandleNV, + EOpHitObjectGetAttributesNV, + EOpHitObjectGetCurrentTimeNV, + EOpReorderThreadNV, + // HLSL operations // @@ -1086,31 +1121,31 @@ public: virtual const glslang::TSourceLoc& getLoc() const { return loc; } virtual void setLoc(const glslang::TSourceLoc& l) { loc = l; } virtual void traverse(glslang::TIntermTraverser*) = 0; - virtual glslang::TIntermTyped* getAsTyped() { return 0; } - virtual glslang::TIntermOperator* getAsOperator() { return 0; } - virtual glslang::TIntermConstantUnion* getAsConstantUnion() { return 0; } - virtual glslang::TIntermAggregate* getAsAggregate() { return 0; } - virtual glslang::TIntermUnary* getAsUnaryNode() { return 0; } - virtual glslang::TIntermBinary* getAsBinaryNode() { return 0; } - virtual glslang::TIntermSelection* getAsSelectionNode() { return 0; } - virtual glslang::TIntermSwitch* getAsSwitchNode() { return 0; } - virtual glslang::TIntermMethod* getAsMethodNode() { return 0; } - virtual glslang::TIntermSymbol* getAsSymbolNode() { return 0; } - virtual glslang::TIntermBranch* getAsBranchNode() { return 0; } - virtual glslang::TIntermLoop* getAsLoopNode() { return 0; } + virtual glslang::TIntermTyped* getAsTyped() { return nullptr; } + virtual glslang::TIntermOperator* getAsOperator() { return nullptr; } + virtual glslang::TIntermConstantUnion* getAsConstantUnion() { return nullptr; } + virtual glslang::TIntermAggregate* getAsAggregate() { return nullptr; } + virtual glslang::TIntermUnary* getAsUnaryNode() { return nullptr; } + virtual glslang::TIntermBinary* getAsBinaryNode() { return nullptr; } + virtual glslang::TIntermSelection* getAsSelectionNode() { return nullptr; } + virtual glslang::TIntermSwitch* getAsSwitchNode() { return nullptr; } + virtual glslang::TIntermMethod* getAsMethodNode() { return nullptr; } + virtual glslang::TIntermSymbol* getAsSymbolNode() { return nullptr; } + virtual glslang::TIntermBranch* getAsBranchNode() { return nullptr; } + virtual glslang::TIntermLoop* getAsLoopNode() { return nullptr; } - virtual const glslang::TIntermTyped* getAsTyped() const { return 0; } - virtual const glslang::TIntermOperator* getAsOperator() const { return 0; } - virtual const glslang::TIntermConstantUnion* getAsConstantUnion() const { return 0; } - virtual const glslang::TIntermAggregate* getAsAggregate() const { return 0; } - virtual const glslang::TIntermUnary* getAsUnaryNode() const { return 0; } - virtual const glslang::TIntermBinary* getAsBinaryNode() const { return 0; } - virtual const glslang::TIntermSelection* getAsSelectionNode() const { return 0; } - virtual const glslang::TIntermSwitch* getAsSwitchNode() const { return 0; } - virtual const glslang::TIntermMethod* getAsMethodNode() const { return 0; } - virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return 0; } - virtual const glslang::TIntermBranch* getAsBranchNode() const { return 0; } - virtual const glslang::TIntermLoop* getAsLoopNode() const { return 0; } + virtual const glslang::TIntermTyped* getAsTyped() const { return nullptr; } + virtual const glslang::TIntermOperator* getAsOperator() const { return nullptr; } + virtual const glslang::TIntermConstantUnion* getAsConstantUnion() const { return nullptr; } + virtual const glslang::TIntermAggregate* getAsAggregate() const { return nullptr; } + virtual const glslang::TIntermUnary* getAsUnaryNode() const { return nullptr; } + virtual const glslang::TIntermBinary* getAsBinaryNode() const { return nullptr; } + virtual const glslang::TIntermSelection* getAsSelectionNode() const { return nullptr; } + virtual const glslang::TIntermSwitch* getAsSwitchNode() const { return nullptr; } + virtual const glslang::TIntermMethod* getAsMethodNode() const { return nullptr; } + virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return nullptr; } + virtual const glslang::TIntermBranch* getAsBranchNode() const { return nullptr; } + virtual const glslang::TIntermLoop* getAsLoopNode() const { return nullptr; } virtual ~TIntermNode() { } protected: @@ -1616,8 +1651,8 @@ protected: // class TIntermUnary : public TIntermOperator { public: - TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0) {} - TIntermUnary(TOperator o) : TIntermOperator(o), operand(0) {} + TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(nullptr) {} + TIntermUnary(TOperator o) : TIntermOperator(o), operand(nullptr) {} virtual void traverse(TIntermTraverser*); virtual void setOperand(TIntermTyped* o) { operand = o; } virtual TIntermTyped* getOperand() { return operand; } @@ -1819,7 +1854,7 @@ public: TIntermNode *getParentNode() { - return path.size() == 0 ? NULL : path.back(); + return path.size() == 0 ? nullptr : path.back(); } const bool preVisit; diff --git a/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp index 5fc61dbb7..40f53bbcc 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp @@ -226,7 +226,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const()); break; default: - return 0; + return nullptr; #endif } } @@ -354,7 +354,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right break; default: - return 0; + return nullptr; } TIntermConstantUnion *newNode = new TIntermConstantUnion(newConstArray, returnType); @@ -1345,7 +1345,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons { TType dereferencedType(node->getType(), index); dereferencedType.getQualifier().storage = EvqConst; - TIntermTyped* result = 0; + TIntermTyped* result = nullptr; int size = dereferencedType.computeNumComponents(); // arrays, vectors, matrices, all use simple multiplicative math @@ -1365,7 +1365,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons result = addConstantUnion(TConstUnionArray(node->getAsConstantUnion()->getConstArray(), start, size), node->getType(), loc); - if (result == 0) + if (result == nullptr) result = node; else result->setType(dereferencedType); @@ -1387,7 +1387,7 @@ TIntermTyped* TIntermediate::foldSwizzle(TIntermTyped* node, TSwizzleSelectorsgetType(), loc); - if (result == 0) + if (result == nullptr) result = node; else result->setType(TType(node->getBasicType(), EvqConst, selectors.size())); diff --git a/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp index 5a9e5003d..16287dfd1 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp @@ -4550,7 +4550,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query + // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query/ + // GL_NV_shader_invocation_reorder if (profile != EEsProfile && version >= 460) { commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);" "void rayQueryTerminateEXT(rayQueryEXT);" @@ -4583,6 +4584,39 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" "void executeCallableEXT(uint, int);" + "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitWithIndexNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissNV(hitObjectNV,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyNV(hitObjectNV);" + "void hitObjectExecuteShaderNV(hitObjectNV,int);" + "bool hitObjectIsEmptyNV(hitObjectNV);" + "bool hitObjectIsMissNV(hitObjectNV);" + "bool hitObjectIsHitNV(hitObjectNV);" + "float hitObjectGetRayTMinNV(hitObjectNV);" + "float hitObjectGetRayTMaxNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" + "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" + "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" + "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" + "int hitObjectGetInstanceIdNV(hitObjectNV);" + "int hitObjectGetGeometryIndexNV(hitObjectNV);" + "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" + "uint hitObjectGetHitKindNV(hitObjectNV);" + "void hitObjectGetAttributesNV(hitObjectNV,int);" + "float hitObjectGetCurrentTimeNV(hitObjectNV);" + "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" + "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" + "void reorderThreadNV(uint, uint);" + "void reorderThreadNV(hitObjectNV);" + "void reorderThreadNV(hitObjectNV, uint, uint);" "\n"); stageBuiltins[EShLangIntersect].append( "bool reportIntersectionNV(float, uint);" @@ -4598,6 +4632,36 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" "void executeCallableEXT(uint, int);" + "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);" + "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyNV(hitObjectNV);" + "void hitObjectExecuteShaderNV(hitObjectNV, int);" + "bool hitObjectIsEmptyNV(hitObjectNV);" + "bool hitObjectIsMissNV(hitObjectNV);" + "bool hitObjectIsHitNV(hitObjectNV);" + "float hitObjectGetRayTMinNV(hitObjectNV);" + "float hitObjectGetRayTMaxNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" + "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" + "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" + "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" + "int hitObjectGetInstanceIdNV(hitObjectNV);" + "int hitObjectGetGeometryIndexNV(hitObjectNV);" + "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" + "uint hitObjectGetHitKindNV(hitObjectNV);" + "void hitObjectGetAttributesNV(hitObjectNV,int);" + "float hitObjectGetCurrentTimeNV(hitObjectNV);" + "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" + "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" "\n"); stageBuiltins[EShLangMiss].append( "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" @@ -4605,6 +4669,36 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" "void executeCallableEXT(uint, int);" + "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);" + "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyNV(hitObjectNV);" + "void hitObjectExecuteShaderNV(hitObjectNV, int);" + "bool hitObjectIsEmptyNV(hitObjectNV);" + "bool hitObjectIsMissNV(hitObjectNV);" + "bool hitObjectIsHitNV(hitObjectNV);" + "float hitObjectGetRayTMinNV(hitObjectNV);" + "float hitObjectGetRayTMaxNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" + "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" + "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" + "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" + "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" + "int hitObjectGetInstanceIdNV(hitObjectNV);" + "int hitObjectGetGeometryIndexNV(hitObjectNV);" + "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" + "uint hitObjectGetHitKindNV(hitObjectNV);" + "void hitObjectGetAttributesNV(hitObjectNV,int);" + "float hitObjectGetCurrentTimeNV(hitObjectNV);" + "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" + "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" "\n"); stageBuiltins[EShLangCallable].append( "void executeCallableNV(uint, int);" @@ -5737,6 +5831,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in highp uint gl_SMCountNV;" "in highp uint gl_WarpIDNV;" "in highp uint gl_SMIDNV;" + // GL_ARM_shader_core_builtins + "in highp uint gl_CoreIDARM;" + "in highp uint gl_CoreCountARM;" + "in highp uint gl_CoreMaxIDARM;" + "in highp uint gl_WarpIDARM;" + "in highp uint gl_WarpMaxIDARM;" "\n"; const char* fragmentSubgroupDecls = "flat in mediump uint gl_SubgroupSize;" @@ -5751,6 +5851,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "flat in highp uint gl_SMCountNV;" "flat in highp uint gl_WarpIDNV;" "flat in highp uint gl_SMIDNV;" + // GL_ARM_shader_core_builtins + "flat in highp uint gl_CoreIDARM;" + "flat in highp uint gl_CoreCountARM;" + "flat in highp uint gl_CoreMaxIDARM;" + "flat in highp uint gl_WarpIDARM;" + "flat in highp uint gl_WarpMaxIDARM;" "\n"; const char* computeSubgroupDecls = "in highp uint gl_NumSubgroups;" @@ -5770,6 +5876,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in highp uint gl_SMCountNV;" "in highp volatile uint gl_WarpIDNV;" "in highp volatile uint gl_SMIDNV;" + // GL_ARM_shader_core_builtins + "in highp uint gl_CoreIDARM;" + "in highp uint gl_CoreCountARM;" + "in highp uint gl_CoreMaxIDARM;" + "in highp uint gl_WarpIDARM;" + "in highp uint gl_WarpMaxIDARM;" "\n"; stageBuiltins[EShLangVertex] .append(subgroupDecls); @@ -8036,6 +8148,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); } if (language == EShLangGeometry || language == EShLangVertex) { @@ -8551,6 +8676,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); } if (profile == EEsProfile) { @@ -8694,6 +8832,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); } // GL_KHR_shader_subgroup @@ -8795,6 +8946,38 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("executeCallableNV", 1, &E_GL_NV_ray_tracing); symbolTable.setFunctionExtensions("executeCallableEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setFunctionExtensions("hitObjectTraceRayNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceRayMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissMotionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordEmptyNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectExecuteShaderNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsEmptyNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsMissNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsHitNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMinNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMaxNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetbjectToWorldNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceIdNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetHitKindNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetAttributesNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("reorderThreadNV", 1, &E_GL_NV_shader_invocation_reorder); + BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable); BuiltInVariable("gl_LaunchIDEXT", EbvLaunchId, symbolTable); @@ -8888,6 +9071,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); } if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 450)) { @@ -9094,6 +9290,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); } if ((profile == EEsProfile && version >= 310) || @@ -9224,6 +9433,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); + + // GL_ARM_shader_core_builtins + symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); + symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); + + BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); + BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); + BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); + BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); + BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); } if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 450)) { @@ -9759,6 +9981,38 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR); symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR); + + symbolTable.relateToOperator("hitObjectTraceRayNV", EOpHitObjectTraceRayNV); + symbolTable.relateToOperator("hitObjectTraceRayMotionNV", EOpHitObjectTraceRayMotionNV); + symbolTable.relateToOperator("hitObjectRecordHitNV", EOpHitObjectRecordHitNV); + symbolTable.relateToOperator("hitObjectRecordHitMotionNV", EOpHitObjectRecordHitMotionNV); + symbolTable.relateToOperator("hitObjectRecordHitWithIndexNV", EOpHitObjectRecordHitWithIndexNV); + symbolTable.relateToOperator("hitObjectRecordHitWithIndexMotionNV", EOpHitObjectRecordHitWithIndexMotionNV); + symbolTable.relateToOperator("hitObjectRecordMissNV", EOpHitObjectRecordMissNV); + symbolTable.relateToOperator("hitObjectRecordMissMotionNV", EOpHitObjectRecordMissMotionNV); + symbolTable.relateToOperator("hitObjectRecordEmptyNV", EOpHitObjectRecordEmptyNV); + symbolTable.relateToOperator("hitObjectExecuteShaderNV", EOpHitObjectExecuteShaderNV); + symbolTable.relateToOperator("hitObjectIsEmptyNV", EOpHitObjectIsEmptyNV); + symbolTable.relateToOperator("hitObjectIsMissNV", EOpHitObjectIsMissNV); + symbolTable.relateToOperator("hitObjectIsHitNV", EOpHitObjectIsHitNV); + symbolTable.relateToOperator("hitObjectGetRayTMinNV", EOpHitObjectGetRayTMinNV); + symbolTable.relateToOperator("hitObjectGetRayTMaxNV", EOpHitObjectGetRayTMaxNV); + symbolTable.relateToOperator("hitObjectGetObjectRayOriginNV", EOpHitObjectGetObjectRayOriginNV); + symbolTable.relateToOperator("hitObjectGetObjectRayDirectionNV", EOpHitObjectGetObjectRayDirectionNV); + symbolTable.relateToOperator("hitObjectGetWorldRayOriginNV", EOpHitObjectGetWorldRayOriginNV); + symbolTable.relateToOperator("hitObjectGetWorldRayDirectionNV", EOpHitObjectGetWorldRayDirectionNV); + symbolTable.relateToOperator("hitObjectGetWorldToObjectNV", EOpHitObjectGetWorldToObjectNV); + symbolTable.relateToOperator("hitObjectGetObjectToWorldNV", EOpHitObjectGetObjectToWorldNV); + symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexNV", EOpHitObjectGetInstanceCustomIndexNV); + symbolTable.relateToOperator("hitObjectGetInstanceIdNV", EOpHitObjectGetInstanceIdNV); + symbolTable.relateToOperator("hitObjectGetGeometryIndexNV", EOpHitObjectGetGeometryIndexNV); + symbolTable.relateToOperator("hitObjectGetPrimitiveIndexNV", EOpHitObjectGetPrimitiveIndexNV); + symbolTable.relateToOperator("hitObjectGetHitKindNV", EOpHitObjectGetHitKindNV); + symbolTable.relateToOperator("hitObjectGetAttributesNV", EOpHitObjectGetAttributesNV); + symbolTable.relateToOperator("hitObjectGetCurrentTimeNV", EOpHitObjectGetCurrentTimeNV); + symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexNV", EOpHitObjectGetShaderBindingTableRecordIndexNV); + symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleNV", EOpHitObjectGetShaderRecordBufferHandleNV); + symbolTable.relateToOperator("reorderThreadNV", EOpReorderThreadNV); } break; case EShLangIntersect: diff --git a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp index 6a43ef3e8..e542f90c8 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -352,7 +352,7 @@ TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermT TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, const TSourceLoc& loc) { - if (child == 0) + if (child == nullptr) return nullptr; if (child->getType().getBasicType() == EbtBlock) @@ -751,6 +751,11 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne case EbtInt64: newOp = EOpConvInt64ToUint; break; case EbtUint64: newOp = EOpConvUint64ToUint; break; #endif + // For bindless texture type conversion, add a dummy convert op, just + // to generate a new TIntermTyped + // uvec2(any sampler type) + // uvec2(any image type) + case EbtSampler: newOp = EOpConvIntToUint; break; default: return false; } diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 616580f99..758572bb8 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -159,7 +159,8 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, // switch (node->getBasicType()) { case EbtSampler: - message = "can't modify a sampler"; + if (extensionTurnedOn(E_GL_ARB_bindless_texture) == false) + message = "can't modify a sampler"; break; case EbtVoid: message = "can't modify void"; @@ -174,6 +175,9 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, case EbtRayQuery: message = "can't modify rayQueryEXT"; break; + case EbtHitObjectNV: + message = "can't modify hitObjectNV"; + break; #endif default: break; diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 41afbc052..515137b70 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -608,6 +608,15 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn #ifndef GLSLANG_WEB if (base->getType().isUnsizedArray()) { base->getWritableType().updateImplicitArraySize(indexValue + 1); + base->getWritableType().setImplicitlySized(true); + if (base->getQualifier().builtIn == EbvClipDistance && + indexValue >= resources.maxClipDistances) { + error(loc, "gl_ClipDistance", "[", "array index out of range '%d'", indexValue); + } + else if (base->getQualifier().builtIn == EbvCullDistance && + indexValue >= resources.maxCullDistances) { + error(loc, "gl_CullDistance", "[", "array index out of range '%d'", indexValue); + } // For 2D per-view builtin arrays, update the inner dimension size in parent type if (base->getQualifier().isPerView() && base->getQualifier().builtIn != EbvNone) { TIntermBinary* binaryNode = base->getAsBinaryNode(); @@ -1026,14 +1035,22 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm inheritMemoryQualifiers(base->getQualifier(), result->getWritableType().getQualifier()); } else { auto baseSymbol = base; - while (baseSymbol->getAsSymbolNode() == nullptr) - baseSymbol = baseSymbol->getAsBinaryNode()->getLeft(); - TString structName; - structName.append("\'").append(baseSymbol->getAsSymbolNode()->getName().c_str()).append( "\'"); - error(loc, "no such field in structure", field.c_str(), structName.c_str()); + while (baseSymbol->getAsSymbolNode() == nullptr) { + auto binaryNode = baseSymbol->getAsBinaryNode(); + if (binaryNode == nullptr) break; + baseSymbol = binaryNode->getLeft(); + } + if (baseSymbol->getAsSymbolNode() != nullptr) { + TString structName; + structName.append("\'").append(baseSymbol->getAsSymbolNode()->getName().c_str()).append("\'"); + error(loc, "no such field in structure", field.c_str(), structName.c_str()); + } else { + error(loc, "no such field in structure", field.c_str(), ""); + } } } else - error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str()); + error(loc, "does not apply to this type:", field.c_str(), + base->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str()); // Propagate noContraction up the dereference chain if (base->getQualifier().isNoContraction()) @@ -1165,7 +1182,7 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct if (symbol && builtIn && function.getBuiltInOp() == EOpSpirvInst) symbol = nullptr; #endif - const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0; + const TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; if (prevDec) { if (prevDec->isPrototyped() && prototype) profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function"); @@ -1389,7 +1406,8 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction #endif const TType& argType = arg->getAsTyped()->getType(); const TQualifier& argQualifier = argType.getQualifier(); - if (argQualifier.isMemory() && (argType.containsOpaque() || argType.isReference())) { + bool containsBindlessSampler = intermediate.getBindlessMode() && argType.containsSampler(); + if (argQualifier.isMemory() && !containsBindlessSampler && (argType.containsOpaque() || argType.isReference())) { const char* message = "argument cannot drop memory qualifier when passed to formal parameter"; #ifndef GLSLANG_WEB if (argQualifier.volatil && ! formalQualifier.volatil) @@ -1675,9 +1693,13 @@ TIntermNode* TParseContext::handleReturnValue(const TSourceLoc& loc, TIntermType error(loc, "type does not match, or is not convertible to, the function's return type", "return", ""); branch = intermediate.addBranch(EOpReturn, value, loc); } - } else + } else { + if (value->getType().isTexture() || value->getType().isImage()) { + if (!extensionTurnedOn(E_GL_ARB_bindless_texture)) + error(loc, "sampler or image can be used as return type only when the extension GL_ARB_bindless_texture enabled", "return", ""); + } branch = intermediate.addBranch(EOpReturn, value, loc); - + } branch->updatePrecision(currentFunctionType->getQualifier().precision); return branch; } @@ -1928,6 +1950,9 @@ TIntermTyped* TParseContext::addAssign(const TSourceLoc& loc, TOperator op, TInt if ((op == EOpAddAssign || op == EOpSubAssign) && left->isReference()) requireExtensions(loc, 1, &E_GL_EXT_buffer_reference2, "+= and -= on a buffer reference"); + if (op == EOpAssign && left->getBasicType() == EbtSampler && right->getBasicType() == EbtSampler) + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "sampler assignment for bindless texture"); + return intermediate.addAssign(op, left, right, loc); } @@ -2360,6 +2385,79 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } break; + case EOpHitObjectTraceRayNV: + if (!(*argp)[11]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "payload number", ""); + else { + unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0) + error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location); + } + break; + case EOpHitObjectTraceRayMotionNV: + if (!(*argp)[12]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "payload number", ""); + else { + unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0) + error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location); + } + break; + case EOpHitObjectExecuteShaderNV: + if (!(*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "payload number", ""); + else { + unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0) + error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location); + } + break; + case EOpHitObjectRecordHitNV: + if (!(*argp)[12]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); + else { + unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) + error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); + } + break; + case EOpHitObjectRecordHitMotionNV: + if (!(*argp)[13]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); + else { + unsigned int location = (*argp)[13]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) + error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); + } + break; + case EOpHitObjectRecordHitWithIndexNV: + if (!(*argp)[11]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); + else { + unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) + error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); + } + break; + case EOpHitObjectRecordHitWithIndexMotionNV: + if (!(*argp)[12]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); + else { + unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) + error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); + } + break; + case EOpHitObjectGetAttributesNV: + if (!(*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); + else { + unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) + error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); + } + break; + case EOpRayQueryGetIntersectionType: case EOpRayQueryGetIntersectionT: case EOpRayQueryGetIntersectionInstanceCustomIndex: @@ -2811,6 +2909,14 @@ TFunction* TParseContext::handleConstructorCall(const TSourceLoc& loc, const TPu profileRequires(loc, EEsProfile, 300, nullptr, "arrayed constructor"); } + // Reuse EOpConstructTextureSampler for bindless image constructor + // uvec2 imgHandle; + // imageLoad(image1D(imgHandle), 0); + if (type.isImage() && extensionTurnedOn(E_GL_ARB_bindless_texture)) + { + intermediate.setBindlessImageMode(currentCaller, AstRefTypeFunc); + } + TOperator op = intermediate.mapTypeToConstructorOp(type); if (op == EOpNull) { @@ -3140,7 +3246,7 @@ void TParseContext::reservedPpErrorCheck(const TSourceLoc& loc, const char* iden ppWarn(loc, "\"defined\" is (un)defined:", op, identifier); else ppError(loc, "\"defined\" can't be (un)defined:", op, identifier); - else if (strstr(identifier, "__") != 0 && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) { + else if (strstr(identifier, "__") != nullptr && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) { // The extension GL_EXT_spirv_intrinsics allows us to declare macros prefixed with "__". if (isEsProfile() && version >= 300 && (strcmp(identifier, "__LINE__") == 0 || @@ -3544,8 +3650,13 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T return true; } if (op != EOpConstructStruct && op != EOpConstructNonuniform && typed->getBasicType() == EbtSampler) { - error(loc, "cannot convert a sampler", constructorString.c_str(), ""); - return true; + if (op == EOpConstructUVec2 && extensionTurnedOn(E_GL_ARB_bindless_texture)) { + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeFunc); + } + else { + error(loc, "cannot convert a sampler", constructorString.c_str(), ""); + return true; + } } if (op != EOpConstructStruct && typed->isAtomic()) { error(loc, "cannot convert an atomic_uint", constructorString.c_str(), ""); @@ -3565,6 +3676,26 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const { TString constructorName = function.getType().getBasicTypeString(); // TODO: performance: should not be making copy; interface needs to change const char* token = constructorName.c_str(); + // verify the constructor for bindless texture, the input must be ivec2 or uvec2 + if (function.getParamCount() == 1) { + TType* pType = function[0].type; + TBasicType basicType = pType->getBasicType(); + bool isIntegerVec2 = ((basicType == EbtUint || basicType == EbtInt) && pType->getVectorSize() == 2); + bool bindlessMode = extensionTurnedOn(E_GL_ARB_bindless_texture); + if (isIntegerVec2 && bindlessMode) { + if (pType->getSampler().isImage()) + intermediate.setBindlessImageMode(currentCaller, AstRefTypeFunc); + else + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeFunc); + return false; + } else { + if (!bindlessMode) + error(loc, "sampler-constructor requires the extension GL_ARB_bindless_texture enabled", token, ""); + else + error(loc, "sampler-constructor requires the input to be ivec2 or uvec2", token, ""); + return true; + } + } // exactly two arguments needed if (function.getParamCount() != 2) { @@ -3660,13 +3791,32 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const if (type.getQualifier().storage == EvqUniform) return; - if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtSampler)) - error(loc, "non-uniform struct contains a sampler or image:", type.getBasicTypeString().c_str(), identifier.c_str()); + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtSampler)) { + // For bindless texture, sampler can be declared as an struct member + if (extensionTurnedOn(E_GL_ARB_bindless_texture)) { + if (type.getSampler().isImage()) + intermediate.setBindlessImageMode(currentCaller, AstRefTypeVar); + else + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeVar); + } + else { + error(loc, "non-uniform struct contains a sampler or image:", type.getBasicTypeString().c_str(), identifier.c_str()); + } + } else if (type.getBasicType() == EbtSampler && type.getQualifier().storage != EvqUniform) { - // non-uniform sampler - // not yet: okay if it has an initializer - // if (! initializer) - error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); + // For bindless texture, sampler can be declared as an input/output/block member + if (extensionTurnedOn(E_GL_ARB_bindless_texture)) { + if (type.getSampler().isImage()) + intermediate.setBindlessImageMode(currentCaller, AstRefTypeVar); + else + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeVar); + } + else { + // non-uniform sampler + // not yet: okay if it has an initializer + // if (! initializer) + error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); + } } } @@ -3732,7 +3882,7 @@ void TParseContext::memberQualifierCheck(glslang::TPublicType& publicType) // // Check/fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. // -void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier, bool isMemberCheck) +void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier, bool isMemberCheck, const TPublicType* publicType) { bool nonuniformOkay = false; @@ -3768,6 +3918,11 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q { requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "default std430 layout for uniform"); } + + if (publicType != nullptr && publicType->isImage() && + (qualifier.layoutFormat > ElfExtSizeGuard && qualifier.layoutFormat < ElfCount)) + qualifier.layoutFormat = mapLegacyLayoutFormat(qualifier.layoutFormat, publicType->sampler.getBasicType()); + break; default: break; @@ -4172,7 +4327,7 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba void TParseContext::parameterTypeCheck(const TSourceLoc& loc, TStorageQualifier qualifier, const TType& type) { - if ((qualifier == EvqOut || qualifier == EvqInOut) && type.isOpaque()) + if ((qualifier == EvqOut || qualifier == EvqInOut) && type.isOpaque() && !intermediate.getBindlessMode()) error(loc, "samplers and atomic_uints cannot be output parameters", type.getBasicTypeString().c_str(), ""); if (!parsingBuiltins && type.contains16BitFloat()) requireFloat16Arithmetic(loc, type.getBasicTypeString().c_str(), "float16 types can only be in uniform block or buffer storage"); @@ -4516,7 +4671,7 @@ void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermType // check for additional things allowed by GL_EXT_nonuniform_qualifier if (base.getBasicType() == EbtSampler || base.getBasicType() == EbtAccStruct || base.getBasicType() == EbtRayQuery || - (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) + base.getBasicType() == EbtHitObjectNV || (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) requireExtensions(loc, 1, &E_GL_EXT_nonuniform_qualifier, "variable index"); else error(loc, "", "[", "array must be redeclared with a size before being indexed with a variable"); @@ -5105,7 +5260,7 @@ void TParseContext::arrayObjectCheck(const TSourceLoc& loc, const TType& type, c void TParseContext::opaqueCheck(const TSourceLoc& loc, const TType& type, const char* op) { - if (containsFieldWithBasicType(type, EbtSampler)) + if (containsFieldWithBasicType(type, EbtSampler) && !extensionTurnedOn(E_GL_ARB_bindless_texture)) error(loc, "can't use with samplers or structs containing samplers", op, ""); } @@ -5206,7 +5361,7 @@ void TParseContext::inductiveLoopCheck(const TSourceLoc& loc, TIntermNode* init, bool badInit = false; if (! init || ! init->getAsAggregate() || init->getAsAggregate()->getSequence().size() != 1) badInit = true; - TIntermBinary* binaryInit = 0; + TIntermBinary* binaryInit = nullptr; if (! badInit) { // get the declaration assignment binaryInit = init->getAsAggregate()->getSequence()[0]->getAsBinaryNode(); @@ -5480,6 +5635,28 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi intermediate.setUsePhysicalStorageBuffer(); return; } + if (id == "bindless_sampler") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bindless_sampler"); + publicType.qualifier.layoutBindlessSampler = true; + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeLayout); + return; + } + if (id == "bindless_image") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bindless_image"); + publicType.qualifier.layoutBindlessImage = true; + intermediate.setBindlessImageMode(currentCaller, AstRefTypeLayout); + return; + } + if (id == "bound_sampler") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bound_sampler"); + publicType.qualifier.layoutBindlessSampler = false; + return; + } + if (id == "bound_image") { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bound_image"); + publicType.qualifier.layoutBindlessImage = false; + return; + } if (language == EShLangGeometry || language == EShLangTessEvaluation || language == EShLangMesh) { if (id == TQualifier::getGeometryString(ElgTriangles)) { publicType.shaderQualifiers.geometry = ElgTriangles; @@ -5674,6 +5851,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } publicType.qualifier.layoutShaderRecord = true; return; + } else if (id == "hitobjectshaderrecordnv") { + requireExtensions(loc, 1, &E_GL_NV_shader_invocation_reorder, "hitobject shader record NV"); + publicType.qualifier.layoutHitObjectShaderRecordNV = true; + return; } } @@ -6015,7 +6196,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi if (language == EShLangMesh || language == EShLangTask) { requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "gl_WorkGroupSize"); } else { - profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize"); + profileRequires(loc, EEsProfile, 310, nullptr, "gl_WorkGroupSize"); profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize"); } #endif @@ -6137,10 +6318,16 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset; if (src.layoutShaderRecord) dst.layoutShaderRecord = true; + if (src.layoutBindlessSampler) + dst.layoutBindlessSampler = true; + if (src.layoutBindlessImage) + dst.layoutBindlessImage = true; if (src.pervertexNV) dst.pervertexNV = true; if (src.pervertexEXT) dst.pervertexEXT = true; + if (src.layoutHitObjectShaderRecordNV) + dst.layoutHitObjectShaderRecordNV = true; #endif } } @@ -6298,6 +6485,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqHitAttr: case EvqCallableData: case EvqCallableDataIn: + case EvqHitObjectAttrNV: break; #endif default: @@ -6418,7 +6606,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) // Image format if (qualifier.hasFormat()) { - if (! type.isImage()) + if (! type.isImage() && !intermediate.getBindlessImageMode()) error(loc, "only apply to images", TQualifier::getLayoutFormatString(qualifier.getFormat()), ""); else { if (type.getSampler().type == EbtFloat && qualifier.getFormat() > ElfFloatGuard) @@ -6437,7 +6625,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) } } } - } else if (type.isImage() && ! qualifier.isWriteOnly()) { + } else if (type.isImage() && ! qualifier.isWriteOnly() && !intermediate.getBindlessImageMode()) { const char *explanation = "image variables not declared 'writeonly' and without a format layout qualifier"; requireProfile(loc, ECoreProfile | ECompatibilityProfile, explanation); profileRequires(loc, ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shader_image_load_formatted, explanation); @@ -7082,7 +7270,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T realFunc.addParameter(TParameter().copyParam((*function)[i])); } - TParameter tmpP = { 0, &uintType }; + TParameter tmpP = { nullptr, &uintType }; realFunc.addParameter(TParameter().copyParam(tmpP)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true)); @@ -7099,7 +7287,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T realFunc.addParameter(TParameter().copyParam((*function)[i])); } - TParameter tmpP = { 0, &uintType }; + TParameter tmpP = { nullptr, &uintType }; realFunc.addParameter(TParameter().copyParam(tmpP)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true)); @@ -7253,7 +7441,10 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden if (initializer) { if (type.getBasicType() == EbtRayQuery) { error(loc, "ray queries can only be initialized by using the rayQueryInitializeEXT intrinsic:", "=", identifier.c_str()); + } else if (type.getBasicType() == EbtHitObjectNV) { + error(loc, "hit objects cannot be initialized using initializers", "=", identifier.c_str()); } + } if (type.isCoopMat()) { @@ -7745,12 +7936,14 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* // Combined texture-sampler constructors are completely semantic checked // in constructorTextureSamplerError() if (op == EOpConstructTextureSampler) { - if (aggrNode->getSequence()[1]->getAsTyped()->getType().getSampler().shadow) { - // Transfer depth into the texture (SPIR-V image) type, as a hint - // for tools to know this texture/image is a depth image. - aggrNode->getSequence()[0]->getAsTyped()->getWritableType().getSampler().shadow = true; + if (aggrNode != nullptr) { + if (aggrNode->getSequence()[1]->getAsTyped()->getType().getSampler().shadow) { + // Transfer depth into the texture (SPIR-V image) type, as a hint + // for tools to know this texture/image is a depth image. + aggrNode->getSequence()[0]->getAsTyped()->getWritableType().getSampler().shadow = true; + } + return intermediate.setAggregateOperator(aggrNode, op, type, loc); } - return intermediate.setAggregateOperator(aggrNode, op, type, loc); } TTypeList::const_iterator memberTypes; @@ -7885,6 +8078,16 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvPtrToUvec2, true, node, type); return newNode; + } else if (node->getType().getBasicType() == EbtSampler) { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "sampler conversion to uvec2"); + // force the basic type of the constructor param to uvec2, otherwise spv builder will + // report some errors + TIntermTyped* newSrcNode = intermediate.createConversion(EbtUint, node); + newSrcNode->getAsTyped()->getWritableType().setVectorSize(2); + + TIntermTyped* newNode = + intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type); + return newNode; } case EOpConstructUVec3: case EOpConstructUVec4: @@ -7898,7 +8101,15 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T case EOpConstructBool: basicOp = EOpConstructBool; break; - + case EOpConstructTextureSampler: + if ((node->getType().getBasicType() == EbtUint || node->getType().getBasicType() == EbtInt) && + node->getType().getVectorSize() == 2) { + requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "ivec2/uvec2 convert to texture handle"); + // No matter ivec2 or uvec2, Set EOpPackUint2x32 just to generate an opBitcast op code + TIntermTyped* newNode = + intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type); + return newNode; + } #ifndef GLSLANG_WEB case EOpConstructDVec2: @@ -8245,6 +8456,30 @@ void TParseContext::inheritMemoryQualifiers(const TQualifier& from, TQualifier& #endif } +// +// Update qualifier layoutBindlessImage & layoutBindlessSampler on block member +// +void TParseContext::updateBindlessQualifier(TType& memberType) +{ + if (memberType.containsSampler()) { + if (memberType.isStruct()) { + TTypeList* typeList = memberType.getWritableStruct(); + for (unsigned int member = 0; member < typeList->size(); ++member) { + TType* subMemberType = (*typeList)[member].type; + updateBindlessQualifier(*subMemberType); + } + } + else if (memberType.getSampler().isImage()) { + intermediate.setBindlessImageMode(currentCaller, AstRefTypeLayout); + memberType.getQualifier().layoutBindlessImage = true; + } + else { + intermediate.setBindlessTextureMode(currentCaller, AstRefTypeLayout); + memberType.getQualifier().layoutBindlessSampler = true; + } + } +} + // // Do everything needed to add an interface block. // @@ -8297,8 +8532,13 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con } } - if (memberType.containsOpaque()) - error(memberLoc, "member of block cannot be or contain a sampler, image, or atomic_uint type", typeList[member].type->getFieldName().c_str(), ""); + // For bindless texture, sampler can be declared as uniform/storage block member, + if (memberType.containsOpaque()) { + if (memberType.containsSampler() && extensionTurnedOn(E_GL_ARB_bindless_texture)) + updateBindlessQualifier(memberType); + else + error(memberLoc, "member of block cannot be or contain a sampler, image, or atomic_uint type", typeList[member].type->getFieldName().c_str(), ""); + } if (memberType.containsCoopMat()) error(memberLoc, "member of block cannot be or contain a cooperative matrix type", typeList[member].type->getFieldName().c_str(), ""); @@ -8631,6 +8871,10 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "callableDataInNV block"); requireStage(loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV block"); break; + case EvqHitObjectAttrNV: + profileRequires(loc, ~EEsProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeNV block"); + break; #endif default: error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), ""); @@ -9472,4 +9716,38 @@ const TTypeList* TParseContext::recordStructCopy(TStructRecord& record, const TT return originStruct; } +TLayoutFormat TParseContext::mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType) +{ + TLayoutFormat layoutFormat = ElfNone; + if (imageType == EbtFloat) { + switch (legacyLayoutFormat) { + case ElfSize1x16: layoutFormat = ElfR16f; break; + case ElfSize1x32: layoutFormat = ElfR32f; break; + case ElfSize2x32: layoutFormat = ElfRg32f; break; + case ElfSize4x32: layoutFormat = ElfRgba32f; break; + default: break; + } + } else if (imageType == EbtUint) { + switch (legacyLayoutFormat) { + case ElfSize1x8: layoutFormat = ElfR8ui; break; + case ElfSize1x16: layoutFormat = ElfR16ui; break; + case ElfSize1x32: layoutFormat = ElfR32ui; break; + case ElfSize2x32: layoutFormat = ElfRg32ui; break; + case ElfSize4x32: layoutFormat = ElfRgba32ui; break; + default: break; + } + } else if (imageType == EbtInt) { + switch (legacyLayoutFormat) { + case ElfSize1x8: layoutFormat = ElfR8i; break; + case ElfSize1x16: layoutFormat = ElfR16i; break; + case ElfSize1x32: layoutFormat = ElfR32i; break; + case ElfSize2x32: layoutFormat = ElfRg32i; break; + case ElfSize4x32: layoutFormat = ElfRgba32i; break; + default: break; + } + } + + return layoutFormat; +} + } // end namespace glslang diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h index 885fd9081..8edcfdf8f 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h @@ -393,7 +393,7 @@ public: void accStructCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); void memberQualifierCheck(glslang::TPublicType&); - void globalQualifierFixCheck(const TSourceLoc&, TQualifier&, bool isMemberCheck = false); + void globalQualifierFixCheck(const TSourceLoc&, TQualifier&, bool isMemberCheck = false, const TPublicType* publicType = nullptr); void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&); bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); void mergeQualifiers(const TSourceLoc&, TQualifier& dst, const TQualifier& src, bool force); @@ -438,12 +438,12 @@ public: const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn); const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn); void declareTypeDefaults(const TSourceLoc&, const TPublicType&); - TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0); + TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = nullptr, TIntermTyped* initializer = nullptr); TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&); TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to); - void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0); + void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr); void blockStorageRemap(const TSourceLoc&, const TString*, TQualifier&); void blockStageIoCheck(const TSourceLoc&, const TQualifier&); void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName); @@ -456,9 +456,11 @@ public: void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); void invariantCheck(const TSourceLoc&, const TQualifier&); void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&); + void updateBindlessQualifier(TType& memberType); void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body); const TTypeList* recordStructCopy(TStructRecord&, const TType*, const TType*); + TLayoutFormat mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType); #ifndef GLSLANG_WEB TAttributeType attributeFromName(const TString& name) const; diff --git a/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp index 84c40f4e7..c3a3928ce 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -267,8 +267,8 @@ void* TPoolAllocator::allocate(size_t numBytes) // size_t numBytesToAlloc = allocationSize + headerSkip; tHeader* memory = reinterpret_cast(::new char[numBytesToAlloc]); - if (memory == 0) - return 0; + if (memory == nullptr) + return nullptr; // Use placement-new to initialize header new(memory) tHeader(inUseList, (numBytesToAlloc + pageSize - 1) / pageSize); @@ -289,8 +289,8 @@ void* TPoolAllocator::allocate(size_t numBytes) freeList = freeList->nextPage; } else { memory = reinterpret_cast(::new char[pageSize]); - if (memory == 0) - return 0; + if (memory == nullptr) + return nullptr; } // Use placement-new to initialize header @@ -308,7 +308,7 @@ void* TPoolAllocator::allocate(size_t numBytes) // void TAllocation::checkAllocList() const { - for (const TAllocation* alloc = this; alloc != 0; alloc = alloc->prevAlloc) + for (const TAllocation* alloc = this; alloc != nullptr; alloc = alloc->prevAlloc) alloc->check(); } diff --git a/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp index 7f51173eb..c20048a9e 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp @@ -765,6 +765,9 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["icoopmatNV"] = ICOOPMATNV; (*KeywordMap)["ucoopmatNV"] = UCOOPMATNV; + (*KeywordMap)["hitObjectNV"] = HITOBJECTNV; + (*KeywordMap)["hitObjectAttributeNV"] = HITOBJECTATTRNV; + ReservedSet = new std::unordered_set; ReservedSet->insert("common"); @@ -1789,6 +1792,20 @@ int TScanContext::tokenizeIdentifier() parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) return keyword; return identifierOrType(); + + case HITOBJECTNV: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder))) + return keyword; + return identifierOrType(); + + case HITOBJECTATTRNV: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder))) + return keyword; + return identifierOrType(); #endif default: diff --git a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp index ced00863e..ed40c3669 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -1357,7 +1357,7 @@ int ShInitialize() ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions) { if (!InitThread()) - return 0; + return nullptr; TShHandleBase* base = static_cast(ConstructCompiler(language, debugOptions)); @@ -1367,7 +1367,7 @@ ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions) ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions) { if (!InitThread()) - return 0; + return nullptr; TShHandleBase* base = static_cast(ConstructLinker(executable, debugOptions)); @@ -1377,7 +1377,7 @@ ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions) ShHandle ShConstructUniformMap() { if (!InitThread()) - return 0; + return nullptr; TShHandleBase* base = static_cast(ConstructUniformMap()); @@ -1386,7 +1386,7 @@ ShHandle ShConstructUniformMap() void ShDestruct(ShHandle handle) { - if (handle == 0) + if (handle == nullptr) return; TShHandleBase* base = static_cast(handle); @@ -1419,7 +1419,7 @@ int ShFinalize() for (int source = 0; source < SourceCount; ++source) { for (int stage = 0; stage < EShLangCount; ++stage) { delete SharedSymbolTables[version][spvVersion][p][source][stage]; - SharedSymbolTables[version][spvVersion][p][source][stage] = 0; + SharedSymbolTables[version][spvVersion][p][source][stage] = nullptr; } } } @@ -1432,7 +1432,7 @@ int ShFinalize() for (int source = 0; source < SourceCount; ++source) { for (int pc = 0; pc < EPcCount; ++pc) { delete CommonSymbolTable[version][spvVersion][p][source][pc]; - CommonSymbolTable[version][spvVersion][p][source][pc] = 0; + CommonSymbolTable[version][spvVersion][p][source][pc] = nullptr; } } } @@ -1475,12 +1475,12 @@ int ShCompile( ) { // Map the generic handle to the C++ object - if (handle == 0) + if (handle == nullptr) return 0; TShHandleBase* base = reinterpret_cast(handle); TCompiler* compiler = base->getAsCompiler(); - if (compiler == 0) + if (compiler == nullptr) return 0; SetThreadPoolAllocator(compiler->getPool()); @@ -1520,13 +1520,13 @@ int ShLinkExt( const ShHandle compHandles[], const int numHandles) { - if (linkHandle == 0 || numHandles == 0) + if (linkHandle == nullptr || numHandles == 0) return 0; THandleList cObjects; for (int i = 0; i < numHandles; ++i) { - if (compHandles[i] == 0) + if (compHandles[i] == nullptr) return 0; TShHandleBase* base = reinterpret_cast(compHandles[i]); if (base->getAsLinker()) { @@ -1535,7 +1535,7 @@ int ShLinkExt( if (base->getAsCompiler()) cObjects.push_back(base->getAsCompiler()); - if (cObjects[i] == 0) + if (cObjects[i] == nullptr) return 0; } @@ -1544,7 +1544,7 @@ int ShLinkExt( SetThreadPoolAllocator(linker->getPool()); - if (linker == 0) + if (linker == nullptr) return 0; linker->infoSink.info.erase(); @@ -1569,7 +1569,7 @@ int ShLinkExt( // void ShSetEncryptionMethod(ShHandle handle) { - if (handle == 0) + if (handle == nullptr) return; } @@ -1578,8 +1578,8 @@ void ShSetEncryptionMethod(ShHandle handle) // const char* ShGetInfoLog(const ShHandle handle) { - if (handle == 0) - return 0; + if (handle == nullptr) + return nullptr; TShHandleBase* base = static_cast(handle); TInfoSink* infoSink; @@ -1589,7 +1589,7 @@ const char* ShGetInfoLog(const ShHandle handle) else if (base->getAsLinker()) infoSink = &(base->getAsLinker()->getInfoSink()); else - return 0; + return nullptr; infoSink->info << infoSink->debug.c_str(); return infoSink->info.c_str(); @@ -1601,14 +1601,14 @@ const char* ShGetInfoLog(const ShHandle handle) // const void* ShGetExecutable(const ShHandle handle) { - if (handle == 0) - return 0; + if (handle == nullptr) + return nullptr; TShHandleBase* base = reinterpret_cast(handle); TLinker* linker = static_cast(base->getAsLinker()); - if (linker == 0) - return 0; + if (linker == nullptr) + return nullptr; return linker->getObjectCode(); } @@ -1623,13 +1623,13 @@ const void* ShGetExecutable(const ShHandle handle) // int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (handle == 0) + if (handle == nullptr) return 0; TShHandleBase* base = reinterpret_cast(handle); TLinker* linker = static_cast(base->getAsLinker()); - if (linker == 0) + if (linker == nullptr) return 0; linker->setAppAttributeBindings(table); @@ -1642,13 +1642,13 @@ int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* t // int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (handle == 0) + if (handle == nullptr) return 0; TShHandleBase* base = reinterpret_cast(handle); TLinker* linker = static_cast(base->getAsLinker()); - if (linker == 0) + if (linker == nullptr) return 0; linker->setFixedAttributeBindings(table); @@ -1660,12 +1660,12 @@ int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* tab // int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) { - if (handle == 0) + if (handle == nullptr) return 0; TShHandleBase* base = reinterpret_cast(handle); TLinker* linker = static_cast(base->getAsLinker()); - if (linker == 0) + if (linker == nullptr) return 0; linker->setExcludedAttributes(attributes, count); @@ -1681,12 +1681,12 @@ int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) // int ShGetUniformLocation(const ShHandle handle, const char* name) { - if (handle == 0) + if (handle == nullptr) return -1; TShHandleBase* base = reinterpret_cast(handle); TUniformMap* uniformMap= base->getAsUniformMap(); - if (uniformMap == 0) + if (uniformMap == nullptr) return -1; return uniformMap->getLocation(name); @@ -1954,14 +1954,14 @@ const char* TShader::getInfoDebugLog() TProgram::TProgram() : #if !defined(GLSLANG_WEB) - reflection(0), + reflection(nullptr), #endif linked(false) { pool = new TPoolAllocator; infoSink = new TInfoSink; for (int s = 0; s < EShLangCount; ++s) { - intermediate[s] = 0; + intermediate[s] = nullptr; newedIntermediate[s] = false; } } diff --git a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp index b140686d6..f5f98a0b0 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -78,6 +78,7 @@ void TType::buildMangledName(TString& mangledName) const case EbtAccStruct: mangledName += "as"; break; case EbtRayQuery: mangledName += "rq"; break; case EbtSpirvType: mangledName += "spv-t"; break; + case EbtHitObjectNV: mangledName += "ho"; break; #endif case EbtSampler: switch (sampler.type) { @@ -416,7 +417,7 @@ TAnonMember* TAnonMember::clone() const // copy of the original container. assert(0); - return 0; + return nullptr; } TSymbolTableLevel* TSymbolTableLevel::clone() const diff --git a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h index 0d45e484c..c2b386e80 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h @@ -84,7 +84,7 @@ typedef TVector TExtensionList; class TSymbol { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(0), writable(true) { } + explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(nullptr), writable(true) { } virtual TSymbol* clone() const = 0; virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool @@ -97,18 +97,18 @@ public: changeName(NewPoolTString(newName.c_str())); } virtual const TString& getMangledName() const { return getName(); } - virtual TFunction* getAsFunction() { return 0; } - virtual const TFunction* getAsFunction() const { return 0; } - virtual TVariable* getAsVariable() { return 0; } - virtual const TVariable* getAsVariable() const { return 0; } - virtual const TAnonMember* getAsAnonMember() const { return 0; } + virtual TFunction* getAsFunction() { return nullptr; } + virtual const TFunction* getAsFunction() const { return nullptr; } + virtual TVariable* getAsVariable() { return nullptr; } + virtual const TVariable* getAsVariable() const { return nullptr; } + virtual const TAnonMember* getAsAnonMember() const { return nullptr; } virtual const TType& getType() const = 0; virtual TType& getWritableType() = 0; virtual void setUniqueId(long long id) { uniqueId = id; } virtual long long getUniqueId() const { return uniqueId; } virtual void setExtensions(int numExts, const char* const exts[]) { - assert(extensions == 0); + assert(extensions == nullptr); assert(numExts > 0); extensions = NewPoolObject(extensions); for (int e = 0; e < numExts; ++e) @@ -229,7 +229,7 @@ struct TParameter { if (param.name) name = NewPoolTString(param.name->c_str()); else - name = 0; + name = nullptr; type = param.type->clone(); defaultValue = param.defaultValue; return *this; @@ -243,7 +243,7 @@ struct TParameter { class TFunction : public TSymbol { public: explicit TFunction(TOperator o) : - TSymbol(0), + TSymbol(nullptr), op(o), defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) { } TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) : @@ -319,6 +319,7 @@ public: virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; } virtual const TParameter& operator[](int i) const { return parameters[i]; } + const TQualifier& getQualifier() const { return returnType.getQualifier(); } #ifndef GLSLANG_WEB virtual void setSpirvInstruction(const TSpirvInstruction& inst) @@ -411,7 +412,7 @@ protected: class TSymbolTableLevel { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TSymbolTableLevel() : defaultPrecision(0), anonId(0), thisLevel(false) { } + TSymbolTableLevel() : defaultPrecision(nullptr), anonId(0), thisLevel(false) { } ~TSymbolTableLevel(); bool insert(const TString& name, TSymbol* symbol) { @@ -493,7 +494,7 @@ public: { tLevel::const_iterator it = level.find(name); if (it == level.end()) - return 0; + return nullptr; else return (*it).second; } @@ -561,7 +562,7 @@ public: { // can call multiple times at one scope, will only latch on first call, // as we're tracking the previous scope's values, not the current values - if (defaultPrecision != 0) + if (defaultPrecision != nullptr) return; defaultPrecision = new TPrecisionQualifier[EbtNumTypes]; @@ -573,7 +574,7 @@ public: { // can be called for table level pops that didn't set the // defaults - if (defaultPrecision == 0 || p == 0) + if (defaultPrecision == nullptr || p == nullptr) return; for (int t = 0; t < EbtNumTypes; ++t) @@ -622,7 +623,7 @@ public: // don't deallocate levels passed in from elsewhere while (table.size() > adoptedLevels) - pop(0); + pop(nullptr); } void adoptLevels(TSymbolTable& symTable) @@ -783,7 +784,7 @@ public: // Normal find of a symbol, that can optionally say whether the symbol was found // at a built-in level or the current top-scope level. - TSymbol* find(const TString& name, bool* builtIn = 0, bool* currentScope = 0, int* thisDepthP = 0) + TSymbol* find(const TString& name, bool* builtIn = nullptr, bool* currentScope = nullptr, int* thisDepthP = nullptr) { int level = currentLevel(); TSymbol* symbol; @@ -827,7 +828,7 @@ public: ++thisDepth; symbol = table[level]->find(name); --level; - } while (symbol == 0 && level >= 0); + } while (symbol == nullptr && level >= 0); if (! table[level + 1]->isThisLevel()) thisDepth = 0; diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index a5fd10753..bf5ce2f67 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -227,6 +227,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_texture_query_lod] = EBhDisable; extensionBehavior[E_GL_ARB_vertex_attrib_64bit] = EBhDisable; extensionBehavior[E_GL_ARB_draw_instanced] = EBhDisable; + extensionBehavior[E_GL_ARB_bindless_texture] = EBhDisable; extensionBehavior[E_GL_ARB_fragment_coord_conventions] = EBhDisable; @@ -301,6 +302,11 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable; extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable; + extensionBehavior[E_GL_NV_shader_invocation_reorder] = EBhDisable; + + // ARM + extensionBehavior[E_GL_ARM_shader_core_builtins] = EBhDisable; + // AEP extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable; extensionBehavior[E_GL_KHR_blend_equation_advanced] = EBhDisable; @@ -370,6 +376,9 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_float16] = EBhDisable; extensionBehavior[E_GL_EXT_shader_atomic_float] = EBhDisable; extensionBehavior[E_GL_EXT_shader_atomic_float2] = EBhDisable; + + // Record extensions not for spv. + spvUnsupportedExt.push_back(E_GL_ARB_bindless_texture); } #endif // GLSLANG_WEB @@ -437,7 +446,6 @@ void TParseVersions::getPreamble(std::string& preamble) } else { // !isEsProfile() preamble = - "#define GL_FRAGMENT_PRECISION_HIGH 1\n" "#define GL_ARB_texture_rectangle 1\n" "#define GL_ARB_shading_language_420pack 1\n" "#define GL_ARB_texture_gather 1\n" @@ -477,6 +485,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_ARB_vertex_attrib_64bit 1\n" "#define GL_ARB_draw_instanced 1\n" "#define GL_ARB_fragment_coord_conventions 1\n" + "#define GL_ARB_bindless_texture 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_image_load_formatted 1\n" "#define GL_EXT_post_depth_coverage 1\n" @@ -544,6 +553,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_mesh_shader 1\n" "#define GL_NV_cooperative_matrix 1\n" "#define GL_NV_integer_cooperative_matrix 1\n" + "#define GL_NV_shader_execution_reorder 1\n" "#define GL_EXT_shader_explicit_arithmetic_types 1\n" "#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n" @@ -576,6 +586,10 @@ void TParseVersions::getPreamble(std::string& preamble) preamble += "#define GL_EXT_null_initializer 1\n"; preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n"; } + if (version >= 130) { + preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n"; + } + #endif // GLSLANG_WEB } @@ -1066,8 +1080,8 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con if (strcmp(extension, "GL_NV_mesh_shader") == 0) { requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask), "#extension GL_NV_mesh_shader"); - profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader"); - profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader"); + profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_NV_mesh_shader"); + profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_NV_mesh_shader"); if (extensionTurnedOn(E_GL_EXT_mesh_shader)) { error(loc, "GL_EXT_mesh_shader is already turned on, and not allowed with", "#extension", extension); } @@ -1075,8 +1089,8 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con else if (strcmp(extension, "GL_EXT_mesh_shader") == 0) { requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask), "#extension GL_EXT_mesh_shader"); - profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_EXT_mesh_shader"); - profileRequires(loc, EEsProfile, 320, 0, "#extension GL_EXT_mesh_shader"); + profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_EXT_mesh_shader"); + profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_EXT_mesh_shader"); if (extensionTurnedOn(E_GL_NV_mesh_shader)) { error(loc, "GL_NV_mesh_shader is already turned on, and not allowed with", "#extension", extension); } @@ -1099,6 +1113,13 @@ void TParseVersions::extensionRequires(const TSourceLoc &loc, const char * const minSpvVersion = iter->second; requireSpv(loc, extension, minSpvVersion); } + + if (spvVersion.spv != 0){ + for (auto ext : spvUnsupportedExt){ + if (strcmp(extension, ext.c_str()) == 0) + error(loc, "not allowed when using generating SPIR-V codes", extension, ""); + } + } } // Call for any operation needing full GLSL integer data-type support. diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/3rdparty/glslang/glslang/MachineIndependent/Versions.h index f06abdd6f..9e4c9feaa 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.h +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.h @@ -163,6 +163,7 @@ const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_ const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_64bit"; const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced"; const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions"; +const char* const E_GL_ARB_bindless_texture = "GL_ARB_bindless_texture"; const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; @@ -265,6 +266,9 @@ const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; +// ARM +const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; + // Arrays of extensions for the above viewportEXTs duplications const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 }; @@ -273,6 +277,7 @@ const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]); const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix"; const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins"; const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix"; +const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder"; // AEP const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a"; diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 b/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 index a59da443d..442529be5 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 @@ -211,6 +211,7 @@ GLSLANG_WEB_EXCLUDE_ON %token ACCSTRUCTEXT %token RAYQUERYEXT %token FCOOPMATNV ICOOPMATNV UCOOPMATNV +%token HITOBJECTNV HITOBJECTATTRNV // combined image/sampler %token SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW @@ -310,7 +311,7 @@ GLSLANG_WEB_EXCLUDE_ON %token DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT %token INT64CONSTANT UINT64CONSTANT %token SUBROUTINE DEMOTE -%token PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV +%token PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV %token PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT %token PATCH SAMPLE NONUNIFORM %token COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT @@ -1218,7 +1219,7 @@ fully_specified_type parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier); } | type_qualifier type_specifier { - parseContext.globalQualifierFixCheck($1.loc, $1.qualifier); + parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2); parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2); if ($2.arraySizes) { @@ -1534,6 +1535,14 @@ GLSLANG_WEB_EXCLUDE_ON $$.init($1.loc); $$.qualifier.storage = EvqHitAttr; } + | HITOBJECTATTRNV { + parseContext.globalCheck($1.loc, "hitAttributeNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitObjectAttrNV; + } | HITATTREXT { parseContext.globalCheck($1.loc, "hitAttributeEXT"); parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -3509,6 +3518,10 @@ GLSLANG_WEB_EXCLUDE_ON parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); $$ = $1; } + | HITOBJECTNV { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtHitObjectNV; + } GLSLANG_WEB_EXCLUDE_OFF | struct_specifier { $$ = $1; diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/3rdparty/glslang/glslang/MachineIndependent/glslang.y index 35242f215..e0a5bcf15 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.y +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang.y @@ -151,7 +151,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %parse-param {glslang::TParseContext* pParseContext} %lex-param {parseContext} -%define api.pure // enable thread safety +%pure-parser // enable thread safety %expect 1 // One shift reduce conflict because of if | else %token CONST BOOL INT UINT FLOAT @@ -211,6 +211,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token ACCSTRUCTEXT %token RAYQUERYEXT %token FCOOPMATNV ICOOPMATNV UCOOPMATNV +%token HITOBJECTNV HITOBJECTATTRNV // combined image/sampler %token SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW @@ -310,7 +311,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT %token INT64CONSTANT UINT64CONSTANT %token SUBROUTINE DEMOTE -%token PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV +%token PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV %token PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT %token PATCH SAMPLE NONUNIFORM %token COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT @@ -1218,7 +1219,7 @@ fully_specified_type parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier); } | type_qualifier type_specifier { - parseContext.globalQualifierFixCheck($1.loc, $1.qualifier); + parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2); parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2); if ($2.arraySizes) { @@ -1534,6 +1535,14 @@ storage_qualifier $$.init($1.loc); $$.qualifier.storage = EvqHitAttr; } + | HITOBJECTATTRNV { + parseContext.globalCheck($1.loc, "hitAttributeNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitObjectAttrNV; + } | HITATTREXT { parseContext.globalCheck($1.loc, "hitAttributeEXT"); parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -3509,6 +3518,10 @@ type_specifier_nonarray parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); $$ = $1; } + | HITOBJECTNV { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtHitObjectNV; + } | struct_specifier { $$ = $1; diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp index 7ca3e711b..5c17c8cea 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -287,429 +287,431 @@ enum yysymbol_kind_t YYSYMBOL_FCOOPMATNV = 163, /* FCOOPMATNV */ YYSYMBOL_ICOOPMATNV = 164, /* ICOOPMATNV */ YYSYMBOL_UCOOPMATNV = 165, /* UCOOPMATNV */ - YYSYMBOL_SAMPLERCUBEARRAY = 166, /* SAMPLERCUBEARRAY */ - YYSYMBOL_SAMPLERCUBEARRAYSHADOW = 167, /* SAMPLERCUBEARRAYSHADOW */ - YYSYMBOL_ISAMPLERCUBEARRAY = 168, /* ISAMPLERCUBEARRAY */ - YYSYMBOL_USAMPLERCUBEARRAY = 169, /* USAMPLERCUBEARRAY */ - YYSYMBOL_SAMPLER1D = 170, /* SAMPLER1D */ - YYSYMBOL_SAMPLER1DARRAY = 171, /* SAMPLER1DARRAY */ - YYSYMBOL_SAMPLER1DARRAYSHADOW = 172, /* SAMPLER1DARRAYSHADOW */ - YYSYMBOL_ISAMPLER1D = 173, /* ISAMPLER1D */ - YYSYMBOL_SAMPLER1DSHADOW = 174, /* SAMPLER1DSHADOW */ - YYSYMBOL_SAMPLER2DRECT = 175, /* SAMPLER2DRECT */ - YYSYMBOL_SAMPLER2DRECTSHADOW = 176, /* SAMPLER2DRECTSHADOW */ - YYSYMBOL_ISAMPLER2DRECT = 177, /* ISAMPLER2DRECT */ - YYSYMBOL_USAMPLER2DRECT = 178, /* USAMPLER2DRECT */ - YYSYMBOL_SAMPLERBUFFER = 179, /* SAMPLERBUFFER */ - YYSYMBOL_ISAMPLERBUFFER = 180, /* ISAMPLERBUFFER */ - YYSYMBOL_USAMPLERBUFFER = 181, /* USAMPLERBUFFER */ - YYSYMBOL_SAMPLER2DMS = 182, /* SAMPLER2DMS */ - YYSYMBOL_ISAMPLER2DMS = 183, /* ISAMPLER2DMS */ - YYSYMBOL_USAMPLER2DMS = 184, /* USAMPLER2DMS */ - YYSYMBOL_SAMPLER2DMSARRAY = 185, /* SAMPLER2DMSARRAY */ - YYSYMBOL_ISAMPLER2DMSARRAY = 186, /* ISAMPLER2DMSARRAY */ - YYSYMBOL_USAMPLER2DMSARRAY = 187, /* USAMPLER2DMSARRAY */ - YYSYMBOL_SAMPLEREXTERNALOES = 188, /* SAMPLEREXTERNALOES */ - YYSYMBOL_SAMPLEREXTERNAL2DY2YEXT = 189, /* SAMPLEREXTERNAL2DY2YEXT */ - YYSYMBOL_ISAMPLER1DARRAY = 190, /* ISAMPLER1DARRAY */ - YYSYMBOL_USAMPLER1D = 191, /* USAMPLER1D */ - YYSYMBOL_USAMPLER1DARRAY = 192, /* USAMPLER1DARRAY */ - YYSYMBOL_F16SAMPLER1D = 193, /* F16SAMPLER1D */ - YYSYMBOL_F16SAMPLER2D = 194, /* F16SAMPLER2D */ - YYSYMBOL_F16SAMPLER3D = 195, /* F16SAMPLER3D */ - YYSYMBOL_F16SAMPLER2DRECT = 196, /* F16SAMPLER2DRECT */ - YYSYMBOL_F16SAMPLERCUBE = 197, /* F16SAMPLERCUBE */ - YYSYMBOL_F16SAMPLER1DARRAY = 198, /* F16SAMPLER1DARRAY */ - YYSYMBOL_F16SAMPLER2DARRAY = 199, /* F16SAMPLER2DARRAY */ - YYSYMBOL_F16SAMPLERCUBEARRAY = 200, /* F16SAMPLERCUBEARRAY */ - YYSYMBOL_F16SAMPLERBUFFER = 201, /* F16SAMPLERBUFFER */ - YYSYMBOL_F16SAMPLER2DMS = 202, /* F16SAMPLER2DMS */ - YYSYMBOL_F16SAMPLER2DMSARRAY = 203, /* F16SAMPLER2DMSARRAY */ - YYSYMBOL_F16SAMPLER1DSHADOW = 204, /* F16SAMPLER1DSHADOW */ - YYSYMBOL_F16SAMPLER2DSHADOW = 205, /* F16SAMPLER2DSHADOW */ - YYSYMBOL_F16SAMPLER1DARRAYSHADOW = 206, /* F16SAMPLER1DARRAYSHADOW */ - YYSYMBOL_F16SAMPLER2DARRAYSHADOW = 207, /* F16SAMPLER2DARRAYSHADOW */ - YYSYMBOL_F16SAMPLER2DRECTSHADOW = 208, /* F16SAMPLER2DRECTSHADOW */ - YYSYMBOL_F16SAMPLERCUBESHADOW = 209, /* F16SAMPLERCUBESHADOW */ - YYSYMBOL_F16SAMPLERCUBEARRAYSHADOW = 210, /* F16SAMPLERCUBEARRAYSHADOW */ - YYSYMBOL_IMAGE1D = 211, /* IMAGE1D */ - YYSYMBOL_IIMAGE1D = 212, /* IIMAGE1D */ - YYSYMBOL_UIMAGE1D = 213, /* UIMAGE1D */ - YYSYMBOL_IMAGE2D = 214, /* IMAGE2D */ - YYSYMBOL_IIMAGE2D = 215, /* IIMAGE2D */ - YYSYMBOL_UIMAGE2D = 216, /* UIMAGE2D */ - YYSYMBOL_IMAGE3D = 217, /* IMAGE3D */ - YYSYMBOL_IIMAGE3D = 218, /* IIMAGE3D */ - YYSYMBOL_UIMAGE3D = 219, /* UIMAGE3D */ - YYSYMBOL_IMAGE2DRECT = 220, /* IMAGE2DRECT */ - YYSYMBOL_IIMAGE2DRECT = 221, /* IIMAGE2DRECT */ - YYSYMBOL_UIMAGE2DRECT = 222, /* UIMAGE2DRECT */ - YYSYMBOL_IMAGECUBE = 223, /* IMAGECUBE */ - YYSYMBOL_IIMAGECUBE = 224, /* IIMAGECUBE */ - YYSYMBOL_UIMAGECUBE = 225, /* UIMAGECUBE */ - YYSYMBOL_IMAGEBUFFER = 226, /* IMAGEBUFFER */ - YYSYMBOL_IIMAGEBUFFER = 227, /* IIMAGEBUFFER */ - YYSYMBOL_UIMAGEBUFFER = 228, /* UIMAGEBUFFER */ - YYSYMBOL_IMAGE1DARRAY = 229, /* IMAGE1DARRAY */ - YYSYMBOL_IIMAGE1DARRAY = 230, /* IIMAGE1DARRAY */ - YYSYMBOL_UIMAGE1DARRAY = 231, /* UIMAGE1DARRAY */ - YYSYMBOL_IMAGE2DARRAY = 232, /* IMAGE2DARRAY */ - YYSYMBOL_IIMAGE2DARRAY = 233, /* IIMAGE2DARRAY */ - YYSYMBOL_UIMAGE2DARRAY = 234, /* UIMAGE2DARRAY */ - YYSYMBOL_IMAGECUBEARRAY = 235, /* IMAGECUBEARRAY */ - YYSYMBOL_IIMAGECUBEARRAY = 236, /* IIMAGECUBEARRAY */ - YYSYMBOL_UIMAGECUBEARRAY = 237, /* UIMAGECUBEARRAY */ - YYSYMBOL_IMAGE2DMS = 238, /* IMAGE2DMS */ - YYSYMBOL_IIMAGE2DMS = 239, /* IIMAGE2DMS */ - YYSYMBOL_UIMAGE2DMS = 240, /* UIMAGE2DMS */ - YYSYMBOL_IMAGE2DMSARRAY = 241, /* IMAGE2DMSARRAY */ - YYSYMBOL_IIMAGE2DMSARRAY = 242, /* IIMAGE2DMSARRAY */ - YYSYMBOL_UIMAGE2DMSARRAY = 243, /* UIMAGE2DMSARRAY */ - YYSYMBOL_F16IMAGE1D = 244, /* F16IMAGE1D */ - YYSYMBOL_F16IMAGE2D = 245, /* F16IMAGE2D */ - YYSYMBOL_F16IMAGE3D = 246, /* F16IMAGE3D */ - YYSYMBOL_F16IMAGE2DRECT = 247, /* F16IMAGE2DRECT */ - YYSYMBOL_F16IMAGECUBE = 248, /* F16IMAGECUBE */ - YYSYMBOL_F16IMAGE1DARRAY = 249, /* F16IMAGE1DARRAY */ - YYSYMBOL_F16IMAGE2DARRAY = 250, /* F16IMAGE2DARRAY */ - YYSYMBOL_F16IMAGECUBEARRAY = 251, /* F16IMAGECUBEARRAY */ - YYSYMBOL_F16IMAGEBUFFER = 252, /* F16IMAGEBUFFER */ - YYSYMBOL_F16IMAGE2DMS = 253, /* F16IMAGE2DMS */ - YYSYMBOL_F16IMAGE2DMSARRAY = 254, /* F16IMAGE2DMSARRAY */ - YYSYMBOL_I64IMAGE1D = 255, /* I64IMAGE1D */ - YYSYMBOL_U64IMAGE1D = 256, /* U64IMAGE1D */ - YYSYMBOL_I64IMAGE2D = 257, /* I64IMAGE2D */ - YYSYMBOL_U64IMAGE2D = 258, /* U64IMAGE2D */ - YYSYMBOL_I64IMAGE3D = 259, /* I64IMAGE3D */ - YYSYMBOL_U64IMAGE3D = 260, /* U64IMAGE3D */ - YYSYMBOL_I64IMAGE2DRECT = 261, /* I64IMAGE2DRECT */ - YYSYMBOL_U64IMAGE2DRECT = 262, /* U64IMAGE2DRECT */ - YYSYMBOL_I64IMAGECUBE = 263, /* I64IMAGECUBE */ - YYSYMBOL_U64IMAGECUBE = 264, /* U64IMAGECUBE */ - YYSYMBOL_I64IMAGEBUFFER = 265, /* I64IMAGEBUFFER */ - YYSYMBOL_U64IMAGEBUFFER = 266, /* U64IMAGEBUFFER */ - YYSYMBOL_I64IMAGE1DARRAY = 267, /* I64IMAGE1DARRAY */ - YYSYMBOL_U64IMAGE1DARRAY = 268, /* U64IMAGE1DARRAY */ - YYSYMBOL_I64IMAGE2DARRAY = 269, /* I64IMAGE2DARRAY */ - YYSYMBOL_U64IMAGE2DARRAY = 270, /* U64IMAGE2DARRAY */ - YYSYMBOL_I64IMAGECUBEARRAY = 271, /* I64IMAGECUBEARRAY */ - YYSYMBOL_U64IMAGECUBEARRAY = 272, /* U64IMAGECUBEARRAY */ - YYSYMBOL_I64IMAGE2DMS = 273, /* I64IMAGE2DMS */ - YYSYMBOL_U64IMAGE2DMS = 274, /* U64IMAGE2DMS */ - YYSYMBOL_I64IMAGE2DMSARRAY = 275, /* I64IMAGE2DMSARRAY */ - YYSYMBOL_U64IMAGE2DMSARRAY = 276, /* U64IMAGE2DMSARRAY */ - YYSYMBOL_TEXTURECUBEARRAY = 277, /* TEXTURECUBEARRAY */ - YYSYMBOL_ITEXTURECUBEARRAY = 278, /* ITEXTURECUBEARRAY */ - YYSYMBOL_UTEXTURECUBEARRAY = 279, /* UTEXTURECUBEARRAY */ - YYSYMBOL_TEXTURE1D = 280, /* TEXTURE1D */ - YYSYMBOL_ITEXTURE1D = 281, /* ITEXTURE1D */ - YYSYMBOL_UTEXTURE1D = 282, /* UTEXTURE1D */ - YYSYMBOL_TEXTURE1DARRAY = 283, /* TEXTURE1DARRAY */ - YYSYMBOL_ITEXTURE1DARRAY = 284, /* ITEXTURE1DARRAY */ - YYSYMBOL_UTEXTURE1DARRAY = 285, /* UTEXTURE1DARRAY */ - YYSYMBOL_TEXTURE2DRECT = 286, /* TEXTURE2DRECT */ - YYSYMBOL_ITEXTURE2DRECT = 287, /* ITEXTURE2DRECT */ - YYSYMBOL_UTEXTURE2DRECT = 288, /* UTEXTURE2DRECT */ - YYSYMBOL_TEXTUREBUFFER = 289, /* TEXTUREBUFFER */ - YYSYMBOL_ITEXTUREBUFFER = 290, /* ITEXTUREBUFFER */ - YYSYMBOL_UTEXTUREBUFFER = 291, /* UTEXTUREBUFFER */ - YYSYMBOL_TEXTURE2DMS = 292, /* TEXTURE2DMS */ - YYSYMBOL_ITEXTURE2DMS = 293, /* ITEXTURE2DMS */ - YYSYMBOL_UTEXTURE2DMS = 294, /* UTEXTURE2DMS */ - YYSYMBOL_TEXTURE2DMSARRAY = 295, /* TEXTURE2DMSARRAY */ - YYSYMBOL_ITEXTURE2DMSARRAY = 296, /* ITEXTURE2DMSARRAY */ - YYSYMBOL_UTEXTURE2DMSARRAY = 297, /* UTEXTURE2DMSARRAY */ - YYSYMBOL_F16TEXTURE1D = 298, /* F16TEXTURE1D */ - YYSYMBOL_F16TEXTURE2D = 299, /* F16TEXTURE2D */ - YYSYMBOL_F16TEXTURE3D = 300, /* F16TEXTURE3D */ - YYSYMBOL_F16TEXTURE2DRECT = 301, /* F16TEXTURE2DRECT */ - YYSYMBOL_F16TEXTURECUBE = 302, /* F16TEXTURECUBE */ - YYSYMBOL_F16TEXTURE1DARRAY = 303, /* F16TEXTURE1DARRAY */ - YYSYMBOL_F16TEXTURE2DARRAY = 304, /* F16TEXTURE2DARRAY */ - YYSYMBOL_F16TEXTURECUBEARRAY = 305, /* F16TEXTURECUBEARRAY */ - YYSYMBOL_F16TEXTUREBUFFER = 306, /* F16TEXTUREBUFFER */ - YYSYMBOL_F16TEXTURE2DMS = 307, /* F16TEXTURE2DMS */ - YYSYMBOL_F16TEXTURE2DMSARRAY = 308, /* F16TEXTURE2DMSARRAY */ - YYSYMBOL_SUBPASSINPUT = 309, /* SUBPASSINPUT */ - YYSYMBOL_SUBPASSINPUTMS = 310, /* SUBPASSINPUTMS */ - YYSYMBOL_ISUBPASSINPUT = 311, /* ISUBPASSINPUT */ - YYSYMBOL_ISUBPASSINPUTMS = 312, /* ISUBPASSINPUTMS */ - YYSYMBOL_USUBPASSINPUT = 313, /* USUBPASSINPUT */ - YYSYMBOL_USUBPASSINPUTMS = 314, /* USUBPASSINPUTMS */ - YYSYMBOL_F16SUBPASSINPUT = 315, /* F16SUBPASSINPUT */ - YYSYMBOL_F16SUBPASSINPUTMS = 316, /* F16SUBPASSINPUTMS */ - YYSYMBOL_SPIRV_INSTRUCTION = 317, /* SPIRV_INSTRUCTION */ - YYSYMBOL_SPIRV_EXECUTION_MODE = 318, /* SPIRV_EXECUTION_MODE */ - YYSYMBOL_SPIRV_EXECUTION_MODE_ID = 319, /* SPIRV_EXECUTION_MODE_ID */ - YYSYMBOL_SPIRV_DECORATE = 320, /* SPIRV_DECORATE */ - YYSYMBOL_SPIRV_DECORATE_ID = 321, /* SPIRV_DECORATE_ID */ - YYSYMBOL_SPIRV_DECORATE_STRING = 322, /* SPIRV_DECORATE_STRING */ - YYSYMBOL_SPIRV_TYPE = 323, /* SPIRV_TYPE */ - YYSYMBOL_SPIRV_STORAGE_CLASS = 324, /* SPIRV_STORAGE_CLASS */ - YYSYMBOL_SPIRV_BY_REFERENCE = 325, /* SPIRV_BY_REFERENCE */ - YYSYMBOL_SPIRV_LITERAL = 326, /* SPIRV_LITERAL */ - YYSYMBOL_LEFT_OP = 327, /* LEFT_OP */ - YYSYMBOL_RIGHT_OP = 328, /* RIGHT_OP */ - YYSYMBOL_INC_OP = 329, /* INC_OP */ - YYSYMBOL_DEC_OP = 330, /* DEC_OP */ - YYSYMBOL_LE_OP = 331, /* LE_OP */ - YYSYMBOL_GE_OP = 332, /* GE_OP */ - YYSYMBOL_EQ_OP = 333, /* EQ_OP */ - YYSYMBOL_NE_OP = 334, /* NE_OP */ - YYSYMBOL_AND_OP = 335, /* AND_OP */ - YYSYMBOL_OR_OP = 336, /* OR_OP */ - YYSYMBOL_XOR_OP = 337, /* XOR_OP */ - YYSYMBOL_MUL_ASSIGN = 338, /* MUL_ASSIGN */ - YYSYMBOL_DIV_ASSIGN = 339, /* DIV_ASSIGN */ - YYSYMBOL_ADD_ASSIGN = 340, /* ADD_ASSIGN */ - YYSYMBOL_MOD_ASSIGN = 341, /* MOD_ASSIGN */ - YYSYMBOL_LEFT_ASSIGN = 342, /* LEFT_ASSIGN */ - YYSYMBOL_RIGHT_ASSIGN = 343, /* RIGHT_ASSIGN */ - YYSYMBOL_AND_ASSIGN = 344, /* AND_ASSIGN */ - YYSYMBOL_XOR_ASSIGN = 345, /* XOR_ASSIGN */ - YYSYMBOL_OR_ASSIGN = 346, /* OR_ASSIGN */ - YYSYMBOL_SUB_ASSIGN = 347, /* SUB_ASSIGN */ - YYSYMBOL_STRING_LITERAL = 348, /* STRING_LITERAL */ - YYSYMBOL_LEFT_PAREN = 349, /* LEFT_PAREN */ - YYSYMBOL_RIGHT_PAREN = 350, /* RIGHT_PAREN */ - YYSYMBOL_LEFT_BRACKET = 351, /* LEFT_BRACKET */ - YYSYMBOL_RIGHT_BRACKET = 352, /* RIGHT_BRACKET */ - YYSYMBOL_LEFT_BRACE = 353, /* LEFT_BRACE */ - YYSYMBOL_RIGHT_BRACE = 354, /* RIGHT_BRACE */ - YYSYMBOL_DOT = 355, /* DOT */ - YYSYMBOL_COMMA = 356, /* COMMA */ - YYSYMBOL_COLON = 357, /* COLON */ - YYSYMBOL_EQUAL = 358, /* EQUAL */ - YYSYMBOL_SEMICOLON = 359, /* SEMICOLON */ - YYSYMBOL_BANG = 360, /* BANG */ - YYSYMBOL_DASH = 361, /* DASH */ - YYSYMBOL_TILDE = 362, /* TILDE */ - YYSYMBOL_PLUS = 363, /* PLUS */ - YYSYMBOL_STAR = 364, /* STAR */ - YYSYMBOL_SLASH = 365, /* SLASH */ - YYSYMBOL_PERCENT = 366, /* PERCENT */ - YYSYMBOL_LEFT_ANGLE = 367, /* LEFT_ANGLE */ - YYSYMBOL_RIGHT_ANGLE = 368, /* RIGHT_ANGLE */ - YYSYMBOL_VERTICAL_BAR = 369, /* VERTICAL_BAR */ - YYSYMBOL_CARET = 370, /* CARET */ - YYSYMBOL_AMPERSAND = 371, /* AMPERSAND */ - YYSYMBOL_QUESTION = 372, /* QUESTION */ - YYSYMBOL_INVARIANT = 373, /* INVARIANT */ - YYSYMBOL_HIGH_PRECISION = 374, /* HIGH_PRECISION */ - YYSYMBOL_MEDIUM_PRECISION = 375, /* MEDIUM_PRECISION */ - YYSYMBOL_LOW_PRECISION = 376, /* LOW_PRECISION */ - YYSYMBOL_PRECISION = 377, /* PRECISION */ - YYSYMBOL_PACKED = 378, /* PACKED */ - YYSYMBOL_RESOURCE = 379, /* RESOURCE */ - YYSYMBOL_SUPERP = 380, /* SUPERP */ - YYSYMBOL_FLOATCONSTANT = 381, /* FLOATCONSTANT */ - YYSYMBOL_INTCONSTANT = 382, /* INTCONSTANT */ - YYSYMBOL_UINTCONSTANT = 383, /* UINTCONSTANT */ - YYSYMBOL_BOOLCONSTANT = 384, /* BOOLCONSTANT */ - YYSYMBOL_IDENTIFIER = 385, /* IDENTIFIER */ - YYSYMBOL_TYPE_NAME = 386, /* TYPE_NAME */ - YYSYMBOL_CENTROID = 387, /* CENTROID */ - YYSYMBOL_IN = 388, /* IN */ - YYSYMBOL_OUT = 389, /* OUT */ - YYSYMBOL_INOUT = 390, /* INOUT */ - YYSYMBOL_STRUCT = 391, /* STRUCT */ - YYSYMBOL_VOID = 392, /* VOID */ - YYSYMBOL_WHILE = 393, /* WHILE */ - YYSYMBOL_BREAK = 394, /* BREAK */ - YYSYMBOL_CONTINUE = 395, /* CONTINUE */ - YYSYMBOL_DO = 396, /* DO */ - YYSYMBOL_ELSE = 397, /* ELSE */ - YYSYMBOL_FOR = 398, /* FOR */ - YYSYMBOL_IF = 399, /* IF */ - YYSYMBOL_DISCARD = 400, /* DISCARD */ - YYSYMBOL_RETURN = 401, /* RETURN */ - YYSYMBOL_SWITCH = 402, /* SWITCH */ - YYSYMBOL_CASE = 403, /* CASE */ - YYSYMBOL_DEFAULT = 404, /* DEFAULT */ - YYSYMBOL_TERMINATE_INVOCATION = 405, /* TERMINATE_INVOCATION */ - YYSYMBOL_TERMINATE_RAY = 406, /* TERMINATE_RAY */ - YYSYMBOL_IGNORE_INTERSECTION = 407, /* IGNORE_INTERSECTION */ - YYSYMBOL_UNIFORM = 408, /* UNIFORM */ - YYSYMBOL_SHARED = 409, /* SHARED */ - YYSYMBOL_BUFFER = 410, /* BUFFER */ - YYSYMBOL_FLAT = 411, /* FLAT */ - YYSYMBOL_SMOOTH = 412, /* SMOOTH */ - YYSYMBOL_LAYOUT = 413, /* LAYOUT */ - YYSYMBOL_DOUBLECONSTANT = 414, /* DOUBLECONSTANT */ - YYSYMBOL_INT16CONSTANT = 415, /* INT16CONSTANT */ - YYSYMBOL_UINT16CONSTANT = 416, /* UINT16CONSTANT */ - YYSYMBOL_FLOAT16CONSTANT = 417, /* FLOAT16CONSTANT */ - YYSYMBOL_INT32CONSTANT = 418, /* INT32CONSTANT */ - YYSYMBOL_UINT32CONSTANT = 419, /* UINT32CONSTANT */ - YYSYMBOL_INT64CONSTANT = 420, /* INT64CONSTANT */ - YYSYMBOL_UINT64CONSTANT = 421, /* UINT64CONSTANT */ - YYSYMBOL_SUBROUTINE = 422, /* SUBROUTINE */ - YYSYMBOL_DEMOTE = 423, /* DEMOTE */ - YYSYMBOL_PAYLOADNV = 424, /* PAYLOADNV */ - YYSYMBOL_PAYLOADINNV = 425, /* PAYLOADINNV */ - YYSYMBOL_HITATTRNV = 426, /* HITATTRNV */ - YYSYMBOL_CALLDATANV = 427, /* CALLDATANV */ - YYSYMBOL_CALLDATAINNV = 428, /* CALLDATAINNV */ - YYSYMBOL_PAYLOADEXT = 429, /* PAYLOADEXT */ - YYSYMBOL_PAYLOADINEXT = 430, /* PAYLOADINEXT */ - YYSYMBOL_HITATTREXT = 431, /* HITATTREXT */ - YYSYMBOL_CALLDATAEXT = 432, /* CALLDATAEXT */ - YYSYMBOL_CALLDATAINEXT = 433, /* CALLDATAINEXT */ - YYSYMBOL_PATCH = 434, /* PATCH */ - YYSYMBOL_SAMPLE = 435, /* SAMPLE */ - YYSYMBOL_NONUNIFORM = 436, /* NONUNIFORM */ - YYSYMBOL_COHERENT = 437, /* COHERENT */ - YYSYMBOL_VOLATILE = 438, /* VOLATILE */ - YYSYMBOL_RESTRICT = 439, /* RESTRICT */ - YYSYMBOL_READONLY = 440, /* READONLY */ - YYSYMBOL_WRITEONLY = 441, /* WRITEONLY */ - YYSYMBOL_DEVICECOHERENT = 442, /* DEVICECOHERENT */ - YYSYMBOL_QUEUEFAMILYCOHERENT = 443, /* QUEUEFAMILYCOHERENT */ - YYSYMBOL_WORKGROUPCOHERENT = 444, /* WORKGROUPCOHERENT */ - YYSYMBOL_SUBGROUPCOHERENT = 445, /* SUBGROUPCOHERENT */ - YYSYMBOL_NONPRIVATE = 446, /* NONPRIVATE */ - YYSYMBOL_SHADERCALLCOHERENT = 447, /* SHADERCALLCOHERENT */ - YYSYMBOL_NOPERSPECTIVE = 448, /* NOPERSPECTIVE */ - YYSYMBOL_EXPLICITINTERPAMD = 449, /* EXPLICITINTERPAMD */ - YYSYMBOL_PERVERTEXEXT = 450, /* PERVERTEXEXT */ - YYSYMBOL_PERVERTEXNV = 451, /* PERVERTEXNV */ - YYSYMBOL_PERPRIMITIVENV = 452, /* PERPRIMITIVENV */ - YYSYMBOL_PERVIEWNV = 453, /* PERVIEWNV */ - YYSYMBOL_PERTASKNV = 454, /* PERTASKNV */ - YYSYMBOL_PERPRIMITIVEEXT = 455, /* PERPRIMITIVEEXT */ - YYSYMBOL_TASKPAYLOADWORKGROUPEXT = 456, /* TASKPAYLOADWORKGROUPEXT */ - YYSYMBOL_PRECISE = 457, /* PRECISE */ - YYSYMBOL_YYACCEPT = 458, /* $accept */ - YYSYMBOL_variable_identifier = 459, /* variable_identifier */ - YYSYMBOL_primary_expression = 460, /* primary_expression */ - YYSYMBOL_postfix_expression = 461, /* postfix_expression */ - YYSYMBOL_integer_expression = 462, /* integer_expression */ - YYSYMBOL_function_call = 463, /* function_call */ - YYSYMBOL_function_call_or_method = 464, /* function_call_or_method */ - YYSYMBOL_function_call_generic = 465, /* function_call_generic */ - YYSYMBOL_function_call_header_no_parameters = 466, /* function_call_header_no_parameters */ - YYSYMBOL_function_call_header_with_parameters = 467, /* function_call_header_with_parameters */ - YYSYMBOL_function_call_header = 468, /* function_call_header */ - YYSYMBOL_function_identifier = 469, /* function_identifier */ - YYSYMBOL_unary_expression = 470, /* unary_expression */ - YYSYMBOL_unary_operator = 471, /* unary_operator */ - YYSYMBOL_multiplicative_expression = 472, /* multiplicative_expression */ - YYSYMBOL_additive_expression = 473, /* additive_expression */ - YYSYMBOL_shift_expression = 474, /* shift_expression */ - YYSYMBOL_relational_expression = 475, /* relational_expression */ - YYSYMBOL_equality_expression = 476, /* equality_expression */ - YYSYMBOL_and_expression = 477, /* and_expression */ - YYSYMBOL_exclusive_or_expression = 478, /* exclusive_or_expression */ - YYSYMBOL_inclusive_or_expression = 479, /* inclusive_or_expression */ - YYSYMBOL_logical_and_expression = 480, /* logical_and_expression */ - YYSYMBOL_logical_xor_expression = 481, /* logical_xor_expression */ - YYSYMBOL_logical_or_expression = 482, /* logical_or_expression */ - YYSYMBOL_conditional_expression = 483, /* conditional_expression */ - YYSYMBOL_484_1 = 484, /* $@1 */ - YYSYMBOL_assignment_expression = 485, /* assignment_expression */ - YYSYMBOL_assignment_operator = 486, /* assignment_operator */ - YYSYMBOL_expression = 487, /* expression */ - YYSYMBOL_constant_expression = 488, /* constant_expression */ - YYSYMBOL_declaration = 489, /* declaration */ - YYSYMBOL_block_structure = 490, /* block_structure */ - YYSYMBOL_491_2 = 491, /* $@2 */ - YYSYMBOL_identifier_list = 492, /* identifier_list */ - YYSYMBOL_function_prototype = 493, /* function_prototype */ - YYSYMBOL_function_declarator = 494, /* function_declarator */ - YYSYMBOL_function_header_with_parameters = 495, /* function_header_with_parameters */ - YYSYMBOL_function_header = 496, /* function_header */ - YYSYMBOL_parameter_declarator = 497, /* parameter_declarator */ - YYSYMBOL_parameter_declaration = 498, /* parameter_declaration */ - YYSYMBOL_parameter_type_specifier = 499, /* parameter_type_specifier */ - YYSYMBOL_init_declarator_list = 500, /* init_declarator_list */ - YYSYMBOL_single_declaration = 501, /* single_declaration */ - YYSYMBOL_fully_specified_type = 502, /* fully_specified_type */ - YYSYMBOL_invariant_qualifier = 503, /* invariant_qualifier */ - YYSYMBOL_interpolation_qualifier = 504, /* interpolation_qualifier */ - YYSYMBOL_layout_qualifier = 505, /* layout_qualifier */ - YYSYMBOL_layout_qualifier_id_list = 506, /* layout_qualifier_id_list */ - YYSYMBOL_layout_qualifier_id = 507, /* layout_qualifier_id */ - YYSYMBOL_precise_qualifier = 508, /* precise_qualifier */ - YYSYMBOL_type_qualifier = 509, /* type_qualifier */ - YYSYMBOL_single_type_qualifier = 510, /* single_type_qualifier */ - YYSYMBOL_storage_qualifier = 511, /* storage_qualifier */ - YYSYMBOL_non_uniform_qualifier = 512, /* non_uniform_qualifier */ - YYSYMBOL_type_name_list = 513, /* type_name_list */ - YYSYMBOL_type_specifier = 514, /* type_specifier */ - YYSYMBOL_array_specifier = 515, /* array_specifier */ - YYSYMBOL_type_parameter_specifier_opt = 516, /* type_parameter_specifier_opt */ - YYSYMBOL_type_parameter_specifier = 517, /* type_parameter_specifier */ - YYSYMBOL_type_parameter_specifier_list = 518, /* type_parameter_specifier_list */ - YYSYMBOL_type_specifier_nonarray = 519, /* type_specifier_nonarray */ - YYSYMBOL_precision_qualifier = 520, /* precision_qualifier */ - YYSYMBOL_struct_specifier = 521, /* struct_specifier */ - YYSYMBOL_522_3 = 522, /* $@3 */ - YYSYMBOL_523_4 = 523, /* $@4 */ - YYSYMBOL_struct_declaration_list = 524, /* struct_declaration_list */ - YYSYMBOL_struct_declaration = 525, /* struct_declaration */ - YYSYMBOL_struct_declarator_list = 526, /* struct_declarator_list */ - YYSYMBOL_struct_declarator = 527, /* struct_declarator */ - YYSYMBOL_initializer = 528, /* initializer */ - YYSYMBOL_initializer_list = 529, /* initializer_list */ - YYSYMBOL_declaration_statement = 530, /* declaration_statement */ - YYSYMBOL_statement = 531, /* statement */ - YYSYMBOL_simple_statement = 532, /* simple_statement */ - YYSYMBOL_demote_statement = 533, /* demote_statement */ - YYSYMBOL_compound_statement = 534, /* compound_statement */ - YYSYMBOL_535_5 = 535, /* $@5 */ - YYSYMBOL_536_6 = 536, /* $@6 */ - YYSYMBOL_statement_no_new_scope = 537, /* statement_no_new_scope */ - YYSYMBOL_statement_scoped = 538, /* statement_scoped */ - YYSYMBOL_539_7 = 539, /* $@7 */ - YYSYMBOL_540_8 = 540, /* $@8 */ - YYSYMBOL_compound_statement_no_new_scope = 541, /* compound_statement_no_new_scope */ - YYSYMBOL_statement_list = 542, /* statement_list */ - YYSYMBOL_expression_statement = 543, /* expression_statement */ - YYSYMBOL_selection_statement = 544, /* selection_statement */ - YYSYMBOL_selection_statement_nonattributed = 545, /* selection_statement_nonattributed */ - YYSYMBOL_selection_rest_statement = 546, /* selection_rest_statement */ - YYSYMBOL_condition = 547, /* condition */ - YYSYMBOL_switch_statement = 548, /* switch_statement */ - YYSYMBOL_switch_statement_nonattributed = 549, /* switch_statement_nonattributed */ - YYSYMBOL_550_9 = 550, /* $@9 */ - YYSYMBOL_switch_statement_list = 551, /* switch_statement_list */ - YYSYMBOL_case_label = 552, /* case_label */ - YYSYMBOL_iteration_statement = 553, /* iteration_statement */ - YYSYMBOL_iteration_statement_nonattributed = 554, /* iteration_statement_nonattributed */ - YYSYMBOL_555_10 = 555, /* $@10 */ - YYSYMBOL_556_11 = 556, /* $@11 */ - YYSYMBOL_557_12 = 557, /* $@12 */ - YYSYMBOL_for_init_statement = 558, /* for_init_statement */ - YYSYMBOL_conditionopt = 559, /* conditionopt */ - YYSYMBOL_for_rest_statement = 560, /* for_rest_statement */ - YYSYMBOL_jump_statement = 561, /* jump_statement */ - YYSYMBOL_translation_unit = 562, /* translation_unit */ - YYSYMBOL_external_declaration = 563, /* external_declaration */ - YYSYMBOL_function_definition = 564, /* function_definition */ - YYSYMBOL_565_13 = 565, /* $@13 */ - YYSYMBOL_attribute = 566, /* attribute */ - YYSYMBOL_attribute_list = 567, /* attribute_list */ - YYSYMBOL_single_attribute = 568, /* single_attribute */ - YYSYMBOL_spirv_requirements_list = 569, /* spirv_requirements_list */ - YYSYMBOL_spirv_requirements_parameter = 570, /* spirv_requirements_parameter */ - YYSYMBOL_spirv_extension_list = 571, /* spirv_extension_list */ - YYSYMBOL_spirv_capability_list = 572, /* spirv_capability_list */ - YYSYMBOL_spirv_execution_mode_qualifier = 573, /* spirv_execution_mode_qualifier */ - YYSYMBOL_spirv_execution_mode_parameter_list = 574, /* spirv_execution_mode_parameter_list */ - YYSYMBOL_spirv_execution_mode_parameter = 575, /* spirv_execution_mode_parameter */ - YYSYMBOL_spirv_execution_mode_id_parameter_list = 576, /* spirv_execution_mode_id_parameter_list */ - YYSYMBOL_spirv_storage_class_qualifier = 577, /* spirv_storage_class_qualifier */ - YYSYMBOL_spirv_decorate_qualifier = 578, /* spirv_decorate_qualifier */ - YYSYMBOL_spirv_decorate_parameter_list = 579, /* spirv_decorate_parameter_list */ - YYSYMBOL_spirv_decorate_parameter = 580, /* spirv_decorate_parameter */ - YYSYMBOL_spirv_decorate_id_parameter_list = 581, /* spirv_decorate_id_parameter_list */ - YYSYMBOL_spirv_decorate_string_parameter_list = 582, /* spirv_decorate_string_parameter_list */ - YYSYMBOL_spirv_type_specifier = 583, /* spirv_type_specifier */ - YYSYMBOL_spirv_type_parameter_list = 584, /* spirv_type_parameter_list */ - YYSYMBOL_spirv_type_parameter = 585, /* spirv_type_parameter */ - YYSYMBOL_spirv_instruction_qualifier = 586, /* spirv_instruction_qualifier */ - YYSYMBOL_spirv_instruction_qualifier_list = 587, /* spirv_instruction_qualifier_list */ - YYSYMBOL_spirv_instruction_qualifier_id = 588 /* spirv_instruction_qualifier_id */ + YYSYMBOL_HITOBJECTNV = 166, /* HITOBJECTNV */ + YYSYMBOL_HITOBJECTATTRNV = 167, /* HITOBJECTATTRNV */ + YYSYMBOL_SAMPLERCUBEARRAY = 168, /* SAMPLERCUBEARRAY */ + YYSYMBOL_SAMPLERCUBEARRAYSHADOW = 169, /* SAMPLERCUBEARRAYSHADOW */ + YYSYMBOL_ISAMPLERCUBEARRAY = 170, /* ISAMPLERCUBEARRAY */ + YYSYMBOL_USAMPLERCUBEARRAY = 171, /* USAMPLERCUBEARRAY */ + YYSYMBOL_SAMPLER1D = 172, /* SAMPLER1D */ + YYSYMBOL_SAMPLER1DARRAY = 173, /* SAMPLER1DARRAY */ + YYSYMBOL_SAMPLER1DARRAYSHADOW = 174, /* SAMPLER1DARRAYSHADOW */ + YYSYMBOL_ISAMPLER1D = 175, /* ISAMPLER1D */ + YYSYMBOL_SAMPLER1DSHADOW = 176, /* SAMPLER1DSHADOW */ + YYSYMBOL_SAMPLER2DRECT = 177, /* SAMPLER2DRECT */ + YYSYMBOL_SAMPLER2DRECTSHADOW = 178, /* SAMPLER2DRECTSHADOW */ + YYSYMBOL_ISAMPLER2DRECT = 179, /* ISAMPLER2DRECT */ + YYSYMBOL_USAMPLER2DRECT = 180, /* USAMPLER2DRECT */ + YYSYMBOL_SAMPLERBUFFER = 181, /* SAMPLERBUFFER */ + YYSYMBOL_ISAMPLERBUFFER = 182, /* ISAMPLERBUFFER */ + YYSYMBOL_USAMPLERBUFFER = 183, /* USAMPLERBUFFER */ + YYSYMBOL_SAMPLER2DMS = 184, /* SAMPLER2DMS */ + YYSYMBOL_ISAMPLER2DMS = 185, /* ISAMPLER2DMS */ + YYSYMBOL_USAMPLER2DMS = 186, /* USAMPLER2DMS */ + YYSYMBOL_SAMPLER2DMSARRAY = 187, /* SAMPLER2DMSARRAY */ + YYSYMBOL_ISAMPLER2DMSARRAY = 188, /* ISAMPLER2DMSARRAY */ + YYSYMBOL_USAMPLER2DMSARRAY = 189, /* USAMPLER2DMSARRAY */ + YYSYMBOL_SAMPLEREXTERNALOES = 190, /* SAMPLEREXTERNALOES */ + YYSYMBOL_SAMPLEREXTERNAL2DY2YEXT = 191, /* SAMPLEREXTERNAL2DY2YEXT */ + YYSYMBOL_ISAMPLER1DARRAY = 192, /* ISAMPLER1DARRAY */ + YYSYMBOL_USAMPLER1D = 193, /* USAMPLER1D */ + YYSYMBOL_USAMPLER1DARRAY = 194, /* USAMPLER1DARRAY */ + YYSYMBOL_F16SAMPLER1D = 195, /* F16SAMPLER1D */ + YYSYMBOL_F16SAMPLER2D = 196, /* F16SAMPLER2D */ + YYSYMBOL_F16SAMPLER3D = 197, /* F16SAMPLER3D */ + YYSYMBOL_F16SAMPLER2DRECT = 198, /* F16SAMPLER2DRECT */ + YYSYMBOL_F16SAMPLERCUBE = 199, /* F16SAMPLERCUBE */ + YYSYMBOL_F16SAMPLER1DARRAY = 200, /* F16SAMPLER1DARRAY */ + YYSYMBOL_F16SAMPLER2DARRAY = 201, /* F16SAMPLER2DARRAY */ + YYSYMBOL_F16SAMPLERCUBEARRAY = 202, /* F16SAMPLERCUBEARRAY */ + YYSYMBOL_F16SAMPLERBUFFER = 203, /* F16SAMPLERBUFFER */ + YYSYMBOL_F16SAMPLER2DMS = 204, /* F16SAMPLER2DMS */ + YYSYMBOL_F16SAMPLER2DMSARRAY = 205, /* F16SAMPLER2DMSARRAY */ + YYSYMBOL_F16SAMPLER1DSHADOW = 206, /* F16SAMPLER1DSHADOW */ + YYSYMBOL_F16SAMPLER2DSHADOW = 207, /* F16SAMPLER2DSHADOW */ + YYSYMBOL_F16SAMPLER1DARRAYSHADOW = 208, /* F16SAMPLER1DARRAYSHADOW */ + YYSYMBOL_F16SAMPLER2DARRAYSHADOW = 209, /* F16SAMPLER2DARRAYSHADOW */ + YYSYMBOL_F16SAMPLER2DRECTSHADOW = 210, /* F16SAMPLER2DRECTSHADOW */ + YYSYMBOL_F16SAMPLERCUBESHADOW = 211, /* F16SAMPLERCUBESHADOW */ + YYSYMBOL_F16SAMPLERCUBEARRAYSHADOW = 212, /* F16SAMPLERCUBEARRAYSHADOW */ + YYSYMBOL_IMAGE1D = 213, /* IMAGE1D */ + YYSYMBOL_IIMAGE1D = 214, /* IIMAGE1D */ + YYSYMBOL_UIMAGE1D = 215, /* UIMAGE1D */ + YYSYMBOL_IMAGE2D = 216, /* IMAGE2D */ + YYSYMBOL_IIMAGE2D = 217, /* IIMAGE2D */ + YYSYMBOL_UIMAGE2D = 218, /* UIMAGE2D */ + YYSYMBOL_IMAGE3D = 219, /* IMAGE3D */ + YYSYMBOL_IIMAGE3D = 220, /* IIMAGE3D */ + YYSYMBOL_UIMAGE3D = 221, /* UIMAGE3D */ + YYSYMBOL_IMAGE2DRECT = 222, /* IMAGE2DRECT */ + YYSYMBOL_IIMAGE2DRECT = 223, /* IIMAGE2DRECT */ + YYSYMBOL_UIMAGE2DRECT = 224, /* UIMAGE2DRECT */ + YYSYMBOL_IMAGECUBE = 225, /* IMAGECUBE */ + YYSYMBOL_IIMAGECUBE = 226, /* IIMAGECUBE */ + YYSYMBOL_UIMAGECUBE = 227, /* UIMAGECUBE */ + YYSYMBOL_IMAGEBUFFER = 228, /* IMAGEBUFFER */ + YYSYMBOL_IIMAGEBUFFER = 229, /* IIMAGEBUFFER */ + YYSYMBOL_UIMAGEBUFFER = 230, /* UIMAGEBUFFER */ + YYSYMBOL_IMAGE1DARRAY = 231, /* IMAGE1DARRAY */ + YYSYMBOL_IIMAGE1DARRAY = 232, /* IIMAGE1DARRAY */ + YYSYMBOL_UIMAGE1DARRAY = 233, /* UIMAGE1DARRAY */ + YYSYMBOL_IMAGE2DARRAY = 234, /* IMAGE2DARRAY */ + YYSYMBOL_IIMAGE2DARRAY = 235, /* IIMAGE2DARRAY */ + YYSYMBOL_UIMAGE2DARRAY = 236, /* UIMAGE2DARRAY */ + YYSYMBOL_IMAGECUBEARRAY = 237, /* IMAGECUBEARRAY */ + YYSYMBOL_IIMAGECUBEARRAY = 238, /* IIMAGECUBEARRAY */ + YYSYMBOL_UIMAGECUBEARRAY = 239, /* UIMAGECUBEARRAY */ + YYSYMBOL_IMAGE2DMS = 240, /* IMAGE2DMS */ + YYSYMBOL_IIMAGE2DMS = 241, /* IIMAGE2DMS */ + YYSYMBOL_UIMAGE2DMS = 242, /* UIMAGE2DMS */ + YYSYMBOL_IMAGE2DMSARRAY = 243, /* IMAGE2DMSARRAY */ + YYSYMBOL_IIMAGE2DMSARRAY = 244, /* IIMAGE2DMSARRAY */ + YYSYMBOL_UIMAGE2DMSARRAY = 245, /* UIMAGE2DMSARRAY */ + YYSYMBOL_F16IMAGE1D = 246, /* F16IMAGE1D */ + YYSYMBOL_F16IMAGE2D = 247, /* F16IMAGE2D */ + YYSYMBOL_F16IMAGE3D = 248, /* F16IMAGE3D */ + YYSYMBOL_F16IMAGE2DRECT = 249, /* F16IMAGE2DRECT */ + YYSYMBOL_F16IMAGECUBE = 250, /* F16IMAGECUBE */ + YYSYMBOL_F16IMAGE1DARRAY = 251, /* F16IMAGE1DARRAY */ + YYSYMBOL_F16IMAGE2DARRAY = 252, /* F16IMAGE2DARRAY */ + YYSYMBOL_F16IMAGECUBEARRAY = 253, /* F16IMAGECUBEARRAY */ + YYSYMBOL_F16IMAGEBUFFER = 254, /* F16IMAGEBUFFER */ + YYSYMBOL_F16IMAGE2DMS = 255, /* F16IMAGE2DMS */ + YYSYMBOL_F16IMAGE2DMSARRAY = 256, /* F16IMAGE2DMSARRAY */ + YYSYMBOL_I64IMAGE1D = 257, /* I64IMAGE1D */ + YYSYMBOL_U64IMAGE1D = 258, /* U64IMAGE1D */ + YYSYMBOL_I64IMAGE2D = 259, /* I64IMAGE2D */ + YYSYMBOL_U64IMAGE2D = 260, /* U64IMAGE2D */ + YYSYMBOL_I64IMAGE3D = 261, /* I64IMAGE3D */ + YYSYMBOL_U64IMAGE3D = 262, /* U64IMAGE3D */ + YYSYMBOL_I64IMAGE2DRECT = 263, /* I64IMAGE2DRECT */ + YYSYMBOL_U64IMAGE2DRECT = 264, /* U64IMAGE2DRECT */ + YYSYMBOL_I64IMAGECUBE = 265, /* I64IMAGECUBE */ + YYSYMBOL_U64IMAGECUBE = 266, /* U64IMAGECUBE */ + YYSYMBOL_I64IMAGEBUFFER = 267, /* I64IMAGEBUFFER */ + YYSYMBOL_U64IMAGEBUFFER = 268, /* U64IMAGEBUFFER */ + YYSYMBOL_I64IMAGE1DARRAY = 269, /* I64IMAGE1DARRAY */ + YYSYMBOL_U64IMAGE1DARRAY = 270, /* U64IMAGE1DARRAY */ + YYSYMBOL_I64IMAGE2DARRAY = 271, /* I64IMAGE2DARRAY */ + YYSYMBOL_U64IMAGE2DARRAY = 272, /* U64IMAGE2DARRAY */ + YYSYMBOL_I64IMAGECUBEARRAY = 273, /* I64IMAGECUBEARRAY */ + YYSYMBOL_U64IMAGECUBEARRAY = 274, /* U64IMAGECUBEARRAY */ + YYSYMBOL_I64IMAGE2DMS = 275, /* I64IMAGE2DMS */ + YYSYMBOL_U64IMAGE2DMS = 276, /* U64IMAGE2DMS */ + YYSYMBOL_I64IMAGE2DMSARRAY = 277, /* I64IMAGE2DMSARRAY */ + YYSYMBOL_U64IMAGE2DMSARRAY = 278, /* U64IMAGE2DMSARRAY */ + YYSYMBOL_TEXTURECUBEARRAY = 279, /* TEXTURECUBEARRAY */ + YYSYMBOL_ITEXTURECUBEARRAY = 280, /* ITEXTURECUBEARRAY */ + YYSYMBOL_UTEXTURECUBEARRAY = 281, /* UTEXTURECUBEARRAY */ + YYSYMBOL_TEXTURE1D = 282, /* TEXTURE1D */ + YYSYMBOL_ITEXTURE1D = 283, /* ITEXTURE1D */ + YYSYMBOL_UTEXTURE1D = 284, /* UTEXTURE1D */ + YYSYMBOL_TEXTURE1DARRAY = 285, /* TEXTURE1DARRAY */ + YYSYMBOL_ITEXTURE1DARRAY = 286, /* ITEXTURE1DARRAY */ + YYSYMBOL_UTEXTURE1DARRAY = 287, /* UTEXTURE1DARRAY */ + YYSYMBOL_TEXTURE2DRECT = 288, /* TEXTURE2DRECT */ + YYSYMBOL_ITEXTURE2DRECT = 289, /* ITEXTURE2DRECT */ + YYSYMBOL_UTEXTURE2DRECT = 290, /* UTEXTURE2DRECT */ + YYSYMBOL_TEXTUREBUFFER = 291, /* TEXTUREBUFFER */ + YYSYMBOL_ITEXTUREBUFFER = 292, /* ITEXTUREBUFFER */ + YYSYMBOL_UTEXTUREBUFFER = 293, /* UTEXTUREBUFFER */ + YYSYMBOL_TEXTURE2DMS = 294, /* TEXTURE2DMS */ + YYSYMBOL_ITEXTURE2DMS = 295, /* ITEXTURE2DMS */ + YYSYMBOL_UTEXTURE2DMS = 296, /* UTEXTURE2DMS */ + YYSYMBOL_TEXTURE2DMSARRAY = 297, /* TEXTURE2DMSARRAY */ + YYSYMBOL_ITEXTURE2DMSARRAY = 298, /* ITEXTURE2DMSARRAY */ + YYSYMBOL_UTEXTURE2DMSARRAY = 299, /* UTEXTURE2DMSARRAY */ + YYSYMBOL_F16TEXTURE1D = 300, /* F16TEXTURE1D */ + YYSYMBOL_F16TEXTURE2D = 301, /* F16TEXTURE2D */ + YYSYMBOL_F16TEXTURE3D = 302, /* F16TEXTURE3D */ + YYSYMBOL_F16TEXTURE2DRECT = 303, /* F16TEXTURE2DRECT */ + YYSYMBOL_F16TEXTURECUBE = 304, /* F16TEXTURECUBE */ + YYSYMBOL_F16TEXTURE1DARRAY = 305, /* F16TEXTURE1DARRAY */ + YYSYMBOL_F16TEXTURE2DARRAY = 306, /* F16TEXTURE2DARRAY */ + YYSYMBOL_F16TEXTURECUBEARRAY = 307, /* F16TEXTURECUBEARRAY */ + YYSYMBOL_F16TEXTUREBUFFER = 308, /* F16TEXTUREBUFFER */ + YYSYMBOL_F16TEXTURE2DMS = 309, /* F16TEXTURE2DMS */ + YYSYMBOL_F16TEXTURE2DMSARRAY = 310, /* F16TEXTURE2DMSARRAY */ + YYSYMBOL_SUBPASSINPUT = 311, /* SUBPASSINPUT */ + YYSYMBOL_SUBPASSINPUTMS = 312, /* SUBPASSINPUTMS */ + YYSYMBOL_ISUBPASSINPUT = 313, /* ISUBPASSINPUT */ + YYSYMBOL_ISUBPASSINPUTMS = 314, /* ISUBPASSINPUTMS */ + YYSYMBOL_USUBPASSINPUT = 315, /* USUBPASSINPUT */ + YYSYMBOL_USUBPASSINPUTMS = 316, /* USUBPASSINPUTMS */ + YYSYMBOL_F16SUBPASSINPUT = 317, /* F16SUBPASSINPUT */ + YYSYMBOL_F16SUBPASSINPUTMS = 318, /* F16SUBPASSINPUTMS */ + YYSYMBOL_SPIRV_INSTRUCTION = 319, /* SPIRV_INSTRUCTION */ + YYSYMBOL_SPIRV_EXECUTION_MODE = 320, /* SPIRV_EXECUTION_MODE */ + YYSYMBOL_SPIRV_EXECUTION_MODE_ID = 321, /* SPIRV_EXECUTION_MODE_ID */ + YYSYMBOL_SPIRV_DECORATE = 322, /* SPIRV_DECORATE */ + YYSYMBOL_SPIRV_DECORATE_ID = 323, /* SPIRV_DECORATE_ID */ + YYSYMBOL_SPIRV_DECORATE_STRING = 324, /* SPIRV_DECORATE_STRING */ + YYSYMBOL_SPIRV_TYPE = 325, /* SPIRV_TYPE */ + YYSYMBOL_SPIRV_STORAGE_CLASS = 326, /* SPIRV_STORAGE_CLASS */ + YYSYMBOL_SPIRV_BY_REFERENCE = 327, /* SPIRV_BY_REFERENCE */ + YYSYMBOL_SPIRV_LITERAL = 328, /* SPIRV_LITERAL */ + YYSYMBOL_LEFT_OP = 329, /* LEFT_OP */ + YYSYMBOL_RIGHT_OP = 330, /* RIGHT_OP */ + YYSYMBOL_INC_OP = 331, /* INC_OP */ + YYSYMBOL_DEC_OP = 332, /* DEC_OP */ + YYSYMBOL_LE_OP = 333, /* LE_OP */ + YYSYMBOL_GE_OP = 334, /* GE_OP */ + YYSYMBOL_EQ_OP = 335, /* EQ_OP */ + YYSYMBOL_NE_OP = 336, /* NE_OP */ + YYSYMBOL_AND_OP = 337, /* AND_OP */ + YYSYMBOL_OR_OP = 338, /* OR_OP */ + YYSYMBOL_XOR_OP = 339, /* XOR_OP */ + YYSYMBOL_MUL_ASSIGN = 340, /* MUL_ASSIGN */ + YYSYMBOL_DIV_ASSIGN = 341, /* DIV_ASSIGN */ + YYSYMBOL_ADD_ASSIGN = 342, /* ADD_ASSIGN */ + YYSYMBOL_MOD_ASSIGN = 343, /* MOD_ASSIGN */ + YYSYMBOL_LEFT_ASSIGN = 344, /* LEFT_ASSIGN */ + YYSYMBOL_RIGHT_ASSIGN = 345, /* RIGHT_ASSIGN */ + YYSYMBOL_AND_ASSIGN = 346, /* AND_ASSIGN */ + YYSYMBOL_XOR_ASSIGN = 347, /* XOR_ASSIGN */ + YYSYMBOL_OR_ASSIGN = 348, /* OR_ASSIGN */ + YYSYMBOL_SUB_ASSIGN = 349, /* SUB_ASSIGN */ + YYSYMBOL_STRING_LITERAL = 350, /* STRING_LITERAL */ + YYSYMBOL_LEFT_PAREN = 351, /* LEFT_PAREN */ + YYSYMBOL_RIGHT_PAREN = 352, /* RIGHT_PAREN */ + YYSYMBOL_LEFT_BRACKET = 353, /* LEFT_BRACKET */ + YYSYMBOL_RIGHT_BRACKET = 354, /* RIGHT_BRACKET */ + YYSYMBOL_LEFT_BRACE = 355, /* LEFT_BRACE */ + YYSYMBOL_RIGHT_BRACE = 356, /* RIGHT_BRACE */ + YYSYMBOL_DOT = 357, /* DOT */ + YYSYMBOL_COMMA = 358, /* COMMA */ + YYSYMBOL_COLON = 359, /* COLON */ + YYSYMBOL_EQUAL = 360, /* EQUAL */ + YYSYMBOL_SEMICOLON = 361, /* SEMICOLON */ + YYSYMBOL_BANG = 362, /* BANG */ + YYSYMBOL_DASH = 363, /* DASH */ + YYSYMBOL_TILDE = 364, /* TILDE */ + YYSYMBOL_PLUS = 365, /* PLUS */ + YYSYMBOL_STAR = 366, /* STAR */ + YYSYMBOL_SLASH = 367, /* SLASH */ + YYSYMBOL_PERCENT = 368, /* PERCENT */ + YYSYMBOL_LEFT_ANGLE = 369, /* LEFT_ANGLE */ + YYSYMBOL_RIGHT_ANGLE = 370, /* RIGHT_ANGLE */ + YYSYMBOL_VERTICAL_BAR = 371, /* VERTICAL_BAR */ + YYSYMBOL_CARET = 372, /* CARET */ + YYSYMBOL_AMPERSAND = 373, /* AMPERSAND */ + YYSYMBOL_QUESTION = 374, /* QUESTION */ + YYSYMBOL_INVARIANT = 375, /* INVARIANT */ + YYSYMBOL_HIGH_PRECISION = 376, /* HIGH_PRECISION */ + YYSYMBOL_MEDIUM_PRECISION = 377, /* MEDIUM_PRECISION */ + YYSYMBOL_LOW_PRECISION = 378, /* LOW_PRECISION */ + YYSYMBOL_PRECISION = 379, /* PRECISION */ + YYSYMBOL_PACKED = 380, /* PACKED */ + YYSYMBOL_RESOURCE = 381, /* RESOURCE */ + YYSYMBOL_SUPERP = 382, /* SUPERP */ + YYSYMBOL_FLOATCONSTANT = 383, /* FLOATCONSTANT */ + YYSYMBOL_INTCONSTANT = 384, /* INTCONSTANT */ + YYSYMBOL_UINTCONSTANT = 385, /* UINTCONSTANT */ + YYSYMBOL_BOOLCONSTANT = 386, /* BOOLCONSTANT */ + YYSYMBOL_IDENTIFIER = 387, /* IDENTIFIER */ + YYSYMBOL_TYPE_NAME = 388, /* TYPE_NAME */ + YYSYMBOL_CENTROID = 389, /* CENTROID */ + YYSYMBOL_IN = 390, /* IN */ + YYSYMBOL_OUT = 391, /* OUT */ + YYSYMBOL_INOUT = 392, /* INOUT */ + YYSYMBOL_STRUCT = 393, /* STRUCT */ + YYSYMBOL_VOID = 394, /* VOID */ + YYSYMBOL_WHILE = 395, /* WHILE */ + YYSYMBOL_BREAK = 396, /* BREAK */ + YYSYMBOL_CONTINUE = 397, /* CONTINUE */ + YYSYMBOL_DO = 398, /* DO */ + YYSYMBOL_ELSE = 399, /* ELSE */ + YYSYMBOL_FOR = 400, /* FOR */ + YYSYMBOL_IF = 401, /* IF */ + YYSYMBOL_DISCARD = 402, /* DISCARD */ + YYSYMBOL_RETURN = 403, /* RETURN */ + YYSYMBOL_SWITCH = 404, /* SWITCH */ + YYSYMBOL_CASE = 405, /* CASE */ + YYSYMBOL_DEFAULT = 406, /* DEFAULT */ + YYSYMBOL_TERMINATE_INVOCATION = 407, /* TERMINATE_INVOCATION */ + YYSYMBOL_TERMINATE_RAY = 408, /* TERMINATE_RAY */ + YYSYMBOL_IGNORE_INTERSECTION = 409, /* IGNORE_INTERSECTION */ + YYSYMBOL_UNIFORM = 410, /* UNIFORM */ + YYSYMBOL_SHARED = 411, /* SHARED */ + YYSYMBOL_BUFFER = 412, /* BUFFER */ + YYSYMBOL_FLAT = 413, /* FLAT */ + YYSYMBOL_SMOOTH = 414, /* SMOOTH */ + YYSYMBOL_LAYOUT = 415, /* LAYOUT */ + YYSYMBOL_DOUBLECONSTANT = 416, /* DOUBLECONSTANT */ + YYSYMBOL_INT16CONSTANT = 417, /* INT16CONSTANT */ + YYSYMBOL_UINT16CONSTANT = 418, /* UINT16CONSTANT */ + YYSYMBOL_FLOAT16CONSTANT = 419, /* FLOAT16CONSTANT */ + YYSYMBOL_INT32CONSTANT = 420, /* INT32CONSTANT */ + YYSYMBOL_UINT32CONSTANT = 421, /* UINT32CONSTANT */ + YYSYMBOL_INT64CONSTANT = 422, /* INT64CONSTANT */ + YYSYMBOL_UINT64CONSTANT = 423, /* UINT64CONSTANT */ + YYSYMBOL_SUBROUTINE = 424, /* SUBROUTINE */ + YYSYMBOL_DEMOTE = 425, /* DEMOTE */ + YYSYMBOL_PAYLOADNV = 426, /* PAYLOADNV */ + YYSYMBOL_PAYLOADINNV = 427, /* PAYLOADINNV */ + YYSYMBOL_HITATTRNV = 428, /* HITATTRNV */ + YYSYMBOL_CALLDATANV = 429, /* CALLDATANV */ + YYSYMBOL_CALLDATAINNV = 430, /* CALLDATAINNV */ + YYSYMBOL_PAYLOADEXT = 431, /* PAYLOADEXT */ + YYSYMBOL_PAYLOADINEXT = 432, /* PAYLOADINEXT */ + YYSYMBOL_HITATTREXT = 433, /* HITATTREXT */ + YYSYMBOL_CALLDATAEXT = 434, /* CALLDATAEXT */ + YYSYMBOL_CALLDATAINEXT = 435, /* CALLDATAINEXT */ + YYSYMBOL_PATCH = 436, /* PATCH */ + YYSYMBOL_SAMPLE = 437, /* SAMPLE */ + YYSYMBOL_NONUNIFORM = 438, /* NONUNIFORM */ + YYSYMBOL_COHERENT = 439, /* COHERENT */ + YYSYMBOL_VOLATILE = 440, /* VOLATILE */ + YYSYMBOL_RESTRICT = 441, /* RESTRICT */ + YYSYMBOL_READONLY = 442, /* READONLY */ + YYSYMBOL_WRITEONLY = 443, /* WRITEONLY */ + YYSYMBOL_DEVICECOHERENT = 444, /* DEVICECOHERENT */ + YYSYMBOL_QUEUEFAMILYCOHERENT = 445, /* QUEUEFAMILYCOHERENT */ + YYSYMBOL_WORKGROUPCOHERENT = 446, /* WORKGROUPCOHERENT */ + YYSYMBOL_SUBGROUPCOHERENT = 447, /* SUBGROUPCOHERENT */ + YYSYMBOL_NONPRIVATE = 448, /* NONPRIVATE */ + YYSYMBOL_SHADERCALLCOHERENT = 449, /* SHADERCALLCOHERENT */ + YYSYMBOL_NOPERSPECTIVE = 450, /* NOPERSPECTIVE */ + YYSYMBOL_EXPLICITINTERPAMD = 451, /* EXPLICITINTERPAMD */ + YYSYMBOL_PERVERTEXEXT = 452, /* PERVERTEXEXT */ + YYSYMBOL_PERVERTEXNV = 453, /* PERVERTEXNV */ + YYSYMBOL_PERPRIMITIVENV = 454, /* PERPRIMITIVENV */ + YYSYMBOL_PERVIEWNV = 455, /* PERVIEWNV */ + YYSYMBOL_PERTASKNV = 456, /* PERTASKNV */ + YYSYMBOL_PERPRIMITIVEEXT = 457, /* PERPRIMITIVEEXT */ + YYSYMBOL_TASKPAYLOADWORKGROUPEXT = 458, /* TASKPAYLOADWORKGROUPEXT */ + YYSYMBOL_PRECISE = 459, /* PRECISE */ + YYSYMBOL_YYACCEPT = 460, /* $accept */ + YYSYMBOL_variable_identifier = 461, /* variable_identifier */ + YYSYMBOL_primary_expression = 462, /* primary_expression */ + YYSYMBOL_postfix_expression = 463, /* postfix_expression */ + YYSYMBOL_integer_expression = 464, /* integer_expression */ + YYSYMBOL_function_call = 465, /* function_call */ + YYSYMBOL_function_call_or_method = 466, /* function_call_or_method */ + YYSYMBOL_function_call_generic = 467, /* function_call_generic */ + YYSYMBOL_function_call_header_no_parameters = 468, /* function_call_header_no_parameters */ + YYSYMBOL_function_call_header_with_parameters = 469, /* function_call_header_with_parameters */ + YYSYMBOL_function_call_header = 470, /* function_call_header */ + YYSYMBOL_function_identifier = 471, /* function_identifier */ + YYSYMBOL_unary_expression = 472, /* unary_expression */ + YYSYMBOL_unary_operator = 473, /* unary_operator */ + YYSYMBOL_multiplicative_expression = 474, /* multiplicative_expression */ + YYSYMBOL_additive_expression = 475, /* additive_expression */ + YYSYMBOL_shift_expression = 476, /* shift_expression */ + YYSYMBOL_relational_expression = 477, /* relational_expression */ + YYSYMBOL_equality_expression = 478, /* equality_expression */ + YYSYMBOL_and_expression = 479, /* and_expression */ + YYSYMBOL_exclusive_or_expression = 480, /* exclusive_or_expression */ + YYSYMBOL_inclusive_or_expression = 481, /* inclusive_or_expression */ + YYSYMBOL_logical_and_expression = 482, /* logical_and_expression */ + YYSYMBOL_logical_xor_expression = 483, /* logical_xor_expression */ + YYSYMBOL_logical_or_expression = 484, /* logical_or_expression */ + YYSYMBOL_conditional_expression = 485, /* conditional_expression */ + YYSYMBOL_486_1 = 486, /* $@1 */ + YYSYMBOL_assignment_expression = 487, /* assignment_expression */ + YYSYMBOL_assignment_operator = 488, /* assignment_operator */ + YYSYMBOL_expression = 489, /* expression */ + YYSYMBOL_constant_expression = 490, /* constant_expression */ + YYSYMBOL_declaration = 491, /* declaration */ + YYSYMBOL_block_structure = 492, /* block_structure */ + YYSYMBOL_493_2 = 493, /* $@2 */ + YYSYMBOL_identifier_list = 494, /* identifier_list */ + YYSYMBOL_function_prototype = 495, /* function_prototype */ + YYSYMBOL_function_declarator = 496, /* function_declarator */ + YYSYMBOL_function_header_with_parameters = 497, /* function_header_with_parameters */ + YYSYMBOL_function_header = 498, /* function_header */ + YYSYMBOL_parameter_declarator = 499, /* parameter_declarator */ + YYSYMBOL_parameter_declaration = 500, /* parameter_declaration */ + YYSYMBOL_parameter_type_specifier = 501, /* parameter_type_specifier */ + YYSYMBOL_init_declarator_list = 502, /* init_declarator_list */ + YYSYMBOL_single_declaration = 503, /* single_declaration */ + YYSYMBOL_fully_specified_type = 504, /* fully_specified_type */ + YYSYMBOL_invariant_qualifier = 505, /* invariant_qualifier */ + YYSYMBOL_interpolation_qualifier = 506, /* interpolation_qualifier */ + YYSYMBOL_layout_qualifier = 507, /* layout_qualifier */ + YYSYMBOL_layout_qualifier_id_list = 508, /* layout_qualifier_id_list */ + YYSYMBOL_layout_qualifier_id = 509, /* layout_qualifier_id */ + YYSYMBOL_precise_qualifier = 510, /* precise_qualifier */ + YYSYMBOL_type_qualifier = 511, /* type_qualifier */ + YYSYMBOL_single_type_qualifier = 512, /* single_type_qualifier */ + YYSYMBOL_storage_qualifier = 513, /* storage_qualifier */ + YYSYMBOL_non_uniform_qualifier = 514, /* non_uniform_qualifier */ + YYSYMBOL_type_name_list = 515, /* type_name_list */ + YYSYMBOL_type_specifier = 516, /* type_specifier */ + YYSYMBOL_array_specifier = 517, /* array_specifier */ + YYSYMBOL_type_parameter_specifier_opt = 518, /* type_parameter_specifier_opt */ + YYSYMBOL_type_parameter_specifier = 519, /* type_parameter_specifier */ + YYSYMBOL_type_parameter_specifier_list = 520, /* type_parameter_specifier_list */ + YYSYMBOL_type_specifier_nonarray = 521, /* type_specifier_nonarray */ + YYSYMBOL_precision_qualifier = 522, /* precision_qualifier */ + YYSYMBOL_struct_specifier = 523, /* struct_specifier */ + YYSYMBOL_524_3 = 524, /* $@3 */ + YYSYMBOL_525_4 = 525, /* $@4 */ + YYSYMBOL_struct_declaration_list = 526, /* struct_declaration_list */ + YYSYMBOL_struct_declaration = 527, /* struct_declaration */ + YYSYMBOL_struct_declarator_list = 528, /* struct_declarator_list */ + YYSYMBOL_struct_declarator = 529, /* struct_declarator */ + YYSYMBOL_initializer = 530, /* initializer */ + YYSYMBOL_initializer_list = 531, /* initializer_list */ + YYSYMBOL_declaration_statement = 532, /* declaration_statement */ + YYSYMBOL_statement = 533, /* statement */ + YYSYMBOL_simple_statement = 534, /* simple_statement */ + YYSYMBOL_demote_statement = 535, /* demote_statement */ + YYSYMBOL_compound_statement = 536, /* compound_statement */ + YYSYMBOL_537_5 = 537, /* $@5 */ + YYSYMBOL_538_6 = 538, /* $@6 */ + YYSYMBOL_statement_no_new_scope = 539, /* statement_no_new_scope */ + YYSYMBOL_statement_scoped = 540, /* statement_scoped */ + YYSYMBOL_541_7 = 541, /* $@7 */ + YYSYMBOL_542_8 = 542, /* $@8 */ + YYSYMBOL_compound_statement_no_new_scope = 543, /* compound_statement_no_new_scope */ + YYSYMBOL_statement_list = 544, /* statement_list */ + YYSYMBOL_expression_statement = 545, /* expression_statement */ + YYSYMBOL_selection_statement = 546, /* selection_statement */ + YYSYMBOL_selection_statement_nonattributed = 547, /* selection_statement_nonattributed */ + YYSYMBOL_selection_rest_statement = 548, /* selection_rest_statement */ + YYSYMBOL_condition = 549, /* condition */ + YYSYMBOL_switch_statement = 550, /* switch_statement */ + YYSYMBOL_switch_statement_nonattributed = 551, /* switch_statement_nonattributed */ + YYSYMBOL_552_9 = 552, /* $@9 */ + YYSYMBOL_switch_statement_list = 553, /* switch_statement_list */ + YYSYMBOL_case_label = 554, /* case_label */ + YYSYMBOL_iteration_statement = 555, /* iteration_statement */ + YYSYMBOL_iteration_statement_nonattributed = 556, /* iteration_statement_nonattributed */ + YYSYMBOL_557_10 = 557, /* $@10 */ + YYSYMBOL_558_11 = 558, /* $@11 */ + YYSYMBOL_559_12 = 559, /* $@12 */ + YYSYMBOL_for_init_statement = 560, /* for_init_statement */ + YYSYMBOL_conditionopt = 561, /* conditionopt */ + YYSYMBOL_for_rest_statement = 562, /* for_rest_statement */ + YYSYMBOL_jump_statement = 563, /* jump_statement */ + YYSYMBOL_translation_unit = 564, /* translation_unit */ + YYSYMBOL_external_declaration = 565, /* external_declaration */ + YYSYMBOL_function_definition = 566, /* function_definition */ + YYSYMBOL_567_13 = 567, /* $@13 */ + YYSYMBOL_attribute = 568, /* attribute */ + YYSYMBOL_attribute_list = 569, /* attribute_list */ + YYSYMBOL_single_attribute = 570, /* single_attribute */ + YYSYMBOL_spirv_requirements_list = 571, /* spirv_requirements_list */ + YYSYMBOL_spirv_requirements_parameter = 572, /* spirv_requirements_parameter */ + YYSYMBOL_spirv_extension_list = 573, /* spirv_extension_list */ + YYSYMBOL_spirv_capability_list = 574, /* spirv_capability_list */ + YYSYMBOL_spirv_execution_mode_qualifier = 575, /* spirv_execution_mode_qualifier */ + YYSYMBOL_spirv_execution_mode_parameter_list = 576, /* spirv_execution_mode_parameter_list */ + YYSYMBOL_spirv_execution_mode_parameter = 577, /* spirv_execution_mode_parameter */ + YYSYMBOL_spirv_execution_mode_id_parameter_list = 578, /* spirv_execution_mode_id_parameter_list */ + YYSYMBOL_spirv_storage_class_qualifier = 579, /* spirv_storage_class_qualifier */ + YYSYMBOL_spirv_decorate_qualifier = 580, /* spirv_decorate_qualifier */ + YYSYMBOL_spirv_decorate_parameter_list = 581, /* spirv_decorate_parameter_list */ + YYSYMBOL_spirv_decorate_parameter = 582, /* spirv_decorate_parameter */ + YYSYMBOL_spirv_decorate_id_parameter_list = 583, /* spirv_decorate_id_parameter_list */ + YYSYMBOL_spirv_decorate_string_parameter_list = 584, /* spirv_decorate_string_parameter_list */ + YYSYMBOL_spirv_type_specifier = 585, /* spirv_type_specifier */ + YYSYMBOL_spirv_type_parameter_list = 586, /* spirv_type_parameter_list */ + YYSYMBOL_spirv_type_parameter = 587, /* spirv_type_parameter */ + YYSYMBOL_spirv_instruction_qualifier = 588, /* spirv_instruction_qualifier */ + YYSYMBOL_spirv_instruction_qualifier_list = 589, /* spirv_instruction_qualifier_list */ + YYSYMBOL_spirv_instruction_qualifier_id = 590 /* spirv_instruction_qualifier_id */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -731,7 +733,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; extern int yylex(YYSTYPE*, TParseContext&); -#line 735 "MachineIndependent/glslang_tab.cpp" +#line 737 "MachineIndependent/glslang_tab.cpp" #ifdef short @@ -1035,21 +1037,21 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 445 +#define YYFINAL 447 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 12503 +#define YYLAST 12557 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 458 +#define YYNTOKENS 460 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 131 /* YYNRULES -- Number of rules. */ -#define YYNRULES 686 +#define YYNRULES 688 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 932 +#define YYNSTATES 934 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 712 +#define YYMAXUTOK 714 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM @@ -1134,82 +1136,82 @@ static const yytype_int16 yytranslate[] = 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457 + 455, 456, 457, 458, 459 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 392, 392, 398, 401, 406, 409, 412, 416, 420, - 423, 427, 431, 435, 439, 443, 447, 453, 461, 464, - 467, 470, 473, 478, 486, 493, 500, 506, 510, 517, - 520, 526, 533, 543, 551, 556, 584, 593, 599, 603, - 607, 627, 628, 629, 630, 636, 637, 642, 647, 656, - 657, 662, 670, 671, 677, 686, 687, 692, 697, 702, - 710, 711, 720, 732, 733, 742, 743, 752, 753, 762, - 763, 771, 772, 780, 781, 789, 790, 790, 808, 809, - 825, 829, 833, 837, 842, 846, 850, 854, 858, 862, - 866, 873, 876, 887, 894, 900, 907, 913, 918, 925, - 929, 933, 937, 942, 947, 956, 956, 967, 971, 978, - 982, 988, 994, 1004, 1007, 1014, 1022, 1042, 1065, 1080, - 1105, 1116, 1126, 1136, 1146, 1155, 1158, 1162, 1166, 1171, - 1179, 1186, 1191, 1196, 1201, 1210, 1220, 1247, 1256, 1263, - 1271, 1278, 1285, 1293, 1301, 1311, 1321, 1328, 1339, 1345, - 1348, 1355, 1359, 1363, 1372, 1382, 1385, 1396, 1399, 1402, - 1406, 1410, 1415, 1419, 1422, 1427, 1431, 1436, 1445, 1449, - 1454, 1460, 1466, 1473, 1478, 1486, 1492, 1504, 1518, 1524, - 1529, 1537, 1545, 1553, 1561, 1569, 1577, 1585, 1593, 1600, - 1607, 1611, 1616, 1621, 1626, 1631, 1636, 1641, 1645, 1649, - 1653, 1657, 1663, 1669, 1681, 1688, 1691, 1700, 1705, 1715, - 1720, 1728, 1732, 1742, 1745, 1751, 1757, 1764, 1774, 1778, - 1782, 1786, 1791, 1795, 1800, 1805, 1810, 1815, 1820, 1825, - 1830, 1835, 1840, 1846, 1852, 1858, 1863, 1868, 1873, 1878, - 1883, 1888, 1893, 1898, 1903, 1908, 1913, 1919, 1926, 1931, - 1936, 1941, 1946, 1951, 1956, 1961, 1966, 1971, 1976, 1981, - 1989, 1997, 2005, 2011, 2017, 2023, 2029, 2035, 2041, 2047, - 2053, 2059, 2065, 2071, 2077, 2083, 2089, 2095, 2101, 2107, - 2113, 2119, 2125, 2131, 2137, 2143, 2149, 2155, 2161, 2167, - 2173, 2179, 2185, 2191, 2197, 2203, 2211, 2219, 2227, 2235, - 2243, 2251, 2259, 2267, 2275, 2283, 2291, 2299, 2305, 2311, - 2317, 2323, 2329, 2335, 2341, 2347, 2353, 2359, 2365, 2371, - 2377, 2383, 2389, 2395, 2401, 2407, 2413, 2419, 2425, 2431, - 2437, 2443, 2449, 2455, 2461, 2467, 2473, 2479, 2485, 2491, - 2497, 2503, 2509, 2515, 2519, 2523, 2527, 2532, 2538, 2543, - 2548, 2553, 2558, 2563, 2568, 2574, 2579, 2584, 2589, 2594, - 2599, 2605, 2611, 2617, 2623, 2629, 2635, 2641, 2647, 2653, - 2659, 2665, 2671, 2677, 2683, 2688, 2693, 2698, 2703, 2708, - 2713, 2719, 2724, 2729, 2734, 2739, 2744, 2749, 2754, 2760, - 2765, 2770, 2775, 2780, 2785, 2790, 2795, 2800, 2805, 2810, - 2815, 2820, 2825, 2830, 2836, 2841, 2846, 2852, 2858, 2863, - 2868, 2873, 2879, 2884, 2889, 2894, 2900, 2905, 2910, 2915, - 2921, 2926, 2931, 2936, 2942, 2948, 2954, 2960, 2965, 2971, - 2977, 2983, 2988, 2993, 2998, 3003, 3008, 3014, 3019, 3024, - 3029, 3035, 3040, 3045, 3050, 3056, 3061, 3066, 3071, 3077, - 3082, 3087, 3092, 3098, 3103, 3108, 3113, 3119, 3124, 3129, - 3134, 3140, 3145, 3150, 3155, 3161, 3166, 3171, 3176, 3182, - 3187, 3192, 3197, 3203, 3208, 3213, 3218, 3224, 3229, 3234, - 3239, 3245, 3250, 3255, 3260, 3266, 3271, 3276, 3281, 3287, - 3292, 3297, 3302, 3308, 3313, 3318, 3323, 3328, 3333, 3338, - 3343, 3348, 3353, 3358, 3363, 3368, 3373, 3378, 3383, 3388, - 3393, 3398, 3403, 3408, 3413, 3418, 3423, 3428, 3434, 3440, - 3446, 3452, 3459, 3466, 3472, 3478, 3484, 3490, 3496, 3502, - 3508, 3513, 3518, 3534, 3539, 3544, 3552, 3552, 3563, 3563, - 3573, 3576, 3589, 3611, 3638, 3642, 3648, 3653, 3664, 3668, - 3674, 3680, 3691, 3694, 3701, 3705, 3706, 3712, 3713, 3714, - 3715, 3716, 3717, 3718, 3720, 3726, 3735, 3736, 3740, 3736, - 3752, 3753, 3757, 3757, 3764, 3764, 3778, 3781, 3789, 3797, - 3808, 3809, 3813, 3817, 3825, 3832, 3836, 3844, 3848, 3861, - 3865, 3873, 3873, 3893, 3896, 3902, 3914, 3926, 3930, 3938, - 3938, 3953, 3953, 3971, 3971, 3992, 3995, 4001, 4004, 4010, - 4014, 4021, 4026, 4031, 4038, 4041, 4045, 4050, 4054, 4064, - 4068, 4077, 4080, 4084, 4093, 4093, 4135, 4140, 4143, 4148, - 4151, 4158, 4161, 4166, 4169, 4174, 4177, 4182, 4185, 4190, - 4194, 4199, 4203, 4208, 4212, 4219, 4222, 4227, 4230, 4233, - 4236, 4239, 4244, 4253, 4264, 4269, 4277, 4281, 4286, 4290, - 4295, 4299, 4304, 4308, 4315, 4318, 4323, 4326, 4329, 4332, - 4337, 4345, 4355, 4359, 4364, 4368, 4373, 4377, 4384, 4387, - 4392, 4397, 4400, 4406, 4409, 4414, 4417 + 0, 393, 393, 399, 402, 407, 410, 413, 417, 421, + 424, 428, 432, 436, 440, 444, 448, 454, 462, 465, + 468, 471, 474, 479, 487, 494, 501, 507, 511, 518, + 521, 527, 534, 544, 552, 557, 585, 594, 600, 604, + 608, 628, 629, 630, 631, 637, 638, 643, 648, 657, + 658, 663, 671, 672, 678, 687, 688, 693, 698, 703, + 711, 712, 721, 733, 734, 743, 744, 753, 754, 763, + 764, 772, 773, 781, 782, 790, 791, 791, 809, 810, + 826, 830, 834, 838, 843, 847, 851, 855, 859, 863, + 867, 874, 877, 888, 895, 901, 908, 914, 919, 926, + 930, 934, 938, 943, 948, 957, 957, 968, 972, 979, + 983, 989, 995, 1005, 1008, 1015, 1023, 1043, 1066, 1081, + 1106, 1117, 1127, 1137, 1147, 1156, 1159, 1163, 1167, 1172, + 1180, 1187, 1192, 1197, 1202, 1211, 1221, 1248, 1257, 1264, + 1272, 1279, 1286, 1294, 1302, 1312, 1322, 1329, 1340, 1346, + 1349, 1356, 1360, 1364, 1373, 1383, 1386, 1397, 1400, 1403, + 1407, 1411, 1416, 1420, 1423, 1428, 1432, 1437, 1446, 1450, + 1455, 1461, 1467, 1474, 1479, 1487, 1493, 1505, 1519, 1525, + 1530, 1538, 1546, 1554, 1562, 1570, 1578, 1586, 1594, 1602, + 1609, 1616, 1620, 1625, 1630, 1635, 1640, 1645, 1650, 1654, + 1658, 1662, 1666, 1672, 1678, 1690, 1697, 1700, 1709, 1714, + 1724, 1729, 1737, 1741, 1751, 1754, 1760, 1766, 1773, 1783, + 1787, 1791, 1795, 1800, 1804, 1809, 1814, 1819, 1824, 1829, + 1834, 1839, 1844, 1849, 1855, 1861, 1867, 1872, 1877, 1882, + 1887, 1892, 1897, 1902, 1907, 1912, 1917, 1922, 1928, 1935, + 1940, 1945, 1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, + 1990, 1998, 2006, 2014, 2020, 2026, 2032, 2038, 2044, 2050, + 2056, 2062, 2068, 2074, 2080, 2086, 2092, 2098, 2104, 2110, + 2116, 2122, 2128, 2134, 2140, 2146, 2152, 2158, 2164, 2170, + 2176, 2182, 2188, 2194, 2200, 2206, 2212, 2220, 2228, 2236, + 2244, 2252, 2260, 2268, 2276, 2284, 2292, 2300, 2308, 2314, + 2320, 2326, 2332, 2338, 2344, 2350, 2356, 2362, 2368, 2374, + 2380, 2386, 2392, 2398, 2404, 2410, 2416, 2422, 2428, 2434, + 2440, 2446, 2452, 2458, 2464, 2470, 2476, 2482, 2488, 2494, + 2500, 2506, 2512, 2518, 2524, 2528, 2532, 2536, 2541, 2547, + 2552, 2557, 2562, 2567, 2572, 2577, 2583, 2588, 2593, 2598, + 2603, 2608, 2614, 2620, 2626, 2632, 2638, 2644, 2650, 2656, + 2662, 2668, 2674, 2680, 2686, 2692, 2697, 2702, 2707, 2712, + 2717, 2722, 2728, 2733, 2738, 2743, 2748, 2753, 2758, 2763, + 2769, 2774, 2779, 2784, 2789, 2794, 2799, 2804, 2809, 2814, + 2819, 2824, 2829, 2834, 2839, 2845, 2850, 2855, 2861, 2867, + 2872, 2877, 2882, 2888, 2893, 2898, 2903, 2909, 2914, 2919, + 2924, 2930, 2935, 2940, 2945, 2951, 2957, 2963, 2969, 2974, + 2980, 2986, 2992, 2997, 3002, 3007, 3012, 3017, 3023, 3028, + 3033, 3038, 3044, 3049, 3054, 3059, 3065, 3070, 3075, 3080, + 3086, 3091, 3096, 3101, 3107, 3112, 3117, 3122, 3128, 3133, + 3138, 3143, 3149, 3154, 3159, 3164, 3170, 3175, 3180, 3185, + 3191, 3196, 3201, 3206, 3212, 3217, 3222, 3227, 3233, 3238, + 3243, 3248, 3254, 3259, 3264, 3269, 3275, 3280, 3285, 3290, + 3296, 3301, 3306, 3311, 3317, 3322, 3327, 3332, 3337, 3342, + 3347, 3352, 3357, 3362, 3367, 3372, 3377, 3382, 3387, 3392, + 3397, 3402, 3407, 3412, 3417, 3422, 3427, 3432, 3437, 3443, + 3449, 3455, 3461, 3468, 3475, 3481, 3487, 3493, 3499, 3505, + 3511, 3517, 3521, 3526, 3531, 3547, 3552, 3557, 3565, 3565, + 3576, 3576, 3586, 3589, 3602, 3624, 3651, 3655, 3661, 3666, + 3677, 3681, 3687, 3693, 3704, 3707, 3714, 3718, 3719, 3725, + 3726, 3727, 3728, 3729, 3730, 3731, 3733, 3739, 3748, 3749, + 3753, 3749, 3765, 3766, 3770, 3770, 3777, 3777, 3791, 3794, + 3802, 3810, 3821, 3822, 3826, 3830, 3838, 3845, 3849, 3857, + 3861, 3874, 3878, 3886, 3886, 3906, 3909, 3915, 3927, 3939, + 3943, 3951, 3951, 3966, 3966, 3984, 3984, 4005, 4008, 4014, + 4017, 4023, 4027, 4034, 4039, 4044, 4051, 4054, 4058, 4063, + 4067, 4077, 4081, 4090, 4093, 4097, 4106, 4106, 4148, 4153, + 4156, 4161, 4164, 4171, 4174, 4179, 4182, 4187, 4190, 4195, + 4198, 4203, 4207, 4212, 4216, 4221, 4225, 4232, 4235, 4240, + 4243, 4246, 4249, 4252, 4257, 4266, 4277, 4282, 4290, 4294, + 4299, 4303, 4308, 4312, 4317, 4321, 4328, 4331, 4336, 4339, + 4342, 4345, 4350, 4358, 4368, 4372, 4377, 4381, 4386, 4390, + 4397, 4400, 4405, 4410, 4413, 4419, 4422, 4427, 4430 }; #endif @@ -1254,9 +1256,9 @@ static const char *const yytname[] = "F32MAT4X2", "F32MAT4X3", "F32MAT4X4", "F64MAT2X2", "F64MAT2X3", "F64MAT2X4", "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", "F64MAT4X2", "F64MAT4X3", "F64MAT4X4", "ATOMIC_UINT", "ACCSTRUCTNV", "ACCSTRUCTEXT", - "RAYQUERYEXT", "FCOOPMATNV", "ICOOPMATNV", "UCOOPMATNV", - "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", - "USAMPLERCUBEARRAY", "SAMPLER1D", "SAMPLER1DARRAY", + "RAYQUERYEXT", "FCOOPMATNV", "ICOOPMATNV", "UCOOPMATNV", "HITOBJECTNV", + "HITOBJECTATTRNV", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", + "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", "SAMPLER1D", "SAMPLER1DARRAY", "SAMPLER1DARRAYSHADOW", "ISAMPLER1D", "SAMPLER1DSHADOW", "SAMPLER2DRECT", "SAMPLER2DRECTSHADOW", "ISAMPLER2DRECT", "USAMPLER2DRECT", "SAMPLERBUFFER", "ISAMPLERBUFFER", "USAMPLERBUFFER", "SAMPLER2DMS", @@ -1434,16 +1436,16 @@ static const yytype_int16 yytoknum[] = 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712 + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714 }; #endif -#define YYPACT_NINF (-813) +#define YYPACT_NINF (-868) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-573) +#define YYTABLE_NINF (-575) #define yytable_value_is_error(Yyn) \ 0 @@ -1452,100 +1454,100 @@ static const yytype_int16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 4575, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -300, -272, -219, -123, -120, - -118, -105, -87, -813, -813, -317, -813, -813, -813, -813, - -813, -62, -813, -813, -813, -813, -813, -324, -813, -813, - -813, -813, -813, -813, -76, -64, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -319, -260, -133, -174, 7760, -191, -813, -166, -813, - -813, -813, -813, 5485, -813, -813, -813, -813, -61, -813, - -813, 935, -813, -813, 7760, -39, -813, -813, -813, 5940, - -50, -335, -267, -162, -152, -139, -50, -137, -46, 12111, - -813, -29, -339, -43, -813, -268, -813, -27, -6, 7760, - -813, -813, -813, 7760, -37, -36, -813, -298, -813, -237, - -813, -813, 10812, -5, -813, -813, -813, 1, -33, 7760, - -813, -4, -2, -3, -813, -236, -813, -227, -1, 3, - 4, 5, -225, 6, 10, 12, 13, 14, 17, -223, - 8, 18, 16, -304, -813, 21, 7760, -813, 19, -813, - -222, -813, -813, -207, 9080, -813, -247, 1390, -813, -813, - -813, -813, -813, -5, -270, -813, 9513, -250, -813, -22, - -813, -132, 10812, 10812, -813, 10812, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -265, -813, -813, -813, 25, - -204, 11245, 27, -813, 10812, -813, -813, -314, 30, -6, - 33, -813, -315, -50, -813, 15, -813, -325, 32, -130, - 10812, -129, -813, -146, -125, 10812, -124, 39, -119, -50, - -813, 11678, -813, -115, 10812, 36, -46, -813, 7760, 20, - 6395, -813, 7760, 10812, -813, -339, -813, 29, -813, -813, - -47, -83, -59, -288, -18, -17, 22, 26, 54, 59, - -309, 46, 9946, -813, 37, -813, -813, 50, 56, 58, - -813, 72, 74, 65, 10379, 76, 10812, 69, 68, 73, - 75, 77, -168, -813, -813, -82, -813, -260, 79, 82, - -813, -813, -813, -813, -813, 1845, -813, -813, -813, -813, - -813, -813, -813, -813, -813, 5030, 30, 9513, -241, 8214, - -813, -813, 9513, 7760, -813, 52, -813, -813, -813, -202, - -813, -813, 10812, 55, -813, -813, 10812, 85, -813, -813, - -813, 10812, -813, -813, -813, -310, -813, -813, -197, 81, - -813, -813, -813, -813, -813, -813, -195, -813, -194, -813, - -813, -190, 87, -813, -813, -813, -813, -169, -813, -167, - -813, -165, 89, -813, -158, 90, -157, 81, -813, -156, - -813, 91, 97, -813, -813, 20, -5, -77, -813, -813, - -813, 6850, -813, -813, -813, 10812, 10812, 10812, 10812, 10812, - 10812, 10812, 10812, 10812, 10812, 10812, 10812, 10812, 10812, 10812, - 10812, 10812, 10812, 10812, -813, -813, -813, 96, -813, 2300, - -813, -813, -813, 2300, -813, 10812, -813, -813, -49, 10812, - -26, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, 10812, 10812, -813, - -813, -813, -813, -813, -813, -813, 9513, -813, -813, -31, - -813, 7305, -813, -813, 98, 95, -813, -813, -813, -813, - -813, -172, -134, -813, -307, -813, -325, -813, -325, -813, - 10812, 10812, -813, -146, -813, -146, -813, 10812, 10812, -813, - 104, 39, -813, 11678, -813, 10812, -813, -813, -48, 30, - 20, -813, -813, -813, -813, -813, -47, -47, -83, -83, - -59, -59, -59, -59, -288, -288, -18, -17, 22, 26, - 54, 59, 10812, -813, 2300, 4120, 60, 3665, -155, -813, - -154, -813, -813, -813, -813, -813, 8647, -813, -813, -813, - 106, -813, -15, -813, -147, -813, -145, -813, -144, -813, - -143, -813, -142, -140, -813, -813, -813, -24, 101, 95, - 71, 107, 110, -813, -813, 4120, 109, -813, -813, -813, - -813, -813, -813, -813, -813, -813, -813, -813, 10812, -813, - 102, 2755, 10812, -813, 105, 113, 70, 112, 3210, -813, - 115, -813, 9513, -813, -813, -813, -135, 10812, 2755, 109, - -813, -813, 2300, -813, 111, 95, -813, -813, 2300, 117, - -813, -813 + 4593, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -296, -250, -233, + -225, -220, -203, -180, -178, -868, -868, -125, -868, -868, + -868, -868, -868, -60, -868, -868, -868, -868, -868, -329, + -868, -868, -868, -868, -868, -868, -156, -116, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -331, -313, -109, -94, 7792, -309, -868, + -106, -868, -868, -868, -868, 5507, -868, -868, -868, -868, + -98, -868, -868, 937, -868, -868, 7792, -124, -868, -868, + -868, 5964, -74, -288, -234, -154, -138, -137, -74, -127, + -68, 12163, -868, -32, -345, -61, -868, -307, -868, -17, + -13, 7792, -868, -868, -868, 7792, -57, -38, -868, -262, + -868, -223, -868, -868, 10858, -3, -868, -868, -868, 1, + -36, 7792, -868, -9, -6, -2, -868, -268, -868, -239, + -5, 3, 4, 5, -231, 6, 10, 12, 13, 14, + 17, -219, 8, 18, 16, -291, -868, -4, 7792, -868, + 19, -868, -216, -868, -868, -184, 9118, -868, -302, 1394, + -868, -868, -868, -868, -868, -3, -260, -868, 9553, -258, + -868, -29, -868, -218, 10858, 10858, -868, 10858, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -245, -868, -868, + -868, 25, -169, 11293, 27, -868, 10858, -868, -868, -308, + 29, -13, 32, -868, -316, -74, -868, -28, -868, -303, + 36, -126, 10858, -122, -868, -144, -121, 10858, -115, 15, + -114, -74, -868, 11728, -868, -108, 10858, 31, -68, -868, + 7792, -18, 6421, -868, 7792, 10858, -868, -345, -868, 20, + -868, -868, -46, -196, -1, -305, -264, 21, 26, 22, + 53, 52, -314, 38, 9988, -868, 43, -868, -868, 49, + 41, 48, -868, 66, 68, 62, 10423, 73, 10858, 67, + 64, 69, 72, 75, -185, -868, -868, -78, -868, -313, + 76, 77, -868, -868, -868, -868, -868, 1851, -868, -868, + -868, -868, -868, -868, -868, -868, -868, 5050, 29, 9553, + -249, 8248, -868, -868, 9553, 7792, -868, 42, -868, -868, + -868, -168, -868, -868, 10858, 47, -868, -868, 10858, 85, + -868, -868, -868, 10858, -868, -868, -868, -311, -868, -868, + -167, 78, -868, -868, -868, -868, -868, -868, -165, -868, + -160, -868, -868, -158, 81, -868, -868, -868, -868, -155, + -868, -153, -868, -150, 83, -868, -148, 84, -146, 78, + -868, -145, -868, 91, 93, -868, -868, -18, -3, -51, + -868, -868, -868, 6878, -868, -868, -868, 10858, 10858, 10858, + 10858, 10858, 10858, 10858, 10858, 10858, 10858, 10858, 10858, 10858, + 10858, 10858, 10858, 10858, 10858, 10858, -868, -868, -868, 94, + -868, 2308, -868, -868, -868, 2308, -868, 10858, -868, -868, + -49, 10858, -25, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, 10858, + 10858, -868, -868, -868, -868, -868, -868, -868, 9553, -868, + -868, -71, -868, 7335, -868, -868, 95, 89, -868, -868, + -868, -868, -868, -244, -213, -868, -306, -868, -303, -868, + -303, -868, 10858, 10858, -868, -144, -868, -144, -868, 10858, + 10858, -868, 100, 15, -868, 11728, -868, 10858, -868, -868, + -47, 29, -18, -868, -868, -868, -868, -868, -46, -46, + -196, -196, -1, -1, -1, -1, -305, -305, -264, 21, + 26, 22, 53, 52, 10858, -868, 2308, 4136, 57, 3679, + -143, -868, -141, -868, -868, -868, -868, -868, 8683, -868, + -868, -868, 103, -868, 70, -868, -136, -868, -134, -868, + -133, -868, -132, -868, -131, -129, -868, -868, -868, -23, + 99, 89, 71, 104, 106, -868, -868, 4136, 107, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + 10858, -868, 105, 2765, 10858, -868, 98, 111, 65, 112, + 3222, -868, 113, -868, 9553, -868, -868, -868, -120, 10858, + 2765, 107, -868, -868, 2308, -868, 108, 89, -868, -868, + 2308, 110, -868, -868 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1553,138 +1555,138 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 0, 168, 222, 220, 221, 219, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 223, 224, 225, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 348, 349, 350, 351, 352, 353, 354, 374, 375, 376, - 377, 378, 379, 380, 389, 402, 403, 390, 391, 393, - 392, 394, 395, 396, 397, 398, 399, 400, 401, 176, - 177, 248, 249, 247, 250, 257, 258, 255, 256, 253, - 254, 251, 252, 280, 281, 282, 292, 293, 294, 277, - 278, 279, 289, 290, 291, 274, 275, 276, 286, 287, - 288, 271, 272, 273, 283, 284, 285, 259, 260, 261, - 295, 296, 297, 262, 263, 264, 307, 308, 309, 265, - 266, 267, 319, 320, 321, 268, 269, 270, 331, 332, - 333, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 334, 335, - 336, 337, 338, 339, 340, 341, 342, 346, 343, 344, - 345, 527, 528, 529, 358, 359, 382, 385, 347, 356, - 357, 373, 355, 404, 405, 408, 409, 410, 412, 413, - 414, 416, 417, 418, 420, 421, 517, 518, 381, 383, - 384, 360, 361, 362, 406, 363, 367, 368, 371, 411, - 415, 419, 364, 365, 369, 370, 407, 366, 372, 451, - 453, 454, 455, 457, 458, 459, 461, 462, 463, 465, - 466, 467, 469, 470, 471, 473, 474, 475, 477, 478, - 479, 481, 482, 483, 485, 486, 487, 489, 490, 491, - 493, 494, 452, 456, 460, 464, 468, 476, 480, 484, - 472, 488, 492, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 516, 386, 387, 388, 422, 431, - 433, 427, 432, 434, 435, 437, 438, 439, 441, 442, - 443, 445, 446, 447, 449, 450, 423, 424, 425, 436, - 426, 428, 429, 430, 440, 444, 448, 519, 520, 523, - 524, 525, 526, 521, 522, 0, 0, 0, 0, 0, - 0, 0, 0, 166, 167, 0, 623, 137, 533, 534, - 535, 0, 532, 172, 170, 171, 169, 0, 218, 173, - 174, 175, 139, 138, 0, 201, 182, 184, 180, 186, - 188, 183, 185, 181, 187, 189, 178, 179, 204, 190, - 197, 198, 199, 200, 191, 192, 193, 194, 195, 196, - 140, 141, 143, 142, 144, 146, 147, 145, 203, 154, - 622, 0, 624, 0, 114, 113, 0, 125, 130, 161, - 160, 158, 162, 0, 155, 157, 163, 135, 214, 159, - 531, 0, 619, 621, 0, 0, 164, 165, 530, 0, + 0, 168, 223, 221, 222, 220, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 224, 225, 226, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 349, 350, 351, 352, 353, 354, 355, 375, 376, 377, + 378, 379, 380, 381, 390, 403, 404, 391, 392, 394, + 393, 395, 396, 397, 398, 399, 400, 401, 402, 176, + 177, 249, 250, 248, 251, 258, 259, 256, 257, 254, + 255, 252, 253, 281, 282, 283, 293, 294, 295, 278, + 279, 280, 290, 291, 292, 275, 276, 277, 287, 288, + 289, 272, 273, 274, 284, 285, 286, 260, 261, 262, + 296, 297, 298, 263, 264, 265, 308, 309, 310, 266, + 267, 268, 320, 321, 322, 269, 270, 271, 332, 333, + 334, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 347, 344, 345, + 346, 528, 529, 530, 532, 181, 359, 360, 383, 386, + 348, 357, 358, 374, 356, 405, 406, 409, 410, 411, + 413, 414, 415, 417, 418, 419, 421, 422, 518, 519, + 382, 384, 385, 361, 362, 363, 407, 364, 368, 369, + 372, 412, 416, 420, 365, 366, 370, 371, 408, 367, + 373, 452, 454, 455, 456, 458, 459, 460, 462, 463, + 464, 466, 467, 468, 470, 471, 472, 474, 475, 476, + 478, 479, 480, 482, 483, 484, 486, 487, 488, 490, + 491, 492, 494, 495, 453, 457, 461, 465, 469, 477, + 481, 485, 473, 489, 493, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 387, 388, 389, + 423, 432, 434, 428, 433, 435, 436, 438, 439, 440, + 442, 443, 444, 446, 447, 448, 450, 451, 424, 425, + 426, 437, 427, 429, 430, 431, 441, 445, 449, 520, + 521, 524, 525, 526, 527, 522, 523, 0, 0, 0, + 0, 0, 0, 0, 0, 166, 167, 0, 625, 137, + 535, 536, 537, 0, 534, 172, 170, 171, 169, 0, + 219, 173, 174, 175, 139, 138, 0, 202, 183, 185, + 180, 187, 189, 184, 186, 182, 188, 190, 178, 179, + 205, 191, 198, 199, 200, 201, 192, 193, 194, 195, + 196, 197, 140, 141, 143, 142, 144, 146, 147, 145, + 204, 154, 624, 0, 626, 0, 114, 113, 0, 125, + 130, 161, 160, 158, 162, 0, 155, 157, 163, 135, + 215, 159, 533, 0, 621, 623, 0, 0, 164, 165, + 531, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 540, 0, 0, 0, 99, 0, 94, 0, + 109, 0, 121, 115, 123, 0, 124, 0, 97, 131, + 102, 0, 156, 136, 0, 208, 214, 1, 622, 0, + 0, 0, 96, 0, 0, 0, 633, 0, 685, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 538, 0, 0, 0, 99, 0, 94, 0, 109, 0, - 121, 115, 123, 0, 124, 0, 97, 131, 102, 0, - 156, 136, 0, 207, 213, 1, 620, 0, 0, 0, - 96, 0, 0, 0, 631, 0, 683, 0, 0, 0, + 0, 0, 0, 0, 631, 0, 629, 0, 0, 538, + 151, 153, 0, 149, 206, 0, 0, 100, 0, 0, + 627, 110, 116, 120, 122, 118, 126, 117, 0, 132, + 105, 0, 103, 0, 0, 0, 9, 0, 43, 42, + 44, 41, 5, 6, 7, 8, 2, 16, 14, 15, + 17, 10, 11, 12, 13, 3, 18, 37, 20, 25, + 26, 0, 0, 30, 0, 217, 0, 36, 34, 0, + 209, 111, 0, 95, 0, 0, 683, 0, 641, 0, + 0, 0, 0, 0, 658, 0, 0, 0, 0, 0, + 0, 0, 678, 0, 656, 0, 0, 0, 0, 98, + 0, 0, 0, 542, 0, 0, 148, 0, 203, 0, + 210, 45, 49, 52, 55, 60, 63, 65, 67, 69, + 71, 73, 75, 0, 0, 101, 569, 578, 582, 0, + 0, 0, 603, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 45, 78, 91, 0, 556, 0, + 163, 135, 559, 580, 558, 566, 557, 0, 560, 561, + 584, 562, 591, 563, 564, 599, 565, 0, 119, 0, + 127, 0, 550, 134, 0, 0, 107, 0, 104, 38, + 39, 0, 22, 23, 0, 0, 28, 27, 0, 219, + 31, 33, 40, 0, 216, 112, 687, 0, 688, 634, + 0, 0, 686, 653, 649, 650, 651, 652, 0, 647, + 0, 93, 654, 0, 0, 668, 669, 670, 671, 0, + 666, 0, 672, 0, 0, 674, 0, 0, 0, 2, + 682, 0, 680, 0, 0, 628, 630, 0, 548, 0, + 546, 541, 543, 0, 152, 150, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 629, 0, 627, 0, 0, 536, 151, 153, - 0, 149, 205, 0, 0, 100, 0, 0, 625, 110, - 116, 120, 122, 118, 126, 117, 0, 132, 105, 0, - 103, 0, 0, 0, 9, 0, 43, 42, 44, 41, - 5, 6, 7, 8, 2, 16, 14, 15, 17, 10, - 11, 12, 13, 3, 18, 37, 20, 25, 26, 0, - 0, 30, 0, 216, 0, 36, 34, 0, 208, 111, - 0, 95, 0, 0, 681, 0, 639, 0, 0, 0, - 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, - 676, 0, 654, 0, 0, 0, 0, 98, 0, 0, - 0, 540, 0, 0, 148, 0, 202, 0, 209, 45, - 49, 52, 55, 60, 63, 65, 67, 69, 71, 73, - 75, 0, 0, 101, 567, 576, 580, 0, 0, 0, - 601, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 45, 78, 91, 0, 554, 0, 163, 135, - 557, 578, 556, 564, 555, 0, 558, 559, 582, 560, - 589, 561, 562, 597, 563, 0, 119, 0, 127, 0, - 548, 134, 0, 0, 107, 0, 104, 38, 39, 0, - 22, 23, 0, 0, 28, 27, 0, 218, 31, 33, - 40, 0, 215, 112, 685, 0, 686, 632, 0, 0, - 684, 651, 647, 648, 649, 650, 0, 645, 0, 93, - 652, 0, 0, 666, 667, 668, 669, 0, 664, 0, - 670, 0, 0, 672, 0, 0, 0, 2, 680, 0, - 678, 0, 0, 626, 628, 0, 546, 0, 544, 539, - 541, 0, 152, 150, 206, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 76, 210, 211, 0, 566, 0, - 599, 612, 611, 0, 603, 0, 615, 613, 0, 0, - 0, 596, 616, 617, 618, 565, 81, 82, 84, 83, - 86, 87, 88, 89, 90, 85, 80, 0, 0, 581, - 577, 579, 583, 590, 598, 129, 0, 551, 552, 0, - 133, 0, 108, 4, 0, 24, 21, 32, 217, 635, - 637, 0, 0, 682, 0, 641, 0, 640, 0, 643, - 0, 0, 658, 0, 657, 0, 660, 0, 0, 662, - 0, 0, 677, 0, 674, 0, 655, 630, 0, 547, - 0, 542, 537, 46, 47, 48, 51, 50, 53, 54, - 58, 59, 56, 57, 61, 62, 64, 66, 68, 70, - 72, 74, 0, 212, 568, 0, 0, 0, 0, 614, - 0, 595, 79, 92, 128, 549, 0, 106, 19, 633, - 0, 634, 0, 646, 0, 653, 0, 665, 0, 671, - 0, 673, 0, 0, 679, 543, 545, 0, 0, 587, - 0, 0, 0, 606, 605, 608, 574, 591, 550, 553, - 636, 638, 642, 644, 659, 661, 663, 675, 0, 569, - 0, 0, 0, 607, 0, 0, 586, 0, 0, 584, - 0, 77, 0, 571, 600, 570, 0, 609, 0, 574, - 573, 575, 593, 588, 0, 610, 604, 585, 594, 0, - 602, 592 + 0, 0, 0, 0, 0, 0, 76, 211, 212, 0, + 568, 0, 601, 614, 613, 0, 605, 0, 617, 615, + 0, 0, 0, 598, 618, 619, 620, 567, 81, 82, + 84, 83, 86, 87, 88, 89, 90, 85, 80, 0, + 0, 583, 579, 581, 585, 592, 600, 129, 0, 553, + 554, 0, 133, 0, 108, 4, 0, 24, 21, 32, + 218, 637, 639, 0, 0, 684, 0, 643, 0, 642, + 0, 645, 0, 0, 660, 0, 659, 0, 662, 0, + 0, 664, 0, 0, 679, 0, 676, 0, 657, 632, + 0, 549, 0, 544, 539, 46, 47, 48, 51, 50, + 53, 54, 58, 59, 56, 57, 61, 62, 64, 66, + 68, 70, 72, 74, 0, 213, 570, 0, 0, 0, + 0, 616, 0, 597, 79, 92, 128, 551, 0, 106, + 19, 635, 0, 636, 0, 648, 0, 655, 0, 667, + 0, 673, 0, 675, 0, 0, 681, 545, 547, 0, + 0, 589, 0, 0, 0, 608, 607, 610, 576, 593, + 552, 555, 638, 640, 644, 646, 661, 663, 665, 677, + 0, 571, 0, 0, 0, 609, 0, 0, 588, 0, + 0, 586, 0, 77, 0, 573, 602, 572, 0, 611, + 0, 576, 575, 577, 595, 590, 0, 612, 606, 587, + 596, 0, 604, 594 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, - -813, -813, -429, -813, -381, -380, -483, -383, -262, -257, - -261, -258, -255, -259, -813, -479, -813, -492, -813, -495, - -536, 11, -813, -813, -813, 7, -388, -813, -813, 42, - 49, 47, -813, -813, -401, -813, -813, -813, -813, -96, - -813, -384, -371, -813, 9, -813, 0, -425, -813, -813, - -813, -813, 150, -813, -813, -813, -546, -553, -217, -338, - -607, -813, -364, -619, -812, -813, -421, -813, -813, -428, - -430, -813, -813, 64, -718, -355, -813, -141, -813, -390, - -813, -138, -813, -813, -813, -813, -136, -813, -813, -813, - -813, -813, -813, -813, -813, 92, -813, -813, 2, -813, - -68, -275, -456, -813, -813, -813, -296, -293, -301, -813, - -813, -299, -295, -303, -302, -813, -306, -311, -813, -392, - -530 + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -429, -868, -378, -377, -471, -381, -259, -261, + -257, -256, -255, -263, -868, -478, -868, -492, -868, -503, + -535, 11, -868, -868, -868, 7, -392, -868, -868, 39, + 45, 46, -868, -868, -401, -868, -868, -868, -868, -104, + -868, -386, -374, -868, 9, -868, 0, -426, -868, -868, + -868, -868, 147, -868, -868, -868, -551, -569, -224, -340, + -606, -868, -365, -615, -867, -868, -424, -868, -868, -432, + -431, -868, -868, 63, -723, -358, -868, -142, -868, -394, + -868, -140, -868, -868, -868, -868, -135, -868, -868, -868, + -868, -868, -868, -868, -868, 96, -868, -868, 2, -868, + -72, -237, -436, -868, -868, -868, -300, -304, -299, -868, + -868, -301, -298, -297, -310, -868, -295, -312, -868, -391, + -531 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 523, 524, 525, 784, 526, 527, 528, 529, 530, - 531, 532, 612, 534, 580, 581, 582, 583, 584, 585, - 586, 587, 588, 589, 590, 613, 842, 614, 767, 615, - 698, 616, 381, 643, 501, 617, 383, 384, 385, 430, - 431, 432, 386, 387, 388, 389, 390, 391, 480, 481, - 392, 393, 394, 395, 535, 483, 536, 486, 443, 444, - 537, 398, 399, 400, 572, 476, 570, 571, 707, 708, - 641, 779, 620, 621, 622, 623, 624, 739, 878, 914, - 906, 907, 908, 915, 625, 626, 627, 628, 909, 881, - 629, 630, 910, 929, 631, 632, 633, 845, 743, 847, - 885, 904, 905, 634, 401, 402, 403, 427, 635, 473, - 474, 453, 454, 791, 792, 405, 676, 677, 681, 406, - 407, 687, 688, 691, 694, 408, 699, 700, 409, 455, - 456 + -1, 525, 526, 527, 786, 528, 529, 530, 531, 532, + 533, 534, 614, 536, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 615, 844, 616, 769, 617, + 700, 618, 383, 645, 503, 619, 385, 386, 387, 432, + 433, 434, 388, 389, 390, 391, 392, 393, 482, 483, + 394, 395, 396, 397, 537, 485, 538, 488, 445, 446, + 539, 400, 401, 402, 574, 478, 572, 573, 709, 710, + 643, 781, 622, 623, 624, 625, 626, 741, 880, 916, + 908, 909, 910, 917, 627, 628, 629, 630, 911, 883, + 631, 632, 912, 931, 633, 634, 635, 847, 745, 849, + 887, 906, 907, 636, 403, 404, 405, 429, 637, 475, + 476, 455, 456, 793, 794, 407, 678, 679, 683, 408, + 409, 689, 690, 693, 696, 410, 701, 702, 411, 457, + 458 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1692,877 +1694,106 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 397, 433, 404, 448, 640, 591, 771, 382, 448, 396, - 649, 380, 497, 533, 680, 670, 447, 710, 538, 690, - 449, 844, 440, 671, 469, 449, 711, 733, 702, 420, - 775, 670, 778, 664, 418, 780, 665, 712, 789, 658, - 424, 664, 661, 722, 723, 433, 478, 457, 565, 410, - 458, 495, 566, 484, 662, 579, 672, 673, 674, 675, - 496, 421, 440, 734, 650, 651, 425, 666, 636, 638, - 479, 679, 790, 647, 648, 666, 679, 411, 440, 724, - 725, 484, 679, 484, -35, 679, 652, 667, 637, 913, - 653, 485, 568, 667, 679, 667, 921, 781, 667, 426, - 667, 592, 667, 667, 592, 660, 913, 667, 642, 748, - 592, 750, 593, 737, 544, 460, 498, 776, 458, 499, - 545, 579, 500, 546, 846, 552, 579, 560, 574, 547, - 412, 553, 579, 561, 575, 579, 459, 461, 463, 465, - 467, 468, 471, 576, 579, 640, 655, 640, 783, 577, - 640, 668, 656, 793, 768, 795, 797, 785, 710, 545, - 799, 796, 798, 579, 787, 435, 800, 696, 436, 854, - 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, - 859, 802, 429, 804, 860, 806, 568, 803, 568, 805, - 766, 807, 809, 812, 814, 886, 887, 440, 810, 813, - 815, 768, 768, 892, 928, 893, 894, 895, 896, 796, - 897, 800, 803, 807, 810, 924, 815, 428, 861, 437, - 462, 768, 862, 458, 645, 771, 413, 646, 710, 414, - 464, 415, 788, 458, 448, 683, 684, 685, 686, 830, - 831, 832, 833, 466, 416, 470, 458, 447, 458, 889, - 848, 449, 678, 682, 850, 458, 458, 689, 692, 568, - 458, 458, 417, 695, 865, 680, 458, 701, 720, 721, - 458, 869, 690, 422, 768, 852, 853, 769, 718, 820, - 719, 819, 821, 670, 640, 423, 823, 824, 825, 579, - 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, - 579, 579, 579, 579, 579, 923, 442, 768, 820, 771, - 849, 875, 328, 329, 330, 726, 727, 715, 716, 717, - 450, 679, 679, 855, 477, 856, 487, 568, 679, 679, - 768, 851, 768, 898, 679, 452, 679, 826, 827, 472, - 828, 829, 482, 834, 835, 325, 484, 877, 493, 494, - 879, 539, 540, 543, 728, 541, 542, 548, 562, 549, - 550, 551, 554, 644, 640, 564, 555, 891, 556, 557, - 558, 579, 579, 559, 563, 654, 659, 573, 579, 579, - 567, 592, 495, 665, 579, 434, 579, 693, 703, 731, - 879, 738, 729, 441, 396, 730, 732, 568, 735, 740, - 669, 397, 396, 404, 397, 706, 911, 916, 382, 397, - 396, 404, 380, 396, 714, 741, 451, 742, 396, 475, - 640, 744, 925, 745, 746, 749, 751, 752, -36, 434, - 489, -34, 753, 434, 754, -29, 755, 782, 396, 794, - 786, 816, 396, 801, 880, 808, 811, 817, 843, 441, - 858, 768, 871, 882, 890, 899, 900, 901, 396, 902, - 912, 449, -572, 918, 917, 594, 836, 919, 922, 838, - 930, 931, 837, 839, 841, 491, 569, 840, 490, 713, - 492, 419, 876, 883, 880, 396, 920, 619, 818, 927, - 926, 488, 884, 446, 772, 903, 618, 773, 704, 774, - 866, 449, 864, 863, 874, 870, 868, 873, 867, 872, + 399, 435, 406, 712, 651, 450, 642, 384, 593, 398, + 450, 382, 773, 499, 449, 535, 672, 682, 846, 540, + 451, 442, 692, 713, 735, 451, 422, 471, 724, 725, + 426, 704, 672, 777, 666, 780, 915, 667, 782, 791, + 714, 660, 480, 923, 666, 435, 486, 673, 428, 437, + 663, 594, 438, 915, 487, 412, 427, 581, 423, 595, + 736, 442, 664, 567, 726, 727, 481, 568, 668, 638, + 640, 728, 729, 792, 681, 649, 650, 442, 668, 681, + 674, 675, 676, 677, 546, 681, 652, 653, 681, 497, + 547, 486, 570, 486, 783, 594, 459, 681, 498, 460, + 639, 413, 644, 750, 594, 752, -35, 662, 654, 669, + 861, 778, 655, 548, 862, 669, 739, 669, 414, 549, + 669, 554, 669, 581, 669, 669, 415, 555, 581, 669, + 848, 416, 500, 562, 581, 501, 576, 581, 502, 563, + 647, 863, 577, 648, 712, 864, 581, 642, 417, 642, + 462, 787, 642, 460, 670, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 581, 789, 720, 578, 721, + 698, 418, 856, 419, 579, 768, 461, 463, 465, 467, + 469, 470, 473, 657, 785, 795, 570, 797, 570, 658, + 770, 547, 799, 798, 801, 424, 442, 804, 800, 806, + 802, 930, 808, 805, 811, 807, 814, 816, 809, 888, + 812, 889, 815, 817, 712, 770, 894, 770, 895, 896, + 897, 898, 798, 899, 802, 805, 809, 812, 420, 817, + 464, 773, 926, 460, 790, 425, 450, 452, 770, 685, + 686, 687, 688, 430, 850, 449, 466, 468, 852, 460, + 460, 451, 891, 832, 833, 834, 835, 472, 680, 570, + 460, 460, 684, 691, 431, 460, 460, 867, 682, 694, + 697, 444, 460, 460, 871, 692, 703, 854, 855, 460, + 770, 439, 821, 771, 672, 857, 642, 858, 825, 826, + 827, 581, 581, 581, 581, 581, 581, 581, 581, 581, + 581, 581, 581, 581, 581, 581, 581, 822, 925, 770, + 823, 822, 851, 454, 877, 773, 330, 331, 332, 474, + 717, 718, 719, 479, 681, 681, 484, 570, 722, 723, + 495, 681, 681, 770, 853, 770, 900, 681, 489, 681, + 327, 879, 828, 829, 881, 830, 831, 836, 837, 496, + 486, 542, 543, 541, 544, 550, 545, 569, 646, 671, + 564, 551, 552, 553, 556, 695, 642, 566, 557, 708, + 558, 559, 560, 581, 581, 561, 565, 656, 661, 575, + 581, 581, 594, 497, 881, 705, 581, 436, 581, 667, + 733, 734, 737, 732, 730, 443, 398, 570, 731, 740, + 742, 918, 743, 399, 398, 406, 399, 716, 913, 744, + 384, 399, 398, 406, 382, 398, 927, 746, 453, 747, + 398, 477, 642, 748, 751, 754, 753, -36, -34, 784, + 755, 436, 491, 756, 788, 436, 757, -29, 796, 803, + 398, 810, 813, 818, 398, 819, 882, 770, 845, 860, + 873, 443, 884, 892, 893, 901, 903, 904, 902, 919, + 398, 451, -574, 920, 921, 914, 933, 596, 924, 932, + 839, 838, 843, 715, 493, 840, 492, 841, 571, 842, + 421, 494, 878, 820, 885, 922, 882, 398, 928, 621, + 929, 886, 490, 905, 865, 774, 706, 775, 620, 448, + 866, 451, 776, 874, 868, 876, 870, 869, 0, 0, + 0, 0, 0, 872, 0, 0, 0, 0, 0, 0, + 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 665, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 707, 0, 571, 0, 571, 0, 0, 0, 0, 398, + 0, 398, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 663, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 705, 0, - 569, 0, 569, 0, 0, 0, 0, 396, 0, 396, - 0, 396, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 619, 0, 0, 0, 0, - 0, 0, 0, 0, 618, 397, 0, 0, 0, 0, - 0, 0, 0, 569, 396, 0, 0, 0, 0, 0, - 0, 0, 396, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 621, 0, 0, + 0, 0, 0, 0, 0, 0, 620, 399, 0, 0, + 0, 0, 0, 0, 0, 571, 398, 0, 0, 0, + 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 569, 0, 0, 0, 0, 0, 0, 0, 0, - 396, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 619, - 0, 0, 0, 619, 0, 0, 0, 0, 618, 0, - 0, 0, 618, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, + 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 621, 0, 0, 0, 621, 0, 0, 0, 0, + 620, 0, 0, 0, 620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 569, 0, 0, 0, 0, 0, 0, 0, 0, - 396, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, + 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 619, 619, 0, 619, 0, 404, - 0, 0, 0, 618, 618, 0, 618, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 621, 621, 0, 621, + 0, 406, 0, 0, 0, 620, 620, 0, 620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 619, 0, 0, 0, 0, - 0, 0, 0, 0, 618, 0, 0, 0, 0, 0, - 0, 619, 0, 0, 0, 0, 0, 0, 619, 0, - 618, 0, 0, 0, 0, 0, 0, 618, 619, 0, - 0, 0, 619, 0, 0, 0, 0, 618, 619, 0, - 0, 618, 0, 0, 0, 445, 0, 618, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, - 0, 0, 0, 0, 326, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 331, 0, 0, 0, 0, 0, 0, 0, - 0, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 0, - 0, 0, 0, 0, 0, 0, 0, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 502, - 503, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 504, 505, - 0, 325, 0, 594, 595, 0, 0, 0, 0, 596, - 506, 507, 508, 509, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 331, 0, 0, - 0, 510, 511, 512, 513, 514, 332, 333, 334, 335, - 336, 337, 338, 597, 598, 599, 600, 0, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, 339, 340, - 341, 342, 343, 344, 515, 516, 517, 518, 519, 520, - 521, 522, 345, 611, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 502, 503, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 504, 505, 0, 325, 0, 594, 770, - 0, 0, 0, 0, 596, 506, 507, 508, 509, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 331, 0, 0, 0, 510, 511, 512, 513, - 514, 332, 333, 334, 335, 336, 337, 338, 597, 598, - 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 339, 340, 341, 342, 343, 344, 515, - 516, 517, 518, 519, 520, 521, 522, 345, 611, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 502, - 503, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 504, 505, - 0, 325, 0, 594, 0, 0, 0, 0, 0, 596, - 506, 507, 508, 509, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 331, 0, 0, - 0, 510, 511, 512, 513, 514, 332, 333, 334, 335, - 336, 337, 338, 597, 598, 599, 600, 0, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, 339, 340, - 341, 342, 343, 344, 515, 516, 517, 518, 519, 520, - 521, 522, 345, 611, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 502, 503, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 504, 505, 0, 325, 0, 487, 0, - 0, 0, 0, 0, 596, 506, 507, 508, 509, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 331, 0, 0, 0, 510, 511, 512, 513, - 514, 332, 333, 334, 335, 336, 337, 338, 597, 598, - 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 339, 340, 341, 342, 343, 344, 515, - 516, 517, 518, 519, 520, 521, 522, 345, 611, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 502, - 503, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 504, 505, - 0, 325, 0, 0, 0, 0, 0, 0, 0, 596, - 506, 507, 508, 509, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 331, 0, 0, - 0, 510, 511, 512, 513, 514, 332, 333, 334, 335, - 336, 337, 338, 597, 598, 599, 600, 0, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, 339, 340, - 341, 342, 343, 344, 515, 516, 517, 518, 519, 520, - 521, 522, 345, 611, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 502, 503, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 504, 505, 0, 325, 0, 0, 0, - 0, 0, 0, 0, 596, 506, 507, 508, 509, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 331, 0, 0, 0, 510, 511, 512, 513, - 514, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 515, - 516, 517, 518, 519, 520, 521, 522, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 502, - 503, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 504, 505, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 506, 507, 508, 509, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 0, 0, 0, - 0, 510, 511, 512, 513, 514, 332, 333, 334, 335, - 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 339, 340, - 341, 342, 343, 344, 515, 516, 517, 518, 519, 520, - 521, 522, 345, 0, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, - 0, 0, 0, 0, 326, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 331, 0, 0, 0, 0, 0, 0, 0, - 0, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 0, - 0, 0, 0, 0, 0, 0, 0, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, - 336, 337, 338, 597, 0, 0, 600, 0, 601, 602, - 0, 0, 605, 0, 0, 0, 0, 0, 339, 340, - 341, 342, 343, 344, 0, 0, 0, 0, 0, 0, - 0, 0, 345, 0, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 0, 0, 0, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 438, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 0, 0, 0, 0, 0, 0, 0, 0, - 439, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 0, - 0, 0, 0, 0, 0, 0, 0, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, - 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 339, 340, - 341, 342, 343, 344, 0, 0, 0, 0, 0, 0, - 0, 0, 345, 0, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 0, 0, 0, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 709, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 0, - 0, 0, 0, 0, 0, 0, 0, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 822, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, - 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 339, 340, - 341, 342, 343, 344, 0, 0, 0, 0, 0, 0, - 0, 0, 345, 0, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 0, 0, 0, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 857, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 0, - 0, 0, 0, 0, 0, 0, 0, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, - 318, 319, 320, 321, 322, 323, 324, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 327, 328, 329, 330, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, - 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 339, 340, - 341, 342, 343, 344, 0, 0, 0, 0, 0, 0, - 0, 0, 345, 0, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 0, 0, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 0, 0, 0, 0, 0, 0, 321, 0, 0, - 0, 0, 0, 502, 503, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 504, 505, 0, 0, 0, 639, 777, 0, - 0, 0, 0, 0, 506, 507, 508, 509, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 510, 511, 512, 513, 514, - 332, 0, 0, 0, 0, 337, 338, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 515, 516, - 517, 518, 519, 520, 521, 522, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 358, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 0, 0, 0, 0, 0, 0, 0, 621, 0, 0, + 0, 0, 0, 0, 0, 0, 620, 0, 0, 0, + 0, 0, 0, 621, 0, 0, 0, 0, 0, 0, + 621, 0, 620, 0, 0, 0, 0, 0, 0, 620, + 621, 0, 0, 0, 621, 0, 0, 0, 0, 620, + 621, 0, 0, 620, 0, 0, 0, 447, 0, 620, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 0, 0, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, @@ -2588,1366 +1819,27 @@ static const yytype_int16 yytable[] = 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 0, 0, 0, 0, 0, 0, - 321, 0, 0, 0, 0, 0, 502, 503, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 504, 505, 0, 0, 0, - 639, 888, 0, 0, 0, 0, 0, 506, 507, 508, - 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 510, 511, - 512, 513, 514, 332, 0, 0, 0, 0, 337, 338, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 515, 516, 517, 518, 519, 520, 521, 522, 0, + 327, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 358, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 0, 0, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, - 0, 0, 0, 321, 0, 0, 0, 0, 0, 502, - 503, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 504, 505, - 0, 0, 578, 0, 0, 0, 0, 0, 0, 0, - 506, 507, 508, 509, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 510, 511, 512, 513, 514, 332, 0, 0, 0, - 0, 337, 338, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 515, 516, 517, 518, 519, 520, - 521, 522, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 358, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, - 0, 0, 502, 503, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 504, 505, 0, 0, 0, 639, 0, 0, 0, - 0, 0, 0, 506, 507, 508, 509, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 510, 511, 512, 513, 514, 332, - 0, 0, 0, 0, 337, 338, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 515, 516, 517, - 518, 519, 520, 521, 522, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 358, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 0, 0, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 0, 0, 0, 0, 0, 0, 321, - 0, 0, 0, 0, 0, 502, 503, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 736, 0, - 0, 0, 0, 0, 0, 0, 506, 507, 508, 509, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 510, 511, 512, - 513, 514, 332, 0, 0, 0, 0, 337, 338, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 515, 516, 517, 518, 519, 520, 521, 522, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 358, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 0, 0, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 0, 0, 0, 0, - 0, 0, 321, 0, 0, 0, 0, 0, 502, 503, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 504, 505, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 747, 506, - 507, 508, 509, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 510, 511, 512, 513, 514, 332, 0, 0, 0, 0, - 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 515, 516, 517, 518, 519, 520, 521, - 522, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 358, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 0, 0, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 0, - 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, - 0, 502, 503, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 506, 507, 508, 509, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 510, 511, 512, 513, 514, 332, 0, - 0, 0, 0, 337, 338, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 515, 516, 517, 518, - 519, 520, 521, 522, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 358, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 0, 0, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 0, 0, 0, 0, 0, 0, 321, 0, - 0, 0, 0, 0, 502, 503, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 504, 505, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 506, 507, 508, 509, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 510, 511, 512, 513, - 514, 332, 0, 0, 0, 0, 337, 657, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 515, - 516, 517, 518, 519, 520, 521, 522, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 358, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 0, 0, 0, 0, 0, - 0, 321, 0, 0, 0, 0, 0, 502, 503, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 504, 505, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 508, 509, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 510, - 511, 512, 513, 697, 332, 0, 0, 0, 0, 337, - 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 515, 516, 517, 518, 519, 520, 521, 522, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 358, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 0, 0, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 0, 0, - 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 332, 0, 0, - 0, 0, 337, 338 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 385, 0, 404, 496, 484, 625, 0, 409, 0, - 505, 0, 437, 442, 550, 545, 404, 570, 443, 555, - 404, 739, 393, 348, 416, 409, 572, 336, 564, 353, - 637, 561, 639, 348, 351, 642, 351, 573, 348, 531, - 359, 348, 356, 331, 332, 429, 385, 382, 352, 349, - 385, 349, 356, 351, 368, 484, 381, 382, 383, 384, - 358, 385, 433, 372, 329, 330, 385, 382, 493, 494, - 409, 550, 382, 502, 503, 382, 555, 349, 449, 367, - 368, 351, 561, 351, 349, 564, 351, 543, 358, 901, - 355, 359, 476, 549, 573, 551, 908, 643, 554, 359, - 556, 351, 558, 559, 351, 534, 918, 563, 358, 604, - 351, 606, 359, 592, 350, 382, 353, 358, 385, 356, - 356, 550, 359, 350, 743, 350, 555, 350, 350, 356, - 349, 356, 561, 356, 356, 564, 411, 412, 413, 414, - 415, 416, 417, 350, 573, 637, 350, 639, 350, 356, - 642, 543, 356, 350, 356, 350, 350, 652, 711, 356, - 350, 356, 356, 592, 656, 356, 356, 559, 359, 776, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 352, 350, 356, 350, 356, 350, 570, 356, 572, 356, - 358, 356, 350, 350, 350, 350, 350, 568, 356, 356, - 356, 356, 356, 350, 922, 350, 350, 350, 350, 356, - 350, 356, 356, 356, 356, 350, 356, 350, 352, 385, - 382, 356, 356, 385, 356, 844, 349, 359, 781, 349, - 382, 349, 661, 385, 635, 381, 382, 383, 384, 722, - 723, 724, 725, 382, 349, 382, 385, 635, 385, 856, - 745, 635, 382, 382, 749, 385, 385, 382, 382, 643, - 385, 385, 349, 382, 800, 801, 385, 382, 327, 328, - 385, 807, 808, 349, 356, 767, 768, 359, 361, 356, - 363, 706, 359, 813, 776, 349, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 912, 367, 356, 356, 928, - 359, 359, 374, 375, 376, 333, 334, 364, 365, 366, - 359, 800, 801, 354, 353, 356, 353, 711, 807, 808, - 356, 357, 356, 357, 813, 385, 815, 718, 719, 385, - 720, 721, 385, 726, 727, 351, 351, 842, 385, 385, - 845, 350, 385, 356, 371, 359, 358, 358, 350, 356, - 356, 356, 356, 385, 856, 349, 356, 382, 356, 356, - 356, 800, 801, 356, 356, 350, 349, 358, 807, 808, - 359, 351, 349, 351, 813, 385, 815, 348, 352, 335, - 885, 354, 370, 393, 385, 369, 337, 781, 352, 349, - 385, 401, 393, 401, 404, 385, 898, 902, 401, 409, - 401, 409, 401, 404, 385, 359, 409, 359, 409, 419, - 912, 349, 917, 349, 359, 349, 357, 359, 349, 429, - 428, 349, 359, 433, 359, 350, 359, 385, 429, 358, - 385, 350, 433, 356, 845, 356, 356, 350, 352, 449, - 352, 356, 348, 393, 348, 354, 385, 350, 449, 349, - 358, 845, 353, 350, 359, 353, 728, 397, 353, 730, - 359, 354, 729, 731, 733, 433, 476, 732, 429, 575, - 433, 331, 820, 847, 885, 476, 907, 487, 705, 919, - 918, 427, 847, 401, 635, 885, 487, 635, 566, 635, - 801, 885, 798, 796, 815, 808, 805, 813, 803, 811, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 539, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 568, -1, - 570, -1, 572, -1, -1, -1, -1, 568, -1, 570, - -1, 572, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 625, -1, -1, -1, -1, - -1, -1, -1, -1, 625, 635, -1, -1, -1, -1, - -1, -1, -1, 643, 635, -1, -1, -1, -1, -1, - -1, -1, 643, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 711, -1, -1, -1, -1, -1, -1, -1, -1, - 711, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 739, - -1, -1, -1, 743, -1, -1, -1, -1, 739, -1, - -1, -1, 743, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 781, -1, -1, -1, -1, -1, -1, -1, -1, - 781, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 844, 845, -1, 847, -1, 847, - -1, -1, -1, 844, 845, -1, 847, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 885, -1, -1, -1, -1, - -1, -1, -1, -1, 885, -1, -1, -1, -1, -1, - -1, 901, -1, -1, -1, -1, -1, -1, 908, -1, - 901, -1, -1, -1, -1, -1, -1, 908, 918, -1, - -1, -1, 922, -1, -1, -1, -1, 918, 928, -1, - -1, 922, -1, -1, -1, 0, -1, 928, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, - -1, -1, -1, -1, 359, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, 377, -1, -1, -1, -1, -1, -1, -1, - -1, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, -1, -1, -1, -1, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, -1, -1, 329, - 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, - -1, 351, -1, 353, 354, -1, -1, -1, -1, 359, - 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, 377, -1, -1, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 348, 349, -1, 351, -1, 353, 354, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, 377, -1, -1, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, -1, -1, 329, - 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, - -1, 351, -1, 353, -1, -1, -1, -1, -1, 359, - 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, 377, -1, -1, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 348, 349, -1, 351, -1, 353, -1, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, 377, -1, -1, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, -1, -1, 329, - 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, - -1, 351, -1, -1, -1, -1, -1, -1, -1, 359, - 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, 377, -1, -1, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 348, 349, -1, 351, -1, -1, -1, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, 377, -1, -1, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, - 320, 321, 322, 323, 324, 325, 326, -1, -1, 329, - 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, -1, -1, -1, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, -1, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, - -1, -1, -1, -1, 359, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, 377, -1, -1, -1, -1, -1, -1, -1, - -1, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, -1, -1, -1, -1, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, - 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 386, 387, 388, 389, - 390, 391, 392, 393, -1, -1, 396, -1, 398, 399, - -1, -1, 402, -1, -1, -1, -1, -1, 408, 409, - 410, 411, 412, 413, -1, -1, -1, -1, -1, -1, - -1, -1, 422, -1, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, -1, -1, -1, 320, 321, 322, 323, 324, - 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 359, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, - 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, -1, -1, -1, -1, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, - 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 351, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 386, 387, 388, 389, - 390, 391, 392, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 408, 409, - 410, 411, 412, 413, -1, -1, -1, -1, -1, -1, - -1, -1, 422, -1, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, -1, -1, -1, 320, 321, 322, 323, 324, - 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 354, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, -1, -1, -1, -1, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, - 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 354, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 386, 387, 388, 389, - 390, 391, 392, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 408, 409, - 410, 411, 412, 413, -1, -1, -1, -1, -1, -1, - -1, -1, 422, -1, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, -1, -1, -1, 320, 321, 322, 323, 324, - 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 354, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, -1, -1, -1, -1, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, - 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, 374, 375, 376, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 386, 387, 388, 389, - 390, 391, 392, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 408, 409, - 410, 411, 412, 413, -1, -1, -1, -1, -1, -1, - -1, -1, 422, -1, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, -1, -1, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, -1, -1, -1, -1, -1, -1, 323, -1, -1, - -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 348, 349, -1, -1, -1, 353, 354, -1, - -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, - 386, -1, -1, -1, -1, 391, 392, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 414, 415, - 416, 417, 418, 419, 420, 421, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 436, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, -1, -1, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, -1, -1, -1, -1, -1, -1, - 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 348, 349, -1, -1, -1, - 353, 354, -1, -1, -1, -1, -1, 360, 361, 362, - 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, - 383, 384, 385, 386, -1, -1, -1, -1, 391, 392, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 414, 415, 416, 417, 418, 419, 420, 421, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 436, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, -1, -1, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, - -1, -1, -1, 323, -1, -1, -1, -1, -1, 329, - 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, - -1, -1, 352, -1, -1, -1, -1, -1, -1, -1, - 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 381, 382, 383, 384, 385, 386, -1, -1, -1, - -1, 391, 392, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 414, 415, 416, 417, 418, 419, - 420, 421, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 436, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, - -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 348, 349, -1, -1, -1, 353, -1, -1, -1, - -1, -1, -1, 360, 361, 362, 363, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 381, 382, 383, 384, 385, 386, - -1, -1, -1, -1, 391, 392, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 414, 415, 416, - 417, 418, 419, 420, 421, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 436, + 0, 0, 329, 330, 331, 332, 333, 0, 0, 0, + 0, 0, 0, 0, 0, 334, 335, 336, 337, 338, + 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, + 344, 345, 346, 0, 0, 0, 0, 0, 0, 0, + 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, -1, -1, 63, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, @@ -3973,111 +1865,301 @@ static const yytype_int16 yycheck[] = 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, -1, -1, -1, -1, -1, -1, 323, - -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 348, 349, -1, -1, 352, -1, - -1, -1, -1, -1, -1, -1, 360, 361, 362, 363, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, - 384, 385, 386, -1, -1, -1, -1, 391, 392, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 414, 415, 416, 417, 418, 419, 420, 421, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 436, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - -1, -1, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, -1, -1, -1, -1, - -1, -1, 323, -1, -1, -1, -1, -1, 329, 330, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 348, 349, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, - 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 381, 382, 383, 384, 385, 386, -1, -1, -1, -1, - 391, 392, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 414, 415, 416, 417, 418, 419, 420, - 421, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 436, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, -1, -1, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, - -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, - -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 348, 349, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 360, 361, 362, 363, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 381, 382, 383, 384, 385, 386, -1, - -1, -1, -1, 391, 392, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 414, 415, 416, 417, - 418, 419, 420, 421, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 436, 4, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 0, 0, 504, 505, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 506, 507, 0, 327, 0, 596, + 597, 0, 0, 0, 0, 598, 508, 509, 510, 511, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, + 330, 331, 332, 333, 0, 0, 0, 512, 513, 514, + 515, 516, 334, 335, 336, 337, 338, 339, 340, 599, + 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 341, 342, 343, 344, 345, 346, + 517, 518, 519, 520, 521, 522, 523, 524, 347, 613, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 506, 507, 0, 327, 0, 596, 772, 0, 0, + 0, 0, 598, 508, 509, 510, 511, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 329, 330, 331, 332, + 333, 0, 0, 0, 512, 513, 514, 515, 516, 334, + 335, 336, 337, 338, 339, 340, 599, 600, 601, 602, + 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, + 612, 341, 342, 343, 344, 345, 346, 517, 518, 519, + 520, 521, 522, 523, 524, 347, 613, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 327, 0, 596, 0, 0, 0, 0, 0, 598, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 329, 330, 331, 332, 333, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 335, 336, 337, + 338, 339, 340, 599, 600, 601, 602, 0, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 341, 342, + 343, 344, 345, 346, 517, 518, 519, 520, 521, 522, + 523, 524, 347, 613, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 0, 0, 504, 505, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 506, 507, 0, 327, 0, + 489, 0, 0, 0, 0, 0, 598, 508, 509, 510, + 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 329, 330, 331, 332, 333, 0, 0, 0, 512, 513, + 514, 515, 516, 334, 335, 336, 337, 338, 339, 340, + 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 341, 342, 343, 344, 345, + 346, 517, 518, 519, 520, 521, 522, 523, 524, 347, + 613, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 0, 0, 504, 505, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 506, 507, 0, 327, 0, 0, 0, 0, + 0, 0, 0, 598, 508, 509, 510, 511, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, + 332, 333, 0, 0, 0, 512, 513, 514, 515, 516, + 334, 335, 336, 337, 338, 339, 340, 599, 600, 601, + 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 341, 342, 343, 344, 345, 346, 517, 518, + 519, 520, 521, 522, 523, 524, 347, 613, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 0, 0, + 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 506, + 507, 0, 327, 0, 0, 0, 0, 0, 0, 0, + 598, 508, 509, 510, 511, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 329, 330, 331, 332, 333, 0, + 0, 0, 512, 513, 514, 515, 516, 334, 335, 336, + 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, + 342, 343, 344, 345, 346, 517, 518, 519, 520, 521, + 522, 523, 524, 347, 0, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 0, 0, 0, 320, 321, + 322, 323, 324, 325, 326, 0, 0, 504, 505, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 506, 507, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 508, 509, + 510, 511, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 329, 330, 331, 332, 0, 0, 0, 0, 512, + 513, 514, 515, 516, 334, 335, 336, 337, 338, 339, + 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 341, 342, 343, 344, + 345, 346, 517, 518, 519, 520, 521, 522, 523, 524, + 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, -1, -1, 63, 64, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, @@ -4103,68 +2185,967 @@ static const yytype_int16 yycheck[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, -1, -1, -1, -1, -1, -1, 323, -1, - -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, + 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, + 331, 332, 333, 0, 0, 0, 0, 0, 0, 0, + 0, 334, 335, 336, 337, 338, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 341, 342, 343, 344, 345, 346, 0, + 0, 0, 0, 0, 0, 0, 0, 347, 0, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 0, + 0, 0, 320, 321, 322, 323, 324, 325, 326, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 329, 330, 331, 332, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 334, 335, + 336, 337, 338, 339, 340, 599, 0, 0, 602, 0, + 603, 604, 0, 0, 607, 0, 0, 0, 0, 0, + 341, 342, 343, 344, 345, 346, 0, 0, 0, 0, + 0, 0, 0, 0, 347, 0, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 0, 0, 0, 320, + 321, 322, 323, 324, 325, 326, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 440, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 329, 330, 331, 332, 0, 0, 0, 0, + 0, 0, 0, 0, 441, 334, 335, 336, 337, 338, + 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, + 344, 345, 346, 0, 0, 0, 0, 0, 0, 0, + 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 0, 0, 0, 320, 321, 322, 323, + 324, 325, 326, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, + 330, 331, 332, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 334, 335, 336, 337, 338, 339, 340, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 341, 342, 343, 344, 345, 346, + 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 0, 0, 0, 320, 321, 322, 323, 324, 325, 326, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 711, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 329, 330, 331, 332, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 334, + 335, 336, 337, 338, 339, 340, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 341, 342, 343, 344, 345, 346, 0, 0, 0, + 0, 0, 0, 0, 0, 347, 0, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 320, 321, 322, 323, 324, 325, 326, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 824, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 329, 330, 331, 332, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 334, 335, 336, 337, + 338, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 341, 342, + 343, 344, 345, 346, 0, 0, 0, 0, 0, 0, + 0, 0, 347, 0, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 0, 0, 0, 320, 321, 322, + 323, 324, 325, 326, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 859, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 329, 330, 331, 332, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 334, 335, 336, 337, 338, 339, 340, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 341, 342, 343, 344, 345, + 346, 0, 0, 0, 0, 0, 0, 0, 0, 347, + 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 0, 0, 0, 320, 321, 322, 323, 324, 325, + 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, + 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 341, 342, 343, 344, 345, 346, 0, 0, + 0, 0, 0, 0, 0, 0, 347, 0, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 0, 641, 779, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 0, 641, 890, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 580, 0, 0, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 0, 641, 0, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 749, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 659, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 699, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 334, 0, 0, 0, 0, 339, 340 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 387, 0, 572, 507, 406, 498, 0, 486, 0, + 411, 0, 627, 439, 406, 444, 547, 552, 741, 445, + 406, 395, 557, 574, 338, 411, 355, 418, 333, 334, + 361, 566, 563, 639, 350, 641, 903, 353, 644, 350, + 575, 533, 387, 910, 350, 431, 353, 350, 361, 358, + 358, 353, 361, 920, 361, 351, 387, 486, 387, 361, + 374, 435, 370, 354, 369, 370, 411, 358, 384, 495, + 496, 335, 336, 384, 552, 504, 505, 451, 384, 557, + 383, 384, 385, 386, 352, 563, 331, 332, 566, 351, + 358, 353, 478, 353, 645, 353, 384, 575, 360, 387, + 360, 351, 360, 606, 353, 608, 351, 536, 353, 545, + 354, 360, 357, 352, 358, 551, 594, 553, 351, 358, + 556, 352, 558, 552, 560, 561, 351, 358, 557, 565, + 745, 351, 355, 352, 563, 358, 352, 566, 361, 358, + 358, 354, 358, 361, 713, 358, 575, 639, 351, 641, + 384, 654, 644, 387, 545, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 594, 658, 363, 352, 365, + 561, 351, 778, 351, 358, 360, 413, 414, 415, 416, + 417, 418, 419, 352, 352, 352, 572, 352, 574, 358, + 358, 358, 352, 358, 352, 351, 570, 352, 358, 352, + 358, 924, 352, 358, 352, 358, 352, 352, 358, 352, + 358, 352, 358, 358, 783, 358, 352, 358, 352, 352, + 352, 352, 358, 352, 358, 358, 358, 358, 353, 358, + 384, 846, 352, 387, 663, 351, 637, 361, 358, 383, + 384, 385, 386, 352, 747, 637, 384, 384, 751, 387, + 387, 637, 858, 724, 725, 726, 727, 384, 384, 645, + 387, 387, 384, 384, 358, 387, 387, 802, 803, 384, + 384, 369, 387, 387, 809, 810, 384, 769, 770, 387, + 358, 387, 708, 361, 815, 356, 778, 358, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 358, 914, 358, + 361, 358, 361, 387, 361, 930, 376, 377, 378, 387, + 366, 367, 368, 355, 802, 803, 387, 713, 329, 330, + 387, 809, 810, 358, 359, 358, 359, 815, 355, 817, + 353, 844, 720, 721, 847, 722, 723, 728, 729, 387, + 353, 387, 361, 352, 360, 360, 358, 361, 387, 387, + 352, 358, 358, 358, 358, 350, 858, 351, 358, 387, + 358, 358, 358, 802, 803, 358, 358, 352, 351, 360, + 809, 810, 353, 351, 887, 354, 815, 387, 817, 353, + 337, 339, 354, 371, 373, 395, 387, 783, 372, 356, + 351, 904, 361, 403, 395, 403, 406, 387, 900, 361, + 403, 411, 403, 411, 403, 406, 919, 351, 411, 351, + 411, 421, 914, 361, 351, 361, 359, 351, 351, 387, + 361, 431, 430, 361, 387, 435, 361, 352, 360, 358, + 431, 358, 358, 352, 435, 352, 847, 358, 354, 354, + 350, 451, 395, 350, 384, 356, 352, 351, 387, 361, + 451, 847, 355, 352, 399, 360, 356, 355, 355, 361, + 731, 730, 735, 577, 435, 732, 431, 733, 478, 734, + 333, 435, 822, 707, 849, 909, 887, 478, 920, 489, + 921, 849, 429, 887, 798, 637, 568, 637, 489, 403, + 800, 887, 637, 813, 803, 817, 807, 805, -1, -1, + -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, + 815, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 348, 349, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 360, 361, 362, 363, -1, + -1, -1, -1, 541, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 381, 382, 383, 384, - 385, 386, -1, -1, -1, -1, 391, 392, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 414, - 415, 416, 417, 418, 419, 420, 421, -1, -1, -1, + 570, -1, 572, -1, 574, -1, -1, -1, -1, 570, + -1, 572, -1, 574, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 436, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, - -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, -1, -1, -1, -1, -1, - -1, 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 348, 349, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 360, 361, - 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, - 382, 383, 384, 385, 386, -1, -1, -1, -1, 391, - 392, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 414, 415, 416, 417, 418, 419, 420, 421, + -1, -1, -1, -1, -1, -1, -1, 627, -1, -1, + -1, -1, -1, -1, -1, -1, 627, 637, -1, -1, + -1, -1, -1, -1, -1, 645, 637, -1, -1, -1, + -1, -1, -1, -1, 645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 436, 4, 5, 6, 7, 8, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 713, -1, -1, -1, -1, -1, -1, + -1, -1, 713, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 741, -1, -1, -1, 745, -1, -1, -1, -1, + 741, -1, -1, -1, 745, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 783, -1, -1, -1, -1, -1, -1, + -1, -1, 783, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 846, 847, -1, 849, + -1, 849, -1, -1, -1, 846, 847, -1, 849, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 887, -1, -1, + -1, -1, -1, -1, -1, -1, 887, -1, -1, -1, + -1, -1, -1, 903, -1, -1, -1, -1, -1, -1, + 910, -1, 903, -1, -1, -1, -1, -1, -1, 910, + 920, -1, -1, -1, 924, -1, -1, -1, -1, 920, + 930, -1, -1, 924, -1, -1, -1, 0, -1, 930, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 353, -1, -1, -1, -1, -1, -1, -1, 361, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 375, 376, 377, 378, 379, -1, -1, -1, + -1, -1, -1, -1, -1, 388, 389, 390, 391, 392, + 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, + 413, 414, 415, -1, -1, -1, -1, -1, -1, -1, + -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, -1, -1, 331, 332, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 350, 351, -1, 353, -1, 355, + 356, -1, -1, -1, -1, 361, 362, 363, 364, 365, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, + 376, 377, 378, 379, -1, -1, -1, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, -1, -1, 63, 64, 65, 66, 67, 68, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, @@ -4189,15 +3170,1046 @@ static const yytype_int16 yycheck[] = 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, -1, -1, - -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 350, 351, -1, 353, -1, 355, 356, -1, -1, + -1, -1, 361, 362, 363, 364, 365, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 375, 376, 377, 378, + 379, -1, -1, -1, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, -1, -1, 331, + 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, + -1, 353, -1, 355, -1, -1, -1, -1, -1, 361, + 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 375, 376, 377, 378, 379, -1, -1, + -1, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, -1, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, -1, 331, 332, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 350, 351, -1, 353, -1, + 355, -1, -1, -1, -1, -1, 361, 362, 363, 364, + 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 375, 376, 377, 378, 379, -1, -1, -1, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, -1, -1, 331, 332, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 350, 351, -1, 353, -1, -1, -1, -1, + -1, -1, -1, 361, 362, 363, 364, 365, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, + 378, 379, -1, -1, -1, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, -1, + 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, + 351, -1, 353, -1, -1, -1, -1, -1, -1, -1, + 361, 362, 363, 364, 365, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 375, 376, 377, 378, 379, -1, + -1, -1, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, 422, 423, 424, -1, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, -1, -1, -1, 322, 323, + 324, 325, 326, 327, 328, -1, -1, 331, 332, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 350, 351, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 362, 363, + 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 375, 376, 377, 378, -1, -1, -1, -1, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, + 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, + 454, 455, 456, 457, 458, 459, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 353, -1, -1, -1, + -1, -1, -1, -1, 361, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, + 377, 378, 379, -1, -1, -1, -1, -1, -1, -1, + -1, 388, 389, 390, 391, 392, 393, 394, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 410, 411, 412, 413, 414, 415, -1, + -1, -1, -1, -1, -1, -1, -1, 424, -1, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, + -1, -1, 322, 323, 324, 325, 326, 327, 328, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 375, 376, 377, 378, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 388, 389, + 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, + 400, 401, -1, -1, 404, -1, -1, -1, -1, -1, + 410, 411, 412, 413, 414, 415, -1, -1, -1, -1, + -1, -1, -1, -1, 424, -1, 426, 427, 428, 429, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, -1, -1, -1, 322, + 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 361, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 375, 376, 377, 378, -1, -1, -1, -1, + -1, -1, -1, -1, 387, 388, 389, 390, 391, 392, + 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, + 413, 414, 415, -1, -1, -1, -1, -1, -1, -1, + -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, -1, -1, -1, 322, 323, 324, 325, + 326, 327, 328, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 353, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, + 376, 377, 378, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 388, 389, 390, 391, 392, 393, 394, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 410, 411, 412, 413, 414, 415, + -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + -1, -1, -1, 322, 323, 324, 325, 326, 327, 328, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 356, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 375, 376, 377, 378, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 388, + 389, 390, 391, 392, 393, 394, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 410, 411, 412, 413, 414, 415, -1, -1, -1, + -1, -1, -1, -1, -1, 424, -1, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + 322, 323, 324, 325, 326, 327, 328, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 356, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 375, 376, 377, 378, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 388, 389, 390, 391, + 392, 393, 394, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 410, 411, + 412, 413, 414, 415, -1, -1, -1, -1, -1, -1, + -1, -1, 424, -1, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, -1, -1, -1, 322, 323, 324, + 325, 326, 327, 328, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 356, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 375, 376, 377, 378, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 388, 389, 390, 391, 392, 393, 394, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 410, 411, 412, 413, 414, + 415, -1, -1, -1, -1, -1, -1, -1, -1, 424, + -1, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, -1, -1, -1, 322, 323, 324, 325, 326, 327, + 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, + 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 410, 411, 412, 413, 414, 415, -1, -1, + -1, -1, -1, -1, -1, -1, 424, -1, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, + 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, + -1, -1, -1, 355, 356, -1, -1, -1, -1, -1, + 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, + -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, + 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, + -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 350, 351, -1, -1, -1, 355, 356, + -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, + 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, + 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, + 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, + -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, + 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, + -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, + 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, + -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 350, 351, -1, -1, -1, 355, -1, + -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, + 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, + 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, + 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, + -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, + 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, + -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, + 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, + -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 350, 351, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, + 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, + 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, + 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, + -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, + 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, + -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 350, 351, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, + 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, + 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, + 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, + -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, + 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 386, -1, -1, - -1, -1, 391, 392 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 388, -1, -1, -1, -1, 393, 394 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -4236,142 +4248,142 @@ static const yytype_int16 yystos[] = 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 351, 359, 373, 374, 375, - 376, 377, 386, 387, 388, 389, 390, 391, 392, 408, - 409, 410, 411, 412, 413, 422, 424, 425, 426, 427, + 322, 323, 324, 325, 326, 327, 328, 353, 361, 375, + 376, 377, 378, 379, 388, 389, 390, 391, 392, 393, + 394, 410, 411, 412, 413, 414, 415, 424, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 489, 490, 493, 494, 495, 496, 500, 501, 502, 503, - 504, 505, 508, 509, 510, 511, 512, 514, 519, 520, - 521, 562, 563, 564, 566, 573, 577, 578, 583, 586, - 349, 349, 349, 349, 349, 349, 349, 349, 351, 520, - 353, 385, 349, 349, 359, 385, 359, 565, 350, 356, - 497, 498, 499, 509, 514, 356, 359, 385, 359, 385, - 510, 514, 367, 516, 517, 0, 563, 494, 502, 509, - 359, 493, 385, 569, 570, 587, 588, 382, 385, 569, - 382, 569, 382, 569, 382, 569, 382, 569, 569, 587, - 382, 569, 385, 567, 568, 514, 523, 353, 385, 409, - 506, 507, 385, 513, 351, 359, 515, 353, 541, 566, - 498, 497, 499, 385, 385, 349, 358, 515, 353, 356, - 359, 492, 329, 330, 348, 349, 360, 361, 362, 363, - 381, 382, 383, 384, 385, 414, 415, 416, 417, 418, - 419, 420, 421, 459, 460, 461, 463, 464, 465, 466, - 467, 468, 469, 470, 471, 512, 514, 518, 515, 350, - 385, 359, 358, 356, 350, 356, 350, 356, 358, 356, - 356, 356, 350, 356, 356, 356, 356, 356, 356, 356, - 350, 356, 350, 356, 349, 352, 356, 359, 509, 514, - 524, 525, 522, 358, 350, 356, 350, 356, 352, 470, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 351, 359, 353, 354, 359, 393, 394, 395, - 396, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 423, 470, 483, 485, 487, 489, 493, 512, 514, - 530, 531, 532, 533, 534, 542, 543, 544, 545, 548, - 549, 552, 553, 554, 561, 566, 515, 358, 515, 353, - 485, 528, 358, 491, 385, 356, 359, 470, 470, 487, - 329, 330, 351, 355, 350, 350, 356, 392, 485, 349, - 470, 356, 368, 566, 348, 351, 382, 570, 587, 385, - 588, 348, 381, 382, 383, 384, 574, 575, 382, 483, - 488, 576, 382, 381, 382, 383, 384, 579, 580, 382, - 488, 581, 382, 348, 582, 382, 587, 385, 488, 584, - 585, 382, 488, 352, 568, 514, 385, 526, 527, 354, - 525, 524, 488, 507, 385, 364, 365, 366, 361, 363, - 327, 328, 331, 332, 367, 368, 333, 334, 371, 370, - 369, 335, 337, 336, 372, 352, 352, 483, 354, 535, - 349, 359, 359, 556, 349, 349, 359, 359, 487, 349, - 487, 357, 359, 359, 359, 359, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 358, 486, 356, 359, - 354, 531, 545, 549, 554, 528, 358, 354, 528, 529, - 528, 524, 385, 350, 462, 487, 385, 485, 470, 348, - 382, 571, 572, 350, 358, 350, 356, 350, 356, 350, - 356, 356, 350, 356, 350, 356, 350, 356, 356, 350, - 356, 356, 350, 356, 350, 356, 350, 350, 526, 515, - 356, 359, 354, 470, 470, 470, 472, 472, 473, 473, - 474, 474, 474, 474, 475, 475, 476, 477, 478, 479, - 480, 481, 484, 352, 542, 555, 531, 557, 487, 359, - 487, 357, 485, 485, 528, 354, 356, 354, 352, 352, - 356, 352, 356, 575, 574, 488, 576, 580, 579, 488, - 581, 348, 582, 584, 585, 359, 527, 487, 536, 487, - 502, 547, 393, 530, 543, 558, 350, 350, 354, 528, - 348, 382, 350, 350, 350, 350, 350, 350, 357, 354, - 385, 350, 349, 547, 559, 560, 538, 539, 540, 546, - 550, 485, 358, 532, 537, 541, 487, 359, 350, 397, - 534, 532, 353, 528, 350, 487, 537, 538, 542, 551, - 359, 354 + 458, 459, 491, 492, 495, 496, 497, 498, 502, 503, + 504, 505, 506, 507, 510, 511, 512, 513, 514, 516, + 521, 522, 523, 564, 565, 566, 568, 575, 579, 580, + 585, 588, 351, 351, 351, 351, 351, 351, 351, 351, + 353, 522, 355, 387, 351, 351, 361, 387, 361, 567, + 352, 358, 499, 500, 501, 511, 516, 358, 361, 387, + 361, 387, 512, 516, 369, 518, 519, 0, 565, 496, + 504, 511, 361, 495, 387, 571, 572, 589, 590, 384, + 387, 571, 384, 571, 384, 571, 384, 571, 384, 571, + 571, 589, 384, 571, 387, 569, 570, 516, 525, 355, + 387, 411, 508, 509, 387, 515, 353, 361, 517, 355, + 543, 568, 500, 499, 501, 387, 387, 351, 360, 517, + 355, 358, 361, 494, 331, 332, 350, 351, 362, 363, + 364, 365, 383, 384, 385, 386, 387, 416, 417, 418, + 419, 420, 421, 422, 423, 461, 462, 463, 465, 466, + 467, 468, 469, 470, 471, 472, 473, 514, 516, 520, + 517, 352, 387, 361, 360, 358, 352, 358, 352, 358, + 360, 358, 358, 358, 352, 358, 358, 358, 358, 358, + 358, 358, 352, 358, 352, 358, 351, 354, 358, 361, + 511, 516, 526, 527, 524, 360, 352, 358, 352, 358, + 354, 472, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 353, 361, 355, 356, 361, 395, + 396, 397, 398, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 425, 472, 485, 487, 489, 491, 495, + 514, 516, 532, 533, 534, 535, 536, 544, 545, 546, + 547, 550, 551, 554, 555, 556, 563, 568, 517, 360, + 517, 355, 487, 530, 360, 493, 387, 358, 361, 472, + 472, 489, 331, 332, 353, 357, 352, 352, 358, 394, + 487, 351, 472, 358, 370, 568, 350, 353, 384, 572, + 589, 387, 590, 350, 383, 384, 385, 386, 576, 577, + 384, 485, 490, 578, 384, 383, 384, 385, 386, 581, + 582, 384, 490, 583, 384, 350, 584, 384, 589, 387, + 490, 586, 587, 384, 490, 354, 570, 516, 387, 528, + 529, 356, 527, 526, 490, 509, 387, 366, 367, 368, + 363, 365, 329, 330, 333, 334, 369, 370, 335, 336, + 373, 372, 371, 337, 339, 338, 374, 354, 354, 485, + 356, 537, 351, 361, 361, 558, 351, 351, 361, 361, + 489, 351, 489, 359, 361, 361, 361, 361, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 360, 488, + 358, 361, 356, 533, 547, 551, 556, 530, 360, 356, + 530, 531, 530, 526, 387, 352, 464, 489, 387, 487, + 472, 350, 384, 573, 574, 352, 360, 352, 358, 352, + 358, 352, 358, 358, 352, 358, 352, 358, 352, 358, + 358, 352, 358, 358, 352, 358, 352, 358, 352, 352, + 528, 517, 358, 361, 356, 472, 472, 472, 474, 474, + 475, 475, 476, 476, 476, 476, 477, 477, 478, 479, + 480, 481, 482, 483, 486, 354, 544, 557, 533, 559, + 489, 361, 489, 359, 487, 487, 530, 356, 358, 356, + 354, 354, 358, 354, 358, 577, 576, 490, 578, 582, + 581, 490, 583, 350, 584, 586, 587, 361, 529, 489, + 538, 489, 504, 549, 395, 532, 545, 560, 352, 352, + 356, 530, 350, 384, 352, 352, 352, 352, 352, 352, + 359, 356, 387, 352, 351, 549, 561, 562, 540, 541, + 542, 548, 552, 487, 360, 534, 539, 543, 489, 361, + 352, 399, 536, 534, 355, 530, 352, 489, 539, 540, + 544, 553, 361, 356 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int16 yyr1[] = { - 0, 458, 459, 460, 460, 460, 460, 460, 460, 460, - 460, 460, 460, 460, 460, 460, 460, 460, 461, 461, - 461, 461, 461, 461, 462, 463, 464, 465, 465, 466, - 466, 467, 467, 468, 469, 469, 469, 470, 470, 470, - 470, 471, 471, 471, 471, 472, 472, 472, 472, 473, - 473, 473, 474, 474, 474, 475, 475, 475, 475, 475, - 476, 476, 476, 477, 477, 478, 478, 479, 479, 480, - 480, 481, 481, 482, 482, 483, 484, 483, 485, 485, - 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, - 486, 487, 487, 488, 489, 489, 489, 489, 489, 489, - 489, 489, 489, 489, 489, 491, 490, 492, 492, 493, - 493, 493, 493, 494, 494, 495, 495, 496, 497, 497, - 498, 498, 498, 498, 499, 500, 500, 500, 500, 500, - 501, 501, 501, 501, 501, 502, 502, 503, 504, 504, - 504, 504, 504, 504, 504, 504, 504, 504, 505, 506, - 506, 507, 507, 507, 508, 509, 509, 510, 510, 510, - 510, 510, 510, 510, 510, 510, 510, 510, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 511, 512, 513, 513, 514, 514, 515, - 515, 515, 515, 516, 516, 517, 518, 518, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 520, 520, 520, 522, 521, 523, 521, - 524, 524, 525, 525, 526, 526, 527, 527, 528, 528, - 528, 528, 529, 529, 530, 531, 531, 532, 532, 532, - 532, 532, 532, 532, 532, 533, 534, 535, 536, 534, - 537, 537, 539, 538, 540, 538, 541, 541, 542, 542, - 543, 543, 544, 544, 545, 546, 546, 547, 547, 548, - 548, 550, 549, 551, 551, 552, 552, 553, 553, 555, - 554, 556, 554, 557, 554, 558, 558, 559, 559, 560, - 560, 561, 561, 561, 561, 561, 561, 561, 561, 562, - 562, 563, 563, 563, 565, 564, 566, 567, 567, 568, - 568, 569, 569, 570, 570, 571, 571, 572, 572, 573, - 573, 573, 573, 573, 573, 574, 574, 575, 575, 575, - 575, 575, 576, 576, 577, 577, 578, 578, 578, 578, - 578, 578, 578, 578, 579, 579, 580, 580, 580, 580, - 581, 581, 582, 582, 583, 583, 583, 583, 584, 584, - 585, 586, 586, 587, 587, 588, 588 + 0, 460, 461, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 463, 463, + 463, 463, 463, 463, 464, 465, 466, 467, 467, 468, + 468, 469, 469, 470, 471, 471, 471, 472, 472, 472, + 472, 473, 473, 473, 473, 474, 474, 474, 474, 475, + 475, 475, 476, 476, 476, 477, 477, 477, 477, 477, + 478, 478, 478, 479, 479, 480, 480, 481, 481, 482, + 482, 483, 483, 484, 484, 485, 486, 485, 487, 487, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 489, 489, 490, 491, 491, 491, 491, 491, 491, + 491, 491, 491, 491, 491, 493, 492, 494, 494, 495, + 495, 495, 495, 496, 496, 497, 497, 498, 499, 499, + 500, 500, 500, 500, 501, 502, 502, 502, 502, 502, + 503, 503, 503, 503, 503, 504, 504, 505, 506, 506, + 506, 506, 506, 506, 506, 506, 506, 506, 507, 508, + 508, 509, 509, 509, 510, 511, 511, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, 513, 513, + 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, + 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, + 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, + 513, 513, 513, 513, 513, 514, 515, 515, 516, 516, + 517, 517, 517, 517, 518, 518, 519, 520, 520, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 522, 522, 522, 524, 523, + 525, 523, 526, 526, 527, 527, 528, 528, 529, 529, + 530, 530, 530, 530, 531, 531, 532, 533, 533, 534, + 534, 534, 534, 534, 534, 534, 534, 535, 536, 537, + 538, 536, 539, 539, 541, 540, 542, 540, 543, 543, + 544, 544, 545, 545, 546, 546, 547, 548, 548, 549, + 549, 550, 550, 552, 551, 553, 553, 554, 554, 555, + 555, 557, 556, 558, 556, 559, 556, 560, 560, 561, + 561, 562, 562, 563, 563, 563, 563, 563, 563, 563, + 563, 564, 564, 565, 565, 565, 567, 566, 568, 569, + 569, 570, 570, 571, 571, 572, 572, 573, 573, 574, + 574, 575, 575, 575, 575, 575, 575, 576, 576, 577, + 577, 577, 577, 577, 578, 578, 579, 579, 580, 580, + 580, 580, 580, 580, 580, 580, 581, 581, 582, 582, + 582, 582, 583, 583, 584, 584, 585, 585, 585, 585, + 586, 586, 587, 588, 588, 589, 589, 590, 590 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -4397,8 +4409,8 @@ static const yytype_int8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 1, 1, 1, 3, 2, 3, 2, - 3, 3, 4, 1, 0, 3, 1, 3, 1, 1, + 1, 1, 1, 4, 1, 1, 1, 3, 2, 3, + 2, 3, 3, 4, 1, 0, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -4430,22 +4442,22 @@ static const yytype_int8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 6, 0, 5, - 1, 2, 3, 4, 1, 3, 1, 2, 1, 3, - 4, 2, 1, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 0, 0, 5, - 1, 1, 0, 2, 0, 2, 2, 3, 1, 2, - 1, 2, 1, 2, 5, 3, 1, 1, 4, 1, - 2, 0, 8, 0, 1, 3, 2, 1, 2, 0, - 6, 0, 8, 0, 7, 1, 1, 1, 0, 2, - 3, 2, 2, 2, 3, 2, 2, 2, 2, 1, - 2, 1, 1, 1, 0, 3, 5, 1, 3, 1, - 4, 1, 3, 5, 5, 1, 3, 1, 3, 4, - 6, 6, 8, 6, 8, 1, 3, 1, 1, 1, - 1, 1, 1, 3, 4, 6, 4, 6, 6, 8, - 6, 8, 6, 8, 1, 3, 1, 1, 1, 1, - 1, 3, 1, 3, 6, 8, 4, 6, 1, 3, - 1, 4, 6, 1, 3, 3, 3 + 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, + 0, 5, 1, 2, 3, 4, 1, 3, 1, 2, + 1, 3, 4, 2, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, + 0, 5, 1, 1, 0, 2, 0, 2, 2, 3, + 1, 2, 1, 2, 1, 2, 5, 3, 1, 1, + 4, 1, 2, 0, 8, 0, 1, 3, 2, 1, + 2, 0, 6, 0, 8, 0, 7, 1, 1, 1, + 0, 2, 3, 2, 2, 2, 3, 2, 2, 2, + 2, 1, 2, 1, 1, 1, 0, 3, 5, 1, + 3, 1, 4, 1, 3, 5, 5, 1, 3, 1, + 3, 4, 6, 6, 8, 6, 8, 1, 3, 1, + 1, 1, 1, 1, 1, 3, 4, 6, 4, 6, + 6, 8, 6, 8, 6, 8, 1, 3, 1, 1, + 1, 1, 1, 3, 1, 3, 6, 8, 4, 6, + 1, 3, 1, 4, 6, 1, 3, 3, 3 }; @@ -5191,260 +5203,260 @@ yyreduce: switch (yyn) { case 2: /* variable_identifier: IDENTIFIER */ -#line 392 "MachineIndependent/glslang.y" +#line 393 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 5199 "MachineIndependent/glslang_tab.cpp" +#line 5211 "MachineIndependent/glslang_tab.cpp" break; case 3: /* primary_expression: variable_identifier */ -#line 398 "MachineIndependent/glslang.y" +#line 399 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5207 "MachineIndependent/glslang_tab.cpp" +#line 5219 "MachineIndependent/glslang_tab.cpp" break; case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */ -#line 401 "MachineIndependent/glslang.y" +#line 402 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 5217 "MachineIndependent/glslang_tab.cpp" +#line 5229 "MachineIndependent/glslang_tab.cpp" break; case 5: /* primary_expression: FLOATCONSTANT */ -#line 406 "MachineIndependent/glslang.y" +#line 407 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 5225 "MachineIndependent/glslang_tab.cpp" +#line 5237 "MachineIndependent/glslang_tab.cpp" break; case 6: /* primary_expression: INTCONSTANT */ -#line 409 "MachineIndependent/glslang.y" +#line 410 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5233 "MachineIndependent/glslang_tab.cpp" +#line 5245 "MachineIndependent/glslang_tab.cpp" break; case 7: /* primary_expression: UINTCONSTANT */ -#line 412 "MachineIndependent/glslang.y" +#line 413 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5242 "MachineIndependent/glslang_tab.cpp" +#line 5254 "MachineIndependent/glslang_tab.cpp" break; case 8: /* primary_expression: BOOLCONSTANT */ -#line 416 "MachineIndependent/glslang.y" +#line 417 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 5250 "MachineIndependent/glslang_tab.cpp" +#line 5262 "MachineIndependent/glslang_tab.cpp" break; case 9: /* primary_expression: STRING_LITERAL */ -#line 420 "MachineIndependent/glslang.y" +#line 421 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 5258 "MachineIndependent/glslang_tab.cpp" +#line 5270 "MachineIndependent/glslang_tab.cpp" break; case 10: /* primary_expression: INT32CONSTANT */ -#line 423 "MachineIndependent/glslang.y" +#line 424 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5267 "MachineIndependent/glslang_tab.cpp" +#line 5279 "MachineIndependent/glslang_tab.cpp" break; case 11: /* primary_expression: UINT32CONSTANT */ -#line 427 "MachineIndependent/glslang.y" +#line 428 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5276 "MachineIndependent/glslang_tab.cpp" +#line 5288 "MachineIndependent/glslang_tab.cpp" break; case 12: /* primary_expression: INT64CONSTANT */ -#line 431 "MachineIndependent/glslang.y" +#line 432 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 5285 "MachineIndependent/glslang_tab.cpp" +#line 5297 "MachineIndependent/glslang_tab.cpp" break; case 13: /* primary_expression: UINT64CONSTANT */ -#line 435 "MachineIndependent/glslang.y" +#line 436 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 5294 "MachineIndependent/glslang_tab.cpp" +#line 5306 "MachineIndependent/glslang_tab.cpp" break; case 14: /* primary_expression: INT16CONSTANT */ -#line 439 "MachineIndependent/glslang.y" +#line 440 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5303 "MachineIndependent/glslang_tab.cpp" +#line 5315 "MachineIndependent/glslang_tab.cpp" break; case 15: /* primary_expression: UINT16CONSTANT */ -#line 443 "MachineIndependent/glslang.y" +#line 444 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5312 "MachineIndependent/glslang_tab.cpp" +#line 5324 "MachineIndependent/glslang_tab.cpp" break; case 16: /* primary_expression: DOUBLECONSTANT */ -#line 447 "MachineIndependent/glslang.y" +#line 448 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double literal"); if (! parseContext.symbolTable.atBuiltInLevel()) parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } -#line 5323 "MachineIndependent/glslang_tab.cpp" +#line 5335 "MachineIndependent/glslang_tab.cpp" break; case 17: /* primary_expression: FLOAT16CONSTANT */ -#line 453 "MachineIndependent/glslang.y" +#line 454 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 5332 "MachineIndependent/glslang_tab.cpp" +#line 5344 "MachineIndependent/glslang_tab.cpp" break; case 18: /* postfix_expression: primary_expression */ -#line 461 "MachineIndependent/glslang.y" +#line 462 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5340 "MachineIndependent/glslang_tab.cpp" +#line 5352 "MachineIndependent/glslang_tab.cpp" break; case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */ -#line 464 "MachineIndependent/glslang.y" +#line 465 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } -#line 5348 "MachineIndependent/glslang_tab.cpp" +#line 5360 "MachineIndependent/glslang_tab.cpp" break; case 20: /* postfix_expression: function_call */ -#line 467 "MachineIndependent/glslang.y" +#line 468 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5356 "MachineIndependent/glslang_tab.cpp" +#line 5368 "MachineIndependent/glslang_tab.cpp" break; case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */ -#line 470 "MachineIndependent/glslang.y" +#line 471 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } -#line 5364 "MachineIndependent/glslang_tab.cpp" +#line 5376 "MachineIndependent/glslang_tab.cpp" break; case 22: /* postfix_expression: postfix_expression INC_OP */ -#line 473 "MachineIndependent/glslang.y" +#line 474 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5374 "MachineIndependent/glslang_tab.cpp" +#line 5386 "MachineIndependent/glslang_tab.cpp" break; case 23: /* postfix_expression: postfix_expression DEC_OP */ -#line 478 "MachineIndependent/glslang.y" +#line 479 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5384 "MachineIndependent/glslang_tab.cpp" +#line 5396 "MachineIndependent/glslang_tab.cpp" break; case 24: /* integer_expression: expression */ -#line 486 "MachineIndependent/glslang.y" +#line 487 "MachineIndependent/glslang.y" { parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5393 "MachineIndependent/glslang_tab.cpp" +#line 5405 "MachineIndependent/glslang_tab.cpp" break; case 25: /* function_call: function_call_or_method */ -#line 493 "MachineIndependent/glslang.y" +#line 494 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 5402 "MachineIndependent/glslang_tab.cpp" +#line 5414 "MachineIndependent/glslang_tab.cpp" break; case 26: /* function_call_or_method: function_call_generic */ -#line 500 "MachineIndependent/glslang.y" +#line 501 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5410 "MachineIndependent/glslang_tab.cpp" +#line 5422 "MachineIndependent/glslang_tab.cpp" break; case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */ -#line 506 "MachineIndependent/glslang.y" +#line 507 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5419 "MachineIndependent/glslang_tab.cpp" +#line 5431 "MachineIndependent/glslang_tab.cpp" break; case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */ -#line 510 "MachineIndependent/glslang.y" +#line 511 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5428 "MachineIndependent/glslang_tab.cpp" +#line 5440 "MachineIndependent/glslang_tab.cpp" break; case 29: /* function_call_header_no_parameters: function_call_header VOID */ -#line 517 "MachineIndependent/glslang.y" +#line 518 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5436 "MachineIndependent/glslang_tab.cpp" +#line 5448 "MachineIndependent/glslang_tab.cpp" break; case 30: /* function_call_header_no_parameters: function_call_header */ -#line 520 "MachineIndependent/glslang.y" +#line 521 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5444 "MachineIndependent/glslang_tab.cpp" +#line 5456 "MachineIndependent/glslang_tab.cpp" break; case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */ -#line 526 "MachineIndependent/glslang.y" +#line 527 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -5452,11 +5464,11 @@ yyreduce: (yyval.interm).function = (yyvsp[-1].interm).function; (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } -#line 5456 "MachineIndependent/glslang_tab.cpp" +#line 5468 "MachineIndependent/glslang_tab.cpp" break; case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */ -#line 533 "MachineIndependent/glslang.y" +#line 534 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -5464,29 +5476,29 @@ yyreduce: (yyval.interm).function = (yyvsp[-2].interm).function; (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } -#line 5468 "MachineIndependent/glslang_tab.cpp" +#line 5480 "MachineIndependent/glslang_tab.cpp" break; case 33: /* function_call_header: function_identifier LEFT_PAREN */ -#line 543 "MachineIndependent/glslang.y" +#line 544 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5476 "MachineIndependent/glslang_tab.cpp" +#line 5488 "MachineIndependent/glslang_tab.cpp" break; case 34: /* function_identifier: type_specifier */ -#line 551 "MachineIndependent/glslang.y" +#line 552 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5486 "MachineIndependent/glslang_tab.cpp" +#line 5498 "MachineIndependent/glslang_tab.cpp" break; case 35: /* function_identifier: postfix_expression */ -#line 556 "MachineIndependent/glslang.y" +#line 557 "MachineIndependent/glslang.y" { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -5514,50 +5526,50 @@ yyreduce: (yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull); } } -#line 5518 "MachineIndependent/glslang_tab.cpp" +#line 5530 "MachineIndependent/glslang_tab.cpp" break; case 36: /* function_identifier: non_uniform_qualifier */ -#line 584 "MachineIndependent/glslang.y" +#line 585 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5528 "MachineIndependent/glslang_tab.cpp" +#line 5540 "MachineIndependent/glslang_tab.cpp" break; case 37: /* unary_expression: postfix_expression */ -#line 593 "MachineIndependent/glslang.y" +#line 594 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 5539 "MachineIndependent/glslang_tab.cpp" +#line 5551 "MachineIndependent/glslang_tab.cpp" break; case 38: /* unary_expression: INC_OP unary_expression */ -#line 599 "MachineIndependent/glslang.y" +#line 600 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5548 "MachineIndependent/glslang_tab.cpp" +#line 5560 "MachineIndependent/glslang_tab.cpp" break; case 39: /* unary_expression: DEC_OP unary_expression */ -#line 603 "MachineIndependent/glslang.y" +#line 604 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5557 "MachineIndependent/glslang_tab.cpp" +#line 5569 "MachineIndependent/glslang_tab.cpp" break; case 40: /* unary_expression: unary_operator unary_expression */ -#line 607 "MachineIndependent/glslang.y" +#line 608 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -5574,179 +5586,179 @@ yyreduce: (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 5578 "MachineIndependent/glslang_tab.cpp" - break; - - case 41: /* unary_operator: PLUS */ -#line 627 "MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 5584 "MachineIndependent/glslang_tab.cpp" - break; - - case 42: /* unary_operator: DASH */ -#line 628 "MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } #line 5590 "MachineIndependent/glslang_tab.cpp" break; - case 43: /* unary_operator: BANG */ -#line 629 "MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } + case 41: /* unary_operator: PLUS */ +#line 628 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } #line 5596 "MachineIndependent/glslang_tab.cpp" break; - case 44: /* unary_operator: TILDE */ + case 42: /* unary_operator: DASH */ +#line 629 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } +#line 5602 "MachineIndependent/glslang_tab.cpp" + break; + + case 43: /* unary_operator: BANG */ #line 630 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 5608 "MachineIndependent/glslang_tab.cpp" + break; + + case 44: /* unary_operator: TILDE */ +#line 631 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 5603 "MachineIndependent/glslang_tab.cpp" +#line 5615 "MachineIndependent/glslang_tab.cpp" break; case 45: /* multiplicative_expression: unary_expression */ -#line 636 "MachineIndependent/glslang.y" +#line 637 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5609 "MachineIndependent/glslang_tab.cpp" +#line 5621 "MachineIndependent/glslang_tab.cpp" break; case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ -#line 637 "MachineIndependent/glslang.y" +#line 638 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5619 "MachineIndependent/glslang_tab.cpp" +#line 5631 "MachineIndependent/glslang_tab.cpp" break; case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ -#line 642 "MachineIndependent/glslang.y" +#line 643 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5629 "MachineIndependent/glslang_tab.cpp" +#line 5641 "MachineIndependent/glslang_tab.cpp" break; case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ -#line 647 "MachineIndependent/glslang.y" +#line 648 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5640 "MachineIndependent/glslang_tab.cpp" +#line 5652 "MachineIndependent/glslang_tab.cpp" break; case 49: /* additive_expression: multiplicative_expression */ -#line 656 "MachineIndependent/glslang.y" +#line 657 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5646 "MachineIndependent/glslang_tab.cpp" +#line 5658 "MachineIndependent/glslang_tab.cpp" break; case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */ -#line 657 "MachineIndependent/glslang.y" +#line 658 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5656 "MachineIndependent/glslang_tab.cpp" +#line 5668 "MachineIndependent/glslang_tab.cpp" break; case 51: /* additive_expression: additive_expression DASH multiplicative_expression */ -#line 662 "MachineIndependent/glslang.y" +#line 663 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5666 "MachineIndependent/glslang_tab.cpp" +#line 5678 "MachineIndependent/glslang_tab.cpp" break; case 52: /* shift_expression: additive_expression */ -#line 670 "MachineIndependent/glslang.y" +#line 671 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5672 "MachineIndependent/glslang_tab.cpp" +#line 5684 "MachineIndependent/glslang_tab.cpp" break; case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */ -#line 671 "MachineIndependent/glslang.y" +#line 672 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5683 "MachineIndependent/glslang_tab.cpp" +#line 5695 "MachineIndependent/glslang_tab.cpp" break; case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */ -#line 677 "MachineIndependent/glslang.y" +#line 678 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5694 "MachineIndependent/glslang_tab.cpp" +#line 5706 "MachineIndependent/glslang_tab.cpp" break; case 55: /* relational_expression: shift_expression */ -#line 686 "MachineIndependent/glslang.y" +#line 687 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5700 "MachineIndependent/glslang_tab.cpp" +#line 5712 "MachineIndependent/glslang_tab.cpp" break; case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ -#line 687 "MachineIndependent/glslang.y" +#line 688 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5710 "MachineIndependent/glslang_tab.cpp" +#line 5722 "MachineIndependent/glslang_tab.cpp" break; case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ -#line 692 "MachineIndependent/glslang.y" +#line 693 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5720 "MachineIndependent/glslang_tab.cpp" +#line 5732 "MachineIndependent/glslang_tab.cpp" break; case 58: /* relational_expression: relational_expression LE_OP shift_expression */ -#line 697 "MachineIndependent/glslang.y" +#line 698 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5730 "MachineIndependent/glslang_tab.cpp" +#line 5742 "MachineIndependent/glslang_tab.cpp" break; case 59: /* relational_expression: relational_expression GE_OP shift_expression */ -#line 702 "MachineIndependent/glslang.y" +#line 703 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5740 "MachineIndependent/glslang_tab.cpp" +#line 5752 "MachineIndependent/glslang_tab.cpp" break; case 60: /* equality_expression: relational_expression */ -#line 710 "MachineIndependent/glslang.y" +#line 711 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5746 "MachineIndependent/glslang_tab.cpp" +#line 5758 "MachineIndependent/glslang_tab.cpp" break; case 61: /* equality_expression: equality_expression EQ_OP relational_expression */ -#line 711 "MachineIndependent/glslang.y" +#line 712 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -5756,11 +5768,11 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5760 "MachineIndependent/glslang_tab.cpp" +#line 5772 "MachineIndependent/glslang_tab.cpp" break; case 62: /* equality_expression: equality_expression NE_OP relational_expression */ -#line 720 "MachineIndependent/glslang.y" +#line 721 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -5770,124 +5782,124 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5774 "MachineIndependent/glslang_tab.cpp" +#line 5786 "MachineIndependent/glslang_tab.cpp" break; case 63: /* and_expression: equality_expression */ -#line 732 "MachineIndependent/glslang.y" +#line 733 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5780 "MachineIndependent/glslang_tab.cpp" +#line 5792 "MachineIndependent/glslang_tab.cpp" break; case 64: /* and_expression: and_expression AMPERSAND equality_expression */ -#line 733 "MachineIndependent/glslang.y" +#line 734 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5791 "MachineIndependent/glslang_tab.cpp" +#line 5803 "MachineIndependent/glslang_tab.cpp" break; case 65: /* exclusive_or_expression: and_expression */ -#line 742 "MachineIndependent/glslang.y" +#line 743 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5797 "MachineIndependent/glslang_tab.cpp" +#line 5809 "MachineIndependent/glslang_tab.cpp" break; case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ -#line 743 "MachineIndependent/glslang.y" +#line 744 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5808 "MachineIndependent/glslang_tab.cpp" +#line 5820 "MachineIndependent/glslang_tab.cpp" break; case 67: /* inclusive_or_expression: exclusive_or_expression */ -#line 752 "MachineIndependent/glslang.y" +#line 753 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5814 "MachineIndependent/glslang_tab.cpp" +#line 5826 "MachineIndependent/glslang_tab.cpp" break; case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ -#line 753 "MachineIndependent/glslang.y" +#line 754 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5825 "MachineIndependent/glslang_tab.cpp" +#line 5837 "MachineIndependent/glslang_tab.cpp" break; case 69: /* logical_and_expression: inclusive_or_expression */ -#line 762 "MachineIndependent/glslang.y" +#line 763 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5831 "MachineIndependent/glslang_tab.cpp" +#line 5843 "MachineIndependent/glslang_tab.cpp" break; case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ -#line 763 "MachineIndependent/glslang.y" +#line 764 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5841 "MachineIndependent/glslang_tab.cpp" +#line 5853 "MachineIndependent/glslang_tab.cpp" break; case 71: /* logical_xor_expression: logical_and_expression */ -#line 771 "MachineIndependent/glslang.y" +#line 772 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5847 "MachineIndependent/glslang_tab.cpp" +#line 5859 "MachineIndependent/glslang_tab.cpp" break; case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ -#line 772 "MachineIndependent/glslang.y" +#line 773 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5857 "MachineIndependent/glslang_tab.cpp" +#line 5869 "MachineIndependent/glslang_tab.cpp" break; case 73: /* logical_or_expression: logical_xor_expression */ -#line 780 "MachineIndependent/glslang.y" +#line 781 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5863 "MachineIndependent/glslang_tab.cpp" +#line 5875 "MachineIndependent/glslang_tab.cpp" break; case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ -#line 781 "MachineIndependent/glslang.y" +#line 782 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5873 "MachineIndependent/glslang_tab.cpp" +#line 5885 "MachineIndependent/glslang_tab.cpp" break; case 75: /* conditional_expression: logical_or_expression */ -#line 789 "MachineIndependent/glslang.y" +#line 790 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5879 "MachineIndependent/glslang_tab.cpp" +#line 5891 "MachineIndependent/glslang_tab.cpp" break; case 76: /* $@1: %empty */ -#line 790 "MachineIndependent/glslang.y" +#line 791 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 5887 "MachineIndependent/glslang_tab.cpp" +#line 5899 "MachineIndependent/glslang_tab.cpp" break; case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ -#line 793 "MachineIndependent/glslang.y" +#line 794 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -5900,17 +5912,17 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 5904 "MachineIndependent/glslang_tab.cpp" +#line 5916 "MachineIndependent/glslang_tab.cpp" break; case 78: /* assignment_expression: conditional_expression */ -#line 808 "MachineIndependent/glslang.y" +#line 809 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5910 "MachineIndependent/glslang_tab.cpp" +#line 5922 "MachineIndependent/glslang_tab.cpp" break; case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */ -#line 809 "MachineIndependent/glslang.y" +#line 810 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); @@ -5924,119 +5936,119 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 5928 "MachineIndependent/glslang_tab.cpp" +#line 5940 "MachineIndependent/glslang_tab.cpp" break; case 80: /* assignment_operator: EQUAL */ -#line 825 "MachineIndependent/glslang.y" +#line 826 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 5937 "MachineIndependent/glslang_tab.cpp" +#line 5949 "MachineIndependent/glslang_tab.cpp" break; case 81: /* assignment_operator: MUL_ASSIGN */ -#line 829 "MachineIndependent/glslang.y" +#line 830 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 5946 "MachineIndependent/glslang_tab.cpp" +#line 5958 "MachineIndependent/glslang_tab.cpp" break; case 82: /* assignment_operator: DIV_ASSIGN */ -#line 833 "MachineIndependent/glslang.y" +#line 834 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 5955 "MachineIndependent/glslang_tab.cpp" +#line 5967 "MachineIndependent/glslang_tab.cpp" break; case 83: /* assignment_operator: MOD_ASSIGN */ -#line 837 "MachineIndependent/glslang.y" +#line 838 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 5965 "MachineIndependent/glslang_tab.cpp" +#line 5977 "MachineIndependent/glslang_tab.cpp" break; case 84: /* assignment_operator: ADD_ASSIGN */ -#line 842 "MachineIndependent/glslang.y" +#line 843 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 5974 "MachineIndependent/glslang_tab.cpp" +#line 5986 "MachineIndependent/glslang_tab.cpp" break; case 85: /* assignment_operator: SUB_ASSIGN */ -#line 846 "MachineIndependent/glslang.y" +#line 847 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 5983 "MachineIndependent/glslang_tab.cpp" +#line 5995 "MachineIndependent/glslang_tab.cpp" break; case 86: /* assignment_operator: LEFT_ASSIGN */ -#line 850 "MachineIndependent/glslang.y" +#line 851 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 5992 "MachineIndependent/glslang_tab.cpp" +#line 6004 "MachineIndependent/glslang_tab.cpp" break; case 87: /* assignment_operator: RIGHT_ASSIGN */ -#line 854 "MachineIndependent/glslang.y" +#line 855 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 6001 "MachineIndependent/glslang_tab.cpp" +#line 6013 "MachineIndependent/glslang_tab.cpp" break; case 88: /* assignment_operator: AND_ASSIGN */ -#line 858 "MachineIndependent/glslang.y" +#line 859 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 6010 "MachineIndependent/glslang_tab.cpp" +#line 6022 "MachineIndependent/glslang_tab.cpp" break; case 89: /* assignment_operator: XOR_ASSIGN */ -#line 862 "MachineIndependent/glslang.y" +#line 863 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 6019 "MachineIndependent/glslang_tab.cpp" +#line 6031 "MachineIndependent/glslang_tab.cpp" break; case 90: /* assignment_operator: OR_ASSIGN */ -#line 866 "MachineIndependent/glslang.y" +#line 867 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 6028 "MachineIndependent/glslang_tab.cpp" +#line 6040 "MachineIndependent/glslang_tab.cpp" break; case 91: /* expression: assignment_expression */ -#line 873 "MachineIndependent/glslang.y" +#line 874 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6036 "MachineIndependent/glslang_tab.cpp" +#line 6048 "MachineIndependent/glslang_tab.cpp" break; case 92: /* expression: expression COMMA assignment_expression */ -#line 876 "MachineIndependent/glslang.y" +#line 877 "MachineIndependent/glslang.y" { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -6045,62 +6057,62 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 6049 "MachineIndependent/glslang_tab.cpp" +#line 6061 "MachineIndependent/glslang_tab.cpp" break; case 93: /* constant_expression: conditional_expression */ -#line 887 "MachineIndependent/glslang.y" +#line 888 "MachineIndependent/glslang.y" { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6058 "MachineIndependent/glslang_tab.cpp" +#line 6070 "MachineIndependent/glslang_tab.cpp" break; case 94: /* declaration: function_prototype SEMICOLON */ -#line 894 "MachineIndependent/glslang.y" +#line 895 "MachineIndependent/glslang.y" { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6068 "MachineIndependent/glslang_tab.cpp" - break; - - case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ -#line 900 "MachineIndependent/glslang.y" - { - parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); - (yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier - parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); - (yyval.interm.intermNode) = 0; - // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature - } #line 6080 "MachineIndependent/glslang_tab.cpp" break; + case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ +#line 901 "MachineIndependent/glslang.y" + { + parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); + (yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier + parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); + (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + } +#line 6092 "MachineIndependent/glslang_tab.cpp" + break; + case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ -#line 907 "MachineIndependent/glslang.y" +#line 908 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "SPIR-V execution mode qualifier"); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); (yyval.interm.intermNode) = 0; } -#line 6090 "MachineIndependent/glslang_tab.cpp" +#line 6102 "MachineIndependent/glslang_tab.cpp" break; case 97: /* declaration: init_declarator_list SEMICOLON */ -#line 913 "MachineIndependent/glslang.y" +#line 914 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 6100 "MachineIndependent/glslang_tab.cpp" +#line 6112 "MachineIndependent/glslang_tab.cpp" break; case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ -#line 918 "MachineIndependent/glslang.y" +#line 919 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope @@ -6108,75 +6120,75 @@ yyreduce: parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 6112 "MachineIndependent/glslang_tab.cpp" +#line 6124 "MachineIndependent/glslang_tab.cpp" break; case 99: /* declaration: block_structure SEMICOLON */ -#line 925 "MachineIndependent/glslang.y" +#line 926 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } -#line 6121 "MachineIndependent/glslang_tab.cpp" +#line 6133 "MachineIndependent/glslang_tab.cpp" break; case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */ -#line 929 "MachineIndependent/glslang.y" +#line 930 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 6130 "MachineIndependent/glslang_tab.cpp" +#line 6142 "MachineIndependent/glslang_tab.cpp" break; case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ -#line 933 "MachineIndependent/glslang.y" +#line 934 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } -#line 6139 "MachineIndependent/glslang_tab.cpp" +#line 6151 "MachineIndependent/glslang_tab.cpp" break; case 102: /* declaration: type_qualifier SEMICOLON */ -#line 937 "MachineIndependent/glslang.y" +#line 938 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } -#line 6149 "MachineIndependent/glslang_tab.cpp" +#line 6161 "MachineIndependent/glslang_tab.cpp" break; case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */ -#line 942 "MachineIndependent/glslang.y" +#line 943 "MachineIndependent/glslang.y" { parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 6159 "MachineIndependent/glslang_tab.cpp" +#line 6171 "MachineIndependent/glslang_tab.cpp" break; case 104: /* declaration: type_qualifier IDENTIFIER identifier_list SEMICOLON */ -#line 947 "MachineIndependent/glslang.y" +#line 948 "MachineIndependent/glslang.y" { parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 6170 "MachineIndependent/glslang_tab.cpp" +#line 6182 "MachineIndependent/glslang_tab.cpp" break; case 105: /* $@2: %empty */ -#line 956 "MachineIndependent/glslang.y" +#line 957 "MachineIndependent/glslang.y" { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 6176 "MachineIndependent/glslang_tab.cpp" +#line 6188 "MachineIndependent/glslang_tab.cpp" break; case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */ -#line 956 "MachineIndependent/glslang.y" +#line 957 "MachineIndependent/glslang.y" { --parseContext.blockNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; @@ -6186,60 +6198,60 @@ yyreduce: (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 6190 "MachineIndependent/glslang_tab.cpp" +#line 6202 "MachineIndependent/glslang_tab.cpp" break; case 107: /* identifier_list: COMMA IDENTIFIER */ -#line 967 "MachineIndependent/glslang.y" +#line 968 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6199 "MachineIndependent/glslang_tab.cpp" +#line 6211 "MachineIndependent/glslang_tab.cpp" break; case 108: /* identifier_list: identifier_list COMMA IDENTIFIER */ -#line 971 "MachineIndependent/glslang.y" +#line 972 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6208 "MachineIndependent/glslang_tab.cpp" +#line 6220 "MachineIndependent/glslang_tab.cpp" break; case 109: /* function_prototype: function_declarator RIGHT_PAREN */ -#line 978 "MachineIndependent/glslang.y" +#line 979 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 6217 "MachineIndependent/glslang_tab.cpp" +#line 6229 "MachineIndependent/glslang_tab.cpp" break; case 110: /* function_prototype: function_declarator RIGHT_PAREN attribute */ -#line 982 "MachineIndependent/glslang.y" +#line 983 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); (yyval.interm).loc = (yyvsp[-1].lex).loc; parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6228 "MachineIndependent/glslang_tab.cpp" +#line 6240 "MachineIndependent/glslang_tab.cpp" break; case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN */ -#line 988 "MachineIndependent/glslang.y" +#line 989 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); } -#line 6239 "MachineIndependent/glslang_tab.cpp" +#line 6251 "MachineIndependent/glslang_tab.cpp" break; case 112: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */ -#line 994 "MachineIndependent/glslang.y" +#line 995 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); (yyval.interm).loc = (yyvsp[-1].lex).loc; @@ -6247,27 +6259,27 @@ yyreduce: parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6251 "MachineIndependent/glslang_tab.cpp" +#line 6263 "MachineIndependent/glslang_tab.cpp" break; case 113: /* function_declarator: function_header */ -#line 1004 "MachineIndependent/glslang.y" +#line 1005 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6259 "MachineIndependent/glslang_tab.cpp" +#line 6271 "MachineIndependent/glslang_tab.cpp" break; case 114: /* function_declarator: function_header_with_parameters */ -#line 1007 "MachineIndependent/glslang.y" +#line 1008 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6267 "MachineIndependent/glslang_tab.cpp" +#line 6279 "MachineIndependent/glslang_tab.cpp" break; case 115: /* function_header_with_parameters: function_header parameter_declaration */ -#line 1014 "MachineIndependent/glslang.y" +#line 1015 "MachineIndependent/glslang.y" { // Add the parameter (yyval.interm.function) = (yyvsp[-1].interm.function); @@ -6276,11 +6288,11 @@ yyreduce: else delete (yyvsp[0].interm).param.type; } -#line 6280 "MachineIndependent/glslang_tab.cpp" +#line 6292 "MachineIndependent/glslang_tab.cpp" break; case 116: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */ -#line 1022 "MachineIndependent/glslang.y" +#line 1023 "MachineIndependent/glslang.y" { // // Only first parameter of one-parameter functions can be void @@ -6298,11 +6310,11 @@ yyreduce: (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 6302 "MachineIndependent/glslang_tab.cpp" +#line 6314 "MachineIndependent/glslang_tab.cpp" break; case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ -#line 1042 "MachineIndependent/glslang.y" +#line 1043 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -6322,11 +6334,11 @@ yyreduce: function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 6326 "MachineIndependent/glslang_tab.cpp" +#line 6338 "MachineIndependent/glslang_tab.cpp" break; case 118: /* parameter_declarator: type_specifier IDENTIFIER */ -#line 1065 "MachineIndependent/glslang.y" +#line 1066 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6342,11 +6354,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 6346 "MachineIndependent/glslang_tab.cpp" +#line 6358 "MachineIndependent/glslang_tab.cpp" break; case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ -#line 1080 "MachineIndependent/glslang.y" +#line 1081 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6366,11 +6378,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 6370 "MachineIndependent/glslang_tab.cpp" +#line 6382 "MachineIndependent/glslang_tab.cpp" break; case 120: /* parameter_declaration: type_qualifier parameter_declarator */ -#line 1105 "MachineIndependent/glslang.y" +#line 1106 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6382,11 +6394,11 @@ yyreduce: parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6386 "MachineIndependent/glslang_tab.cpp" +#line 6398 "MachineIndependent/glslang_tab.cpp" break; case 121: /* parameter_declaration: parameter_declarator */ -#line 1116 "MachineIndependent/glslang.y" +#line 1117 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6394,11 +6406,11 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 6398 "MachineIndependent/glslang_tab.cpp" +#line 6410 "MachineIndependent/glslang_tab.cpp" break; case 122: /* parameter_declaration: type_qualifier parameter_type_specifier */ -#line 1126 "MachineIndependent/glslang.y" +#line 1127 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6409,11 +6421,11 @@ yyreduce: parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6413 "MachineIndependent/glslang_tab.cpp" +#line 6425 "MachineIndependent/glslang_tab.cpp" break; case 123: /* parameter_declaration: parameter_type_specifier */ -#line 1136 "MachineIndependent/glslang.y" +#line 1137 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6421,68 +6433,68 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 6425 "MachineIndependent/glslang_tab.cpp" +#line 6437 "MachineIndependent/glslang_tab.cpp" break; case 124: /* parameter_type_specifier: type_specifier */ -#line 1146 "MachineIndependent/glslang.y" +#line 1147 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 6436 "MachineIndependent/glslang_tab.cpp" +#line 6448 "MachineIndependent/glslang_tab.cpp" break; case 125: /* init_declarator_list: single_declaration */ -#line 1155 "MachineIndependent/glslang.y" +#line 1156 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 6444 "MachineIndependent/glslang_tab.cpp" +#line 6456 "MachineIndependent/glslang_tab.cpp" break; case 126: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ -#line 1158 "MachineIndependent/glslang.y" +#line 1159 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 6453 "MachineIndependent/glslang_tab.cpp" +#line 6465 "MachineIndependent/glslang_tab.cpp" break; case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ -#line 1162 "MachineIndependent/glslang.y" +#line 1163 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 6462 "MachineIndependent/glslang_tab.cpp" +#line 6474 "MachineIndependent/glslang_tab.cpp" break; case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ -#line 1166 "MachineIndependent/glslang.y" +#line 1167 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-5].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6472 "MachineIndependent/glslang_tab.cpp" +#line 6484 "MachineIndependent/glslang_tab.cpp" break; case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ -#line 1171 "MachineIndependent/glslang.y" +#line 1172 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6482 "MachineIndependent/glslang_tab.cpp" +#line 6494 "MachineIndependent/glslang_tab.cpp" break; case 130: /* single_declaration: fully_specified_type */ -#line 1179 "MachineIndependent/glslang.y" +#line 1180 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; @@ -6490,51 +6502,51 @@ yyreduce: parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 6494 "MachineIndependent/glslang_tab.cpp" +#line 6506 "MachineIndependent/glslang_tab.cpp" break; case 131: /* single_declaration: fully_specified_type IDENTIFIER */ -#line 1186 "MachineIndependent/glslang.y" +#line 1187 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-1].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 6504 "MachineIndependent/glslang_tab.cpp" +#line 6516 "MachineIndependent/glslang_tab.cpp" break; case 132: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ -#line 1191 "MachineIndependent/glslang.y" +#line 1192 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-2].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 6514 "MachineIndependent/glslang_tab.cpp" +#line 6526 "MachineIndependent/glslang_tab.cpp" break; case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ -#line 1196 "MachineIndependent/glslang.y" +#line 1197 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6524 "MachineIndependent/glslang_tab.cpp" +#line 6536 "MachineIndependent/glslang_tab.cpp" break; case 134: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 1201 "MachineIndependent/glslang.y" +#line 1202 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-3].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6534 "MachineIndependent/glslang_tab.cpp" +#line 6546 "MachineIndependent/glslang_tab.cpp" break; case 135: /* fully_specified_type: type_specifier */ -#line 1210 "MachineIndependent/glslang.y" +#line 1211 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -6545,13 +6557,13 @@ yyreduce: } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } -#line 6549 "MachineIndependent/glslang_tab.cpp" +#line 6561 "MachineIndependent/glslang_tab.cpp" break; case 136: /* fully_specified_type: type_qualifier type_specifier */ -#line 1220 "MachineIndependent/glslang.y" +#line 1221 "MachineIndependent/glslang.y" { - parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, false, &(yyvsp[0].interm.type)); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); if ((yyvsp[0].interm.type).arraySizes) { @@ -6574,22 +6586,22 @@ yyreduce: (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 6578 "MachineIndependent/glslang_tab.cpp" +#line 6590 "MachineIndependent/glslang_tab.cpp" break; case 137: /* invariant_qualifier: INVARIANT */ -#line 1247 "MachineIndependent/glslang.y" +#line 1248 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 6589 "MachineIndependent/glslang_tab.cpp" +#line 6601 "MachineIndependent/glslang_tab.cpp" break; case 138: /* interpolation_qualifier: SMOOTH */ -#line 1256 "MachineIndependent/glslang.y" +#line 1257 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -6597,11 +6609,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 6601 "MachineIndependent/glslang_tab.cpp" +#line 6613 "MachineIndependent/glslang_tab.cpp" break; case 139: /* interpolation_qualifier: FLAT */ -#line 1263 "MachineIndependent/glslang.y" +#line 1264 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -6609,11 +6621,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 6613 "MachineIndependent/glslang_tab.cpp" +#line 6625 "MachineIndependent/glslang_tab.cpp" break; case 140: /* interpolation_qualifier: NOPERSPECTIVE */ -#line 1271 "MachineIndependent/glslang.y" +#line 1272 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); @@ -6621,11 +6633,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 6625 "MachineIndependent/glslang_tab.cpp" +#line 6637 "MachineIndependent/glslang_tab.cpp" break; case 141: /* interpolation_qualifier: EXPLICITINTERPAMD */ -#line 1278 "MachineIndependent/glslang.y" +#line 1279 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); @@ -6633,11 +6645,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.explicitInterp = true; } -#line 6637 "MachineIndependent/glslang_tab.cpp" +#line 6649 "MachineIndependent/glslang_tab.cpp" break; case 142: /* interpolation_qualifier: PERVERTEXNV */ -#line 1285 "MachineIndependent/glslang.y" +#line 1286 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6646,11 +6658,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexNV = true; } -#line 6650 "MachineIndependent/glslang_tab.cpp" +#line 6662 "MachineIndependent/glslang_tab.cpp" break; case 143: /* interpolation_qualifier: PERVERTEXEXT */ -#line 1293 "MachineIndependent/glslang.y" +#line 1294 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexEXT"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6659,11 +6671,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexEXT = true; } -#line 6663 "MachineIndependent/glslang_tab.cpp" +#line 6675 "MachineIndependent/glslang_tab.cpp" break; case 144: /* interpolation_qualifier: PERPRIMITIVENV */ -#line 1301 "MachineIndependent/glslang.y" +#line 1302 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); @@ -6674,11 +6686,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6678 "MachineIndependent/glslang_tab.cpp" +#line 6690 "MachineIndependent/glslang_tab.cpp" break; case 145: /* interpolation_qualifier: PERPRIMITIVEEXT */ -#line 1311 "MachineIndependent/glslang.y" +#line 1312 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveEXT"); @@ -6689,11 +6701,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6693 "MachineIndependent/glslang_tab.cpp" +#line 6705 "MachineIndependent/glslang_tab.cpp" break; case 146: /* interpolation_qualifier: PERVIEWNV */ -#line 1321 "MachineIndependent/glslang.y" +#line 1322 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); @@ -6701,11 +6713,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perViewNV = true; } -#line 6705 "MachineIndependent/glslang_tab.cpp" +#line 6717 "MachineIndependent/glslang_tab.cpp" break; case 147: /* interpolation_qualifier: PERTASKNV */ -#line 1328 "MachineIndependent/glslang.y" +#line 1329 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); @@ -6713,84 +6725,84 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perTaskNV = true; } -#line 6717 "MachineIndependent/glslang_tab.cpp" +#line 6729 "MachineIndependent/glslang_tab.cpp" break; case 148: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ -#line 1339 "MachineIndependent/glslang.y" +#line 1340 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 6725 "MachineIndependent/glslang_tab.cpp" +#line 6737 "MachineIndependent/glslang_tab.cpp" break; case 149: /* layout_qualifier_id_list: layout_qualifier_id */ -#line 1345 "MachineIndependent/glslang.y" +#line 1346 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6733 "MachineIndependent/glslang_tab.cpp" +#line 6745 "MachineIndependent/glslang_tab.cpp" break; case 150: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ -#line 1348 "MachineIndependent/glslang.y" +#line 1349 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6743 "MachineIndependent/glslang_tab.cpp" +#line 6755 "MachineIndependent/glslang_tab.cpp" break; case 151: /* layout_qualifier_id: IDENTIFIER */ -#line 1355 "MachineIndependent/glslang.y" +#line 1356 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 6752 "MachineIndependent/glslang_tab.cpp" +#line 6764 "MachineIndependent/glslang_tab.cpp" break; case 152: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ -#line 1359 "MachineIndependent/glslang.y" +#line 1360 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 6761 "MachineIndependent/glslang_tab.cpp" +#line 6773 "MachineIndependent/glslang_tab.cpp" break; case 153: /* layout_qualifier_id: SHARED */ -#line 1363 "MachineIndependent/glslang.y" +#line 1364 "MachineIndependent/glslang.y" { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 6771 "MachineIndependent/glslang_tab.cpp" +#line 6783 "MachineIndependent/glslang_tab.cpp" break; case 154: /* precise_qualifier: PRECISE */ -#line 1372 "MachineIndependent/glslang.y" +#line 1373 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 6782 "MachineIndependent/glslang_tab.cpp" +#line 6794 "MachineIndependent/glslang_tab.cpp" break; case 155: /* type_qualifier: single_type_qualifier */ -#line 1382 "MachineIndependent/glslang.y" +#line 1383 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6790 "MachineIndependent/glslang_tab.cpp" +#line 6802 "MachineIndependent/glslang_tab.cpp" break; case 156: /* type_qualifier: type_qualifier single_type_qualifier */ -#line 1385 "MachineIndependent/glslang.y" +#line 1386 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -6799,151 +6811,151 @@ yyreduce: (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6803 "MachineIndependent/glslang_tab.cpp" +#line 6815 "MachineIndependent/glslang_tab.cpp" break; case 157: /* single_type_qualifier: storage_qualifier */ -#line 1396 "MachineIndependent/glslang.y" +#line 1397 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6811 "MachineIndependent/glslang_tab.cpp" +#line 6823 "MachineIndependent/glslang_tab.cpp" break; case 158: /* single_type_qualifier: layout_qualifier */ -#line 1399 "MachineIndependent/glslang.y" +#line 1400 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6819 "MachineIndependent/glslang_tab.cpp" +#line 6831 "MachineIndependent/glslang_tab.cpp" break; case 159: /* single_type_qualifier: precision_qualifier */ -#line 1402 "MachineIndependent/glslang.y" +#line 1403 "MachineIndependent/glslang.y" { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6828 "MachineIndependent/glslang_tab.cpp" +#line 6840 "MachineIndependent/glslang_tab.cpp" break; case 160: /* single_type_qualifier: interpolation_qualifier */ -#line 1406 "MachineIndependent/glslang.y" +#line 1407 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6837 "MachineIndependent/glslang_tab.cpp" +#line 6849 "MachineIndependent/glslang_tab.cpp" break; case 161: /* single_type_qualifier: invariant_qualifier */ -#line 1410 "MachineIndependent/glslang.y" +#line 1411 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6846 "MachineIndependent/glslang_tab.cpp" +#line 6858 "MachineIndependent/glslang_tab.cpp" break; case 162: /* single_type_qualifier: precise_qualifier */ -#line 1415 "MachineIndependent/glslang.y" +#line 1416 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6855 "MachineIndependent/glslang_tab.cpp" +#line 6867 "MachineIndependent/glslang_tab.cpp" break; case 163: /* single_type_qualifier: non_uniform_qualifier */ -#line 1419 "MachineIndependent/glslang.y" +#line 1420 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6863 "MachineIndependent/glslang_tab.cpp" +#line 6875 "MachineIndependent/glslang_tab.cpp" break; case 164: /* single_type_qualifier: spirv_storage_class_qualifier */ -#line 1422 "MachineIndependent/glslang.y" +#line 1423 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].interm.type).loc, "spirv_storage_class"); parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6873 "MachineIndependent/glslang_tab.cpp" +#line 6885 "MachineIndependent/glslang_tab.cpp" break; case 165: /* single_type_qualifier: spirv_decorate_qualifier */ -#line 1427 "MachineIndependent/glslang.y" +#line 1428 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6882 "MachineIndependent/glslang_tab.cpp" +#line 6894 "MachineIndependent/glslang_tab.cpp" break; case 166: /* single_type_qualifier: SPIRV_BY_REFERENCE */ -#line 1431 "MachineIndependent/glslang.y" +#line 1432 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvByReference(); } -#line 6892 "MachineIndependent/glslang_tab.cpp" +#line 6904 "MachineIndependent/glslang_tab.cpp" break; case 167: /* single_type_qualifier: SPIRV_LITERAL */ -#line 1436 "MachineIndependent/glslang.y" +#line 1437 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvLiteral(); } -#line 6902 "MachineIndependent/glslang_tab.cpp" +#line 6914 "MachineIndependent/glslang_tab.cpp" break; case 168: /* storage_qualifier: CONST */ -#line 1445 "MachineIndependent/glslang.y" +#line 1446 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 6911 "MachineIndependent/glslang_tab.cpp" +#line 6923 "MachineIndependent/glslang_tab.cpp" break; case 169: /* storage_qualifier: INOUT */ -#line 1449 "MachineIndependent/glslang.y" +#line 1450 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 6921 "MachineIndependent/glslang_tab.cpp" +#line 6933 "MachineIndependent/glslang_tab.cpp" break; case 170: /* storage_qualifier: IN */ -#line 1454 "MachineIndependent/glslang.y" +#line 1455 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 6932 "MachineIndependent/glslang_tab.cpp" +#line 6944 "MachineIndependent/glslang_tab.cpp" break; case 171: /* storage_qualifier: OUT */ -#line 1460 "MachineIndependent/glslang.y" +#line 1461 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 6943 "MachineIndependent/glslang_tab.cpp" +#line 6955 "MachineIndependent/glslang_tab.cpp" break; case 172: /* storage_qualifier: CENTROID */ -#line 1466 "MachineIndependent/glslang.y" +#line 1467 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -6951,21 +6963,21 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 6955 "MachineIndependent/glslang_tab.cpp" +#line 6967 "MachineIndependent/glslang_tab.cpp" break; case 173: /* storage_qualifier: UNIFORM */ -#line 1473 "MachineIndependent/glslang.y" +#line 1474 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 6965 "MachineIndependent/glslang_tab.cpp" +#line 6977 "MachineIndependent/glslang_tab.cpp" break; case 174: /* storage_qualifier: SHARED */ -#line 1478 "MachineIndependent/glslang.y" +#line 1479 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -6974,21 +6986,21 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 6978 "MachineIndependent/glslang_tab.cpp" +#line 6990 "MachineIndependent/glslang_tab.cpp" break; case 175: /* storage_qualifier: BUFFER */ -#line 1486 "MachineIndependent/glslang.y" +#line 1487 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 6988 "MachineIndependent/glslang_tab.cpp" +#line 7000 "MachineIndependent/glslang_tab.cpp" break; case 176: /* storage_qualifier: ATTRIBUTE */ -#line 1492 "MachineIndependent/glslang.y" +#line 1493 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -7001,11 +7013,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7005 "MachineIndependent/glslang_tab.cpp" +#line 7017 "MachineIndependent/glslang_tab.cpp" break; case 177: /* storage_qualifier: VARYING */ -#line 1504 "MachineIndependent/glslang.y" +#line 1505 "MachineIndependent/glslang.y" { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -7020,32 +7032,32 @@ yyreduce: else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7024 "MachineIndependent/glslang_tab.cpp" +#line 7036 "MachineIndependent/glslang_tab.cpp" break; case 178: /* storage_qualifier: PATCH */ -#line 1518 "MachineIndependent/glslang.y" +#line 1519 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 7035 "MachineIndependent/glslang_tab.cpp" +#line 7047 "MachineIndependent/glslang_tab.cpp" break; case 179: /* storage_qualifier: SAMPLE */ -#line 1524 "MachineIndependent/glslang.y" +#line 1525 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 7045 "MachineIndependent/glslang_tab.cpp" +#line 7057 "MachineIndependent/glslang_tab.cpp" break; case 180: /* storage_qualifier: HITATTRNV */ -#line 1529 "MachineIndependent/glslang.y" +#line 1530 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7054,11 +7066,24 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7058 "MachineIndependent/glslang_tab.cpp" +#line 7070 "MachineIndependent/glslang_tab.cpp" break; - case 181: /* storage_qualifier: HITATTREXT */ -#line 1537 "MachineIndependent/glslang.y" + case 181: /* storage_qualifier: HITOBJECTATTRNV */ +#line 1538 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqHitObjectAttrNV; + } +#line 7083 "MachineIndependent/glslang_tab.cpp" + break; + + case 182: /* storage_qualifier: HITATTREXT */ +#line 1546 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7067,11 +7092,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7071 "MachineIndependent/glslang_tab.cpp" +#line 7096 "MachineIndependent/glslang_tab.cpp" break; - case 182: /* storage_qualifier: PAYLOADNV */ -#line 1545 "MachineIndependent/glslang.y" + case 183: /* storage_qualifier: PAYLOADNV */ +#line 1554 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7080,11 +7105,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7084 "MachineIndependent/glslang_tab.cpp" +#line 7109 "MachineIndependent/glslang_tab.cpp" break; - case 183: /* storage_qualifier: PAYLOADEXT */ -#line 1553 "MachineIndependent/glslang.y" + case 184: /* storage_qualifier: PAYLOADEXT */ +#line 1562 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7093,11 +7118,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7097 "MachineIndependent/glslang_tab.cpp" +#line 7122 "MachineIndependent/glslang_tab.cpp" break; - case 184: /* storage_qualifier: PAYLOADINNV */ -#line 1561 "MachineIndependent/glslang.y" + case 185: /* storage_qualifier: PAYLOADINNV */ +#line 1570 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7106,11 +7131,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7110 "MachineIndependent/glslang_tab.cpp" +#line 7135 "MachineIndependent/glslang_tab.cpp" break; - case 185: /* storage_qualifier: PAYLOADINEXT */ -#line 1569 "MachineIndependent/glslang.y" + case 186: /* storage_qualifier: PAYLOADINEXT */ +#line 1578 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7119,11 +7144,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7123 "MachineIndependent/glslang_tab.cpp" +#line 7148 "MachineIndependent/glslang_tab.cpp" break; - case 186: /* storage_qualifier: CALLDATANV */ -#line 1577 "MachineIndependent/glslang.y" + case 187: /* storage_qualifier: CALLDATANV */ +#line 1586 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7132,11 +7157,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7136 "MachineIndependent/glslang_tab.cpp" +#line 7161 "MachineIndependent/glslang_tab.cpp" break; - case 187: /* storage_qualifier: CALLDATAEXT */ -#line 1585 "MachineIndependent/glslang.y" + case 188: /* storage_qualifier: CALLDATAEXT */ +#line 1594 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7145,11 +7170,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7149 "MachineIndependent/glslang_tab.cpp" +#line 7174 "MachineIndependent/glslang_tab.cpp" break; - case 188: /* storage_qualifier: CALLDATAINNV */ -#line 1593 "MachineIndependent/glslang.y" + case 189: /* storage_qualifier: CALLDATAINNV */ +#line 1602 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); @@ -7157,11 +7182,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7161 "MachineIndependent/glslang_tab.cpp" +#line 7186 "MachineIndependent/glslang_tab.cpp" break; - case 189: /* storage_qualifier: CALLDATAINEXT */ -#line 1600 "MachineIndependent/glslang.y" + case 190: /* storage_qualifier: CALLDATAINEXT */ +#line 1609 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); @@ -7169,138 +7194,138 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7173 "MachineIndependent/glslang_tab.cpp" +#line 7198 "MachineIndependent/glslang_tab.cpp" break; - case 190: /* storage_qualifier: COHERENT */ -#line 1607 "MachineIndependent/glslang.y" + case 191: /* storage_qualifier: COHERENT */ +#line 1616 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 7182 "MachineIndependent/glslang_tab.cpp" +#line 7207 "MachineIndependent/glslang_tab.cpp" break; - case 191: /* storage_qualifier: DEVICECOHERENT */ -#line 1611 "MachineIndependent/glslang.y" + case 192: /* storage_qualifier: DEVICECOHERENT */ +#line 1620 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 7192 "MachineIndependent/glslang_tab.cpp" +#line 7217 "MachineIndependent/glslang_tab.cpp" break; - case 192: /* storage_qualifier: QUEUEFAMILYCOHERENT */ -#line 1616 "MachineIndependent/glslang.y" + case 193: /* storage_qualifier: QUEUEFAMILYCOHERENT */ +#line 1625 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 7202 "MachineIndependent/glslang_tab.cpp" +#line 7227 "MachineIndependent/glslang_tab.cpp" break; - case 193: /* storage_qualifier: WORKGROUPCOHERENT */ -#line 1621 "MachineIndependent/glslang.y" + case 194: /* storage_qualifier: WORKGROUPCOHERENT */ +#line 1630 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 7212 "MachineIndependent/glslang_tab.cpp" +#line 7237 "MachineIndependent/glslang_tab.cpp" break; - case 194: /* storage_qualifier: SUBGROUPCOHERENT */ -#line 1626 "MachineIndependent/glslang.y" + case 195: /* storage_qualifier: SUBGROUPCOHERENT */ +#line 1635 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 7222 "MachineIndependent/glslang_tab.cpp" +#line 7247 "MachineIndependent/glslang_tab.cpp" break; - case 195: /* storage_qualifier: NONPRIVATE */ -#line 1631 "MachineIndependent/glslang.y" + case 196: /* storage_qualifier: NONPRIVATE */ +#line 1640 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 7232 "MachineIndependent/glslang_tab.cpp" +#line 7257 "MachineIndependent/glslang_tab.cpp" break; - case 196: /* storage_qualifier: SHADERCALLCOHERENT */ -#line 1636 "MachineIndependent/glslang.y" + case 197: /* storage_qualifier: SHADERCALLCOHERENT */ +#line 1645 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); (yyval.interm.type).qualifier.shadercallcoherent = true; } -#line 7242 "MachineIndependent/glslang_tab.cpp" +#line 7267 "MachineIndependent/glslang_tab.cpp" break; - case 197: /* storage_qualifier: VOLATILE */ -#line 1641 "MachineIndependent/glslang.y" + case 198: /* storage_qualifier: VOLATILE */ +#line 1650 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 7251 "MachineIndependent/glslang_tab.cpp" +#line 7276 "MachineIndependent/glslang_tab.cpp" break; - case 198: /* storage_qualifier: RESTRICT */ -#line 1645 "MachineIndependent/glslang.y" + case 199: /* storage_qualifier: RESTRICT */ +#line 1654 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 7260 "MachineIndependent/glslang_tab.cpp" +#line 7285 "MachineIndependent/glslang_tab.cpp" break; - case 199: /* storage_qualifier: READONLY */ -#line 1649 "MachineIndependent/glslang.y" + case 200: /* storage_qualifier: READONLY */ +#line 1658 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 7269 "MachineIndependent/glslang_tab.cpp" +#line 7294 "MachineIndependent/glslang_tab.cpp" break; - case 200: /* storage_qualifier: WRITEONLY */ -#line 1653 "MachineIndependent/glslang.y" + case 201: /* storage_qualifier: WRITEONLY */ +#line 1662 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 7278 "MachineIndependent/glslang_tab.cpp" +#line 7303 "MachineIndependent/glslang_tab.cpp" break; - case 201: /* storage_qualifier: SUBROUTINE */ -#line 1657 "MachineIndependent/glslang.y" + case 202: /* storage_qualifier: SUBROUTINE */ +#line 1666 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 7289 "MachineIndependent/glslang_tab.cpp" +#line 7314 "MachineIndependent/glslang_tab.cpp" break; - case 202: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ -#line 1663 "MachineIndependent/glslang.y" + case 203: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ +#line 1672 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 7300 "MachineIndependent/glslang_tab.cpp" +#line 7325 "MachineIndependent/glslang_tab.cpp" break; - case 203: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ -#line 1669 "MachineIndependent/glslang.y" + case 204: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ +#line 1678 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskPayloadSharedEXT"); @@ -7308,48 +7333,48 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT; } -#line 7312 "MachineIndependent/glslang_tab.cpp" +#line 7337 "MachineIndependent/glslang_tab.cpp" break; - case 204: /* non_uniform_qualifier: NONUNIFORM */ -#line 1681 "MachineIndependent/glslang.y" + case 205: /* non_uniform_qualifier: NONUNIFORM */ +#line 1690 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 7321 "MachineIndependent/glslang_tab.cpp" +#line 7346 "MachineIndependent/glslang_tab.cpp" break; - case 205: /* type_name_list: IDENTIFIER */ -#line 1688 "MachineIndependent/glslang.y" + case 206: /* type_name_list: IDENTIFIER */ +#line 1697 "MachineIndependent/glslang.y" { // TODO } -#line 7329 "MachineIndependent/glslang_tab.cpp" +#line 7354 "MachineIndependent/glslang_tab.cpp" break; - case 206: /* type_name_list: type_name_list COMMA IDENTIFIER */ -#line 1691 "MachineIndependent/glslang.y" + case 207: /* type_name_list: type_name_list COMMA IDENTIFIER */ +#line 1700 "MachineIndependent/glslang.y" { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 7339 "MachineIndependent/glslang_tab.cpp" +#line 7364 "MachineIndependent/glslang_tab.cpp" break; - case 207: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ -#line 1700 "MachineIndependent/glslang.y" + case 208: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ +#line 1709 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); (yyval.interm.type).typeParameters = (yyvsp[0].interm.typeParameters); } -#line 7349 "MachineIndependent/glslang_tab.cpp" +#line 7374 "MachineIndependent/glslang_tab.cpp" break; - case 208: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ -#line 1705 "MachineIndependent/glslang.y" + case 209: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ +#line 1714 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-2].interm.type); @@ -7357,21 +7382,21 @@ yyreduce: (yyval.interm.type).typeParameters = (yyvsp[-1].interm.typeParameters); (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 7361 "MachineIndependent/glslang_tab.cpp" +#line 7386 "MachineIndependent/glslang_tab.cpp" break; - case 209: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ -#line 1715 "MachineIndependent/glslang.y" + case 210: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ +#line 1724 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 7371 "MachineIndependent/glslang_tab.cpp" +#line 7396 "MachineIndependent/glslang_tab.cpp" break; - case 210: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1720 "MachineIndependent/glslang.y" + case 211: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1729 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -7380,20 +7405,20 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7384 "MachineIndependent/glslang_tab.cpp" +#line 7409 "MachineIndependent/glslang_tab.cpp" break; - case 211: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ -#line 1728 "MachineIndependent/glslang.y" + case 212: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ +#line 1737 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 7393 "MachineIndependent/glslang_tab.cpp" +#line 7418 "MachineIndependent/glslang_tab.cpp" break; - case 212: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1732 "MachineIndependent/glslang.y" + case 213: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1741 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); @@ -7401,35 +7426,35 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7405 "MachineIndependent/glslang_tab.cpp" +#line 7430 "MachineIndependent/glslang_tab.cpp" break; - case 213: /* type_parameter_specifier_opt: type_parameter_specifier */ -#line 1742 "MachineIndependent/glslang.y" + case 214: /* type_parameter_specifier_opt: type_parameter_specifier */ +#line 1751 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); } -#line 7413 "MachineIndependent/glslang_tab.cpp" +#line 7438 "MachineIndependent/glslang_tab.cpp" break; - case 214: /* type_parameter_specifier_opt: %empty */ -#line 1745 "MachineIndependent/glslang.y" + case 215: /* type_parameter_specifier_opt: %empty */ +#line 1754 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = 0; } -#line 7421 "MachineIndependent/glslang_tab.cpp" +#line 7446 "MachineIndependent/glslang_tab.cpp" break; - case 215: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ -#line 1751 "MachineIndependent/glslang.y" + case 216: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ +#line 1760 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); } -#line 7429 "MachineIndependent/glslang_tab.cpp" +#line 7454 "MachineIndependent/glslang_tab.cpp" break; - case 216: /* type_parameter_specifier_list: unary_expression */ -#line 1757 "MachineIndependent/glslang.y" + case 217: /* type_parameter_specifier_list: unary_expression */ +#line 1766 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TArraySizes; @@ -7437,11 +7462,11 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 7441 "MachineIndependent/glslang_tab.cpp" +#line 7466 "MachineIndependent/glslang_tab.cpp" break; - case 217: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ -#line 1764 "MachineIndependent/glslang.y" + case 218: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ +#line 1773 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters); @@ -7449,300 +7474,300 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 7453 "MachineIndependent/glslang_tab.cpp" +#line 7478 "MachineIndependent/glslang_tab.cpp" break; - case 218: /* type_specifier_nonarray: VOID */ -#line 1774 "MachineIndependent/glslang.y" + case 219: /* type_specifier_nonarray: VOID */ +#line 1783 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 7462 "MachineIndependent/glslang_tab.cpp" +#line 7487 "MachineIndependent/glslang_tab.cpp" break; - case 219: /* type_specifier_nonarray: FLOAT */ -#line 1778 "MachineIndependent/glslang.y" + case 220: /* type_specifier_nonarray: FLOAT */ +#line 1787 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7471 "MachineIndependent/glslang_tab.cpp" +#line 7496 "MachineIndependent/glslang_tab.cpp" break; - case 220: /* type_specifier_nonarray: INT */ -#line 1782 "MachineIndependent/glslang.y" + case 221: /* type_specifier_nonarray: INT */ +#line 1791 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7480 "MachineIndependent/glslang_tab.cpp" +#line 7505 "MachineIndependent/glslang_tab.cpp" break; - case 221: /* type_specifier_nonarray: UINT */ -#line 1786 "MachineIndependent/glslang.y" + case 222: /* type_specifier_nonarray: UINT */ +#line 1795 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7490 "MachineIndependent/glslang_tab.cpp" +#line 7515 "MachineIndependent/glslang_tab.cpp" break; - case 222: /* type_specifier_nonarray: BOOL */ -#line 1791 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - } -#line 7499 "MachineIndependent/glslang_tab.cpp" - break; - - case 223: /* type_specifier_nonarray: VEC2 */ -#line 1795 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); - } -#line 7509 "MachineIndependent/glslang_tab.cpp" - break; - - case 224: /* type_specifier_nonarray: VEC3 */ + case 223: /* type_specifier_nonarray: BOOL */ #line 1800 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + } +#line 7524 "MachineIndependent/glslang_tab.cpp" + break; + + case 224: /* type_specifier_nonarray: VEC2 */ +#line 1804 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } +#line 7534 "MachineIndependent/glslang_tab.cpp" + break; + + case 225: /* type_specifier_nonarray: VEC3 */ +#line 1809 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 7519 "MachineIndependent/glslang_tab.cpp" +#line 7544 "MachineIndependent/glslang_tab.cpp" break; - case 225: /* type_specifier_nonarray: VEC4 */ -#line 1805 "MachineIndependent/glslang.y" + case 226: /* type_specifier_nonarray: VEC4 */ +#line 1814 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 7529 "MachineIndependent/glslang_tab.cpp" +#line 7554 "MachineIndependent/glslang_tab.cpp" break; - case 226: /* type_specifier_nonarray: BVEC2 */ -#line 1810 "MachineIndependent/glslang.y" + case 227: /* type_specifier_nonarray: BVEC2 */ +#line 1819 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(2); } -#line 7539 "MachineIndependent/glslang_tab.cpp" +#line 7564 "MachineIndependent/glslang_tab.cpp" break; - case 227: /* type_specifier_nonarray: BVEC3 */ -#line 1815 "MachineIndependent/glslang.y" + case 228: /* type_specifier_nonarray: BVEC3 */ +#line 1824 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(3); } -#line 7549 "MachineIndependent/glslang_tab.cpp" +#line 7574 "MachineIndependent/glslang_tab.cpp" break; - case 228: /* type_specifier_nonarray: BVEC4 */ -#line 1820 "MachineIndependent/glslang.y" + case 229: /* type_specifier_nonarray: BVEC4 */ +#line 1829 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(4); } -#line 7559 "MachineIndependent/glslang_tab.cpp" +#line 7584 "MachineIndependent/glslang_tab.cpp" break; - case 229: /* type_specifier_nonarray: IVEC2 */ -#line 1825 "MachineIndependent/glslang.y" + case 230: /* type_specifier_nonarray: IVEC2 */ +#line 1834 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 7569 "MachineIndependent/glslang_tab.cpp" +#line 7594 "MachineIndependent/glslang_tab.cpp" break; - case 230: /* type_specifier_nonarray: IVEC3 */ -#line 1830 "MachineIndependent/glslang.y" + case 231: /* type_specifier_nonarray: IVEC3 */ +#line 1839 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 7579 "MachineIndependent/glslang_tab.cpp" +#line 7604 "MachineIndependent/glslang_tab.cpp" break; - case 231: /* type_specifier_nonarray: IVEC4 */ -#line 1835 "MachineIndependent/glslang.y" + case 232: /* type_specifier_nonarray: IVEC4 */ +#line 1844 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 7589 "MachineIndependent/glslang_tab.cpp" +#line 7614 "MachineIndependent/glslang_tab.cpp" break; - case 232: /* type_specifier_nonarray: UVEC2 */ -#line 1840 "MachineIndependent/glslang.y" + case 233: /* type_specifier_nonarray: UVEC2 */ +#line 1849 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 7600 "MachineIndependent/glslang_tab.cpp" +#line 7625 "MachineIndependent/glslang_tab.cpp" break; - case 233: /* type_specifier_nonarray: UVEC3 */ -#line 1846 "MachineIndependent/glslang.y" + case 234: /* type_specifier_nonarray: UVEC3 */ +#line 1855 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 7611 "MachineIndependent/glslang_tab.cpp" +#line 7636 "MachineIndependent/glslang_tab.cpp" break; - case 234: /* type_specifier_nonarray: UVEC4 */ -#line 1852 "MachineIndependent/glslang.y" + case 235: /* type_specifier_nonarray: UVEC4 */ +#line 1861 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 7622 "MachineIndependent/glslang_tab.cpp" +#line 7647 "MachineIndependent/glslang_tab.cpp" break; - case 235: /* type_specifier_nonarray: MAT2 */ -#line 1858 "MachineIndependent/glslang.y" + case 236: /* type_specifier_nonarray: MAT2 */ +#line 1867 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7632 "MachineIndependent/glslang_tab.cpp" +#line 7657 "MachineIndependent/glslang_tab.cpp" break; - case 236: /* type_specifier_nonarray: MAT3 */ -#line 1863 "MachineIndependent/glslang.y" + case 237: /* type_specifier_nonarray: MAT3 */ +#line 1872 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7642 "MachineIndependent/glslang_tab.cpp" +#line 7667 "MachineIndependent/glslang_tab.cpp" break; - case 237: /* type_specifier_nonarray: MAT4 */ -#line 1868 "MachineIndependent/glslang.y" + case 238: /* type_specifier_nonarray: MAT4 */ +#line 1877 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7652 "MachineIndependent/glslang_tab.cpp" +#line 7677 "MachineIndependent/glslang_tab.cpp" break; - case 238: /* type_specifier_nonarray: MAT2X2 */ -#line 1873 "MachineIndependent/glslang.y" + case 239: /* type_specifier_nonarray: MAT2X2 */ +#line 1882 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7662 "MachineIndependent/glslang_tab.cpp" +#line 7687 "MachineIndependent/glslang_tab.cpp" break; - case 239: /* type_specifier_nonarray: MAT2X3 */ -#line 1878 "MachineIndependent/glslang.y" + case 240: /* type_specifier_nonarray: MAT2X3 */ +#line 1887 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 7672 "MachineIndependent/glslang_tab.cpp" +#line 7697 "MachineIndependent/glslang_tab.cpp" break; - case 240: /* type_specifier_nonarray: MAT2X4 */ -#line 1883 "MachineIndependent/glslang.y" + case 241: /* type_specifier_nonarray: MAT2X4 */ +#line 1892 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 7682 "MachineIndependent/glslang_tab.cpp" +#line 7707 "MachineIndependent/glslang_tab.cpp" break; - case 241: /* type_specifier_nonarray: MAT3X2 */ -#line 1888 "MachineIndependent/glslang.y" + case 242: /* type_specifier_nonarray: MAT3X2 */ +#line 1897 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 7692 "MachineIndependent/glslang_tab.cpp" +#line 7717 "MachineIndependent/glslang_tab.cpp" break; - case 242: /* type_specifier_nonarray: MAT3X3 */ -#line 1893 "MachineIndependent/glslang.y" + case 243: /* type_specifier_nonarray: MAT3X3 */ +#line 1902 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7702 "MachineIndependent/glslang_tab.cpp" +#line 7727 "MachineIndependent/glslang_tab.cpp" break; - case 243: /* type_specifier_nonarray: MAT3X4 */ -#line 1898 "MachineIndependent/glslang.y" + case 244: /* type_specifier_nonarray: MAT3X4 */ +#line 1907 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7712 "MachineIndependent/glslang_tab.cpp" +#line 7737 "MachineIndependent/glslang_tab.cpp" break; - case 244: /* type_specifier_nonarray: MAT4X2 */ -#line 1903 "MachineIndependent/glslang.y" + case 245: /* type_specifier_nonarray: MAT4X2 */ +#line 1912 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7722 "MachineIndependent/glslang_tab.cpp" +#line 7747 "MachineIndependent/glslang_tab.cpp" break; - case 245: /* type_specifier_nonarray: MAT4X3 */ -#line 1908 "MachineIndependent/glslang.y" + case 246: /* type_specifier_nonarray: MAT4X3 */ +#line 1917 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7732 "MachineIndependent/glslang_tab.cpp" +#line 7757 "MachineIndependent/glslang_tab.cpp" break; - case 246: /* type_specifier_nonarray: MAT4X4 */ -#line 1913 "MachineIndependent/glslang.y" + case 247: /* type_specifier_nonarray: MAT4X4 */ +#line 1922 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7742 "MachineIndependent/glslang_tab.cpp" +#line 7767 "MachineIndependent/glslang_tab.cpp" break; - case 247: /* type_specifier_nonarray: DOUBLE */ -#line 1919 "MachineIndependent/glslang.y" + case 248: /* type_specifier_nonarray: DOUBLE */ +#line 1928 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7750,121 +7775,121 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7754 "MachineIndependent/glslang_tab.cpp" +#line 7779 "MachineIndependent/glslang_tab.cpp" break; - case 248: /* type_specifier_nonarray: FLOAT16_T */ -#line 1926 "MachineIndependent/glslang.y" + case 249: /* type_specifier_nonarray: FLOAT16_T */ +#line 1935 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 7764 "MachineIndependent/glslang_tab.cpp" +#line 7789 "MachineIndependent/glslang_tab.cpp" break; - case 249: /* type_specifier_nonarray: FLOAT32_T */ -#line 1931 "MachineIndependent/glslang.y" + case 250: /* type_specifier_nonarray: FLOAT32_T */ +#line 1940 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7774 "MachineIndependent/glslang_tab.cpp" +#line 7799 "MachineIndependent/glslang_tab.cpp" break; - case 250: /* type_specifier_nonarray: FLOAT64_T */ -#line 1936 "MachineIndependent/glslang.y" + case 251: /* type_specifier_nonarray: FLOAT64_T */ +#line 1945 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7784 "MachineIndependent/glslang_tab.cpp" +#line 7809 "MachineIndependent/glslang_tab.cpp" break; - case 251: /* type_specifier_nonarray: INT8_T */ -#line 1941 "MachineIndependent/glslang.y" + case 252: /* type_specifier_nonarray: INT8_T */ +#line 1950 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 7794 "MachineIndependent/glslang_tab.cpp" +#line 7819 "MachineIndependent/glslang_tab.cpp" break; - case 252: /* type_specifier_nonarray: UINT8_T */ -#line 1946 "MachineIndependent/glslang.y" + case 253: /* type_specifier_nonarray: UINT8_T */ +#line 1955 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 7804 "MachineIndependent/glslang_tab.cpp" +#line 7829 "MachineIndependent/glslang_tab.cpp" break; - case 253: /* type_specifier_nonarray: INT16_T */ -#line 1951 "MachineIndependent/glslang.y" + case 254: /* type_specifier_nonarray: INT16_T */ +#line 1960 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 7814 "MachineIndependent/glslang_tab.cpp" +#line 7839 "MachineIndependent/glslang_tab.cpp" break; - case 254: /* type_specifier_nonarray: UINT16_T */ -#line 1956 "MachineIndependent/glslang.y" + case 255: /* type_specifier_nonarray: UINT16_T */ +#line 1965 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 7824 "MachineIndependent/glslang_tab.cpp" +#line 7849 "MachineIndependent/glslang_tab.cpp" break; - case 255: /* type_specifier_nonarray: INT32_T */ -#line 1961 "MachineIndependent/glslang.y" + case 256: /* type_specifier_nonarray: INT32_T */ +#line 1970 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7834 "MachineIndependent/glslang_tab.cpp" +#line 7859 "MachineIndependent/glslang_tab.cpp" break; - case 256: /* type_specifier_nonarray: UINT32_T */ -#line 1966 "MachineIndependent/glslang.y" + case 257: /* type_specifier_nonarray: UINT32_T */ +#line 1975 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7844 "MachineIndependent/glslang_tab.cpp" +#line 7869 "MachineIndependent/glslang_tab.cpp" break; - case 257: /* type_specifier_nonarray: INT64_T */ -#line 1971 "MachineIndependent/glslang.y" + case 258: /* type_specifier_nonarray: INT64_T */ +#line 1980 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 7854 "MachineIndependent/glslang_tab.cpp" +#line 7879 "MachineIndependent/glslang_tab.cpp" break; - case 258: /* type_specifier_nonarray: UINT64_T */ -#line 1976 "MachineIndependent/glslang.y" + case 259: /* type_specifier_nonarray: UINT64_T */ +#line 1985 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 7864 "MachineIndependent/glslang_tab.cpp" +#line 7889 "MachineIndependent/glslang_tab.cpp" break; - case 259: /* type_specifier_nonarray: DVEC2 */ -#line 1981 "MachineIndependent/glslang.y" + case 260: /* type_specifier_nonarray: DVEC2 */ +#line 1990 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7873,11 +7898,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 7877 "MachineIndependent/glslang_tab.cpp" +#line 7902 "MachineIndependent/glslang_tab.cpp" break; - case 260: /* type_specifier_nonarray: DVEC3 */ -#line 1989 "MachineIndependent/glslang.y" + case 261: /* type_specifier_nonarray: DVEC3 */ +#line 1998 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7886,11 +7911,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 7890 "MachineIndependent/glslang_tab.cpp" +#line 7915 "MachineIndependent/glslang_tab.cpp" break; - case 261: /* type_specifier_nonarray: DVEC4 */ -#line 1997 "MachineIndependent/glslang.y" + case 262: /* type_specifier_nonarray: DVEC4 */ +#line 2006 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7899,374 +7924,374 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 7903 "MachineIndependent/glslang_tab.cpp" +#line 7928 "MachineIndependent/glslang_tab.cpp" break; - case 262: /* type_specifier_nonarray: F16VEC2 */ -#line 2005 "MachineIndependent/glslang.y" + case 263: /* type_specifier_nonarray: F16VEC2 */ +#line 2014 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(2); } -#line 7914 "MachineIndependent/glslang_tab.cpp" +#line 7939 "MachineIndependent/glslang_tab.cpp" break; - case 263: /* type_specifier_nonarray: F16VEC3 */ -#line 2011 "MachineIndependent/glslang.y" + case 264: /* type_specifier_nonarray: F16VEC3 */ +#line 2020 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(3); } -#line 7925 "MachineIndependent/glslang_tab.cpp" +#line 7950 "MachineIndependent/glslang_tab.cpp" break; - case 264: /* type_specifier_nonarray: F16VEC4 */ -#line 2017 "MachineIndependent/glslang.y" + case 265: /* type_specifier_nonarray: F16VEC4 */ +#line 2026 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(4); } -#line 7936 "MachineIndependent/glslang_tab.cpp" +#line 7961 "MachineIndependent/glslang_tab.cpp" break; - case 265: /* type_specifier_nonarray: F32VEC2 */ -#line 2023 "MachineIndependent/glslang.y" + case 266: /* type_specifier_nonarray: F32VEC2 */ +#line 2032 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 7947 "MachineIndependent/glslang_tab.cpp" +#line 7972 "MachineIndependent/glslang_tab.cpp" break; - case 266: /* type_specifier_nonarray: F32VEC3 */ -#line 2029 "MachineIndependent/glslang.y" + case 267: /* type_specifier_nonarray: F32VEC3 */ +#line 2038 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 7958 "MachineIndependent/glslang_tab.cpp" +#line 7983 "MachineIndependent/glslang_tab.cpp" break; - case 267: /* type_specifier_nonarray: F32VEC4 */ -#line 2035 "MachineIndependent/glslang.y" + case 268: /* type_specifier_nonarray: F32VEC4 */ +#line 2044 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 7969 "MachineIndependent/glslang_tab.cpp" +#line 7994 "MachineIndependent/glslang_tab.cpp" break; - case 268: /* type_specifier_nonarray: F64VEC2 */ -#line 2041 "MachineIndependent/glslang.y" + case 269: /* type_specifier_nonarray: F64VEC2 */ +#line 2050 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 7980 "MachineIndependent/glslang_tab.cpp" +#line 8005 "MachineIndependent/glslang_tab.cpp" break; - case 269: /* type_specifier_nonarray: F64VEC3 */ -#line 2047 "MachineIndependent/glslang.y" + case 270: /* type_specifier_nonarray: F64VEC3 */ +#line 2056 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 7991 "MachineIndependent/glslang_tab.cpp" +#line 8016 "MachineIndependent/glslang_tab.cpp" break; - case 270: /* type_specifier_nonarray: F64VEC4 */ -#line 2053 "MachineIndependent/glslang.y" + case 271: /* type_specifier_nonarray: F64VEC4 */ +#line 2062 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 8002 "MachineIndependent/glslang_tab.cpp" +#line 8027 "MachineIndependent/glslang_tab.cpp" break; - case 271: /* type_specifier_nonarray: I8VEC2 */ -#line 2059 "MachineIndependent/glslang.y" + case 272: /* type_specifier_nonarray: I8VEC2 */ +#line 2068 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(2); } -#line 8013 "MachineIndependent/glslang_tab.cpp" +#line 8038 "MachineIndependent/glslang_tab.cpp" break; - case 272: /* type_specifier_nonarray: I8VEC3 */ -#line 2065 "MachineIndependent/glslang.y" + case 273: /* type_specifier_nonarray: I8VEC3 */ +#line 2074 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(3); } -#line 8024 "MachineIndependent/glslang_tab.cpp" +#line 8049 "MachineIndependent/glslang_tab.cpp" break; - case 273: /* type_specifier_nonarray: I8VEC4 */ -#line 2071 "MachineIndependent/glslang.y" + case 274: /* type_specifier_nonarray: I8VEC4 */ +#line 2080 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(4); } -#line 8035 "MachineIndependent/glslang_tab.cpp" +#line 8060 "MachineIndependent/glslang_tab.cpp" break; - case 274: /* type_specifier_nonarray: I16VEC2 */ -#line 2077 "MachineIndependent/glslang.y" + case 275: /* type_specifier_nonarray: I16VEC2 */ +#line 2086 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(2); } -#line 8046 "MachineIndependent/glslang_tab.cpp" +#line 8071 "MachineIndependent/glslang_tab.cpp" break; - case 275: /* type_specifier_nonarray: I16VEC3 */ -#line 2083 "MachineIndependent/glslang.y" + case 276: /* type_specifier_nonarray: I16VEC3 */ +#line 2092 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(3); } -#line 8057 "MachineIndependent/glslang_tab.cpp" +#line 8082 "MachineIndependent/glslang_tab.cpp" break; - case 276: /* type_specifier_nonarray: I16VEC4 */ -#line 2089 "MachineIndependent/glslang.y" + case 277: /* type_specifier_nonarray: I16VEC4 */ +#line 2098 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(4); } -#line 8068 "MachineIndependent/glslang_tab.cpp" +#line 8093 "MachineIndependent/glslang_tab.cpp" break; - case 277: /* type_specifier_nonarray: I32VEC2 */ -#line 2095 "MachineIndependent/glslang.y" + case 278: /* type_specifier_nonarray: I32VEC2 */ +#line 2104 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 8079 "MachineIndependent/glslang_tab.cpp" +#line 8104 "MachineIndependent/glslang_tab.cpp" break; - case 278: /* type_specifier_nonarray: I32VEC3 */ -#line 2101 "MachineIndependent/glslang.y" + case 279: /* type_specifier_nonarray: I32VEC3 */ +#line 2110 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 8090 "MachineIndependent/glslang_tab.cpp" +#line 8115 "MachineIndependent/glslang_tab.cpp" break; - case 279: /* type_specifier_nonarray: I32VEC4 */ -#line 2107 "MachineIndependent/glslang.y" + case 280: /* type_specifier_nonarray: I32VEC4 */ +#line 2116 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 8101 "MachineIndependent/glslang_tab.cpp" +#line 8126 "MachineIndependent/glslang_tab.cpp" break; - case 280: /* type_specifier_nonarray: I64VEC2 */ -#line 2113 "MachineIndependent/glslang.y" + case 281: /* type_specifier_nonarray: I64VEC2 */ +#line 2122 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(2); } -#line 8112 "MachineIndependent/glslang_tab.cpp" +#line 8137 "MachineIndependent/glslang_tab.cpp" break; - case 281: /* type_specifier_nonarray: I64VEC3 */ -#line 2119 "MachineIndependent/glslang.y" + case 282: /* type_specifier_nonarray: I64VEC3 */ +#line 2128 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(3); } -#line 8123 "MachineIndependent/glslang_tab.cpp" +#line 8148 "MachineIndependent/glslang_tab.cpp" break; - case 282: /* type_specifier_nonarray: I64VEC4 */ -#line 2125 "MachineIndependent/glslang.y" + case 283: /* type_specifier_nonarray: I64VEC4 */ +#line 2134 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 8134 "MachineIndependent/glslang_tab.cpp" +#line 8159 "MachineIndependent/glslang_tab.cpp" break; - case 283: /* type_specifier_nonarray: U8VEC2 */ -#line 2131 "MachineIndependent/glslang.y" + case 284: /* type_specifier_nonarray: U8VEC2 */ +#line 2140 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(2); } -#line 8145 "MachineIndependent/glslang_tab.cpp" +#line 8170 "MachineIndependent/glslang_tab.cpp" break; - case 284: /* type_specifier_nonarray: U8VEC3 */ -#line 2137 "MachineIndependent/glslang.y" + case 285: /* type_specifier_nonarray: U8VEC3 */ +#line 2146 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(3); } -#line 8156 "MachineIndependent/glslang_tab.cpp" +#line 8181 "MachineIndependent/glslang_tab.cpp" break; - case 285: /* type_specifier_nonarray: U8VEC4 */ -#line 2143 "MachineIndependent/glslang.y" + case 286: /* type_specifier_nonarray: U8VEC4 */ +#line 2152 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 8167 "MachineIndependent/glslang_tab.cpp" +#line 8192 "MachineIndependent/glslang_tab.cpp" break; - case 286: /* type_specifier_nonarray: U16VEC2 */ -#line 2149 "MachineIndependent/glslang.y" + case 287: /* type_specifier_nonarray: U16VEC2 */ +#line 2158 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(2); } -#line 8178 "MachineIndependent/glslang_tab.cpp" +#line 8203 "MachineIndependent/glslang_tab.cpp" break; - case 287: /* type_specifier_nonarray: U16VEC3 */ -#line 2155 "MachineIndependent/glslang.y" + case 288: /* type_specifier_nonarray: U16VEC3 */ +#line 2164 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(3); } -#line 8189 "MachineIndependent/glslang_tab.cpp" +#line 8214 "MachineIndependent/glslang_tab.cpp" break; - case 288: /* type_specifier_nonarray: U16VEC4 */ -#line 2161 "MachineIndependent/glslang.y" + case 289: /* type_specifier_nonarray: U16VEC4 */ +#line 2170 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(4); } -#line 8200 "MachineIndependent/glslang_tab.cpp" +#line 8225 "MachineIndependent/glslang_tab.cpp" break; - case 289: /* type_specifier_nonarray: U32VEC2 */ -#line 2167 "MachineIndependent/glslang.y" + case 290: /* type_specifier_nonarray: U32VEC2 */ +#line 2176 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 8211 "MachineIndependent/glslang_tab.cpp" +#line 8236 "MachineIndependent/glslang_tab.cpp" break; - case 290: /* type_specifier_nonarray: U32VEC3 */ -#line 2173 "MachineIndependent/glslang.y" + case 291: /* type_specifier_nonarray: U32VEC3 */ +#line 2182 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 8222 "MachineIndependent/glslang_tab.cpp" +#line 8247 "MachineIndependent/glslang_tab.cpp" break; - case 291: /* type_specifier_nonarray: U32VEC4 */ -#line 2179 "MachineIndependent/glslang.y" + case 292: /* type_specifier_nonarray: U32VEC4 */ +#line 2188 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 8233 "MachineIndependent/glslang_tab.cpp" +#line 8258 "MachineIndependent/glslang_tab.cpp" break; - case 292: /* type_specifier_nonarray: U64VEC2 */ -#line 2185 "MachineIndependent/glslang.y" + case 293: /* type_specifier_nonarray: U64VEC2 */ +#line 2194 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 8244 "MachineIndependent/glslang_tab.cpp" +#line 8269 "MachineIndependent/glslang_tab.cpp" break; - case 293: /* type_specifier_nonarray: U64VEC3 */ -#line 2191 "MachineIndependent/glslang.y" + case 294: /* type_specifier_nonarray: U64VEC3 */ +#line 2200 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 8255 "MachineIndependent/glslang_tab.cpp" +#line 8280 "MachineIndependent/glslang_tab.cpp" break; - case 294: /* type_specifier_nonarray: U64VEC4 */ -#line 2197 "MachineIndependent/glslang.y" + case 295: /* type_specifier_nonarray: U64VEC4 */ +#line 2206 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 8266 "MachineIndependent/glslang_tab.cpp" +#line 8291 "MachineIndependent/glslang_tab.cpp" break; - case 295: /* type_specifier_nonarray: DMAT2 */ -#line 2203 "MachineIndependent/glslang.y" + case 296: /* type_specifier_nonarray: DMAT2 */ +#line 2212 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8275,11 +8300,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8279 "MachineIndependent/glslang_tab.cpp" +#line 8304 "MachineIndependent/glslang_tab.cpp" break; - case 296: /* type_specifier_nonarray: DMAT3 */ -#line 2211 "MachineIndependent/glslang.y" + case 297: /* type_specifier_nonarray: DMAT3 */ +#line 2220 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8288,11 +8313,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8292 "MachineIndependent/glslang_tab.cpp" +#line 8317 "MachineIndependent/glslang_tab.cpp" break; - case 297: /* type_specifier_nonarray: DMAT4 */ -#line 2219 "MachineIndependent/glslang.y" + case 298: /* type_specifier_nonarray: DMAT4 */ +#line 2228 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8301,11 +8326,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8305 "MachineIndependent/glslang_tab.cpp" +#line 8330 "MachineIndependent/glslang_tab.cpp" break; - case 298: /* type_specifier_nonarray: DMAT2X2 */ -#line 2227 "MachineIndependent/glslang.y" + case 299: /* type_specifier_nonarray: DMAT2X2 */ +#line 2236 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8314,11 +8339,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8318 "MachineIndependent/glslang_tab.cpp" +#line 8343 "MachineIndependent/glslang_tab.cpp" break; - case 299: /* type_specifier_nonarray: DMAT2X3 */ -#line 2235 "MachineIndependent/glslang.y" + case 300: /* type_specifier_nonarray: DMAT2X3 */ +#line 2244 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8327,11 +8352,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8331 "MachineIndependent/glslang_tab.cpp" +#line 8356 "MachineIndependent/glslang_tab.cpp" break; - case 300: /* type_specifier_nonarray: DMAT2X4 */ -#line 2243 "MachineIndependent/glslang.y" + case 301: /* type_specifier_nonarray: DMAT2X4 */ +#line 2252 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8340,11 +8365,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8344 "MachineIndependent/glslang_tab.cpp" +#line 8369 "MachineIndependent/glslang_tab.cpp" break; - case 301: /* type_specifier_nonarray: DMAT3X2 */ -#line 2251 "MachineIndependent/glslang.y" + case 302: /* type_specifier_nonarray: DMAT3X2 */ +#line 2260 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8353,11 +8378,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8357 "MachineIndependent/glslang_tab.cpp" +#line 8382 "MachineIndependent/glslang_tab.cpp" break; - case 302: /* type_specifier_nonarray: DMAT3X3 */ -#line 2259 "MachineIndependent/glslang.y" + case 303: /* type_specifier_nonarray: DMAT3X3 */ +#line 2268 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8366,11 +8391,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8370 "MachineIndependent/glslang_tab.cpp" +#line 8395 "MachineIndependent/glslang_tab.cpp" break; - case 303: /* type_specifier_nonarray: DMAT3X4 */ -#line 2267 "MachineIndependent/glslang.y" + case 304: /* type_specifier_nonarray: DMAT3X4 */ +#line 2276 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8379,11 +8404,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8383 "MachineIndependent/glslang_tab.cpp" +#line 8408 "MachineIndependent/glslang_tab.cpp" break; - case 304: /* type_specifier_nonarray: DMAT4X2 */ -#line 2275 "MachineIndependent/glslang.y" + case 305: /* type_specifier_nonarray: DMAT4X2 */ +#line 2284 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8392,11 +8417,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8396 "MachineIndependent/glslang_tab.cpp" +#line 8421 "MachineIndependent/glslang_tab.cpp" break; - case 305: /* type_specifier_nonarray: DMAT4X3 */ -#line 2283 "MachineIndependent/glslang.y" + case 306: /* type_specifier_nonarray: DMAT4X3 */ +#line 2292 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8405,11 +8430,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8409 "MachineIndependent/glslang_tab.cpp" +#line 8434 "MachineIndependent/glslang_tab.cpp" break; - case 306: /* type_specifier_nonarray: DMAT4X4 */ -#line 2291 "MachineIndependent/glslang.y" + case 307: /* type_specifier_nonarray: DMAT4X4 */ +#line 2300 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8418,2228 +8443,2228 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8422 "MachineIndependent/glslang_tab.cpp" +#line 8447 "MachineIndependent/glslang_tab.cpp" break; - case 307: /* type_specifier_nonarray: F16MAT2 */ -#line 2299 "MachineIndependent/glslang.y" + case 308: /* type_specifier_nonarray: F16MAT2 */ +#line 2308 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8433 "MachineIndependent/glslang_tab.cpp" +#line 8458 "MachineIndependent/glslang_tab.cpp" break; - case 308: /* type_specifier_nonarray: F16MAT3 */ -#line 2305 "MachineIndependent/glslang.y" + case 309: /* type_specifier_nonarray: F16MAT3 */ +#line 2314 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8444 "MachineIndependent/glslang_tab.cpp" +#line 8469 "MachineIndependent/glslang_tab.cpp" break; - case 309: /* type_specifier_nonarray: F16MAT4 */ -#line 2311 "MachineIndependent/glslang.y" + case 310: /* type_specifier_nonarray: F16MAT4 */ +#line 2320 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8455 "MachineIndependent/glslang_tab.cpp" +#line 8480 "MachineIndependent/glslang_tab.cpp" break; - case 310: /* type_specifier_nonarray: F16MAT2X2 */ -#line 2317 "MachineIndependent/glslang.y" + case 311: /* type_specifier_nonarray: F16MAT2X2 */ +#line 2326 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8466 "MachineIndependent/glslang_tab.cpp" +#line 8491 "MachineIndependent/glslang_tab.cpp" break; - case 311: /* type_specifier_nonarray: F16MAT2X3 */ -#line 2323 "MachineIndependent/glslang.y" + case 312: /* type_specifier_nonarray: F16MAT2X3 */ +#line 2332 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 3); } -#line 8477 "MachineIndependent/glslang_tab.cpp" +#line 8502 "MachineIndependent/glslang_tab.cpp" break; - case 312: /* type_specifier_nonarray: F16MAT2X4 */ -#line 2329 "MachineIndependent/glslang.y" + case 313: /* type_specifier_nonarray: F16MAT2X4 */ +#line 2338 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 4); } -#line 8488 "MachineIndependent/glslang_tab.cpp" +#line 8513 "MachineIndependent/glslang_tab.cpp" break; - case 313: /* type_specifier_nonarray: F16MAT3X2 */ -#line 2335 "MachineIndependent/glslang.y" + case 314: /* type_specifier_nonarray: F16MAT3X2 */ +#line 2344 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 2); } -#line 8499 "MachineIndependent/glslang_tab.cpp" +#line 8524 "MachineIndependent/glslang_tab.cpp" break; - case 314: /* type_specifier_nonarray: F16MAT3X3 */ -#line 2341 "MachineIndependent/glslang.y" + case 315: /* type_specifier_nonarray: F16MAT3X3 */ +#line 2350 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8510 "MachineIndependent/glslang_tab.cpp" +#line 8535 "MachineIndependent/glslang_tab.cpp" break; - case 315: /* type_specifier_nonarray: F16MAT3X4 */ -#line 2347 "MachineIndependent/glslang.y" + case 316: /* type_specifier_nonarray: F16MAT3X4 */ +#line 2356 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 4); } -#line 8521 "MachineIndependent/glslang_tab.cpp" +#line 8546 "MachineIndependent/glslang_tab.cpp" break; - case 316: /* type_specifier_nonarray: F16MAT4X2 */ -#line 2353 "MachineIndependent/glslang.y" + case 317: /* type_specifier_nonarray: F16MAT4X2 */ +#line 2362 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 2); } -#line 8532 "MachineIndependent/glslang_tab.cpp" +#line 8557 "MachineIndependent/glslang_tab.cpp" break; - case 317: /* type_specifier_nonarray: F16MAT4X3 */ -#line 2359 "MachineIndependent/glslang.y" + case 318: /* type_specifier_nonarray: F16MAT4X3 */ +#line 2368 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 3); } -#line 8543 "MachineIndependent/glslang_tab.cpp" +#line 8568 "MachineIndependent/glslang_tab.cpp" break; - case 318: /* type_specifier_nonarray: F16MAT4X4 */ -#line 2365 "MachineIndependent/glslang.y" + case 319: /* type_specifier_nonarray: F16MAT4X4 */ +#line 2374 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8554 "MachineIndependent/glslang_tab.cpp" +#line 8579 "MachineIndependent/glslang_tab.cpp" break; - case 319: /* type_specifier_nonarray: F32MAT2 */ -#line 2371 "MachineIndependent/glslang.y" + case 320: /* type_specifier_nonarray: F32MAT2 */ +#line 2380 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8565 "MachineIndependent/glslang_tab.cpp" +#line 8590 "MachineIndependent/glslang_tab.cpp" break; - case 320: /* type_specifier_nonarray: F32MAT3 */ -#line 2377 "MachineIndependent/glslang.y" + case 321: /* type_specifier_nonarray: F32MAT3 */ +#line 2386 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8576 "MachineIndependent/glslang_tab.cpp" +#line 8601 "MachineIndependent/glslang_tab.cpp" break; - case 321: /* type_specifier_nonarray: F32MAT4 */ -#line 2383 "MachineIndependent/glslang.y" + case 322: /* type_specifier_nonarray: F32MAT4 */ +#line 2392 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8587 "MachineIndependent/glslang_tab.cpp" +#line 8612 "MachineIndependent/glslang_tab.cpp" break; - case 322: /* type_specifier_nonarray: F32MAT2X2 */ -#line 2389 "MachineIndependent/glslang.y" + case 323: /* type_specifier_nonarray: F32MAT2X2 */ +#line 2398 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8598 "MachineIndependent/glslang_tab.cpp" +#line 8623 "MachineIndependent/glslang_tab.cpp" break; - case 323: /* type_specifier_nonarray: F32MAT2X3 */ -#line 2395 "MachineIndependent/glslang.y" + case 324: /* type_specifier_nonarray: F32MAT2X3 */ +#line 2404 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 8609 "MachineIndependent/glslang_tab.cpp" +#line 8634 "MachineIndependent/glslang_tab.cpp" break; - case 324: /* type_specifier_nonarray: F32MAT2X4 */ -#line 2401 "MachineIndependent/glslang.y" + case 325: /* type_specifier_nonarray: F32MAT2X4 */ +#line 2410 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 8620 "MachineIndependent/glslang_tab.cpp" +#line 8645 "MachineIndependent/glslang_tab.cpp" break; - case 325: /* type_specifier_nonarray: F32MAT3X2 */ -#line 2407 "MachineIndependent/glslang.y" + case 326: /* type_specifier_nonarray: F32MAT3X2 */ +#line 2416 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 8631 "MachineIndependent/glslang_tab.cpp" +#line 8656 "MachineIndependent/glslang_tab.cpp" break; - case 326: /* type_specifier_nonarray: F32MAT3X3 */ -#line 2413 "MachineIndependent/glslang.y" + case 327: /* type_specifier_nonarray: F32MAT3X3 */ +#line 2422 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8642 "MachineIndependent/glslang_tab.cpp" +#line 8667 "MachineIndependent/glslang_tab.cpp" break; - case 327: /* type_specifier_nonarray: F32MAT3X4 */ -#line 2419 "MachineIndependent/glslang.y" + case 328: /* type_specifier_nonarray: F32MAT3X4 */ +#line 2428 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 8653 "MachineIndependent/glslang_tab.cpp" +#line 8678 "MachineIndependent/glslang_tab.cpp" break; - case 328: /* type_specifier_nonarray: F32MAT4X2 */ -#line 2425 "MachineIndependent/glslang.y" + case 329: /* type_specifier_nonarray: F32MAT4X2 */ +#line 2434 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 8664 "MachineIndependent/glslang_tab.cpp" +#line 8689 "MachineIndependent/glslang_tab.cpp" break; - case 329: /* type_specifier_nonarray: F32MAT4X3 */ -#line 2431 "MachineIndependent/glslang.y" + case 330: /* type_specifier_nonarray: F32MAT4X3 */ +#line 2440 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 8675 "MachineIndependent/glslang_tab.cpp" +#line 8700 "MachineIndependent/glslang_tab.cpp" break; - case 330: /* type_specifier_nonarray: F32MAT4X4 */ -#line 2437 "MachineIndependent/glslang.y" + case 331: /* type_specifier_nonarray: F32MAT4X4 */ +#line 2446 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8686 "MachineIndependent/glslang_tab.cpp" +#line 8711 "MachineIndependent/glslang_tab.cpp" break; - case 331: /* type_specifier_nonarray: F64MAT2 */ -#line 2443 "MachineIndependent/glslang.y" + case 332: /* type_specifier_nonarray: F64MAT2 */ +#line 2452 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8697 "MachineIndependent/glslang_tab.cpp" +#line 8722 "MachineIndependent/glslang_tab.cpp" break; - case 332: /* type_specifier_nonarray: F64MAT3 */ -#line 2449 "MachineIndependent/glslang.y" + case 333: /* type_specifier_nonarray: F64MAT3 */ +#line 2458 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8708 "MachineIndependent/glslang_tab.cpp" +#line 8733 "MachineIndependent/glslang_tab.cpp" break; - case 333: /* type_specifier_nonarray: F64MAT4 */ -#line 2455 "MachineIndependent/glslang.y" + case 334: /* type_specifier_nonarray: F64MAT4 */ +#line 2464 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8719 "MachineIndependent/glslang_tab.cpp" +#line 8744 "MachineIndependent/glslang_tab.cpp" break; - case 334: /* type_specifier_nonarray: F64MAT2X2 */ -#line 2461 "MachineIndependent/glslang.y" + case 335: /* type_specifier_nonarray: F64MAT2X2 */ +#line 2470 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8730 "MachineIndependent/glslang_tab.cpp" +#line 8755 "MachineIndependent/glslang_tab.cpp" break; - case 335: /* type_specifier_nonarray: F64MAT2X3 */ -#line 2467 "MachineIndependent/glslang.y" + case 336: /* type_specifier_nonarray: F64MAT2X3 */ +#line 2476 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8741 "MachineIndependent/glslang_tab.cpp" +#line 8766 "MachineIndependent/glslang_tab.cpp" break; - case 336: /* type_specifier_nonarray: F64MAT2X4 */ -#line 2473 "MachineIndependent/glslang.y" + case 337: /* type_specifier_nonarray: F64MAT2X4 */ +#line 2482 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8752 "MachineIndependent/glslang_tab.cpp" +#line 8777 "MachineIndependent/glslang_tab.cpp" break; - case 337: /* type_specifier_nonarray: F64MAT3X2 */ -#line 2479 "MachineIndependent/glslang.y" + case 338: /* type_specifier_nonarray: F64MAT3X2 */ +#line 2488 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8763 "MachineIndependent/glslang_tab.cpp" +#line 8788 "MachineIndependent/glslang_tab.cpp" break; - case 338: /* type_specifier_nonarray: F64MAT3X3 */ -#line 2485 "MachineIndependent/glslang.y" + case 339: /* type_specifier_nonarray: F64MAT3X3 */ +#line 2494 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8774 "MachineIndependent/glslang_tab.cpp" +#line 8799 "MachineIndependent/glslang_tab.cpp" break; - case 339: /* type_specifier_nonarray: F64MAT3X4 */ -#line 2491 "MachineIndependent/glslang.y" + case 340: /* type_specifier_nonarray: F64MAT3X4 */ +#line 2500 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8785 "MachineIndependent/glslang_tab.cpp" +#line 8810 "MachineIndependent/glslang_tab.cpp" break; - case 340: /* type_specifier_nonarray: F64MAT4X2 */ -#line 2497 "MachineIndependent/glslang.y" + case 341: /* type_specifier_nonarray: F64MAT4X2 */ +#line 2506 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8796 "MachineIndependent/glslang_tab.cpp" +#line 8821 "MachineIndependent/glslang_tab.cpp" break; - case 341: /* type_specifier_nonarray: F64MAT4X3 */ -#line 2503 "MachineIndependent/glslang.y" + case 342: /* type_specifier_nonarray: F64MAT4X3 */ +#line 2512 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8807 "MachineIndependent/glslang_tab.cpp" +#line 8832 "MachineIndependent/glslang_tab.cpp" break; - case 342: /* type_specifier_nonarray: F64MAT4X4 */ -#line 2509 "MachineIndependent/glslang.y" + case 343: /* type_specifier_nonarray: F64MAT4X4 */ +#line 2518 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8818 "MachineIndependent/glslang_tab.cpp" +#line 8843 "MachineIndependent/glslang_tab.cpp" break; - case 343: /* type_specifier_nonarray: ACCSTRUCTNV */ -#line 2515 "MachineIndependent/glslang.y" + case 344: /* type_specifier_nonarray: ACCSTRUCTNV */ +#line 2524 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8827 "MachineIndependent/glslang_tab.cpp" +#line 8852 "MachineIndependent/glslang_tab.cpp" break; - case 344: /* type_specifier_nonarray: ACCSTRUCTEXT */ -#line 2519 "MachineIndependent/glslang.y" + case 345: /* type_specifier_nonarray: ACCSTRUCTEXT */ +#line 2528 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8836 "MachineIndependent/glslang_tab.cpp" +#line 8861 "MachineIndependent/glslang_tab.cpp" break; - case 345: /* type_specifier_nonarray: RAYQUERYEXT */ -#line 2523 "MachineIndependent/glslang.y" + case 346: /* type_specifier_nonarray: RAYQUERYEXT */ +#line 2532 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtRayQuery; } -#line 8845 "MachineIndependent/glslang_tab.cpp" +#line 8870 "MachineIndependent/glslang_tab.cpp" break; - case 346: /* type_specifier_nonarray: ATOMIC_UINT */ -#line 2527 "MachineIndependent/glslang.y" + case 347: /* type_specifier_nonarray: ATOMIC_UINT */ +#line 2536 "MachineIndependent/glslang.y" { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 8855 "MachineIndependent/glslang_tab.cpp" +#line 8880 "MachineIndependent/glslang_tab.cpp" break; - case 347: /* type_specifier_nonarray: SAMPLER1D */ -#line 2532 "MachineIndependent/glslang.y" + case 348: /* type_specifier_nonarray: SAMPLER1D */ +#line 2541 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 8865 "MachineIndependent/glslang_tab.cpp" +#line 8890 "MachineIndependent/glslang_tab.cpp" break; - case 348: /* type_specifier_nonarray: SAMPLER2D */ -#line 2538 "MachineIndependent/glslang.y" + case 349: /* type_specifier_nonarray: SAMPLER2D */ +#line 2547 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 8875 "MachineIndependent/glslang_tab.cpp" +#line 8900 "MachineIndependent/glslang_tab.cpp" break; - case 349: /* type_specifier_nonarray: SAMPLER3D */ -#line 2543 "MachineIndependent/glslang.y" + case 350: /* type_specifier_nonarray: SAMPLER3D */ +#line 2552 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 8885 "MachineIndependent/glslang_tab.cpp" +#line 8910 "MachineIndependent/glslang_tab.cpp" break; - case 350: /* type_specifier_nonarray: SAMPLERCUBE */ -#line 2548 "MachineIndependent/glslang.y" + case 351: /* type_specifier_nonarray: SAMPLERCUBE */ +#line 2557 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 8895 "MachineIndependent/glslang_tab.cpp" +#line 8920 "MachineIndependent/glslang_tab.cpp" break; - case 351: /* type_specifier_nonarray: SAMPLER2DSHADOW */ -#line 2553 "MachineIndependent/glslang.y" + case 352: /* type_specifier_nonarray: SAMPLER2DSHADOW */ +#line 2562 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 8905 "MachineIndependent/glslang_tab.cpp" +#line 8930 "MachineIndependent/glslang_tab.cpp" break; - case 352: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ -#line 2558 "MachineIndependent/glslang.y" + case 353: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ +#line 2567 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 8915 "MachineIndependent/glslang_tab.cpp" +#line 8940 "MachineIndependent/glslang_tab.cpp" break; - case 353: /* type_specifier_nonarray: SAMPLER2DARRAY */ -#line 2563 "MachineIndependent/glslang.y" + case 354: /* type_specifier_nonarray: SAMPLER2DARRAY */ +#line 2572 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 8925 "MachineIndependent/glslang_tab.cpp" +#line 8950 "MachineIndependent/glslang_tab.cpp" break; - case 354: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ -#line 2568 "MachineIndependent/glslang.y" + case 355: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ +#line 2577 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 8935 "MachineIndependent/glslang_tab.cpp" +#line 8960 "MachineIndependent/glslang_tab.cpp" break; - case 355: /* type_specifier_nonarray: SAMPLER1DSHADOW */ -#line 2574 "MachineIndependent/glslang.y" + case 356: /* type_specifier_nonarray: SAMPLER1DSHADOW */ +#line 2583 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 8945 "MachineIndependent/glslang_tab.cpp" +#line 8970 "MachineIndependent/glslang_tab.cpp" break; - case 356: /* type_specifier_nonarray: SAMPLER1DARRAY */ -#line 2579 "MachineIndependent/glslang.y" + case 357: /* type_specifier_nonarray: SAMPLER1DARRAY */ +#line 2588 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 8955 "MachineIndependent/glslang_tab.cpp" +#line 8980 "MachineIndependent/glslang_tab.cpp" break; - case 357: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ -#line 2584 "MachineIndependent/glslang.y" + case 358: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ +#line 2593 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 8965 "MachineIndependent/glslang_tab.cpp" +#line 8990 "MachineIndependent/glslang_tab.cpp" break; - case 358: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ -#line 2589 "MachineIndependent/glslang.y" + case 359: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ +#line 2598 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 8975 "MachineIndependent/glslang_tab.cpp" +#line 9000 "MachineIndependent/glslang_tab.cpp" break; - case 359: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ -#line 2594 "MachineIndependent/glslang.y" + case 360: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ +#line 2603 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 8985 "MachineIndependent/glslang_tab.cpp" +#line 9010 "MachineIndependent/glslang_tab.cpp" break; - case 360: /* type_specifier_nonarray: F16SAMPLER1D */ -#line 2599 "MachineIndependent/glslang.y" + case 361: /* type_specifier_nonarray: F16SAMPLER1D */ +#line 2608 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); } -#line 8996 "MachineIndependent/glslang_tab.cpp" +#line 9021 "MachineIndependent/glslang_tab.cpp" break; - case 361: /* type_specifier_nonarray: F16SAMPLER2D */ -#line 2605 "MachineIndependent/glslang.y" + case 362: /* type_specifier_nonarray: F16SAMPLER2D */ +#line 2614 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); } -#line 9007 "MachineIndependent/glslang_tab.cpp" +#line 9032 "MachineIndependent/glslang_tab.cpp" break; - case 362: /* type_specifier_nonarray: F16SAMPLER3D */ -#line 2611 "MachineIndependent/glslang.y" + case 363: /* type_specifier_nonarray: F16SAMPLER3D */ +#line 2620 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); } -#line 9018 "MachineIndependent/glslang_tab.cpp" +#line 9043 "MachineIndependent/glslang_tab.cpp" break; - case 363: /* type_specifier_nonarray: F16SAMPLERCUBE */ -#line 2617 "MachineIndependent/glslang.y" + case 364: /* type_specifier_nonarray: F16SAMPLERCUBE */ +#line 2626 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); } -#line 9029 "MachineIndependent/glslang_tab.cpp" +#line 9054 "MachineIndependent/glslang_tab.cpp" break; - case 364: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ -#line 2623 "MachineIndependent/glslang.y" + case 365: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ +#line 2632 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); } -#line 9040 "MachineIndependent/glslang_tab.cpp" +#line 9065 "MachineIndependent/glslang_tab.cpp" break; - case 365: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ -#line 2629 "MachineIndependent/glslang.y" + case 366: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ +#line 2638 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); } -#line 9051 "MachineIndependent/glslang_tab.cpp" +#line 9076 "MachineIndependent/glslang_tab.cpp" break; - case 366: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ -#line 2635 "MachineIndependent/glslang.y" + case 367: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ +#line 2644 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); } -#line 9062 "MachineIndependent/glslang_tab.cpp" +#line 9087 "MachineIndependent/glslang_tab.cpp" break; - case 367: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ -#line 2641 "MachineIndependent/glslang.y" + case 368: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ +#line 2650 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); } -#line 9073 "MachineIndependent/glslang_tab.cpp" +#line 9098 "MachineIndependent/glslang_tab.cpp" break; - case 368: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ -#line 2647 "MachineIndependent/glslang.y" + case 369: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ +#line 2656 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); } -#line 9084 "MachineIndependent/glslang_tab.cpp" +#line 9109 "MachineIndependent/glslang_tab.cpp" break; - case 369: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ -#line 2653 "MachineIndependent/glslang.y" + case 370: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ +#line 2662 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); } -#line 9095 "MachineIndependent/glslang_tab.cpp" +#line 9120 "MachineIndependent/glslang_tab.cpp" break; - case 370: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ -#line 2659 "MachineIndependent/glslang.y" + case 371: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ +#line 2668 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); } -#line 9106 "MachineIndependent/glslang_tab.cpp" +#line 9131 "MachineIndependent/glslang_tab.cpp" break; - case 371: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ -#line 2665 "MachineIndependent/glslang.y" + case 372: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ +#line 2674 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); } -#line 9117 "MachineIndependent/glslang_tab.cpp" +#line 9142 "MachineIndependent/glslang_tab.cpp" break; - case 372: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ -#line 2671 "MachineIndependent/glslang.y" + case 373: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ +#line 2680 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); } -#line 9128 "MachineIndependent/glslang_tab.cpp" +#line 9153 "MachineIndependent/glslang_tab.cpp" break; - case 373: /* type_specifier_nonarray: ISAMPLER1D */ -#line 2677 "MachineIndependent/glslang.y" + case 374: /* type_specifier_nonarray: ISAMPLER1D */ +#line 2686 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 9138 "MachineIndependent/glslang_tab.cpp" +#line 9163 "MachineIndependent/glslang_tab.cpp" break; - case 374: /* type_specifier_nonarray: ISAMPLER2D */ -#line 2683 "MachineIndependent/glslang.y" + case 375: /* type_specifier_nonarray: ISAMPLER2D */ +#line 2692 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 9148 "MachineIndependent/glslang_tab.cpp" +#line 9173 "MachineIndependent/glslang_tab.cpp" break; - case 375: /* type_specifier_nonarray: ISAMPLER3D */ -#line 2688 "MachineIndependent/glslang.y" + case 376: /* type_specifier_nonarray: ISAMPLER3D */ +#line 2697 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 9158 "MachineIndependent/glslang_tab.cpp" +#line 9183 "MachineIndependent/glslang_tab.cpp" break; - case 376: /* type_specifier_nonarray: ISAMPLERCUBE */ -#line 2693 "MachineIndependent/glslang.y" + case 377: /* type_specifier_nonarray: ISAMPLERCUBE */ +#line 2702 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 9168 "MachineIndependent/glslang_tab.cpp" +#line 9193 "MachineIndependent/glslang_tab.cpp" break; - case 377: /* type_specifier_nonarray: ISAMPLER2DARRAY */ -#line 2698 "MachineIndependent/glslang.y" + case 378: /* type_specifier_nonarray: ISAMPLER2DARRAY */ +#line 2707 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 9178 "MachineIndependent/glslang_tab.cpp" +#line 9203 "MachineIndependent/glslang_tab.cpp" break; - case 378: /* type_specifier_nonarray: USAMPLER2D */ -#line 2703 "MachineIndependent/glslang.y" + case 379: /* type_specifier_nonarray: USAMPLER2D */ +#line 2712 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 9188 "MachineIndependent/glslang_tab.cpp" +#line 9213 "MachineIndependent/glslang_tab.cpp" break; - case 379: /* type_specifier_nonarray: USAMPLER3D */ -#line 2708 "MachineIndependent/glslang.y" + case 380: /* type_specifier_nonarray: USAMPLER3D */ +#line 2717 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 9198 "MachineIndependent/glslang_tab.cpp" +#line 9223 "MachineIndependent/glslang_tab.cpp" break; - case 380: /* type_specifier_nonarray: USAMPLERCUBE */ -#line 2713 "MachineIndependent/glslang.y" + case 381: /* type_specifier_nonarray: USAMPLERCUBE */ +#line 2722 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 9208 "MachineIndependent/glslang_tab.cpp" +#line 9233 "MachineIndependent/glslang_tab.cpp" break; - case 381: /* type_specifier_nonarray: ISAMPLER1DARRAY */ -#line 2719 "MachineIndependent/glslang.y" + case 382: /* type_specifier_nonarray: ISAMPLER1DARRAY */ +#line 2728 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 9218 "MachineIndependent/glslang_tab.cpp" +#line 9243 "MachineIndependent/glslang_tab.cpp" break; - case 382: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ -#line 2724 "MachineIndependent/glslang.y" + case 383: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ +#line 2733 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 9228 "MachineIndependent/glslang_tab.cpp" +#line 9253 "MachineIndependent/glslang_tab.cpp" break; - case 383: /* type_specifier_nonarray: USAMPLER1D */ -#line 2729 "MachineIndependent/glslang.y" + case 384: /* type_specifier_nonarray: USAMPLER1D */ +#line 2738 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 9238 "MachineIndependent/glslang_tab.cpp" +#line 9263 "MachineIndependent/glslang_tab.cpp" break; - case 384: /* type_specifier_nonarray: USAMPLER1DARRAY */ -#line 2734 "MachineIndependent/glslang.y" + case 385: /* type_specifier_nonarray: USAMPLER1DARRAY */ +#line 2743 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 9248 "MachineIndependent/glslang_tab.cpp" +#line 9273 "MachineIndependent/glslang_tab.cpp" break; - case 385: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ -#line 2739 "MachineIndependent/glslang.y" + case 386: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ +#line 2748 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 9258 "MachineIndependent/glslang_tab.cpp" +#line 9283 "MachineIndependent/glslang_tab.cpp" break; - case 386: /* type_specifier_nonarray: TEXTURECUBEARRAY */ -#line 2744 "MachineIndependent/glslang.y" + case 387: /* type_specifier_nonarray: TEXTURECUBEARRAY */ +#line 2753 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 9268 "MachineIndependent/glslang_tab.cpp" +#line 9293 "MachineIndependent/glslang_tab.cpp" break; - case 387: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ -#line 2749 "MachineIndependent/glslang.y" + case 388: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ +#line 2758 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 9278 "MachineIndependent/glslang_tab.cpp" +#line 9303 "MachineIndependent/glslang_tab.cpp" break; - case 388: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ -#line 2754 "MachineIndependent/glslang.y" + case 389: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ +#line 2763 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 9288 "MachineIndependent/glslang_tab.cpp" +#line 9313 "MachineIndependent/glslang_tab.cpp" break; - case 389: /* type_specifier_nonarray: USAMPLER2DARRAY */ -#line 2760 "MachineIndependent/glslang.y" + case 390: /* type_specifier_nonarray: USAMPLER2DARRAY */ +#line 2769 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 9298 "MachineIndependent/glslang_tab.cpp" +#line 9323 "MachineIndependent/glslang_tab.cpp" break; - case 390: /* type_specifier_nonarray: TEXTURE2D */ -#line 2765 "MachineIndependent/glslang.y" + case 391: /* type_specifier_nonarray: TEXTURE2D */ +#line 2774 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 9308 "MachineIndependent/glslang_tab.cpp" +#line 9333 "MachineIndependent/glslang_tab.cpp" break; - case 391: /* type_specifier_nonarray: TEXTURE3D */ -#line 2770 "MachineIndependent/glslang.y" + case 392: /* type_specifier_nonarray: TEXTURE3D */ +#line 2779 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 9318 "MachineIndependent/glslang_tab.cpp" +#line 9343 "MachineIndependent/glslang_tab.cpp" break; - case 392: /* type_specifier_nonarray: TEXTURE2DARRAY */ -#line 2775 "MachineIndependent/glslang.y" + case 393: /* type_specifier_nonarray: TEXTURE2DARRAY */ +#line 2784 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 9328 "MachineIndependent/glslang_tab.cpp" +#line 9353 "MachineIndependent/glslang_tab.cpp" break; - case 393: /* type_specifier_nonarray: TEXTURECUBE */ -#line 2780 "MachineIndependent/glslang.y" + case 394: /* type_specifier_nonarray: TEXTURECUBE */ +#line 2789 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 9338 "MachineIndependent/glslang_tab.cpp" +#line 9363 "MachineIndependent/glslang_tab.cpp" break; - case 394: /* type_specifier_nonarray: ITEXTURE2D */ -#line 2785 "MachineIndependent/glslang.y" + case 395: /* type_specifier_nonarray: ITEXTURE2D */ +#line 2794 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 9348 "MachineIndependent/glslang_tab.cpp" +#line 9373 "MachineIndependent/glslang_tab.cpp" break; - case 395: /* type_specifier_nonarray: ITEXTURE3D */ -#line 2790 "MachineIndependent/glslang.y" + case 396: /* type_specifier_nonarray: ITEXTURE3D */ +#line 2799 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 9358 "MachineIndependent/glslang_tab.cpp" +#line 9383 "MachineIndependent/glslang_tab.cpp" break; - case 396: /* type_specifier_nonarray: ITEXTURECUBE */ -#line 2795 "MachineIndependent/glslang.y" + case 397: /* type_specifier_nonarray: ITEXTURECUBE */ +#line 2804 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 9368 "MachineIndependent/glslang_tab.cpp" +#line 9393 "MachineIndependent/glslang_tab.cpp" break; - case 397: /* type_specifier_nonarray: ITEXTURE2DARRAY */ -#line 2800 "MachineIndependent/glslang.y" + case 398: /* type_specifier_nonarray: ITEXTURE2DARRAY */ +#line 2809 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 9378 "MachineIndependent/glslang_tab.cpp" +#line 9403 "MachineIndependent/glslang_tab.cpp" break; - case 398: /* type_specifier_nonarray: UTEXTURE2D */ -#line 2805 "MachineIndependent/glslang.y" + case 399: /* type_specifier_nonarray: UTEXTURE2D */ +#line 2814 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 9388 "MachineIndependent/glslang_tab.cpp" +#line 9413 "MachineIndependent/glslang_tab.cpp" break; - case 399: /* type_specifier_nonarray: UTEXTURE3D */ -#line 2810 "MachineIndependent/glslang.y" + case 400: /* type_specifier_nonarray: UTEXTURE3D */ +#line 2819 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 9398 "MachineIndependent/glslang_tab.cpp" +#line 9423 "MachineIndependent/glslang_tab.cpp" break; - case 400: /* type_specifier_nonarray: UTEXTURECUBE */ -#line 2815 "MachineIndependent/glslang.y" + case 401: /* type_specifier_nonarray: UTEXTURECUBE */ +#line 2824 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 9408 "MachineIndependent/glslang_tab.cpp" +#line 9433 "MachineIndependent/glslang_tab.cpp" break; - case 401: /* type_specifier_nonarray: UTEXTURE2DARRAY */ -#line 2820 "MachineIndependent/glslang.y" + case 402: /* type_specifier_nonarray: UTEXTURE2DARRAY */ +#line 2829 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 9418 "MachineIndependent/glslang_tab.cpp" +#line 9443 "MachineIndependent/glslang_tab.cpp" break; - case 402: /* type_specifier_nonarray: SAMPLER */ -#line 2825 "MachineIndependent/glslang.y" + case 403: /* type_specifier_nonarray: SAMPLER */ +#line 2834 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 9428 "MachineIndependent/glslang_tab.cpp" +#line 9453 "MachineIndependent/glslang_tab.cpp" break; - case 403: /* type_specifier_nonarray: SAMPLERSHADOW */ -#line 2830 "MachineIndependent/glslang.y" + case 404: /* type_specifier_nonarray: SAMPLERSHADOW */ +#line 2839 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 9438 "MachineIndependent/glslang_tab.cpp" +#line 9463 "MachineIndependent/glslang_tab.cpp" break; - case 404: /* type_specifier_nonarray: SAMPLER2DRECT */ -#line 2836 "MachineIndependent/glslang.y" + case 405: /* type_specifier_nonarray: SAMPLER2DRECT */ +#line 2845 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 9448 "MachineIndependent/glslang_tab.cpp" +#line 9473 "MachineIndependent/glslang_tab.cpp" break; - case 405: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ -#line 2841 "MachineIndependent/glslang.y" + case 406: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ +#line 2850 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 9458 "MachineIndependent/glslang_tab.cpp" +#line 9483 "MachineIndependent/glslang_tab.cpp" break; - case 406: /* type_specifier_nonarray: F16SAMPLER2DRECT */ -#line 2846 "MachineIndependent/glslang.y" + case 407: /* type_specifier_nonarray: F16SAMPLER2DRECT */ +#line 2855 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); } -#line 9469 "MachineIndependent/glslang_tab.cpp" +#line 9494 "MachineIndependent/glslang_tab.cpp" break; - case 407: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ -#line 2852 "MachineIndependent/glslang.y" + case 408: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ +#line 2861 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); } -#line 9480 "MachineIndependent/glslang_tab.cpp" +#line 9505 "MachineIndependent/glslang_tab.cpp" break; - case 408: /* type_specifier_nonarray: ISAMPLER2DRECT */ -#line 2858 "MachineIndependent/glslang.y" + case 409: /* type_specifier_nonarray: ISAMPLER2DRECT */ +#line 2867 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 9490 "MachineIndependent/glslang_tab.cpp" +#line 9515 "MachineIndependent/glslang_tab.cpp" break; - case 409: /* type_specifier_nonarray: USAMPLER2DRECT */ -#line 2863 "MachineIndependent/glslang.y" + case 410: /* type_specifier_nonarray: USAMPLER2DRECT */ +#line 2872 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 9500 "MachineIndependent/glslang_tab.cpp" +#line 9525 "MachineIndependent/glslang_tab.cpp" break; - case 410: /* type_specifier_nonarray: SAMPLERBUFFER */ -#line 2868 "MachineIndependent/glslang.y" + case 411: /* type_specifier_nonarray: SAMPLERBUFFER */ +#line 2877 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 9510 "MachineIndependent/glslang_tab.cpp" +#line 9535 "MachineIndependent/glslang_tab.cpp" break; - case 411: /* type_specifier_nonarray: F16SAMPLERBUFFER */ -#line 2873 "MachineIndependent/glslang.y" + case 412: /* type_specifier_nonarray: F16SAMPLERBUFFER */ +#line 2882 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); } -#line 9521 "MachineIndependent/glslang_tab.cpp" +#line 9546 "MachineIndependent/glslang_tab.cpp" break; - case 412: /* type_specifier_nonarray: ISAMPLERBUFFER */ -#line 2879 "MachineIndependent/glslang.y" + case 413: /* type_specifier_nonarray: ISAMPLERBUFFER */ +#line 2888 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 9531 "MachineIndependent/glslang_tab.cpp" +#line 9556 "MachineIndependent/glslang_tab.cpp" break; - case 413: /* type_specifier_nonarray: USAMPLERBUFFER */ -#line 2884 "MachineIndependent/glslang.y" + case 414: /* type_specifier_nonarray: USAMPLERBUFFER */ +#line 2893 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 9541 "MachineIndependent/glslang_tab.cpp" +#line 9566 "MachineIndependent/glslang_tab.cpp" break; - case 414: /* type_specifier_nonarray: SAMPLER2DMS */ -#line 2889 "MachineIndependent/glslang.y" + case 415: /* type_specifier_nonarray: SAMPLER2DMS */ +#line 2898 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 9551 "MachineIndependent/glslang_tab.cpp" +#line 9576 "MachineIndependent/glslang_tab.cpp" break; - case 415: /* type_specifier_nonarray: F16SAMPLER2DMS */ -#line 2894 "MachineIndependent/glslang.y" + case 416: /* type_specifier_nonarray: F16SAMPLER2DMS */ +#line 2903 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); } -#line 9562 "MachineIndependent/glslang_tab.cpp" +#line 9587 "MachineIndependent/glslang_tab.cpp" break; - case 416: /* type_specifier_nonarray: ISAMPLER2DMS */ -#line 2900 "MachineIndependent/glslang.y" + case 417: /* type_specifier_nonarray: ISAMPLER2DMS */ +#line 2909 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 9572 "MachineIndependent/glslang_tab.cpp" +#line 9597 "MachineIndependent/glslang_tab.cpp" break; - case 417: /* type_specifier_nonarray: USAMPLER2DMS */ -#line 2905 "MachineIndependent/glslang.y" + case 418: /* type_specifier_nonarray: USAMPLER2DMS */ +#line 2914 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 9582 "MachineIndependent/glslang_tab.cpp" +#line 9607 "MachineIndependent/glslang_tab.cpp" break; - case 418: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ -#line 2910 "MachineIndependent/glslang.y" + case 419: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ +#line 2919 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 9592 "MachineIndependent/glslang_tab.cpp" +#line 9617 "MachineIndependent/glslang_tab.cpp" break; - case 419: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ -#line 2915 "MachineIndependent/glslang.y" + case 420: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ +#line 2924 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); } -#line 9603 "MachineIndependent/glslang_tab.cpp" +#line 9628 "MachineIndependent/glslang_tab.cpp" break; - case 420: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ -#line 2921 "MachineIndependent/glslang.y" + case 421: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ +#line 2930 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 9613 "MachineIndependent/glslang_tab.cpp" +#line 9638 "MachineIndependent/glslang_tab.cpp" break; - case 421: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ -#line 2926 "MachineIndependent/glslang.y" + case 422: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ +#line 2935 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 9623 "MachineIndependent/glslang_tab.cpp" +#line 9648 "MachineIndependent/glslang_tab.cpp" break; - case 422: /* type_specifier_nonarray: TEXTURE1D */ -#line 2931 "MachineIndependent/glslang.y" + case 423: /* type_specifier_nonarray: TEXTURE1D */ +#line 2940 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 9633 "MachineIndependent/glslang_tab.cpp" +#line 9658 "MachineIndependent/glslang_tab.cpp" break; - case 423: /* type_specifier_nonarray: F16TEXTURE1D */ -#line 2936 "MachineIndependent/glslang.y" + case 424: /* type_specifier_nonarray: F16TEXTURE1D */ +#line 2945 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); } -#line 9644 "MachineIndependent/glslang_tab.cpp" +#line 9669 "MachineIndependent/glslang_tab.cpp" break; - case 424: /* type_specifier_nonarray: F16TEXTURE2D */ -#line 2942 "MachineIndependent/glslang.y" + case 425: /* type_specifier_nonarray: F16TEXTURE2D */ +#line 2951 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); } -#line 9655 "MachineIndependent/glslang_tab.cpp" +#line 9680 "MachineIndependent/glslang_tab.cpp" break; - case 425: /* type_specifier_nonarray: F16TEXTURE3D */ -#line 2948 "MachineIndependent/glslang.y" + case 426: /* type_specifier_nonarray: F16TEXTURE3D */ +#line 2957 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); } -#line 9666 "MachineIndependent/glslang_tab.cpp" +#line 9691 "MachineIndependent/glslang_tab.cpp" break; - case 426: /* type_specifier_nonarray: F16TEXTURECUBE */ -#line 2954 "MachineIndependent/glslang.y" + case 427: /* type_specifier_nonarray: F16TEXTURECUBE */ +#line 2963 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); } -#line 9677 "MachineIndependent/glslang_tab.cpp" +#line 9702 "MachineIndependent/glslang_tab.cpp" break; - case 427: /* type_specifier_nonarray: TEXTURE1DARRAY */ -#line 2960 "MachineIndependent/glslang.y" + case 428: /* type_specifier_nonarray: TEXTURE1DARRAY */ +#line 2969 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 9687 "MachineIndependent/glslang_tab.cpp" +#line 9712 "MachineIndependent/glslang_tab.cpp" break; - case 428: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ -#line 2965 "MachineIndependent/glslang.y" + case 429: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ +#line 2974 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); } -#line 9698 "MachineIndependent/glslang_tab.cpp" +#line 9723 "MachineIndependent/glslang_tab.cpp" break; - case 429: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ -#line 2971 "MachineIndependent/glslang.y" + case 430: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ +#line 2980 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); } -#line 9709 "MachineIndependent/glslang_tab.cpp" +#line 9734 "MachineIndependent/glslang_tab.cpp" break; - case 430: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ -#line 2977 "MachineIndependent/glslang.y" + case 431: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ +#line 2986 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); } -#line 9720 "MachineIndependent/glslang_tab.cpp" +#line 9745 "MachineIndependent/glslang_tab.cpp" break; - case 431: /* type_specifier_nonarray: ITEXTURE1D */ -#line 2983 "MachineIndependent/glslang.y" + case 432: /* type_specifier_nonarray: ITEXTURE1D */ +#line 2992 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 9730 "MachineIndependent/glslang_tab.cpp" +#line 9755 "MachineIndependent/glslang_tab.cpp" break; - case 432: /* type_specifier_nonarray: ITEXTURE1DARRAY */ -#line 2988 "MachineIndependent/glslang.y" + case 433: /* type_specifier_nonarray: ITEXTURE1DARRAY */ +#line 2997 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 9740 "MachineIndependent/glslang_tab.cpp" +#line 9765 "MachineIndependent/glslang_tab.cpp" break; - case 433: /* type_specifier_nonarray: UTEXTURE1D */ -#line 2993 "MachineIndependent/glslang.y" + case 434: /* type_specifier_nonarray: UTEXTURE1D */ +#line 3002 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 9750 "MachineIndependent/glslang_tab.cpp" +#line 9775 "MachineIndependent/glslang_tab.cpp" break; - case 434: /* type_specifier_nonarray: UTEXTURE1DARRAY */ -#line 2998 "MachineIndependent/glslang.y" + case 435: /* type_specifier_nonarray: UTEXTURE1DARRAY */ +#line 3007 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 9760 "MachineIndependent/glslang_tab.cpp" +#line 9785 "MachineIndependent/glslang_tab.cpp" break; - case 435: /* type_specifier_nonarray: TEXTURE2DRECT */ -#line 3003 "MachineIndependent/glslang.y" + case 436: /* type_specifier_nonarray: TEXTURE2DRECT */ +#line 3012 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 9770 "MachineIndependent/glslang_tab.cpp" +#line 9795 "MachineIndependent/glslang_tab.cpp" break; - case 436: /* type_specifier_nonarray: F16TEXTURE2DRECT */ -#line 3008 "MachineIndependent/glslang.y" + case 437: /* type_specifier_nonarray: F16TEXTURE2DRECT */ +#line 3017 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); } -#line 9781 "MachineIndependent/glslang_tab.cpp" +#line 9806 "MachineIndependent/glslang_tab.cpp" break; - case 437: /* type_specifier_nonarray: ITEXTURE2DRECT */ -#line 3014 "MachineIndependent/glslang.y" + case 438: /* type_specifier_nonarray: ITEXTURE2DRECT */ +#line 3023 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 9791 "MachineIndependent/glslang_tab.cpp" +#line 9816 "MachineIndependent/glslang_tab.cpp" break; - case 438: /* type_specifier_nonarray: UTEXTURE2DRECT */ -#line 3019 "MachineIndependent/glslang.y" + case 439: /* type_specifier_nonarray: UTEXTURE2DRECT */ +#line 3028 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 9801 "MachineIndependent/glslang_tab.cpp" +#line 9826 "MachineIndependent/glslang_tab.cpp" break; - case 439: /* type_specifier_nonarray: TEXTUREBUFFER */ -#line 3024 "MachineIndependent/glslang.y" + case 440: /* type_specifier_nonarray: TEXTUREBUFFER */ +#line 3033 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 9811 "MachineIndependent/glslang_tab.cpp" +#line 9836 "MachineIndependent/glslang_tab.cpp" break; - case 440: /* type_specifier_nonarray: F16TEXTUREBUFFER */ -#line 3029 "MachineIndependent/glslang.y" + case 441: /* type_specifier_nonarray: F16TEXTUREBUFFER */ +#line 3038 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); } -#line 9822 "MachineIndependent/glslang_tab.cpp" +#line 9847 "MachineIndependent/glslang_tab.cpp" break; - case 441: /* type_specifier_nonarray: ITEXTUREBUFFER */ -#line 3035 "MachineIndependent/glslang.y" + case 442: /* type_specifier_nonarray: ITEXTUREBUFFER */ +#line 3044 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 9832 "MachineIndependent/glslang_tab.cpp" +#line 9857 "MachineIndependent/glslang_tab.cpp" break; - case 442: /* type_specifier_nonarray: UTEXTUREBUFFER */ -#line 3040 "MachineIndependent/glslang.y" + case 443: /* type_specifier_nonarray: UTEXTUREBUFFER */ +#line 3049 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 9842 "MachineIndependent/glslang_tab.cpp" +#line 9867 "MachineIndependent/glslang_tab.cpp" break; - case 443: /* type_specifier_nonarray: TEXTURE2DMS */ -#line 3045 "MachineIndependent/glslang.y" + case 444: /* type_specifier_nonarray: TEXTURE2DMS */ +#line 3054 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 9852 "MachineIndependent/glslang_tab.cpp" +#line 9877 "MachineIndependent/glslang_tab.cpp" break; - case 444: /* type_specifier_nonarray: F16TEXTURE2DMS */ -#line 3050 "MachineIndependent/glslang.y" + case 445: /* type_specifier_nonarray: F16TEXTURE2DMS */ +#line 3059 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); } -#line 9863 "MachineIndependent/glslang_tab.cpp" +#line 9888 "MachineIndependent/glslang_tab.cpp" break; - case 445: /* type_specifier_nonarray: ITEXTURE2DMS */ -#line 3056 "MachineIndependent/glslang.y" + case 446: /* type_specifier_nonarray: ITEXTURE2DMS */ +#line 3065 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 9873 "MachineIndependent/glslang_tab.cpp" +#line 9898 "MachineIndependent/glslang_tab.cpp" break; - case 446: /* type_specifier_nonarray: UTEXTURE2DMS */ -#line 3061 "MachineIndependent/glslang.y" + case 447: /* type_specifier_nonarray: UTEXTURE2DMS */ +#line 3070 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 9883 "MachineIndependent/glslang_tab.cpp" +#line 9908 "MachineIndependent/glslang_tab.cpp" break; - case 447: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ -#line 3066 "MachineIndependent/glslang.y" + case 448: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ +#line 3075 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 9893 "MachineIndependent/glslang_tab.cpp" +#line 9918 "MachineIndependent/glslang_tab.cpp" break; - case 448: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ -#line 3071 "MachineIndependent/glslang.y" + case 449: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ +#line 3080 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); } -#line 9904 "MachineIndependent/glslang_tab.cpp" +#line 9929 "MachineIndependent/glslang_tab.cpp" break; - case 449: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ -#line 3077 "MachineIndependent/glslang.y" + case 450: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ +#line 3086 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 9914 "MachineIndependent/glslang_tab.cpp" +#line 9939 "MachineIndependent/glslang_tab.cpp" break; - case 450: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ -#line 3082 "MachineIndependent/glslang.y" + case 451: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ +#line 3091 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 9924 "MachineIndependent/glslang_tab.cpp" +#line 9949 "MachineIndependent/glslang_tab.cpp" break; - case 451: /* type_specifier_nonarray: IMAGE1D */ -#line 3087 "MachineIndependent/glslang.y" + case 452: /* type_specifier_nonarray: IMAGE1D */ +#line 3096 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 9934 "MachineIndependent/glslang_tab.cpp" +#line 9959 "MachineIndependent/glslang_tab.cpp" break; - case 452: /* type_specifier_nonarray: F16IMAGE1D */ -#line 3092 "MachineIndependent/glslang.y" + case 453: /* type_specifier_nonarray: F16IMAGE1D */ +#line 3101 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); } -#line 9945 "MachineIndependent/glslang_tab.cpp" +#line 9970 "MachineIndependent/glslang_tab.cpp" break; - case 453: /* type_specifier_nonarray: IIMAGE1D */ -#line 3098 "MachineIndependent/glslang.y" + case 454: /* type_specifier_nonarray: IIMAGE1D */ +#line 3107 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 9955 "MachineIndependent/glslang_tab.cpp" +#line 9980 "MachineIndependent/glslang_tab.cpp" break; - case 454: /* type_specifier_nonarray: UIMAGE1D */ -#line 3103 "MachineIndependent/glslang.y" + case 455: /* type_specifier_nonarray: UIMAGE1D */ +#line 3112 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 9965 "MachineIndependent/glslang_tab.cpp" +#line 9990 "MachineIndependent/glslang_tab.cpp" break; - case 455: /* type_specifier_nonarray: IMAGE2D */ -#line 3108 "MachineIndependent/glslang.y" + case 456: /* type_specifier_nonarray: IMAGE2D */ +#line 3117 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 9975 "MachineIndependent/glslang_tab.cpp" +#line 10000 "MachineIndependent/glslang_tab.cpp" break; - case 456: /* type_specifier_nonarray: F16IMAGE2D */ -#line 3113 "MachineIndependent/glslang.y" + case 457: /* type_specifier_nonarray: F16IMAGE2D */ +#line 3122 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); } -#line 9986 "MachineIndependent/glslang_tab.cpp" +#line 10011 "MachineIndependent/glslang_tab.cpp" break; - case 457: /* type_specifier_nonarray: IIMAGE2D */ -#line 3119 "MachineIndependent/glslang.y" + case 458: /* type_specifier_nonarray: IIMAGE2D */ +#line 3128 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 9996 "MachineIndependent/glslang_tab.cpp" +#line 10021 "MachineIndependent/glslang_tab.cpp" break; - case 458: /* type_specifier_nonarray: UIMAGE2D */ -#line 3124 "MachineIndependent/glslang.y" + case 459: /* type_specifier_nonarray: UIMAGE2D */ +#line 3133 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 10006 "MachineIndependent/glslang_tab.cpp" +#line 10031 "MachineIndependent/glslang_tab.cpp" break; - case 459: /* type_specifier_nonarray: IMAGE3D */ -#line 3129 "MachineIndependent/glslang.y" + case 460: /* type_specifier_nonarray: IMAGE3D */ +#line 3138 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 10016 "MachineIndependent/glslang_tab.cpp" +#line 10041 "MachineIndependent/glslang_tab.cpp" break; - case 460: /* type_specifier_nonarray: F16IMAGE3D */ -#line 3134 "MachineIndependent/glslang.y" + case 461: /* type_specifier_nonarray: F16IMAGE3D */ +#line 3143 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); } -#line 10027 "MachineIndependent/glslang_tab.cpp" +#line 10052 "MachineIndependent/glslang_tab.cpp" break; - case 461: /* type_specifier_nonarray: IIMAGE3D */ -#line 3140 "MachineIndependent/glslang.y" + case 462: /* type_specifier_nonarray: IIMAGE3D */ +#line 3149 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 10037 "MachineIndependent/glslang_tab.cpp" +#line 10062 "MachineIndependent/glslang_tab.cpp" break; - case 462: /* type_specifier_nonarray: UIMAGE3D */ -#line 3145 "MachineIndependent/glslang.y" + case 463: /* type_specifier_nonarray: UIMAGE3D */ +#line 3154 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 10047 "MachineIndependent/glslang_tab.cpp" +#line 10072 "MachineIndependent/glslang_tab.cpp" break; - case 463: /* type_specifier_nonarray: IMAGE2DRECT */ -#line 3150 "MachineIndependent/glslang.y" + case 464: /* type_specifier_nonarray: IMAGE2DRECT */ +#line 3159 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 10057 "MachineIndependent/glslang_tab.cpp" +#line 10082 "MachineIndependent/glslang_tab.cpp" break; - case 464: /* type_specifier_nonarray: F16IMAGE2DRECT */ -#line 3155 "MachineIndependent/glslang.y" + case 465: /* type_specifier_nonarray: F16IMAGE2DRECT */ +#line 3164 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); } -#line 10068 "MachineIndependent/glslang_tab.cpp" +#line 10093 "MachineIndependent/glslang_tab.cpp" break; - case 465: /* type_specifier_nonarray: IIMAGE2DRECT */ -#line 3161 "MachineIndependent/glslang.y" + case 466: /* type_specifier_nonarray: IIMAGE2DRECT */ +#line 3170 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 10078 "MachineIndependent/glslang_tab.cpp" +#line 10103 "MachineIndependent/glslang_tab.cpp" break; - case 466: /* type_specifier_nonarray: UIMAGE2DRECT */ -#line 3166 "MachineIndependent/glslang.y" + case 467: /* type_specifier_nonarray: UIMAGE2DRECT */ +#line 3175 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 10088 "MachineIndependent/glslang_tab.cpp" +#line 10113 "MachineIndependent/glslang_tab.cpp" break; - case 467: /* type_specifier_nonarray: IMAGECUBE */ -#line 3171 "MachineIndependent/glslang.y" + case 468: /* type_specifier_nonarray: IMAGECUBE */ +#line 3180 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 10098 "MachineIndependent/glslang_tab.cpp" +#line 10123 "MachineIndependent/glslang_tab.cpp" break; - case 468: /* type_specifier_nonarray: F16IMAGECUBE */ -#line 3176 "MachineIndependent/glslang.y" + case 469: /* type_specifier_nonarray: F16IMAGECUBE */ +#line 3185 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); } -#line 10109 "MachineIndependent/glslang_tab.cpp" +#line 10134 "MachineIndependent/glslang_tab.cpp" break; - case 469: /* type_specifier_nonarray: IIMAGECUBE */ -#line 3182 "MachineIndependent/glslang.y" + case 470: /* type_specifier_nonarray: IIMAGECUBE */ +#line 3191 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 10119 "MachineIndependent/glslang_tab.cpp" +#line 10144 "MachineIndependent/glslang_tab.cpp" break; - case 470: /* type_specifier_nonarray: UIMAGECUBE */ -#line 3187 "MachineIndependent/glslang.y" + case 471: /* type_specifier_nonarray: UIMAGECUBE */ +#line 3196 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 10129 "MachineIndependent/glslang_tab.cpp" +#line 10154 "MachineIndependent/glslang_tab.cpp" break; - case 471: /* type_specifier_nonarray: IMAGEBUFFER */ -#line 3192 "MachineIndependent/glslang.y" + case 472: /* type_specifier_nonarray: IMAGEBUFFER */ +#line 3201 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 10139 "MachineIndependent/glslang_tab.cpp" +#line 10164 "MachineIndependent/glslang_tab.cpp" break; - case 472: /* type_specifier_nonarray: F16IMAGEBUFFER */ -#line 3197 "MachineIndependent/glslang.y" + case 473: /* type_specifier_nonarray: F16IMAGEBUFFER */ +#line 3206 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); } -#line 10150 "MachineIndependent/glslang_tab.cpp" +#line 10175 "MachineIndependent/glslang_tab.cpp" break; - case 473: /* type_specifier_nonarray: IIMAGEBUFFER */ -#line 3203 "MachineIndependent/glslang.y" + case 474: /* type_specifier_nonarray: IIMAGEBUFFER */ +#line 3212 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 10160 "MachineIndependent/glslang_tab.cpp" +#line 10185 "MachineIndependent/glslang_tab.cpp" break; - case 474: /* type_specifier_nonarray: UIMAGEBUFFER */ -#line 3208 "MachineIndependent/glslang.y" + case 475: /* type_specifier_nonarray: UIMAGEBUFFER */ +#line 3217 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 10170 "MachineIndependent/glslang_tab.cpp" +#line 10195 "MachineIndependent/glslang_tab.cpp" break; - case 475: /* type_specifier_nonarray: IMAGE1DARRAY */ -#line 3213 "MachineIndependent/glslang.y" + case 476: /* type_specifier_nonarray: IMAGE1DARRAY */ +#line 3222 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 10180 "MachineIndependent/glslang_tab.cpp" +#line 10205 "MachineIndependent/glslang_tab.cpp" break; - case 476: /* type_specifier_nonarray: F16IMAGE1DARRAY */ -#line 3218 "MachineIndependent/glslang.y" + case 477: /* type_specifier_nonarray: F16IMAGE1DARRAY */ +#line 3227 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); } -#line 10191 "MachineIndependent/glslang_tab.cpp" +#line 10216 "MachineIndependent/glslang_tab.cpp" break; - case 477: /* type_specifier_nonarray: IIMAGE1DARRAY */ -#line 3224 "MachineIndependent/glslang.y" + case 478: /* type_specifier_nonarray: IIMAGE1DARRAY */ +#line 3233 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 10201 "MachineIndependent/glslang_tab.cpp" +#line 10226 "MachineIndependent/glslang_tab.cpp" break; - case 478: /* type_specifier_nonarray: UIMAGE1DARRAY */ -#line 3229 "MachineIndependent/glslang.y" + case 479: /* type_specifier_nonarray: UIMAGE1DARRAY */ +#line 3238 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 10211 "MachineIndependent/glslang_tab.cpp" +#line 10236 "MachineIndependent/glslang_tab.cpp" break; - case 479: /* type_specifier_nonarray: IMAGE2DARRAY */ -#line 3234 "MachineIndependent/glslang.y" + case 480: /* type_specifier_nonarray: IMAGE2DARRAY */ +#line 3243 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 10221 "MachineIndependent/glslang_tab.cpp" +#line 10246 "MachineIndependent/glslang_tab.cpp" break; - case 480: /* type_specifier_nonarray: F16IMAGE2DARRAY */ -#line 3239 "MachineIndependent/glslang.y" + case 481: /* type_specifier_nonarray: F16IMAGE2DARRAY */ +#line 3248 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); } -#line 10232 "MachineIndependent/glslang_tab.cpp" +#line 10257 "MachineIndependent/glslang_tab.cpp" break; - case 481: /* type_specifier_nonarray: IIMAGE2DARRAY */ -#line 3245 "MachineIndependent/glslang.y" + case 482: /* type_specifier_nonarray: IIMAGE2DARRAY */ +#line 3254 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 10242 "MachineIndependent/glslang_tab.cpp" +#line 10267 "MachineIndependent/glslang_tab.cpp" break; - case 482: /* type_specifier_nonarray: UIMAGE2DARRAY */ -#line 3250 "MachineIndependent/glslang.y" + case 483: /* type_specifier_nonarray: UIMAGE2DARRAY */ +#line 3259 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 10252 "MachineIndependent/glslang_tab.cpp" +#line 10277 "MachineIndependent/glslang_tab.cpp" break; - case 483: /* type_specifier_nonarray: IMAGECUBEARRAY */ -#line 3255 "MachineIndependent/glslang.y" + case 484: /* type_specifier_nonarray: IMAGECUBEARRAY */ +#line 3264 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 10262 "MachineIndependent/glslang_tab.cpp" +#line 10287 "MachineIndependent/glslang_tab.cpp" break; - case 484: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ -#line 3260 "MachineIndependent/glslang.y" + case 485: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ +#line 3269 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); } -#line 10273 "MachineIndependent/glslang_tab.cpp" +#line 10298 "MachineIndependent/glslang_tab.cpp" break; - case 485: /* type_specifier_nonarray: IIMAGECUBEARRAY */ -#line 3266 "MachineIndependent/glslang.y" + case 486: /* type_specifier_nonarray: IIMAGECUBEARRAY */ +#line 3275 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 10283 "MachineIndependent/glslang_tab.cpp" +#line 10308 "MachineIndependent/glslang_tab.cpp" break; - case 486: /* type_specifier_nonarray: UIMAGECUBEARRAY */ -#line 3271 "MachineIndependent/glslang.y" + case 487: /* type_specifier_nonarray: UIMAGECUBEARRAY */ +#line 3280 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 10293 "MachineIndependent/glslang_tab.cpp" +#line 10318 "MachineIndependent/glslang_tab.cpp" break; - case 487: /* type_specifier_nonarray: IMAGE2DMS */ -#line 3276 "MachineIndependent/glslang.y" + case 488: /* type_specifier_nonarray: IMAGE2DMS */ +#line 3285 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 10303 "MachineIndependent/glslang_tab.cpp" +#line 10328 "MachineIndependent/glslang_tab.cpp" break; - case 488: /* type_specifier_nonarray: F16IMAGE2DMS */ -#line 3281 "MachineIndependent/glslang.y" + case 489: /* type_specifier_nonarray: F16IMAGE2DMS */ +#line 3290 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); } -#line 10314 "MachineIndependent/glslang_tab.cpp" +#line 10339 "MachineIndependent/glslang_tab.cpp" break; - case 489: /* type_specifier_nonarray: IIMAGE2DMS */ -#line 3287 "MachineIndependent/glslang.y" + case 490: /* type_specifier_nonarray: IIMAGE2DMS */ +#line 3296 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 10324 "MachineIndependent/glslang_tab.cpp" +#line 10349 "MachineIndependent/glslang_tab.cpp" break; - case 490: /* type_specifier_nonarray: UIMAGE2DMS */ -#line 3292 "MachineIndependent/glslang.y" + case 491: /* type_specifier_nonarray: UIMAGE2DMS */ +#line 3301 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 10334 "MachineIndependent/glslang_tab.cpp" +#line 10359 "MachineIndependent/glslang_tab.cpp" break; - case 491: /* type_specifier_nonarray: IMAGE2DMSARRAY */ -#line 3297 "MachineIndependent/glslang.y" + case 492: /* type_specifier_nonarray: IMAGE2DMSARRAY */ +#line 3306 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 10344 "MachineIndependent/glslang_tab.cpp" +#line 10369 "MachineIndependent/glslang_tab.cpp" break; - case 492: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ -#line 3302 "MachineIndependent/glslang.y" + case 493: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ +#line 3311 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); } -#line 10355 "MachineIndependent/glslang_tab.cpp" +#line 10380 "MachineIndependent/glslang_tab.cpp" break; - case 493: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ -#line 3308 "MachineIndependent/glslang.y" + case 494: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ +#line 3317 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 10365 "MachineIndependent/glslang_tab.cpp" +#line 10390 "MachineIndependent/glslang_tab.cpp" break; - case 494: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ -#line 3313 "MachineIndependent/glslang.y" + case 495: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ +#line 3322 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 10375 "MachineIndependent/glslang_tab.cpp" +#line 10400 "MachineIndependent/glslang_tab.cpp" break; - case 495: /* type_specifier_nonarray: I64IMAGE1D */ -#line 3318 "MachineIndependent/glslang.y" + case 496: /* type_specifier_nonarray: I64IMAGE1D */ +#line 3327 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D); } -#line 10385 "MachineIndependent/glslang_tab.cpp" +#line 10410 "MachineIndependent/glslang_tab.cpp" break; - case 496: /* type_specifier_nonarray: U64IMAGE1D */ -#line 3323 "MachineIndependent/glslang.y" + case 497: /* type_specifier_nonarray: U64IMAGE1D */ +#line 3332 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D); } -#line 10395 "MachineIndependent/glslang_tab.cpp" +#line 10420 "MachineIndependent/glslang_tab.cpp" break; - case 497: /* type_specifier_nonarray: I64IMAGE2D */ -#line 3328 "MachineIndependent/glslang.y" + case 498: /* type_specifier_nonarray: I64IMAGE2D */ +#line 3337 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D); } -#line 10405 "MachineIndependent/glslang_tab.cpp" +#line 10430 "MachineIndependent/glslang_tab.cpp" break; - case 498: /* type_specifier_nonarray: U64IMAGE2D */ -#line 3333 "MachineIndependent/glslang.y" + case 499: /* type_specifier_nonarray: U64IMAGE2D */ +#line 3342 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D); } -#line 10415 "MachineIndependent/glslang_tab.cpp" +#line 10440 "MachineIndependent/glslang_tab.cpp" break; - case 499: /* type_specifier_nonarray: I64IMAGE3D */ -#line 3338 "MachineIndependent/glslang.y" + case 500: /* type_specifier_nonarray: I64IMAGE3D */ +#line 3347 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd3D); } -#line 10425 "MachineIndependent/glslang_tab.cpp" +#line 10450 "MachineIndependent/glslang_tab.cpp" break; - case 500: /* type_specifier_nonarray: U64IMAGE3D */ -#line 3343 "MachineIndependent/glslang.y" + case 501: /* type_specifier_nonarray: U64IMAGE3D */ +#line 3352 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd3D); } -#line 10435 "MachineIndependent/glslang_tab.cpp" +#line 10460 "MachineIndependent/glslang_tab.cpp" break; - case 501: /* type_specifier_nonarray: I64IMAGE2DRECT */ -#line 3348 "MachineIndependent/glslang.y" + case 502: /* type_specifier_nonarray: I64IMAGE2DRECT */ +#line 3357 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdRect); } -#line 10445 "MachineIndependent/glslang_tab.cpp" +#line 10470 "MachineIndependent/glslang_tab.cpp" break; - case 502: /* type_specifier_nonarray: U64IMAGE2DRECT */ -#line 3353 "MachineIndependent/glslang.y" + case 503: /* type_specifier_nonarray: U64IMAGE2DRECT */ +#line 3362 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdRect); } -#line 10455 "MachineIndependent/glslang_tab.cpp" +#line 10480 "MachineIndependent/glslang_tab.cpp" break; - case 503: /* type_specifier_nonarray: I64IMAGECUBE */ -#line 3358 "MachineIndependent/glslang.y" + case 504: /* type_specifier_nonarray: I64IMAGECUBE */ +#line 3367 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube); } -#line 10465 "MachineIndependent/glslang_tab.cpp" +#line 10490 "MachineIndependent/glslang_tab.cpp" break; - case 504: /* type_specifier_nonarray: U64IMAGECUBE */ -#line 3363 "MachineIndependent/glslang.y" + case 505: /* type_specifier_nonarray: U64IMAGECUBE */ +#line 3372 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube); } -#line 10475 "MachineIndependent/glslang_tab.cpp" +#line 10500 "MachineIndependent/glslang_tab.cpp" break; - case 505: /* type_specifier_nonarray: I64IMAGEBUFFER */ -#line 3368 "MachineIndependent/glslang.y" + case 506: /* type_specifier_nonarray: I64IMAGEBUFFER */ +#line 3377 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdBuffer); } -#line 10485 "MachineIndependent/glslang_tab.cpp" +#line 10510 "MachineIndependent/glslang_tab.cpp" break; - case 506: /* type_specifier_nonarray: U64IMAGEBUFFER */ -#line 3373 "MachineIndependent/glslang.y" + case 507: /* type_specifier_nonarray: U64IMAGEBUFFER */ +#line 3382 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdBuffer); } -#line 10495 "MachineIndependent/glslang_tab.cpp" +#line 10520 "MachineIndependent/glslang_tab.cpp" break; - case 507: /* type_specifier_nonarray: I64IMAGE1DARRAY */ -#line 3378 "MachineIndependent/glslang.y" + case 508: /* type_specifier_nonarray: I64IMAGE1DARRAY */ +#line 3387 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D, true); } -#line 10505 "MachineIndependent/glslang_tab.cpp" +#line 10530 "MachineIndependent/glslang_tab.cpp" break; - case 508: /* type_specifier_nonarray: U64IMAGE1DARRAY */ -#line 3383 "MachineIndependent/glslang.y" + case 509: /* type_specifier_nonarray: U64IMAGE1DARRAY */ +#line 3392 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D, true); } -#line 10515 "MachineIndependent/glslang_tab.cpp" +#line 10540 "MachineIndependent/glslang_tab.cpp" break; - case 509: /* type_specifier_nonarray: I64IMAGE2DARRAY */ -#line 3388 "MachineIndependent/glslang.y" + case 510: /* type_specifier_nonarray: I64IMAGE2DARRAY */ +#line 3397 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true); } -#line 10525 "MachineIndependent/glslang_tab.cpp" +#line 10550 "MachineIndependent/glslang_tab.cpp" break; - case 510: /* type_specifier_nonarray: U64IMAGE2DARRAY */ -#line 3393 "MachineIndependent/glslang.y" + case 511: /* type_specifier_nonarray: U64IMAGE2DARRAY */ +#line 3402 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true); } -#line 10535 "MachineIndependent/glslang_tab.cpp" +#line 10560 "MachineIndependent/glslang_tab.cpp" break; - case 511: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ -#line 3398 "MachineIndependent/glslang.y" + case 512: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ +#line 3407 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube, true); } -#line 10545 "MachineIndependent/glslang_tab.cpp" +#line 10570 "MachineIndependent/glslang_tab.cpp" break; - case 512: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ -#line 3403 "MachineIndependent/glslang.y" + case 513: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ +#line 3412 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube, true); } -#line 10555 "MachineIndependent/glslang_tab.cpp" +#line 10580 "MachineIndependent/glslang_tab.cpp" break; - case 513: /* type_specifier_nonarray: I64IMAGE2DMS */ -#line 3408 "MachineIndependent/glslang.y" + case 514: /* type_specifier_nonarray: I64IMAGE2DMS */ +#line 3417 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, false, false, true); } -#line 10565 "MachineIndependent/glslang_tab.cpp" +#line 10590 "MachineIndependent/glslang_tab.cpp" break; - case 514: /* type_specifier_nonarray: U64IMAGE2DMS */ -#line 3413 "MachineIndependent/glslang.y" + case 515: /* type_specifier_nonarray: U64IMAGE2DMS */ +#line 3422 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, false, false, true); } -#line 10575 "MachineIndependent/glslang_tab.cpp" +#line 10600 "MachineIndependent/glslang_tab.cpp" break; - case 515: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ -#line 3418 "MachineIndependent/glslang.y" + case 516: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ +#line 3427 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true, false, true); } -#line 10585 "MachineIndependent/glslang_tab.cpp" +#line 10610 "MachineIndependent/glslang_tab.cpp" break; - case 516: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ -#line 3423 "MachineIndependent/glslang.y" + case 517: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ +#line 3432 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true, false, true); } -#line 10595 "MachineIndependent/glslang_tab.cpp" +#line 10620 "MachineIndependent/glslang_tab.cpp" break; - case 517: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ -#line 3428 "MachineIndependent/glslang.y" + case 518: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ +#line 3437 "MachineIndependent/glslang.y" { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 10606 "MachineIndependent/glslang_tab.cpp" +#line 10631 "MachineIndependent/glslang_tab.cpp" break; - case 518: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ -#line 3434 "MachineIndependent/glslang.y" + case 519: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ +#line 3443 "MachineIndependent/glslang.y" { // GL_EXT_YUV_target (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.yuv = true; } -#line 10617 "MachineIndependent/glslang_tab.cpp" +#line 10642 "MachineIndependent/glslang_tab.cpp" break; - case 519: /* type_specifier_nonarray: SUBPASSINPUT */ -#line 3440 "MachineIndependent/glslang.y" + case 520: /* type_specifier_nonarray: SUBPASSINPUT */ +#line 3449 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 10628 "MachineIndependent/glslang_tab.cpp" +#line 10653 "MachineIndependent/glslang_tab.cpp" break; - case 520: /* type_specifier_nonarray: SUBPASSINPUTMS */ -#line 3446 "MachineIndependent/glslang.y" + case 521: /* type_specifier_nonarray: SUBPASSINPUTMS */ +#line 3455 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 10639 "MachineIndependent/glslang_tab.cpp" +#line 10664 "MachineIndependent/glslang_tab.cpp" break; - case 521: /* type_specifier_nonarray: F16SUBPASSINPUT */ -#line 3452 "MachineIndependent/glslang.y" + case 522: /* type_specifier_nonarray: F16SUBPASSINPUT */ +#line 3461 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10647,11 +10672,11 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16); } -#line 10651 "MachineIndependent/glslang_tab.cpp" +#line 10676 "MachineIndependent/glslang_tab.cpp" break; - case 522: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ -#line 3459 "MachineIndependent/glslang.y" + case 523: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ +#line 3468 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10659,107 +10684,116 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); } -#line 10663 "MachineIndependent/glslang_tab.cpp" +#line 10688 "MachineIndependent/glslang_tab.cpp" break; - case 523: /* type_specifier_nonarray: ISUBPASSINPUT */ -#line 3466 "MachineIndependent/glslang.y" + case 524: /* type_specifier_nonarray: ISUBPASSINPUT */ +#line 3475 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 10674 "MachineIndependent/glslang_tab.cpp" +#line 10699 "MachineIndependent/glslang_tab.cpp" break; - case 524: /* type_specifier_nonarray: ISUBPASSINPUTMS */ -#line 3472 "MachineIndependent/glslang.y" + case 525: /* type_specifier_nonarray: ISUBPASSINPUTMS */ +#line 3481 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 10685 "MachineIndependent/glslang_tab.cpp" +#line 10710 "MachineIndependent/glslang_tab.cpp" break; - case 525: /* type_specifier_nonarray: USUBPASSINPUT */ -#line 3478 "MachineIndependent/glslang.y" + case 526: /* type_specifier_nonarray: USUBPASSINPUT */ +#line 3487 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 10696 "MachineIndependent/glslang_tab.cpp" +#line 10721 "MachineIndependent/glslang_tab.cpp" break; - case 526: /* type_specifier_nonarray: USUBPASSINPUTMS */ -#line 3484 "MachineIndependent/glslang.y" + case 527: /* type_specifier_nonarray: USUBPASSINPUTMS */ +#line 3493 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 10707 "MachineIndependent/glslang_tab.cpp" +#line 10732 "MachineIndependent/glslang_tab.cpp" break; - case 527: /* type_specifier_nonarray: FCOOPMATNV */ -#line 3490 "MachineIndependent/glslang.y" + case 528: /* type_specifier_nonarray: FCOOPMATNV */ +#line 3499 "MachineIndependent/glslang.y" { parseContext.fcoopmatCheck((yyvsp[0].lex).loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).coopmat = true; } -#line 10718 "MachineIndependent/glslang_tab.cpp" +#line 10743 "MachineIndependent/glslang_tab.cpp" break; - case 528: /* type_specifier_nonarray: ICOOPMATNV */ -#line 3496 "MachineIndependent/glslang.y" + case 529: /* type_specifier_nonarray: ICOOPMATNV */ +#line 3505 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheck((yyvsp[0].lex).loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).coopmat = true; } -#line 10729 "MachineIndependent/glslang_tab.cpp" +#line 10754 "MachineIndependent/glslang_tab.cpp" break; - case 529: /* type_specifier_nonarray: UCOOPMATNV */ -#line 3502 "MachineIndependent/glslang.y" + case 530: /* type_specifier_nonarray: UCOOPMATNV */ +#line 3511 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheck((yyvsp[0].lex).loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).coopmat = true; } -#line 10740 "MachineIndependent/glslang_tab.cpp" +#line 10765 "MachineIndependent/glslang_tab.cpp" break; - case 530: /* type_specifier_nonarray: spirv_type_specifier */ -#line 3508 "MachineIndependent/glslang.y" + case 531: /* type_specifier_nonarray: spirv_type_specifier */ +#line 3517 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 10749 "MachineIndependent/glslang_tab.cpp" +#line 10774 "MachineIndependent/glslang_tab.cpp" break; - case 531: /* type_specifier_nonarray: struct_specifier */ -#line 3513 "MachineIndependent/glslang.y" + case 532: /* type_specifier_nonarray: HITOBJECTNV */ +#line 3521 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtHitObjectNV; + } +#line 10783 "MachineIndependent/glslang_tab.cpp" + break; + + case 533: /* type_specifier_nonarray: struct_specifier */ +#line 3526 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 10759 "MachineIndependent/glslang_tab.cpp" +#line 10793 "MachineIndependent/glslang_tab.cpp" break; - case 532: /* type_specifier_nonarray: TYPE_NAME */ -#line 3518 "MachineIndependent/glslang.y" + case 534: /* type_specifier_nonarray: TYPE_NAME */ +#line 3531 "MachineIndependent/glslang.y" { // // This is for user defined type names. The lexical phase looked up the @@ -10773,47 +10807,47 @@ yyreduce: } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 10777 "MachineIndependent/glslang_tab.cpp" +#line 10811 "MachineIndependent/glslang_tab.cpp" break; - case 533: /* precision_qualifier: HIGH_PRECISION */ -#line 3534 "MachineIndependent/glslang.y" + case 535: /* precision_qualifier: HIGH_PRECISION */ +#line 3547 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 10787 "MachineIndependent/glslang_tab.cpp" +#line 10821 "MachineIndependent/glslang_tab.cpp" break; - case 534: /* precision_qualifier: MEDIUM_PRECISION */ -#line 3539 "MachineIndependent/glslang.y" + case 536: /* precision_qualifier: MEDIUM_PRECISION */ +#line 3552 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 10797 "MachineIndependent/glslang_tab.cpp" +#line 10831 "MachineIndependent/glslang_tab.cpp" break; - case 535: /* precision_qualifier: LOW_PRECISION */ -#line 3544 "MachineIndependent/glslang.y" + case 537: /* precision_qualifier: LOW_PRECISION */ +#line 3557 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 10807 "MachineIndependent/glslang_tab.cpp" +#line 10841 "MachineIndependent/glslang_tab.cpp" break; - case 536: /* $@3: %empty */ -#line 3552 "MachineIndependent/glslang.y" + case 538: /* $@3: %empty */ +#line 3565 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 10813 "MachineIndependent/glslang_tab.cpp" +#line 10847 "MachineIndependent/glslang_tab.cpp" break; - case 537: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ -#line 3552 "MachineIndependent/glslang.y" + case 539: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ +#line 3565 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -10825,17 +10859,17 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10829 "MachineIndependent/glslang_tab.cpp" +#line 10863 "MachineIndependent/glslang_tab.cpp" break; - case 538: /* $@4: %empty */ -#line 3563 "MachineIndependent/glslang.y" + case 540: /* $@4: %empty */ +#line 3576 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 10835 "MachineIndependent/glslang_tab.cpp" +#line 10869 "MachineIndependent/glslang_tab.cpp" break; - case 539: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ -#line 3563 "MachineIndependent/glslang.y" + case 541: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ +#line 3576 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -10843,19 +10877,19 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10847 "MachineIndependent/glslang_tab.cpp" +#line 10881 "MachineIndependent/glslang_tab.cpp" break; - case 540: /* struct_declaration_list: struct_declaration */ -#line 3573 "MachineIndependent/glslang.y" + case 542: /* struct_declaration_list: struct_declaration */ +#line 3586 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 10855 "MachineIndependent/glslang_tab.cpp" +#line 10889 "MachineIndependent/glslang_tab.cpp" break; - case 541: /* struct_declaration_list: struct_declaration_list struct_declaration */ -#line 3576 "MachineIndependent/glslang.y" + case 543: /* struct_declaration_list: struct_declaration_list struct_declaration */ +#line 3589 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -10866,11 +10900,11 @@ yyreduce: (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 10870 "MachineIndependent/glslang_tab.cpp" +#line 10904 "MachineIndependent/glslang_tab.cpp" break; - case 542: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ -#line 3589 "MachineIndependent/glslang.y" + case 544: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ +#line 3602 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -10893,11 +10927,11 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 10897 "MachineIndependent/glslang_tab.cpp" +#line 10931 "MachineIndependent/glslang_tab.cpp" break; - case 543: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ -#line 3611 "MachineIndependent/glslang.y" + case 545: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ +#line 3624 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -10922,38 +10956,38 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 10926 "MachineIndependent/glslang_tab.cpp" +#line 10960 "MachineIndependent/glslang_tab.cpp" break; - case 544: /* struct_declarator_list: struct_declarator */ -#line 3638 "MachineIndependent/glslang.y" + case 546: /* struct_declarator_list: struct_declarator */ +#line 3651 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 10935 "MachineIndependent/glslang_tab.cpp" +#line 10969 "MachineIndependent/glslang_tab.cpp" break; - case 545: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ -#line 3642 "MachineIndependent/glslang.y" + case 547: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ +#line 3655 "MachineIndependent/glslang.y" { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 10943 "MachineIndependent/glslang_tab.cpp" +#line 10977 "MachineIndependent/glslang_tab.cpp" break; - case 546: /* struct_declarator: IDENTIFIER */ -#line 3648 "MachineIndependent/glslang.y" + case 548: /* struct_declarator: IDENTIFIER */ +#line 3661 "MachineIndependent/glslang.y" { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 10953 "MachineIndependent/glslang_tab.cpp" +#line 10987 "MachineIndependent/glslang_tab.cpp" break; - case 547: /* struct_declarator: IDENTIFIER array_specifier */ -#line 3653 "MachineIndependent/glslang.y" + case 549: /* struct_declarator: IDENTIFIER array_specifier */ +#line 3666 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -10962,246 +10996,246 @@ yyreduce: (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 10966 "MachineIndependent/glslang_tab.cpp" +#line 11000 "MachineIndependent/glslang_tab.cpp" break; - case 548: /* initializer: assignment_expression */ -#line 3664 "MachineIndependent/glslang.y" + case 550: /* initializer: assignment_expression */ +#line 3677 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 10974 "MachineIndependent/glslang_tab.cpp" +#line 11008 "MachineIndependent/glslang_tab.cpp" break; - case 549: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ -#line 3668 "MachineIndependent/glslang.y" + case 551: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ +#line 3681 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 10985 "MachineIndependent/glslang_tab.cpp" +#line 11019 "MachineIndependent/glslang_tab.cpp" break; - case 550: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ -#line 3674 "MachineIndependent/glslang.y" + case 552: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ +#line 3687 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 10996 "MachineIndependent/glslang_tab.cpp" +#line 11030 "MachineIndependent/glslang_tab.cpp" break; - case 551: /* initializer: LEFT_BRACE RIGHT_BRACE */ -#line 3680 "MachineIndependent/glslang.y" + case 553: /* initializer: LEFT_BRACE RIGHT_BRACE */ +#line 3693 "MachineIndependent/glslang.y" { const char* initFeature = "empty { } initializer"; parseContext.profileRequires((yyvsp[-1].lex).loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); parseContext.profileRequires((yyvsp[-1].lex).loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); (yyval.interm.intermTypedNode) = parseContext.intermediate.makeAggregate((yyvsp[-1].lex).loc); } -#line 11007 "MachineIndependent/glslang_tab.cpp" - break; - - case 552: /* initializer_list: initializer */ -#line 3691 "MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); - } -#line 11015 "MachineIndependent/glslang_tab.cpp" - break; - - case 553: /* initializer_list: initializer_list COMMA initializer */ -#line 3694 "MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - } -#line 11023 "MachineIndependent/glslang_tab.cpp" - break; - - case 554: /* declaration_statement: declaration */ -#line 3701 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11029 "MachineIndependent/glslang_tab.cpp" - break; - - case 555: /* statement: compound_statement */ -#line 3705 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11035 "MachineIndependent/glslang_tab.cpp" - break; - - case 556: /* statement: simple_statement */ -#line 3706 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } #line 11041 "MachineIndependent/glslang_tab.cpp" break; - case 557: /* simple_statement: declaration_statement */ -#line 3712 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11047 "MachineIndependent/glslang_tab.cpp" + case 554: /* initializer_list: initializer */ +#line 3704 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); + } +#line 11049 "MachineIndependent/glslang_tab.cpp" break; - case 558: /* simple_statement: expression_statement */ -#line 3713 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11053 "MachineIndependent/glslang_tab.cpp" + case 555: /* initializer_list: initializer_list COMMA initializer */ +#line 3707 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + } +#line 11057 "MachineIndependent/glslang_tab.cpp" break; - case 559: /* simple_statement: selection_statement */ + case 556: /* declaration_statement: declaration */ #line 3714 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11059 "MachineIndependent/glslang_tab.cpp" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11063 "MachineIndependent/glslang_tab.cpp" break; - case 560: /* simple_statement: switch_statement */ -#line 3715 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11065 "MachineIndependent/glslang_tab.cpp" - break; - - case 561: /* simple_statement: case_label */ -#line 3716 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11071 "MachineIndependent/glslang_tab.cpp" - break; - - case 562: /* simple_statement: iteration_statement */ -#line 3717 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11077 "MachineIndependent/glslang_tab.cpp" - break; - - case 563: /* simple_statement: jump_statement */ + case 557: /* statement: compound_statement */ #line 3718 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11083 "MachineIndependent/glslang_tab.cpp" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11069 "MachineIndependent/glslang_tab.cpp" break; - case 564: /* simple_statement: demote_statement */ -#line 3720 "MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11089 "MachineIndependent/glslang_tab.cpp" + case 558: /* statement: simple_statement */ +#line 3719 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11075 "MachineIndependent/glslang_tab.cpp" break; - case 565: /* demote_statement: DEMOTE SEMICOLON */ + case 559: /* simple_statement: declaration_statement */ +#line 3725 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11081 "MachineIndependent/glslang_tab.cpp" + break; + + case 560: /* simple_statement: expression_statement */ #line 3726 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11087 "MachineIndependent/glslang_tab.cpp" + break; + + case 561: /* simple_statement: selection_statement */ +#line 3727 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11093 "MachineIndependent/glslang_tab.cpp" + break; + + case 562: /* simple_statement: switch_statement */ +#line 3728 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11099 "MachineIndependent/glslang_tab.cpp" + break; + + case 563: /* simple_statement: case_label */ +#line 3729 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11105 "MachineIndependent/glslang_tab.cpp" + break; + + case 564: /* simple_statement: iteration_statement */ +#line 3730 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11111 "MachineIndependent/glslang_tab.cpp" + break; + + case 565: /* simple_statement: jump_statement */ +#line 3731 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11117 "MachineIndependent/glslang_tab.cpp" + break; + + case 566: /* simple_statement: demote_statement */ +#line 3733 "MachineIndependent/glslang.y" + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 11123 "MachineIndependent/glslang_tab.cpp" + break; + + case 567: /* demote_statement: DEMOTE SEMICOLON */ +#line 3739 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "demote"); parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); } -#line 11099 "MachineIndependent/glslang_tab.cpp" +#line 11133 "MachineIndependent/glslang_tab.cpp" break; - case 566: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ -#line 3735 "MachineIndependent/glslang.y" + case 568: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ +#line 3748 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11105 "MachineIndependent/glslang_tab.cpp" +#line 11139 "MachineIndependent/glslang_tab.cpp" break; - case 567: /* $@5: %empty */ -#line 3736 "MachineIndependent/glslang.y" + case 569: /* $@5: %empty */ +#line 3749 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 11114 "MachineIndependent/glslang_tab.cpp" +#line 11148 "MachineIndependent/glslang_tab.cpp" break; - case 568: /* $@6: %empty */ -#line 3740 "MachineIndependent/glslang.y" + case 570: /* $@6: %empty */ +#line 3753 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 11123 "MachineIndependent/glslang_tab.cpp" +#line 11157 "MachineIndependent/glslang_tab.cpp" break; - case 569: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ -#line 3744 "MachineIndependent/glslang.y" + case 571: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ +#line 3757 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 11133 "MachineIndependent/glslang_tab.cpp" +#line 11167 "MachineIndependent/glslang_tab.cpp" break; - case 570: /* statement_no_new_scope: compound_statement_no_new_scope */ -#line 3752 "MachineIndependent/glslang.y" + case 572: /* statement_no_new_scope: compound_statement_no_new_scope */ +#line 3765 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11139 "MachineIndependent/glslang_tab.cpp" +#line 11173 "MachineIndependent/glslang_tab.cpp" break; - case 571: /* statement_no_new_scope: simple_statement */ -#line 3753 "MachineIndependent/glslang.y" + case 573: /* statement_no_new_scope: simple_statement */ +#line 3766 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11145 "MachineIndependent/glslang_tab.cpp" +#line 11179 "MachineIndependent/glslang_tab.cpp" break; - case 572: /* $@7: %empty */ -#line 3757 "MachineIndependent/glslang.y" + case 574: /* $@7: %empty */ +#line 3770 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 11153 "MachineIndependent/glslang_tab.cpp" +#line 11187 "MachineIndependent/glslang_tab.cpp" break; - case 573: /* statement_scoped: $@7 compound_statement */ -#line 3760 "MachineIndependent/glslang.y" + case 575: /* statement_scoped: $@7 compound_statement */ +#line 3773 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11162 "MachineIndependent/glslang_tab.cpp" +#line 11196 "MachineIndependent/glslang_tab.cpp" break; - case 574: /* $@8: %empty */ -#line 3764 "MachineIndependent/glslang.y" + case 576: /* $@8: %empty */ +#line 3777 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11172 "MachineIndependent/glslang_tab.cpp" +#line 11206 "MachineIndependent/glslang_tab.cpp" break; - case 575: /* statement_scoped: $@8 simple_statement */ -#line 3769 "MachineIndependent/glslang.y" + case 577: /* statement_scoped: $@8 simple_statement */ +#line 3782 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11183 "MachineIndependent/glslang_tab.cpp" +#line 11217 "MachineIndependent/glslang_tab.cpp" break; - case 576: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ -#line 3778 "MachineIndependent/glslang.y" + case 578: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ +#line 3791 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11191 "MachineIndependent/glslang_tab.cpp" +#line 11225 "MachineIndependent/glslang_tab.cpp" break; - case 577: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ -#line 3781 "MachineIndependent/glslang.y" + case 579: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ +#line 3794 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 11201 "MachineIndependent/glslang_tab.cpp" +#line 11235 "MachineIndependent/glslang_tab.cpp" break; - case 578: /* statement_list: statement */ -#line 3789 "MachineIndependent/glslang.y" + case 580: /* statement_list: statement */ +#line 3802 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -11210,11 +11244,11 @@ yyreduce: (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 11214 "MachineIndependent/glslang_tab.cpp" +#line 11248 "MachineIndependent/glslang_tab.cpp" break; - case 579: /* statement_list: statement_list statement */ -#line 3797 "MachineIndependent/glslang.y" + case 581: /* statement_list: statement_list statement */ +#line 3810 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -11223,77 +11257,77 @@ yyreduce: } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11227 "MachineIndependent/glslang_tab.cpp" +#line 11261 "MachineIndependent/glslang_tab.cpp" break; - case 580: /* expression_statement: SEMICOLON */ -#line 3808 "MachineIndependent/glslang.y" + case 582: /* expression_statement: SEMICOLON */ +#line 3821 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11233 "MachineIndependent/glslang_tab.cpp" +#line 11267 "MachineIndependent/glslang_tab.cpp" break; - case 581: /* expression_statement: expression SEMICOLON */ -#line 3809 "MachineIndependent/glslang.y" + case 583: /* expression_statement: expression SEMICOLON */ +#line 3822 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 11239 "MachineIndependent/glslang_tab.cpp" +#line 11273 "MachineIndependent/glslang_tab.cpp" break; - case 582: /* selection_statement: selection_statement_nonattributed */ -#line 3813 "MachineIndependent/glslang.y" + case 584: /* selection_statement: selection_statement_nonattributed */ +#line 3826 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11247 "MachineIndependent/glslang_tab.cpp" +#line 11281 "MachineIndependent/glslang_tab.cpp" break; - case 583: /* selection_statement: attribute selection_statement_nonattributed */ -#line 3817 "MachineIndependent/glslang.y" + case 585: /* selection_statement: attribute selection_statement_nonattributed */ +#line 3830 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11257 "MachineIndependent/glslang_tab.cpp" +#line 11291 "MachineIndependent/glslang_tab.cpp" break; - case 584: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ -#line 3825 "MachineIndependent/glslang.y" + case 586: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ +#line 3838 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 11266 "MachineIndependent/glslang_tab.cpp" +#line 11300 "MachineIndependent/glslang_tab.cpp" break; - case 585: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ -#line 3832 "MachineIndependent/glslang.y" + case 587: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ +#line 3845 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 11275 "MachineIndependent/glslang_tab.cpp" +#line 11309 "MachineIndependent/glslang_tab.cpp" break; - case 586: /* selection_rest_statement: statement_scoped */ -#line 3836 "MachineIndependent/glslang.y" + case 588: /* selection_rest_statement: statement_scoped */ +#line 3849 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 11284 "MachineIndependent/glslang_tab.cpp" +#line 11318 "MachineIndependent/glslang_tab.cpp" break; - case 587: /* condition: expression */ -#line 3844 "MachineIndependent/glslang.y" + case 589: /* condition: expression */ +#line 3857 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 11293 "MachineIndependent/glslang_tab.cpp" +#line 11327 "MachineIndependent/glslang_tab.cpp" break; - case 588: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 3848 "MachineIndependent/glslang.y" + case 590: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ +#line 3861 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -11304,29 +11338,29 @@ yyreduce: else (yyval.interm.intermTypedNode) = 0; } -#line 11308 "MachineIndependent/glslang_tab.cpp" +#line 11342 "MachineIndependent/glslang_tab.cpp" break; - case 589: /* switch_statement: switch_statement_nonattributed */ -#line 3861 "MachineIndependent/glslang.y" + case 591: /* switch_statement: switch_statement_nonattributed */ +#line 3874 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11316 "MachineIndependent/glslang_tab.cpp" +#line 11350 "MachineIndependent/glslang_tab.cpp" break; - case 590: /* switch_statement: attribute switch_statement_nonattributed */ -#line 3865 "MachineIndependent/glslang.y" + case 592: /* switch_statement: attribute switch_statement_nonattributed */ +#line 3878 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11326 "MachineIndependent/glslang_tab.cpp" +#line 11360 "MachineIndependent/glslang_tab.cpp" break; - case 591: /* $@9: %empty */ -#line 3873 "MachineIndependent/glslang.y" + case 593: /* $@9: %empty */ +#line 3886 "MachineIndependent/glslang.y" { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -11335,11 +11369,11 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 11339 "MachineIndependent/glslang_tab.cpp" +#line 11373 "MachineIndependent/glslang_tab.cpp" break; - case 592: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ -#line 3881 "MachineIndependent/glslang.y" + case 594: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ +#line 3894 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -11349,27 +11383,27 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11353 "MachineIndependent/glslang_tab.cpp" +#line 11387 "MachineIndependent/glslang_tab.cpp" break; - case 593: /* switch_statement_list: %empty */ -#line 3893 "MachineIndependent/glslang.y" + case 595: /* switch_statement_list: %empty */ +#line 3906 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11361 "MachineIndependent/glslang_tab.cpp" +#line 11395 "MachineIndependent/glslang_tab.cpp" break; - case 594: /* switch_statement_list: statement_list */ -#line 3896 "MachineIndependent/glslang.y" + case 596: /* switch_statement_list: statement_list */ +#line 3909 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11369 "MachineIndependent/glslang_tab.cpp" +#line 11403 "MachineIndependent/glslang_tab.cpp" break; - case 595: /* case_label: CASE expression COLON */ -#line 3902 "MachineIndependent/glslang.y" + case 597: /* case_label: CASE expression COLON */ +#line 3915 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11382,11 +11416,11 @@ yyreduce: (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 11386 "MachineIndependent/glslang_tab.cpp" +#line 11420 "MachineIndependent/glslang_tab.cpp" break; - case 596: /* case_label: DEFAULT COLON */ -#line 3914 "MachineIndependent/glslang.y" + case 598: /* case_label: DEFAULT COLON */ +#line 3927 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11396,29 +11430,29 @@ yyreduce: else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 11400 "MachineIndependent/glslang_tab.cpp" +#line 11434 "MachineIndependent/glslang_tab.cpp" break; - case 597: /* iteration_statement: iteration_statement_nonattributed */ -#line 3926 "MachineIndependent/glslang.y" + case 599: /* iteration_statement: iteration_statement_nonattributed */ +#line 3939 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11408 "MachineIndependent/glslang_tab.cpp" +#line 11442 "MachineIndependent/glslang_tab.cpp" break; - case 598: /* iteration_statement: attribute iteration_statement_nonattributed */ -#line 3930 "MachineIndependent/glslang.y" + case 600: /* iteration_statement: attribute iteration_statement_nonattributed */ +#line 3943 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11418 "MachineIndependent/glslang_tab.cpp" +#line 11452 "MachineIndependent/glslang_tab.cpp" break; - case 599: /* $@10: %empty */ -#line 3938 "MachineIndependent/glslang.y" + case 601: /* $@10: %empty */ +#line 3951 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -11427,11 +11461,11 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11431 "MachineIndependent/glslang_tab.cpp" +#line 11465 "MachineIndependent/glslang_tab.cpp" break; - case 600: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ -#line 3946 "MachineIndependent/glslang.y" + case 602: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ +#line 3959 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -11439,22 +11473,22 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11443 "MachineIndependent/glslang_tab.cpp" +#line 11477 "MachineIndependent/glslang_tab.cpp" break; - case 601: /* $@11: %empty */ -#line 3953 "MachineIndependent/glslang.y" + case 603: /* $@11: %empty */ +#line 3966 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11454 "MachineIndependent/glslang_tab.cpp" +#line 11488 "MachineIndependent/glslang_tab.cpp" break; - case 602: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ -#line 3959 "MachineIndependent/glslang.y" + case 604: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ +#line 3972 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -11467,22 +11501,22 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11471 "MachineIndependent/glslang_tab.cpp" +#line 11505 "MachineIndependent/glslang_tab.cpp" break; - case 603: /* $@12: %empty */ -#line 3971 "MachineIndependent/glslang.y" + case 605: /* $@12: %empty */ +#line 3984 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11482 "MachineIndependent/glslang_tab.cpp" +#line 11516 "MachineIndependent/glslang_tab.cpp" break; - case 604: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ -#line 3977 "MachineIndependent/glslang.y" + case 606: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ +#line 3990 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -11495,81 +11529,81 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11499 "MachineIndependent/glslang_tab.cpp" +#line 11533 "MachineIndependent/glslang_tab.cpp" break; - case 605: /* for_init_statement: expression_statement */ -#line 3992 "MachineIndependent/glslang.y" + case 607: /* for_init_statement: expression_statement */ +#line 4005 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11507 "MachineIndependent/glslang_tab.cpp" +#line 11541 "MachineIndependent/glslang_tab.cpp" break; - case 606: /* for_init_statement: declaration_statement */ -#line 3995 "MachineIndependent/glslang.y" + case 608: /* for_init_statement: declaration_statement */ +#line 4008 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11515 "MachineIndependent/glslang_tab.cpp" - break; - - case 607: /* conditionopt: condition */ -#line 4001 "MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } -#line 11523 "MachineIndependent/glslang_tab.cpp" - break; - - case 608: /* conditionopt: %empty */ -#line 4004 "MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = 0; - } -#line 11531 "MachineIndependent/glslang_tab.cpp" - break; - - case 609: /* for_rest_statement: conditionopt SEMICOLON */ -#line 4010 "MachineIndependent/glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = 0; - } -#line 11540 "MachineIndependent/glslang_tab.cpp" - break; - - case 610: /* for_rest_statement: conditionopt SEMICOLON expression */ -#line 4014 "MachineIndependent/glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); - } #line 11549 "MachineIndependent/glslang_tab.cpp" break; - case 611: /* jump_statement: CONTINUE SEMICOLON */ -#line 4021 "MachineIndependent/glslang.y" + case 609: /* conditionopt: condition */ +#line 4014 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 11557 "MachineIndependent/glslang_tab.cpp" + break; + + case 610: /* conditionopt: %empty */ +#line 4017 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = 0; + } +#line 11565 "MachineIndependent/glslang_tab.cpp" + break; + + case 611: /* for_rest_statement: conditionopt SEMICOLON */ +#line 4023 "MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = 0; + } +#line 11574 "MachineIndependent/glslang_tab.cpp" + break; + + case 612: /* for_rest_statement: conditionopt SEMICOLON expression */ +#line 4027 "MachineIndependent/glslang.y" + { + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); + } +#line 11583 "MachineIndependent/glslang_tab.cpp" + break; + + case 613: /* jump_statement: CONTINUE SEMICOLON */ +#line 4034 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 11559 "MachineIndependent/glslang_tab.cpp" +#line 11593 "MachineIndependent/glslang_tab.cpp" break; - case 612: /* jump_statement: BREAK SEMICOLON */ -#line 4026 "MachineIndependent/glslang.y" + case 614: /* jump_statement: BREAK SEMICOLON */ +#line 4039 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 11569 "MachineIndependent/glslang_tab.cpp" +#line 11603 "MachineIndependent/glslang_tab.cpp" break; - case 613: /* jump_statement: RETURN SEMICOLON */ -#line 4031 "MachineIndependent/glslang.y" + case 615: /* jump_statement: RETURN SEMICOLON */ +#line 4044 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -11577,101 +11611,101 @@ yyreduce: if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 11581 "MachineIndependent/glslang_tab.cpp" +#line 11615 "MachineIndependent/glslang_tab.cpp" break; - case 614: /* jump_statement: RETURN expression SEMICOLON */ -#line 4038 "MachineIndependent/glslang.y" + case 616: /* jump_statement: RETURN expression SEMICOLON */ +#line 4051 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 11589 "MachineIndependent/glslang_tab.cpp" +#line 11623 "MachineIndependent/glslang_tab.cpp" break; - case 615: /* jump_statement: DISCARD SEMICOLON */ -#line 4041 "MachineIndependent/glslang.y" + case 617: /* jump_statement: DISCARD SEMICOLON */ +#line 4054 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 11598 "MachineIndependent/glslang_tab.cpp" +#line 11632 "MachineIndependent/glslang_tab.cpp" break; - case 616: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ -#line 4045 "MachineIndependent/glslang.y" + case 618: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ +#line 4058 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); } -#line 11607 "MachineIndependent/glslang_tab.cpp" +#line 11641 "MachineIndependent/glslang_tab.cpp" break; - case 617: /* jump_statement: TERMINATE_RAY SEMICOLON */ -#line 4050 "MachineIndependent/glslang.y" + case 619: /* jump_statement: TERMINATE_RAY SEMICOLON */ +#line 4063 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); } -#line 11616 "MachineIndependent/glslang_tab.cpp" +#line 11650 "MachineIndependent/glslang_tab.cpp" break; - case 618: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ -#line 4054 "MachineIndependent/glslang.y" + case 620: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ +#line 4067 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); } -#line 11625 "MachineIndependent/glslang_tab.cpp" +#line 11659 "MachineIndependent/glslang_tab.cpp" break; - case 619: /* translation_unit: external_declaration */ -#line 4064 "MachineIndependent/glslang.y" + case 621: /* translation_unit: external_declaration */ +#line 4077 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 11634 "MachineIndependent/glslang_tab.cpp" +#line 11668 "MachineIndependent/glslang_tab.cpp" break; - case 620: /* translation_unit: translation_unit external_declaration */ -#line 4068 "MachineIndependent/glslang.y" + case 622: /* translation_unit: translation_unit external_declaration */ +#line 4081 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 11645 "MachineIndependent/glslang_tab.cpp" +#line 11679 "MachineIndependent/glslang_tab.cpp" break; - case 621: /* external_declaration: function_definition */ -#line 4077 "MachineIndependent/glslang.y" + case 623: /* external_declaration: function_definition */ +#line 4090 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11653 "MachineIndependent/glslang_tab.cpp" +#line 11687 "MachineIndependent/glslang_tab.cpp" break; - case 622: /* external_declaration: declaration */ -#line 4080 "MachineIndependent/glslang.y" + case 624: /* external_declaration: declaration */ +#line 4093 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11661 "MachineIndependent/glslang_tab.cpp" +#line 11695 "MachineIndependent/glslang_tab.cpp" break; - case 623: /* external_declaration: SEMICOLON */ -#line 4084 "MachineIndependent/glslang.y" + case 625: /* external_declaration: SEMICOLON */ +#line 4097 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 11671 "MachineIndependent/glslang_tab.cpp" +#line 11705 "MachineIndependent/glslang_tab.cpp" break; - case 624: /* $@13: %empty */ -#line 4093 "MachineIndependent/glslang.y" + case 626: /* $@13: %empty */ +#line 4106 "MachineIndependent/glslang.y" { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); @@ -11684,11 +11718,11 @@ yyreduce: ++parseContext.statementNestingLevel; } } -#line 11688 "MachineIndependent/glslang_tab.cpp" +#line 11722 "MachineIndependent/glslang_tab.cpp" break; - case 625: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ -#line 4105 "MachineIndependent/glslang.y" + case 627: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ +#line 4118 "MachineIndependent/glslang.y" { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -11715,228 +11749,228 @@ yyreduce: --parseContext.statementNestingLevel; } } -#line 11719 "MachineIndependent/glslang_tab.cpp" +#line 11753 "MachineIndependent/glslang_tab.cpp" break; - case 626: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ -#line 4135 "MachineIndependent/glslang.y" + case 628: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ +#line 4148 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); } -#line 11727 "MachineIndependent/glslang_tab.cpp" +#line 11761 "MachineIndependent/glslang_tab.cpp" break; - case 627: /* attribute_list: single_attribute */ -#line 4140 "MachineIndependent/glslang.y" + case 629: /* attribute_list: single_attribute */ +#line 4153 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 11735 "MachineIndependent/glslang_tab.cpp" +#line 11769 "MachineIndependent/glslang_tab.cpp" break; - case 628: /* attribute_list: attribute_list COMMA single_attribute */ -#line 4143 "MachineIndependent/glslang.y" + case 630: /* attribute_list: attribute_list COMMA single_attribute */ +#line 4156 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 11743 "MachineIndependent/glslang_tab.cpp" +#line 11777 "MachineIndependent/glslang_tab.cpp" break; - case 629: /* single_attribute: IDENTIFIER */ -#line 4148 "MachineIndependent/glslang.y" + case 631: /* single_attribute: IDENTIFIER */ +#line 4161 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 11751 "MachineIndependent/glslang_tab.cpp" +#line 11785 "MachineIndependent/glslang_tab.cpp" break; - case 630: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ -#line 4151 "MachineIndependent/glslang.y" + case 632: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ +#line 4164 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 11759 "MachineIndependent/glslang_tab.cpp" +#line 11793 "MachineIndependent/glslang_tab.cpp" break; - case 631: /* spirv_requirements_list: spirv_requirements_parameter */ -#line 4158 "MachineIndependent/glslang.y" + case 633: /* spirv_requirements_list: spirv_requirements_parameter */ +#line 4171 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); } -#line 11767 "MachineIndependent/glslang_tab.cpp" +#line 11801 "MachineIndependent/glslang_tab.cpp" break; - case 632: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ -#line 4161 "MachineIndependent/glslang.y" + case 634: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ +#line 4174 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); } -#line 11775 "MachineIndependent/glslang_tab.cpp" +#line 11809 "MachineIndependent/glslang_tab.cpp" break; - case 633: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ -#line 4166 "MachineIndependent/glslang.y" + case 635: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ +#line 4179 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); } -#line 11783 "MachineIndependent/glslang_tab.cpp" +#line 11817 "MachineIndependent/glslang_tab.cpp" break; - case 634: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ -#line 4169 "MachineIndependent/glslang.y" + case 636: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ +#line 4182 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11791 "MachineIndependent/glslang_tab.cpp" +#line 11825 "MachineIndependent/glslang_tab.cpp" break; - case 635: /* spirv_extension_list: STRING_LITERAL */ -#line 4174 "MachineIndependent/glslang.y" + case 637: /* spirv_extension_list: STRING_LITERAL */ +#line 4187 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11799 "MachineIndependent/glslang_tab.cpp" +#line 11833 "MachineIndependent/glslang_tab.cpp" break; - case 636: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ -#line 4177 "MachineIndependent/glslang.y" + case 638: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ +#line 4190 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11807 "MachineIndependent/glslang_tab.cpp" +#line 11841 "MachineIndependent/glslang_tab.cpp" break; - case 637: /* spirv_capability_list: INTCONSTANT */ -#line 4182 "MachineIndependent/glslang.y" + case 639: /* spirv_capability_list: INTCONSTANT */ +#line 4195 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11815 "MachineIndependent/glslang_tab.cpp" +#line 11849 "MachineIndependent/glslang_tab.cpp" break; - case 638: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ -#line 4185 "MachineIndependent/glslang.y" + case 640: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ +#line 4198 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11823 "MachineIndependent/glslang_tab.cpp" +#line 11857 "MachineIndependent/glslang_tab.cpp" break; - case 639: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4190 "MachineIndependent/glslang.y" + case 641: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4203 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11832 "MachineIndependent/glslang_tab.cpp" +#line 11866 "MachineIndependent/glslang_tab.cpp" break; - case 640: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4194 "MachineIndependent/glslang.y" + case 642: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4207 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11842 "MachineIndependent/glslang_tab.cpp" +#line 11876 "MachineIndependent/glslang_tab.cpp" break; - case 641: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4199 "MachineIndependent/glslang.y" + case 643: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4212 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11851 "MachineIndependent/glslang_tab.cpp" +#line 11885 "MachineIndependent/glslang_tab.cpp" break; - case 642: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4203 "MachineIndependent/glslang.y" + case 644: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4216 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11861 "MachineIndependent/glslang_tab.cpp" +#line 11895 "MachineIndependent/glslang_tab.cpp" break; - case 643: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4208 "MachineIndependent/glslang.y" + case 645: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ +#line 4221 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11870 "MachineIndependent/glslang_tab.cpp" +#line 11904 "MachineIndependent/glslang_tab.cpp" break; - case 644: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4212 "MachineIndependent/glslang.y" + case 646: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ +#line 4225 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11880 "MachineIndependent/glslang_tab.cpp" +#line 11914 "MachineIndependent/glslang_tab.cpp" break; - case 645: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ -#line 4219 "MachineIndependent/glslang.y" + case 647: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ +#line 4232 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 11888 "MachineIndependent/glslang_tab.cpp" +#line 11922 "MachineIndependent/glslang_tab.cpp" break; - case 646: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ -#line 4222 "MachineIndependent/glslang.y" + case 648: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ +#line 4235 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11896 "MachineIndependent/glslang_tab.cpp" +#line 11930 "MachineIndependent/glslang_tab.cpp" break; - case 647: /* spirv_execution_mode_parameter: FLOATCONSTANT */ -#line 4227 "MachineIndependent/glslang.y" + case 649: /* spirv_execution_mode_parameter: FLOATCONSTANT */ +#line 4240 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 11904 "MachineIndependent/glslang_tab.cpp" +#line 11938 "MachineIndependent/glslang_tab.cpp" break; - case 648: /* spirv_execution_mode_parameter: INTCONSTANT */ -#line 4230 "MachineIndependent/glslang.y" + case 650: /* spirv_execution_mode_parameter: INTCONSTANT */ +#line 4243 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 11912 "MachineIndependent/glslang_tab.cpp" +#line 11946 "MachineIndependent/glslang_tab.cpp" break; - case 649: /* spirv_execution_mode_parameter: UINTCONSTANT */ -#line 4233 "MachineIndependent/glslang.y" + case 651: /* spirv_execution_mode_parameter: UINTCONSTANT */ +#line 4246 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 11920 "MachineIndependent/glslang_tab.cpp" +#line 11954 "MachineIndependent/glslang_tab.cpp" break; - case 650: /* spirv_execution_mode_parameter: BOOLCONSTANT */ -#line 4236 "MachineIndependent/glslang.y" + case 652: /* spirv_execution_mode_parameter: BOOLCONSTANT */ +#line 4249 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 11928 "MachineIndependent/glslang_tab.cpp" +#line 11962 "MachineIndependent/glslang_tab.cpp" break; - case 651: /* spirv_execution_mode_parameter: STRING_LITERAL */ -#line 4239 "MachineIndependent/glslang.y" + case 653: /* spirv_execution_mode_parameter: STRING_LITERAL */ +#line 4252 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 11936 "MachineIndependent/glslang_tab.cpp" +#line 11970 "MachineIndependent/glslang_tab.cpp" break; - case 652: /* spirv_execution_mode_id_parameter_list: constant_expression */ -#line 4244 "MachineIndependent/glslang.y" + case 654: /* spirv_execution_mode_id_parameter_list: constant_expression */ +#line 4257 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -11946,11 +11980,11 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); } -#line 11950 "MachineIndependent/glslang_tab.cpp" +#line 11984 "MachineIndependent/glslang_tab.cpp" break; - case 653: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ -#line 4253 "MachineIndependent/glslang.y" + case 655: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ +#line 4266 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -11960,156 +11994,156 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11964 "MachineIndependent/glslang_tab.cpp" +#line 11998 "MachineIndependent/glslang_tab.cpp" break; - case 654: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4264 "MachineIndependent/glslang.y" + case 656: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4277 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 11974 "MachineIndependent/glslang_tab.cpp" +#line 12008 "MachineIndependent/glslang_tab.cpp" break; - case 655: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4269 "MachineIndependent/glslang.y" + case 657: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4282 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 11985 "MachineIndependent/glslang_tab.cpp" +#line 12019 "MachineIndependent/glslang_tab.cpp" break; - case 656: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4277 "MachineIndependent/glslang.y" + case 658: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4290 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 11994 "MachineIndependent/glslang_tab.cpp" +#line 12028 "MachineIndependent/glslang_tab.cpp" break; - case 657: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4281 "MachineIndependent/glslang.y" + case 659: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4294 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12004 "MachineIndependent/glslang_tab.cpp" +#line 12038 "MachineIndependent/glslang_tab.cpp" break; - case 658: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4286 "MachineIndependent/glslang.y" + case 660: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4299 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12013 "MachineIndependent/glslang_tab.cpp" +#line 12047 "MachineIndependent/glslang_tab.cpp" break; - case 659: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4290 "MachineIndependent/glslang.y" + case 661: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4303 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12023 "MachineIndependent/glslang_tab.cpp" +#line 12057 "MachineIndependent/glslang_tab.cpp" break; - case 660: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4295 "MachineIndependent/glslang.y" + case 662: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4308 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12032 "MachineIndependent/glslang_tab.cpp" +#line 12066 "MachineIndependent/glslang_tab.cpp" break; - case 661: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4299 "MachineIndependent/glslang.y" + case 663: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4312 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12042 "MachineIndependent/glslang_tab.cpp" +#line 12076 "MachineIndependent/glslang_tab.cpp" break; - case 662: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4304 "MachineIndependent/glslang.y" + case 664: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4317 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12051 "MachineIndependent/glslang_tab.cpp" +#line 12085 "MachineIndependent/glslang_tab.cpp" break; - case 663: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4308 "MachineIndependent/glslang.y" + case 665: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4321 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12061 "MachineIndependent/glslang_tab.cpp" +#line 12095 "MachineIndependent/glslang_tab.cpp" break; - case 664: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ -#line 4315 "MachineIndependent/glslang.y" + case 666: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ +#line 4328 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12069 "MachineIndependent/glslang_tab.cpp" +#line 12103 "MachineIndependent/glslang_tab.cpp" break; - case 665: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ -#line 4318 "MachineIndependent/glslang.y" + case 667: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ +#line 4331 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12077 "MachineIndependent/glslang_tab.cpp" +#line 12111 "MachineIndependent/glslang_tab.cpp" break; - case 666: /* spirv_decorate_parameter: FLOATCONSTANT */ -#line 4323 "MachineIndependent/glslang.y" + case 668: /* spirv_decorate_parameter: FLOATCONSTANT */ +#line 4336 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12085 "MachineIndependent/glslang_tab.cpp" +#line 12119 "MachineIndependent/glslang_tab.cpp" break; - case 667: /* spirv_decorate_parameter: INTCONSTANT */ -#line 4326 "MachineIndependent/glslang.y" + case 669: /* spirv_decorate_parameter: INTCONSTANT */ +#line 4339 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12093 "MachineIndependent/glslang_tab.cpp" +#line 12127 "MachineIndependent/glslang_tab.cpp" break; - case 668: /* spirv_decorate_parameter: UINTCONSTANT */ -#line 4329 "MachineIndependent/glslang.y" + case 670: /* spirv_decorate_parameter: UINTCONSTANT */ +#line 4342 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12101 "MachineIndependent/glslang_tab.cpp" +#line 12135 "MachineIndependent/glslang_tab.cpp" break; - case 669: /* spirv_decorate_parameter: BOOLCONSTANT */ -#line 4332 "MachineIndependent/glslang.y" + case 671: /* spirv_decorate_parameter: BOOLCONSTANT */ +#line 4345 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12109 "MachineIndependent/glslang_tab.cpp" +#line 12143 "MachineIndependent/glslang_tab.cpp" break; - case 670: /* spirv_decorate_id_parameter_list: constant_expression */ -#line 4337 "MachineIndependent/glslang.y" + case 672: /* spirv_decorate_id_parameter_list: constant_expression */ +#line 4350 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12118,11 +12152,11 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); } -#line 12122 "MachineIndependent/glslang_tab.cpp" +#line 12156 "MachineIndependent/glslang_tab.cpp" break; - case 671: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA constant_expression */ -#line 4345 "MachineIndependent/glslang.y" + case 673: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA constant_expression */ +#line 4358 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12131,139 +12165,139 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); } -#line 12135 "MachineIndependent/glslang_tab.cpp" +#line 12169 "MachineIndependent/glslang_tab.cpp" break; - case 672: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ -#line 4355 "MachineIndependent/glslang.y" + case 674: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ +#line 4368 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12144 "MachineIndependent/glslang_tab.cpp" +#line 12178 "MachineIndependent/glslang_tab.cpp" break; - case 673: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ -#line 4359 "MachineIndependent/glslang.y" + case 675: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ +#line 4372 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12152 "MachineIndependent/glslang_tab.cpp" +#line 12186 "MachineIndependent/glslang_tab.cpp" break; - case 674: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4364 "MachineIndependent/glslang.y" + case 676: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4377 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12161 "MachineIndependent/glslang_tab.cpp" +#line 12195 "MachineIndependent/glslang_tab.cpp" break; - case 675: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4368 "MachineIndependent/glslang.y" + case 677: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4381 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12171 "MachineIndependent/glslang_tab.cpp" +#line 12205 "MachineIndependent/glslang_tab.cpp" break; - case 676: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4373 "MachineIndependent/glslang.y" + case 678: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4386 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12180 "MachineIndependent/glslang_tab.cpp" +#line 12214 "MachineIndependent/glslang_tab.cpp" break; - case 677: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4377 "MachineIndependent/glslang.y" + case 679: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4390 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12190 "MachineIndependent/glslang_tab.cpp" +#line 12224 "MachineIndependent/glslang_tab.cpp" break; - case 678: /* spirv_type_parameter_list: spirv_type_parameter */ -#line 4384 "MachineIndependent/glslang.y" + case 680: /* spirv_type_parameter_list: spirv_type_parameter */ +#line 4397 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); } -#line 12198 "MachineIndependent/glslang_tab.cpp" +#line 12232 "MachineIndependent/glslang_tab.cpp" break; - case 679: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ -#line 4387 "MachineIndependent/glslang.y" + case 681: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ +#line 4400 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); } -#line 12206 "MachineIndependent/glslang_tab.cpp" +#line 12240 "MachineIndependent/glslang_tab.cpp" break; - case 680: /* spirv_type_parameter: constant_expression */ -#line 4392 "MachineIndependent/glslang.y" + case 682: /* spirv_type_parameter: constant_expression */ +#line 4405 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); } -#line 12214 "MachineIndependent/glslang_tab.cpp" +#line 12248 "MachineIndependent/glslang_tab.cpp" break; - case 681: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4397 "MachineIndependent/glslang.y" + case 683: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4410 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12222 "MachineIndependent/glslang_tab.cpp" +#line 12256 "MachineIndependent/glslang_tab.cpp" break; - case 682: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4400 "MachineIndependent/glslang.y" + case 684: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4413 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12231 "MachineIndependent/glslang_tab.cpp" +#line 12265 "MachineIndependent/glslang_tab.cpp" break; - case 683: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ -#line 4406 "MachineIndependent/glslang.y" + case 685: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ +#line 4419 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); } -#line 12239 "MachineIndependent/glslang_tab.cpp" +#line 12273 "MachineIndependent/glslang_tab.cpp" break; - case 684: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4409 "MachineIndependent/glslang.y" + case 686: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ +#line 4422 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } -#line 12247 "MachineIndependent/glslang_tab.cpp" +#line 12281 "MachineIndependent/glslang_tab.cpp" break; - case 685: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ -#line 4414 "MachineIndependent/glslang.y" + case 687: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ +#line 4427 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } -#line 12255 "MachineIndependent/glslang_tab.cpp" +#line 12289 "MachineIndependent/glslang_tab.cpp" break; - case 686: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4417 "MachineIndependent/glslang.y" + case 688: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ +#line 4430 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } -#line 12263 "MachineIndependent/glslang_tab.cpp" +#line 12297 "MachineIndependent/glslang_tab.cpp" break; -#line 12267 "MachineIndependent/glslang_tab.cpp" +#line 12301 "MachineIndependent/glslang_tab.cpp" default: break; } @@ -12488,5 +12522,5 @@ yyreturn: return yyresult; } -#line 4422 "MachineIndependent/glslang.y" +#line 4435 "MachineIndependent/glslang.y" diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index 18cef4688..6d168d011 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -217,298 +217,300 @@ extern int yydebug; FCOOPMATNV = 418, /* FCOOPMATNV */ ICOOPMATNV = 419, /* ICOOPMATNV */ UCOOPMATNV = 420, /* UCOOPMATNV */ - SAMPLERCUBEARRAY = 421, /* SAMPLERCUBEARRAY */ - SAMPLERCUBEARRAYSHADOW = 422, /* SAMPLERCUBEARRAYSHADOW */ - ISAMPLERCUBEARRAY = 423, /* ISAMPLERCUBEARRAY */ - USAMPLERCUBEARRAY = 424, /* USAMPLERCUBEARRAY */ - SAMPLER1D = 425, /* SAMPLER1D */ - SAMPLER1DARRAY = 426, /* SAMPLER1DARRAY */ - SAMPLER1DARRAYSHADOW = 427, /* SAMPLER1DARRAYSHADOW */ - ISAMPLER1D = 428, /* ISAMPLER1D */ - SAMPLER1DSHADOW = 429, /* SAMPLER1DSHADOW */ - SAMPLER2DRECT = 430, /* SAMPLER2DRECT */ - SAMPLER2DRECTSHADOW = 431, /* SAMPLER2DRECTSHADOW */ - ISAMPLER2DRECT = 432, /* ISAMPLER2DRECT */ - USAMPLER2DRECT = 433, /* USAMPLER2DRECT */ - SAMPLERBUFFER = 434, /* SAMPLERBUFFER */ - ISAMPLERBUFFER = 435, /* ISAMPLERBUFFER */ - USAMPLERBUFFER = 436, /* USAMPLERBUFFER */ - SAMPLER2DMS = 437, /* SAMPLER2DMS */ - ISAMPLER2DMS = 438, /* ISAMPLER2DMS */ - USAMPLER2DMS = 439, /* USAMPLER2DMS */ - SAMPLER2DMSARRAY = 440, /* SAMPLER2DMSARRAY */ - ISAMPLER2DMSARRAY = 441, /* ISAMPLER2DMSARRAY */ - USAMPLER2DMSARRAY = 442, /* USAMPLER2DMSARRAY */ - SAMPLEREXTERNALOES = 443, /* SAMPLEREXTERNALOES */ - SAMPLEREXTERNAL2DY2YEXT = 444, /* SAMPLEREXTERNAL2DY2YEXT */ - ISAMPLER1DARRAY = 445, /* ISAMPLER1DARRAY */ - USAMPLER1D = 446, /* USAMPLER1D */ - USAMPLER1DARRAY = 447, /* USAMPLER1DARRAY */ - F16SAMPLER1D = 448, /* F16SAMPLER1D */ - F16SAMPLER2D = 449, /* F16SAMPLER2D */ - F16SAMPLER3D = 450, /* F16SAMPLER3D */ - F16SAMPLER2DRECT = 451, /* F16SAMPLER2DRECT */ - F16SAMPLERCUBE = 452, /* F16SAMPLERCUBE */ - F16SAMPLER1DARRAY = 453, /* F16SAMPLER1DARRAY */ - F16SAMPLER2DARRAY = 454, /* F16SAMPLER2DARRAY */ - F16SAMPLERCUBEARRAY = 455, /* F16SAMPLERCUBEARRAY */ - F16SAMPLERBUFFER = 456, /* F16SAMPLERBUFFER */ - F16SAMPLER2DMS = 457, /* F16SAMPLER2DMS */ - F16SAMPLER2DMSARRAY = 458, /* F16SAMPLER2DMSARRAY */ - F16SAMPLER1DSHADOW = 459, /* F16SAMPLER1DSHADOW */ - F16SAMPLER2DSHADOW = 460, /* F16SAMPLER2DSHADOW */ - F16SAMPLER1DARRAYSHADOW = 461, /* F16SAMPLER1DARRAYSHADOW */ - F16SAMPLER2DARRAYSHADOW = 462, /* F16SAMPLER2DARRAYSHADOW */ - F16SAMPLER2DRECTSHADOW = 463, /* F16SAMPLER2DRECTSHADOW */ - F16SAMPLERCUBESHADOW = 464, /* F16SAMPLERCUBESHADOW */ - F16SAMPLERCUBEARRAYSHADOW = 465, /* F16SAMPLERCUBEARRAYSHADOW */ - IMAGE1D = 466, /* IMAGE1D */ - IIMAGE1D = 467, /* IIMAGE1D */ - UIMAGE1D = 468, /* UIMAGE1D */ - IMAGE2D = 469, /* IMAGE2D */ - IIMAGE2D = 470, /* IIMAGE2D */ - UIMAGE2D = 471, /* UIMAGE2D */ - IMAGE3D = 472, /* IMAGE3D */ - IIMAGE3D = 473, /* IIMAGE3D */ - UIMAGE3D = 474, /* UIMAGE3D */ - IMAGE2DRECT = 475, /* IMAGE2DRECT */ - IIMAGE2DRECT = 476, /* IIMAGE2DRECT */ - UIMAGE2DRECT = 477, /* UIMAGE2DRECT */ - IMAGECUBE = 478, /* IMAGECUBE */ - IIMAGECUBE = 479, /* IIMAGECUBE */ - UIMAGECUBE = 480, /* UIMAGECUBE */ - IMAGEBUFFER = 481, /* IMAGEBUFFER */ - IIMAGEBUFFER = 482, /* IIMAGEBUFFER */ - UIMAGEBUFFER = 483, /* UIMAGEBUFFER */ - IMAGE1DARRAY = 484, /* IMAGE1DARRAY */ - IIMAGE1DARRAY = 485, /* IIMAGE1DARRAY */ - UIMAGE1DARRAY = 486, /* UIMAGE1DARRAY */ - IMAGE2DARRAY = 487, /* IMAGE2DARRAY */ - IIMAGE2DARRAY = 488, /* IIMAGE2DARRAY */ - UIMAGE2DARRAY = 489, /* UIMAGE2DARRAY */ - IMAGECUBEARRAY = 490, /* IMAGECUBEARRAY */ - IIMAGECUBEARRAY = 491, /* IIMAGECUBEARRAY */ - UIMAGECUBEARRAY = 492, /* UIMAGECUBEARRAY */ - IMAGE2DMS = 493, /* IMAGE2DMS */ - IIMAGE2DMS = 494, /* IIMAGE2DMS */ - UIMAGE2DMS = 495, /* UIMAGE2DMS */ - IMAGE2DMSARRAY = 496, /* IMAGE2DMSARRAY */ - IIMAGE2DMSARRAY = 497, /* IIMAGE2DMSARRAY */ - UIMAGE2DMSARRAY = 498, /* UIMAGE2DMSARRAY */ - F16IMAGE1D = 499, /* F16IMAGE1D */ - F16IMAGE2D = 500, /* F16IMAGE2D */ - F16IMAGE3D = 501, /* F16IMAGE3D */ - F16IMAGE2DRECT = 502, /* F16IMAGE2DRECT */ - F16IMAGECUBE = 503, /* F16IMAGECUBE */ - F16IMAGE1DARRAY = 504, /* F16IMAGE1DARRAY */ - F16IMAGE2DARRAY = 505, /* F16IMAGE2DARRAY */ - F16IMAGECUBEARRAY = 506, /* F16IMAGECUBEARRAY */ - F16IMAGEBUFFER = 507, /* F16IMAGEBUFFER */ - F16IMAGE2DMS = 508, /* F16IMAGE2DMS */ - F16IMAGE2DMSARRAY = 509, /* F16IMAGE2DMSARRAY */ - I64IMAGE1D = 510, /* I64IMAGE1D */ - U64IMAGE1D = 511, /* U64IMAGE1D */ - I64IMAGE2D = 512, /* I64IMAGE2D */ - U64IMAGE2D = 513, /* U64IMAGE2D */ - I64IMAGE3D = 514, /* I64IMAGE3D */ - U64IMAGE3D = 515, /* U64IMAGE3D */ - I64IMAGE2DRECT = 516, /* I64IMAGE2DRECT */ - U64IMAGE2DRECT = 517, /* U64IMAGE2DRECT */ - I64IMAGECUBE = 518, /* I64IMAGECUBE */ - U64IMAGECUBE = 519, /* U64IMAGECUBE */ - I64IMAGEBUFFER = 520, /* I64IMAGEBUFFER */ - U64IMAGEBUFFER = 521, /* U64IMAGEBUFFER */ - I64IMAGE1DARRAY = 522, /* I64IMAGE1DARRAY */ - U64IMAGE1DARRAY = 523, /* U64IMAGE1DARRAY */ - I64IMAGE2DARRAY = 524, /* I64IMAGE2DARRAY */ - U64IMAGE2DARRAY = 525, /* U64IMAGE2DARRAY */ - I64IMAGECUBEARRAY = 526, /* I64IMAGECUBEARRAY */ - U64IMAGECUBEARRAY = 527, /* U64IMAGECUBEARRAY */ - I64IMAGE2DMS = 528, /* I64IMAGE2DMS */ - U64IMAGE2DMS = 529, /* U64IMAGE2DMS */ - I64IMAGE2DMSARRAY = 530, /* I64IMAGE2DMSARRAY */ - U64IMAGE2DMSARRAY = 531, /* U64IMAGE2DMSARRAY */ - TEXTURECUBEARRAY = 532, /* TEXTURECUBEARRAY */ - ITEXTURECUBEARRAY = 533, /* ITEXTURECUBEARRAY */ - UTEXTURECUBEARRAY = 534, /* UTEXTURECUBEARRAY */ - TEXTURE1D = 535, /* TEXTURE1D */ - ITEXTURE1D = 536, /* ITEXTURE1D */ - UTEXTURE1D = 537, /* UTEXTURE1D */ - TEXTURE1DARRAY = 538, /* TEXTURE1DARRAY */ - ITEXTURE1DARRAY = 539, /* ITEXTURE1DARRAY */ - UTEXTURE1DARRAY = 540, /* UTEXTURE1DARRAY */ - TEXTURE2DRECT = 541, /* TEXTURE2DRECT */ - ITEXTURE2DRECT = 542, /* ITEXTURE2DRECT */ - UTEXTURE2DRECT = 543, /* UTEXTURE2DRECT */ - TEXTUREBUFFER = 544, /* TEXTUREBUFFER */ - ITEXTUREBUFFER = 545, /* ITEXTUREBUFFER */ - UTEXTUREBUFFER = 546, /* UTEXTUREBUFFER */ - TEXTURE2DMS = 547, /* TEXTURE2DMS */ - ITEXTURE2DMS = 548, /* ITEXTURE2DMS */ - UTEXTURE2DMS = 549, /* UTEXTURE2DMS */ - TEXTURE2DMSARRAY = 550, /* TEXTURE2DMSARRAY */ - ITEXTURE2DMSARRAY = 551, /* ITEXTURE2DMSARRAY */ - UTEXTURE2DMSARRAY = 552, /* UTEXTURE2DMSARRAY */ - F16TEXTURE1D = 553, /* F16TEXTURE1D */ - F16TEXTURE2D = 554, /* F16TEXTURE2D */ - F16TEXTURE3D = 555, /* F16TEXTURE3D */ - F16TEXTURE2DRECT = 556, /* F16TEXTURE2DRECT */ - F16TEXTURECUBE = 557, /* F16TEXTURECUBE */ - F16TEXTURE1DARRAY = 558, /* F16TEXTURE1DARRAY */ - F16TEXTURE2DARRAY = 559, /* F16TEXTURE2DARRAY */ - F16TEXTURECUBEARRAY = 560, /* F16TEXTURECUBEARRAY */ - F16TEXTUREBUFFER = 561, /* F16TEXTUREBUFFER */ - F16TEXTURE2DMS = 562, /* F16TEXTURE2DMS */ - F16TEXTURE2DMSARRAY = 563, /* F16TEXTURE2DMSARRAY */ - SUBPASSINPUT = 564, /* SUBPASSINPUT */ - SUBPASSINPUTMS = 565, /* SUBPASSINPUTMS */ - ISUBPASSINPUT = 566, /* ISUBPASSINPUT */ - ISUBPASSINPUTMS = 567, /* ISUBPASSINPUTMS */ - USUBPASSINPUT = 568, /* USUBPASSINPUT */ - USUBPASSINPUTMS = 569, /* USUBPASSINPUTMS */ - F16SUBPASSINPUT = 570, /* F16SUBPASSINPUT */ - F16SUBPASSINPUTMS = 571, /* F16SUBPASSINPUTMS */ - SPIRV_INSTRUCTION = 572, /* SPIRV_INSTRUCTION */ - SPIRV_EXECUTION_MODE = 573, /* SPIRV_EXECUTION_MODE */ - SPIRV_EXECUTION_MODE_ID = 574, /* SPIRV_EXECUTION_MODE_ID */ - SPIRV_DECORATE = 575, /* SPIRV_DECORATE */ - SPIRV_DECORATE_ID = 576, /* SPIRV_DECORATE_ID */ - SPIRV_DECORATE_STRING = 577, /* SPIRV_DECORATE_STRING */ - SPIRV_TYPE = 578, /* SPIRV_TYPE */ - SPIRV_STORAGE_CLASS = 579, /* SPIRV_STORAGE_CLASS */ - SPIRV_BY_REFERENCE = 580, /* SPIRV_BY_REFERENCE */ - SPIRV_LITERAL = 581, /* SPIRV_LITERAL */ - LEFT_OP = 582, /* LEFT_OP */ - RIGHT_OP = 583, /* RIGHT_OP */ - INC_OP = 584, /* INC_OP */ - DEC_OP = 585, /* DEC_OP */ - LE_OP = 586, /* LE_OP */ - GE_OP = 587, /* GE_OP */ - EQ_OP = 588, /* EQ_OP */ - NE_OP = 589, /* NE_OP */ - AND_OP = 590, /* AND_OP */ - OR_OP = 591, /* OR_OP */ - XOR_OP = 592, /* XOR_OP */ - MUL_ASSIGN = 593, /* MUL_ASSIGN */ - DIV_ASSIGN = 594, /* DIV_ASSIGN */ - ADD_ASSIGN = 595, /* ADD_ASSIGN */ - MOD_ASSIGN = 596, /* MOD_ASSIGN */ - LEFT_ASSIGN = 597, /* LEFT_ASSIGN */ - RIGHT_ASSIGN = 598, /* RIGHT_ASSIGN */ - AND_ASSIGN = 599, /* AND_ASSIGN */ - XOR_ASSIGN = 600, /* XOR_ASSIGN */ - OR_ASSIGN = 601, /* OR_ASSIGN */ - SUB_ASSIGN = 602, /* SUB_ASSIGN */ - STRING_LITERAL = 603, /* STRING_LITERAL */ - LEFT_PAREN = 604, /* LEFT_PAREN */ - RIGHT_PAREN = 605, /* RIGHT_PAREN */ - LEFT_BRACKET = 606, /* LEFT_BRACKET */ - RIGHT_BRACKET = 607, /* RIGHT_BRACKET */ - LEFT_BRACE = 608, /* LEFT_BRACE */ - RIGHT_BRACE = 609, /* RIGHT_BRACE */ - DOT = 610, /* DOT */ - COMMA = 611, /* COMMA */ - COLON = 612, /* COLON */ - EQUAL = 613, /* EQUAL */ - SEMICOLON = 614, /* SEMICOLON */ - BANG = 615, /* BANG */ - DASH = 616, /* DASH */ - TILDE = 617, /* TILDE */ - PLUS = 618, /* PLUS */ - STAR = 619, /* STAR */ - SLASH = 620, /* SLASH */ - PERCENT = 621, /* PERCENT */ - LEFT_ANGLE = 622, /* LEFT_ANGLE */ - RIGHT_ANGLE = 623, /* RIGHT_ANGLE */ - VERTICAL_BAR = 624, /* VERTICAL_BAR */ - CARET = 625, /* CARET */ - AMPERSAND = 626, /* AMPERSAND */ - QUESTION = 627, /* QUESTION */ - INVARIANT = 628, /* INVARIANT */ - HIGH_PRECISION = 629, /* HIGH_PRECISION */ - MEDIUM_PRECISION = 630, /* MEDIUM_PRECISION */ - LOW_PRECISION = 631, /* LOW_PRECISION */ - PRECISION = 632, /* PRECISION */ - PACKED = 633, /* PACKED */ - RESOURCE = 634, /* RESOURCE */ - SUPERP = 635, /* SUPERP */ - FLOATCONSTANT = 636, /* FLOATCONSTANT */ - INTCONSTANT = 637, /* INTCONSTANT */ - UINTCONSTANT = 638, /* UINTCONSTANT */ - BOOLCONSTANT = 639, /* BOOLCONSTANT */ - IDENTIFIER = 640, /* IDENTIFIER */ - TYPE_NAME = 641, /* TYPE_NAME */ - CENTROID = 642, /* CENTROID */ - IN = 643, /* IN */ - OUT = 644, /* OUT */ - INOUT = 645, /* INOUT */ - STRUCT = 646, /* STRUCT */ - VOID = 647, /* VOID */ - WHILE = 648, /* WHILE */ - BREAK = 649, /* BREAK */ - CONTINUE = 650, /* CONTINUE */ - DO = 651, /* DO */ - ELSE = 652, /* ELSE */ - FOR = 653, /* FOR */ - IF = 654, /* IF */ - DISCARD = 655, /* DISCARD */ - RETURN = 656, /* RETURN */ - SWITCH = 657, /* SWITCH */ - CASE = 658, /* CASE */ - DEFAULT = 659, /* DEFAULT */ - TERMINATE_INVOCATION = 660, /* TERMINATE_INVOCATION */ - TERMINATE_RAY = 661, /* TERMINATE_RAY */ - IGNORE_INTERSECTION = 662, /* IGNORE_INTERSECTION */ - UNIFORM = 663, /* UNIFORM */ - SHARED = 664, /* SHARED */ - BUFFER = 665, /* BUFFER */ - FLAT = 666, /* FLAT */ - SMOOTH = 667, /* SMOOTH */ - LAYOUT = 668, /* LAYOUT */ - DOUBLECONSTANT = 669, /* DOUBLECONSTANT */ - INT16CONSTANT = 670, /* INT16CONSTANT */ - UINT16CONSTANT = 671, /* UINT16CONSTANT */ - FLOAT16CONSTANT = 672, /* FLOAT16CONSTANT */ - INT32CONSTANT = 673, /* INT32CONSTANT */ - UINT32CONSTANT = 674, /* UINT32CONSTANT */ - INT64CONSTANT = 675, /* INT64CONSTANT */ - UINT64CONSTANT = 676, /* UINT64CONSTANT */ - SUBROUTINE = 677, /* SUBROUTINE */ - DEMOTE = 678, /* DEMOTE */ - PAYLOADNV = 679, /* PAYLOADNV */ - PAYLOADINNV = 680, /* PAYLOADINNV */ - HITATTRNV = 681, /* HITATTRNV */ - CALLDATANV = 682, /* CALLDATANV */ - CALLDATAINNV = 683, /* CALLDATAINNV */ - PAYLOADEXT = 684, /* PAYLOADEXT */ - PAYLOADINEXT = 685, /* PAYLOADINEXT */ - HITATTREXT = 686, /* HITATTREXT */ - CALLDATAEXT = 687, /* CALLDATAEXT */ - CALLDATAINEXT = 688, /* CALLDATAINEXT */ - PATCH = 689, /* PATCH */ - SAMPLE = 690, /* SAMPLE */ - NONUNIFORM = 691, /* NONUNIFORM */ - COHERENT = 692, /* COHERENT */ - VOLATILE = 693, /* VOLATILE */ - RESTRICT = 694, /* RESTRICT */ - READONLY = 695, /* READONLY */ - WRITEONLY = 696, /* WRITEONLY */ - DEVICECOHERENT = 697, /* DEVICECOHERENT */ - QUEUEFAMILYCOHERENT = 698, /* QUEUEFAMILYCOHERENT */ - WORKGROUPCOHERENT = 699, /* WORKGROUPCOHERENT */ - SUBGROUPCOHERENT = 700, /* SUBGROUPCOHERENT */ - NONPRIVATE = 701, /* NONPRIVATE */ - SHADERCALLCOHERENT = 702, /* SHADERCALLCOHERENT */ - NOPERSPECTIVE = 703, /* NOPERSPECTIVE */ - EXPLICITINTERPAMD = 704, /* EXPLICITINTERPAMD */ - PERVERTEXEXT = 705, /* PERVERTEXEXT */ - PERVERTEXNV = 706, /* PERVERTEXNV */ - PERPRIMITIVENV = 707, /* PERPRIMITIVENV */ - PERVIEWNV = 708, /* PERVIEWNV */ - PERTASKNV = 709, /* PERTASKNV */ - PERPRIMITIVEEXT = 710, /* PERPRIMITIVEEXT */ - TASKPAYLOADWORKGROUPEXT = 711, /* TASKPAYLOADWORKGROUPEXT */ - PRECISE = 712 /* PRECISE */ + HITOBJECTNV = 421, /* HITOBJECTNV */ + HITOBJECTATTRNV = 422, /* HITOBJECTATTRNV */ + SAMPLERCUBEARRAY = 423, /* SAMPLERCUBEARRAY */ + SAMPLERCUBEARRAYSHADOW = 424, /* SAMPLERCUBEARRAYSHADOW */ + ISAMPLERCUBEARRAY = 425, /* ISAMPLERCUBEARRAY */ + USAMPLERCUBEARRAY = 426, /* USAMPLERCUBEARRAY */ + SAMPLER1D = 427, /* SAMPLER1D */ + SAMPLER1DARRAY = 428, /* SAMPLER1DARRAY */ + SAMPLER1DARRAYSHADOW = 429, /* SAMPLER1DARRAYSHADOW */ + ISAMPLER1D = 430, /* ISAMPLER1D */ + SAMPLER1DSHADOW = 431, /* SAMPLER1DSHADOW */ + SAMPLER2DRECT = 432, /* SAMPLER2DRECT */ + SAMPLER2DRECTSHADOW = 433, /* SAMPLER2DRECTSHADOW */ + ISAMPLER2DRECT = 434, /* ISAMPLER2DRECT */ + USAMPLER2DRECT = 435, /* USAMPLER2DRECT */ + SAMPLERBUFFER = 436, /* SAMPLERBUFFER */ + ISAMPLERBUFFER = 437, /* ISAMPLERBUFFER */ + USAMPLERBUFFER = 438, /* USAMPLERBUFFER */ + SAMPLER2DMS = 439, /* SAMPLER2DMS */ + ISAMPLER2DMS = 440, /* ISAMPLER2DMS */ + USAMPLER2DMS = 441, /* USAMPLER2DMS */ + SAMPLER2DMSARRAY = 442, /* SAMPLER2DMSARRAY */ + ISAMPLER2DMSARRAY = 443, /* ISAMPLER2DMSARRAY */ + USAMPLER2DMSARRAY = 444, /* USAMPLER2DMSARRAY */ + SAMPLEREXTERNALOES = 445, /* SAMPLEREXTERNALOES */ + SAMPLEREXTERNAL2DY2YEXT = 446, /* SAMPLEREXTERNAL2DY2YEXT */ + ISAMPLER1DARRAY = 447, /* ISAMPLER1DARRAY */ + USAMPLER1D = 448, /* USAMPLER1D */ + USAMPLER1DARRAY = 449, /* USAMPLER1DARRAY */ + F16SAMPLER1D = 450, /* F16SAMPLER1D */ + F16SAMPLER2D = 451, /* F16SAMPLER2D */ + F16SAMPLER3D = 452, /* F16SAMPLER3D */ + F16SAMPLER2DRECT = 453, /* F16SAMPLER2DRECT */ + F16SAMPLERCUBE = 454, /* F16SAMPLERCUBE */ + F16SAMPLER1DARRAY = 455, /* F16SAMPLER1DARRAY */ + F16SAMPLER2DARRAY = 456, /* F16SAMPLER2DARRAY */ + F16SAMPLERCUBEARRAY = 457, /* F16SAMPLERCUBEARRAY */ + F16SAMPLERBUFFER = 458, /* F16SAMPLERBUFFER */ + F16SAMPLER2DMS = 459, /* F16SAMPLER2DMS */ + F16SAMPLER2DMSARRAY = 460, /* F16SAMPLER2DMSARRAY */ + F16SAMPLER1DSHADOW = 461, /* F16SAMPLER1DSHADOW */ + F16SAMPLER2DSHADOW = 462, /* F16SAMPLER2DSHADOW */ + F16SAMPLER1DARRAYSHADOW = 463, /* F16SAMPLER1DARRAYSHADOW */ + F16SAMPLER2DARRAYSHADOW = 464, /* F16SAMPLER2DARRAYSHADOW */ + F16SAMPLER2DRECTSHADOW = 465, /* F16SAMPLER2DRECTSHADOW */ + F16SAMPLERCUBESHADOW = 466, /* F16SAMPLERCUBESHADOW */ + F16SAMPLERCUBEARRAYSHADOW = 467, /* F16SAMPLERCUBEARRAYSHADOW */ + IMAGE1D = 468, /* IMAGE1D */ + IIMAGE1D = 469, /* IIMAGE1D */ + UIMAGE1D = 470, /* UIMAGE1D */ + IMAGE2D = 471, /* IMAGE2D */ + IIMAGE2D = 472, /* IIMAGE2D */ + UIMAGE2D = 473, /* UIMAGE2D */ + IMAGE3D = 474, /* IMAGE3D */ + IIMAGE3D = 475, /* IIMAGE3D */ + UIMAGE3D = 476, /* UIMAGE3D */ + IMAGE2DRECT = 477, /* IMAGE2DRECT */ + IIMAGE2DRECT = 478, /* IIMAGE2DRECT */ + UIMAGE2DRECT = 479, /* UIMAGE2DRECT */ + IMAGECUBE = 480, /* IMAGECUBE */ + IIMAGECUBE = 481, /* IIMAGECUBE */ + UIMAGECUBE = 482, /* UIMAGECUBE */ + IMAGEBUFFER = 483, /* IMAGEBUFFER */ + IIMAGEBUFFER = 484, /* IIMAGEBUFFER */ + UIMAGEBUFFER = 485, /* UIMAGEBUFFER */ + IMAGE1DARRAY = 486, /* IMAGE1DARRAY */ + IIMAGE1DARRAY = 487, /* IIMAGE1DARRAY */ + UIMAGE1DARRAY = 488, /* UIMAGE1DARRAY */ + IMAGE2DARRAY = 489, /* IMAGE2DARRAY */ + IIMAGE2DARRAY = 490, /* IIMAGE2DARRAY */ + UIMAGE2DARRAY = 491, /* UIMAGE2DARRAY */ + IMAGECUBEARRAY = 492, /* IMAGECUBEARRAY */ + IIMAGECUBEARRAY = 493, /* IIMAGECUBEARRAY */ + UIMAGECUBEARRAY = 494, /* UIMAGECUBEARRAY */ + IMAGE2DMS = 495, /* IMAGE2DMS */ + IIMAGE2DMS = 496, /* IIMAGE2DMS */ + UIMAGE2DMS = 497, /* UIMAGE2DMS */ + IMAGE2DMSARRAY = 498, /* IMAGE2DMSARRAY */ + IIMAGE2DMSARRAY = 499, /* IIMAGE2DMSARRAY */ + UIMAGE2DMSARRAY = 500, /* UIMAGE2DMSARRAY */ + F16IMAGE1D = 501, /* F16IMAGE1D */ + F16IMAGE2D = 502, /* F16IMAGE2D */ + F16IMAGE3D = 503, /* F16IMAGE3D */ + F16IMAGE2DRECT = 504, /* F16IMAGE2DRECT */ + F16IMAGECUBE = 505, /* F16IMAGECUBE */ + F16IMAGE1DARRAY = 506, /* F16IMAGE1DARRAY */ + F16IMAGE2DARRAY = 507, /* F16IMAGE2DARRAY */ + F16IMAGECUBEARRAY = 508, /* F16IMAGECUBEARRAY */ + F16IMAGEBUFFER = 509, /* F16IMAGEBUFFER */ + F16IMAGE2DMS = 510, /* F16IMAGE2DMS */ + F16IMAGE2DMSARRAY = 511, /* F16IMAGE2DMSARRAY */ + I64IMAGE1D = 512, /* I64IMAGE1D */ + U64IMAGE1D = 513, /* U64IMAGE1D */ + I64IMAGE2D = 514, /* I64IMAGE2D */ + U64IMAGE2D = 515, /* U64IMAGE2D */ + I64IMAGE3D = 516, /* I64IMAGE3D */ + U64IMAGE3D = 517, /* U64IMAGE3D */ + I64IMAGE2DRECT = 518, /* I64IMAGE2DRECT */ + U64IMAGE2DRECT = 519, /* U64IMAGE2DRECT */ + I64IMAGECUBE = 520, /* I64IMAGECUBE */ + U64IMAGECUBE = 521, /* U64IMAGECUBE */ + I64IMAGEBUFFER = 522, /* I64IMAGEBUFFER */ + U64IMAGEBUFFER = 523, /* U64IMAGEBUFFER */ + I64IMAGE1DARRAY = 524, /* I64IMAGE1DARRAY */ + U64IMAGE1DARRAY = 525, /* U64IMAGE1DARRAY */ + I64IMAGE2DARRAY = 526, /* I64IMAGE2DARRAY */ + U64IMAGE2DARRAY = 527, /* U64IMAGE2DARRAY */ + I64IMAGECUBEARRAY = 528, /* I64IMAGECUBEARRAY */ + U64IMAGECUBEARRAY = 529, /* U64IMAGECUBEARRAY */ + I64IMAGE2DMS = 530, /* I64IMAGE2DMS */ + U64IMAGE2DMS = 531, /* U64IMAGE2DMS */ + I64IMAGE2DMSARRAY = 532, /* I64IMAGE2DMSARRAY */ + U64IMAGE2DMSARRAY = 533, /* U64IMAGE2DMSARRAY */ + TEXTURECUBEARRAY = 534, /* TEXTURECUBEARRAY */ + ITEXTURECUBEARRAY = 535, /* ITEXTURECUBEARRAY */ + UTEXTURECUBEARRAY = 536, /* UTEXTURECUBEARRAY */ + TEXTURE1D = 537, /* TEXTURE1D */ + ITEXTURE1D = 538, /* ITEXTURE1D */ + UTEXTURE1D = 539, /* UTEXTURE1D */ + TEXTURE1DARRAY = 540, /* TEXTURE1DARRAY */ + ITEXTURE1DARRAY = 541, /* ITEXTURE1DARRAY */ + UTEXTURE1DARRAY = 542, /* UTEXTURE1DARRAY */ + TEXTURE2DRECT = 543, /* TEXTURE2DRECT */ + ITEXTURE2DRECT = 544, /* ITEXTURE2DRECT */ + UTEXTURE2DRECT = 545, /* UTEXTURE2DRECT */ + TEXTUREBUFFER = 546, /* TEXTUREBUFFER */ + ITEXTUREBUFFER = 547, /* ITEXTUREBUFFER */ + UTEXTUREBUFFER = 548, /* UTEXTUREBUFFER */ + TEXTURE2DMS = 549, /* TEXTURE2DMS */ + ITEXTURE2DMS = 550, /* ITEXTURE2DMS */ + UTEXTURE2DMS = 551, /* UTEXTURE2DMS */ + TEXTURE2DMSARRAY = 552, /* TEXTURE2DMSARRAY */ + ITEXTURE2DMSARRAY = 553, /* ITEXTURE2DMSARRAY */ + UTEXTURE2DMSARRAY = 554, /* UTEXTURE2DMSARRAY */ + F16TEXTURE1D = 555, /* F16TEXTURE1D */ + F16TEXTURE2D = 556, /* F16TEXTURE2D */ + F16TEXTURE3D = 557, /* F16TEXTURE3D */ + F16TEXTURE2DRECT = 558, /* F16TEXTURE2DRECT */ + F16TEXTURECUBE = 559, /* F16TEXTURECUBE */ + F16TEXTURE1DARRAY = 560, /* F16TEXTURE1DARRAY */ + F16TEXTURE2DARRAY = 561, /* F16TEXTURE2DARRAY */ + F16TEXTURECUBEARRAY = 562, /* F16TEXTURECUBEARRAY */ + F16TEXTUREBUFFER = 563, /* F16TEXTUREBUFFER */ + F16TEXTURE2DMS = 564, /* F16TEXTURE2DMS */ + F16TEXTURE2DMSARRAY = 565, /* F16TEXTURE2DMSARRAY */ + SUBPASSINPUT = 566, /* SUBPASSINPUT */ + SUBPASSINPUTMS = 567, /* SUBPASSINPUTMS */ + ISUBPASSINPUT = 568, /* ISUBPASSINPUT */ + ISUBPASSINPUTMS = 569, /* ISUBPASSINPUTMS */ + USUBPASSINPUT = 570, /* USUBPASSINPUT */ + USUBPASSINPUTMS = 571, /* USUBPASSINPUTMS */ + F16SUBPASSINPUT = 572, /* F16SUBPASSINPUT */ + F16SUBPASSINPUTMS = 573, /* F16SUBPASSINPUTMS */ + SPIRV_INSTRUCTION = 574, /* SPIRV_INSTRUCTION */ + SPIRV_EXECUTION_MODE = 575, /* SPIRV_EXECUTION_MODE */ + SPIRV_EXECUTION_MODE_ID = 576, /* SPIRV_EXECUTION_MODE_ID */ + SPIRV_DECORATE = 577, /* SPIRV_DECORATE */ + SPIRV_DECORATE_ID = 578, /* SPIRV_DECORATE_ID */ + SPIRV_DECORATE_STRING = 579, /* SPIRV_DECORATE_STRING */ + SPIRV_TYPE = 580, /* SPIRV_TYPE */ + SPIRV_STORAGE_CLASS = 581, /* SPIRV_STORAGE_CLASS */ + SPIRV_BY_REFERENCE = 582, /* SPIRV_BY_REFERENCE */ + SPIRV_LITERAL = 583, /* SPIRV_LITERAL */ + LEFT_OP = 584, /* LEFT_OP */ + RIGHT_OP = 585, /* RIGHT_OP */ + INC_OP = 586, /* INC_OP */ + DEC_OP = 587, /* DEC_OP */ + LE_OP = 588, /* LE_OP */ + GE_OP = 589, /* GE_OP */ + EQ_OP = 590, /* EQ_OP */ + NE_OP = 591, /* NE_OP */ + AND_OP = 592, /* AND_OP */ + OR_OP = 593, /* OR_OP */ + XOR_OP = 594, /* XOR_OP */ + MUL_ASSIGN = 595, /* MUL_ASSIGN */ + DIV_ASSIGN = 596, /* DIV_ASSIGN */ + ADD_ASSIGN = 597, /* ADD_ASSIGN */ + MOD_ASSIGN = 598, /* MOD_ASSIGN */ + LEFT_ASSIGN = 599, /* LEFT_ASSIGN */ + RIGHT_ASSIGN = 600, /* RIGHT_ASSIGN */ + AND_ASSIGN = 601, /* AND_ASSIGN */ + XOR_ASSIGN = 602, /* XOR_ASSIGN */ + OR_ASSIGN = 603, /* OR_ASSIGN */ + SUB_ASSIGN = 604, /* SUB_ASSIGN */ + STRING_LITERAL = 605, /* STRING_LITERAL */ + LEFT_PAREN = 606, /* LEFT_PAREN */ + RIGHT_PAREN = 607, /* RIGHT_PAREN */ + LEFT_BRACKET = 608, /* LEFT_BRACKET */ + RIGHT_BRACKET = 609, /* RIGHT_BRACKET */ + LEFT_BRACE = 610, /* LEFT_BRACE */ + RIGHT_BRACE = 611, /* RIGHT_BRACE */ + DOT = 612, /* DOT */ + COMMA = 613, /* COMMA */ + COLON = 614, /* COLON */ + EQUAL = 615, /* EQUAL */ + SEMICOLON = 616, /* SEMICOLON */ + BANG = 617, /* BANG */ + DASH = 618, /* DASH */ + TILDE = 619, /* TILDE */ + PLUS = 620, /* PLUS */ + STAR = 621, /* STAR */ + SLASH = 622, /* SLASH */ + PERCENT = 623, /* PERCENT */ + LEFT_ANGLE = 624, /* LEFT_ANGLE */ + RIGHT_ANGLE = 625, /* RIGHT_ANGLE */ + VERTICAL_BAR = 626, /* VERTICAL_BAR */ + CARET = 627, /* CARET */ + AMPERSAND = 628, /* AMPERSAND */ + QUESTION = 629, /* QUESTION */ + INVARIANT = 630, /* INVARIANT */ + HIGH_PRECISION = 631, /* HIGH_PRECISION */ + MEDIUM_PRECISION = 632, /* MEDIUM_PRECISION */ + LOW_PRECISION = 633, /* LOW_PRECISION */ + PRECISION = 634, /* PRECISION */ + PACKED = 635, /* PACKED */ + RESOURCE = 636, /* RESOURCE */ + SUPERP = 637, /* SUPERP */ + FLOATCONSTANT = 638, /* FLOATCONSTANT */ + INTCONSTANT = 639, /* INTCONSTANT */ + UINTCONSTANT = 640, /* UINTCONSTANT */ + BOOLCONSTANT = 641, /* BOOLCONSTANT */ + IDENTIFIER = 642, /* IDENTIFIER */ + TYPE_NAME = 643, /* TYPE_NAME */ + CENTROID = 644, /* CENTROID */ + IN = 645, /* IN */ + OUT = 646, /* OUT */ + INOUT = 647, /* INOUT */ + STRUCT = 648, /* STRUCT */ + VOID = 649, /* VOID */ + WHILE = 650, /* WHILE */ + BREAK = 651, /* BREAK */ + CONTINUE = 652, /* CONTINUE */ + DO = 653, /* DO */ + ELSE = 654, /* ELSE */ + FOR = 655, /* FOR */ + IF = 656, /* IF */ + DISCARD = 657, /* DISCARD */ + RETURN = 658, /* RETURN */ + SWITCH = 659, /* SWITCH */ + CASE = 660, /* CASE */ + DEFAULT = 661, /* DEFAULT */ + TERMINATE_INVOCATION = 662, /* TERMINATE_INVOCATION */ + TERMINATE_RAY = 663, /* TERMINATE_RAY */ + IGNORE_INTERSECTION = 664, /* IGNORE_INTERSECTION */ + UNIFORM = 665, /* UNIFORM */ + SHARED = 666, /* SHARED */ + BUFFER = 667, /* BUFFER */ + FLAT = 668, /* FLAT */ + SMOOTH = 669, /* SMOOTH */ + LAYOUT = 670, /* LAYOUT */ + DOUBLECONSTANT = 671, /* DOUBLECONSTANT */ + INT16CONSTANT = 672, /* INT16CONSTANT */ + UINT16CONSTANT = 673, /* UINT16CONSTANT */ + FLOAT16CONSTANT = 674, /* FLOAT16CONSTANT */ + INT32CONSTANT = 675, /* INT32CONSTANT */ + UINT32CONSTANT = 676, /* UINT32CONSTANT */ + INT64CONSTANT = 677, /* INT64CONSTANT */ + UINT64CONSTANT = 678, /* UINT64CONSTANT */ + SUBROUTINE = 679, /* SUBROUTINE */ + DEMOTE = 680, /* DEMOTE */ + PAYLOADNV = 681, /* PAYLOADNV */ + PAYLOADINNV = 682, /* PAYLOADINNV */ + HITATTRNV = 683, /* HITATTRNV */ + CALLDATANV = 684, /* CALLDATANV */ + CALLDATAINNV = 685, /* CALLDATAINNV */ + PAYLOADEXT = 686, /* PAYLOADEXT */ + PAYLOADINEXT = 687, /* PAYLOADINEXT */ + HITATTREXT = 688, /* HITATTREXT */ + CALLDATAEXT = 689, /* CALLDATAEXT */ + CALLDATAINEXT = 690, /* CALLDATAINEXT */ + PATCH = 691, /* PATCH */ + SAMPLE = 692, /* SAMPLE */ + NONUNIFORM = 693, /* NONUNIFORM */ + COHERENT = 694, /* COHERENT */ + VOLATILE = 695, /* VOLATILE */ + RESTRICT = 696, /* RESTRICT */ + READONLY = 697, /* READONLY */ + WRITEONLY = 698, /* WRITEONLY */ + DEVICECOHERENT = 699, /* DEVICECOHERENT */ + QUEUEFAMILYCOHERENT = 700, /* QUEUEFAMILYCOHERENT */ + WORKGROUPCOHERENT = 701, /* WORKGROUPCOHERENT */ + SUBGROUPCOHERENT = 702, /* SUBGROUPCOHERENT */ + NONPRIVATE = 703, /* NONPRIVATE */ + SHADERCALLCOHERENT = 704, /* SHADERCALLCOHERENT */ + NOPERSPECTIVE = 705, /* NOPERSPECTIVE */ + EXPLICITINTERPAMD = 706, /* EXPLICITINTERPAMD */ + PERVERTEXEXT = 707, /* PERVERTEXEXT */ + PERVERTEXNV = 708, /* PERVERTEXNV */ + PERPRIMITIVENV = 709, /* PERPRIMITIVENV */ + PERVIEWNV = 710, /* PERVIEWNV */ + PERTASKNV = 711, /* PERTASKNV */ + PERPRIMITIVEEXT = 712, /* PERPRIMITIVEEXT */ + TASKPAYLOADWORKGROUPEXT = 713, /* TASKPAYLOADWORKGROUPEXT */ + PRECISE = 714 /* PRECISE */ }; typedef enum yytokentype yytoken_kind_t; #endif @@ -556,7 +558,7 @@ union YYSTYPE glslang::TArraySizes* typeParameters; } interm; -#line 560 "MachineIndependent/glslang_tab.cpp.h" +#line 562 "MachineIndependent/glslang_tab.cpp.h" }; typedef union YYSTYPE YYSTYPE; diff --git a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp index a79a6928b..91d5b954e 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -1105,6 +1105,38 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break; case EOpDebugPrintf: out.debug << "Debug printf"; break; + case EOpHitObjectTraceRayNV: out.debug << "HitObjectTraceRayNV"; break; + case EOpHitObjectTraceRayMotionNV: out.debug << "HitObjectTraceRayMotionNV"; break; + case EOpHitObjectRecordHitNV: out.debug << "HitObjectRecordHitNV"; break; + case EOpHitObjectRecordHitMotionNV: out.debug << "HitObjectRecordHitMotionNV"; break; + case EOpHitObjectRecordHitWithIndexNV: out.debug << "HitObjectRecordHitWithIndexNV"; break; + case EOpHitObjectRecordHitWithIndexMotionNV: out.debug << "HitObjectRecordHitWithIndexMotionNV"; break; + case EOpHitObjectRecordMissNV: out.debug << "HitObjectRecordMissNV"; break; + case EOpHitObjectRecordMissMotionNV: out.debug << "HitObjectRecordMissMotionNV"; break; + case EOpHitObjectRecordEmptyNV: out.debug << "HitObjectRecordEmptyNV"; break; + case EOpHitObjectExecuteShaderNV: out.debug << "HitObjectExecuteShaderNV"; break; + case EOpHitObjectIsEmptyNV: out.debug << "HitObjectIsEmptyNV"; break; + case EOpHitObjectIsMissNV: out.debug << "HitObjectIsMissNV"; break; + case EOpHitObjectIsHitNV: out.debug << "HitObjectIsHitNV"; break; + case EOpHitObjectGetRayTMinNV: out.debug << "HitObjectGetRayTMinNV"; break; + case EOpHitObjectGetRayTMaxNV: out.debug << "HitObjectGetRayTMaxNV"; break; + case EOpHitObjectGetObjectRayOriginNV: out.debug << "HitObjectGetObjectRayOriginNV"; break; + case EOpHitObjectGetObjectRayDirectionNV: out.debug << "HitObjectGetObjectRayDirectionNV"; break; + case EOpHitObjectGetWorldRayOriginNV: out.debug << "HitObjectGetWorldRayOriginNV"; break; + case EOpHitObjectGetWorldRayDirectionNV: out.debug << "HitObjectGetWorldRayDirectionNV"; break; + case EOpHitObjectGetObjectToWorldNV: out.debug << "HitObjectGetObjectToWorldNV"; break; + case EOpHitObjectGetWorldToObjectNV: out.debug << "HitObjectGetWorldToObjectNV"; break; + case EOpHitObjectGetInstanceCustomIndexNV: out.debug<< "HitObjectGetInstanceCustomIndexNV"; break; + case EOpHitObjectGetInstanceIdNV: out.debug << "HitObjectGetInstaneIdNV"; break; + case EOpHitObjectGetGeometryIndexNV: out.debug << "HitObjectGetGeometryIndexNV"; break; + case EOpHitObjectGetPrimitiveIndexNV: out.debug << "HitObjectGetPrimitiveIndexNV"; break; + case EOpHitObjectGetHitKindNV: out.debug << "HitObjectGetHitKindNV"; break; + case EOpHitObjectGetAttributesNV: out.debug << "HitObjectGetAttributesNV"; break; + case EOpHitObjectGetCurrentTimeNV: out.debug << "HitObjectGetCurrentTimeNV"; break; + case EOpHitObjectGetShaderBindingTableRecordIndexNV: out.debug << "HitObjectGetShaderBindingTableRecordIndexNV"; break; + case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break; + case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break; + #ifndef GLSLANG_WEB case EOpSpirvInst: out.debug << "spirv_instruction"; break; #endif @@ -1552,7 +1584,7 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) break; } - if (treeRoot == 0 || ! tree) + if (treeRoot == nullptr || ! tree) return; TOutputTraverser it(infoSink); diff --git a/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp index fab65a76e..3a4cb567b 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -749,6 +749,21 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin symbol->getQualifier().layoutLocation = unitSymbol->getQualifier().layoutLocation; } + // Update implicit array sizes + if (symbol->getWritableType().isImplicitlySizedArray() && unitSymbol->getType().isImplicitlySizedArray()) { + if (unitSymbol->getType().getImplicitArraySize() > symbol->getType().getImplicitArraySize()){ + symbol->getWritableType().updateImplicitArraySize(unitSymbol->getType().getImplicitArraySize()); + } + } + else if (symbol->getWritableType().isImplicitlySizedArray() && unitSymbol->getType().isSizedArray()) { + if (symbol->getWritableType().getImplicitArraySize() > unitSymbol->getType().getOuterArraySize()) + error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders."); + } + else if (unitSymbol->getType().isImplicitlySizedArray() && symbol->getWritableType().isSizedArray()) { + if (unitSymbol->getType().getImplicitArraySize() > symbol->getWritableType().getOuterArraySize()) + error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders."); + } + // Update implicit array sizes mergeImplicitArraySizes(symbol->getWritableType(), unitSymbol->getType()); @@ -759,6 +774,19 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin else if (symbol->getQualifier().isPushConstant() && unitSymbol->getQualifier().isPushConstant() && getStage() == unitStage) error(infoSink, "Only one push_constant block is allowed per stage"); } + + // Check conflicts between preset primitives and sizes of I/O variables among multiple geometry shaders + if (language == EShLangGeometry && unitStage == EShLangGeometry) + { + TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); + if (unitSymbol->isArray() && unitSymbol->getQualifier().storage == EvqVaryingIn && unitSymbol->getQualifier().builtIn == EbvNone) + if ((unitSymbol->getArraySizes()->isImplicitlySized() && + unitSymbol->getArraySizes()->getImplicitSize() != TQualifier::mapGeometryToSize(getInputPrimitive())) || + (! unitSymbol->getArraySizes()->isImplicitlySized() && + unitSymbol->getArraySizes()->getDimSize(0) != TQualifier::mapGeometryToSize(getInputPrimitive()))) + error(infoSink, "Not all array sizes match across all geometry shaders in the program"); + } + if (merge) { linkerObjects.push_back(unitLinkerObjects[unitLinkObj]); @@ -863,7 +891,8 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy else { arraysMatch = symbol.getType().sameArrayness(unitSymbol.getType()) || (symbol.getType().isArray() && unitSymbol.getType().isArray() && - (symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray())); + (symbol.getType().isImplicitlySizedArray() || unitSymbol.getType().isImplicitlySizedArray() || + symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray())); } int lpidx = -1; @@ -1383,7 +1412,7 @@ void TIntermediate::checkCallGraphCycles(TInfoSink& infoSink) TCall* newRoot; do { // See if we have unvisited parts of the graph. - newRoot = 0; + newRoot = nullptr; for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) { if (! call->visited) { newRoot = &(*call); @@ -1517,7 +1546,10 @@ void TIntermediate::checkCallGraphBodies(TInfoSink& infoSink, bool keepUncalled) if (! keepUncalled) { for (int f = 0; f < (int)functionSequence.size(); ++f) { if (! reachable[f]) + { + resetTopLevelUncalledStatus(functionSequence[f]->getAsAggregate()->getName()); functionSequence[f] = nullptr; + } } functionSequence.erase(std::remove(functionSequence.begin(), functionSequence.end(), nullptr), functionSequence.end()); } @@ -1611,6 +1643,8 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ setRT = 0; else if (qualifier.isAnyCallable()) setRT = 1; + else if (qualifier.isHitObjectAttrNV()) + setRT = 2; else return -1; @@ -1650,7 +1684,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ // slot irrespective of type. int collision = -1; // no collision #ifndef GLSLANG_WEB - if (qualifier.isAnyPayload() || qualifier.isAnyCallable()) { + if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) { TRange range(qualifier.layoutLocation, qualifier.layoutLocation); collision = checkLocationRT(setRT, qualifier.layoutLocation); if (collision < 0) @@ -2012,6 +2046,15 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) case EbtInt16: case EbtUint16: size = 2; return 2; case EbtReference: size = 8; return 8; + case EbtSampler: + { + if (type.isBindlessImage() || type.isBindlessTexture()) { + size = 8; return 8; + } + else { + size = 4; return 4; + } + } default: size = 4; return 4; } } diff --git a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h index 1bb4e9770..0c5699760 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +++ b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h @@ -225,6 +225,16 @@ enum ComputeDerivativeMode { LayoutDerivativeGroupLinear, // derivative_group_linearNV }; +// +// Status type on AST level. Some uncalled status or functions would be reset in call graph. +// Currently we will keep status set by explicitly declared layout or variable decl. +// +enum AstRefType { + AstRefTypeVar, // Status set by variable decl + AstRefTypeFunc, // Status set by function decl + AstRefTypeLayout, // Status set by layout decl +}; + class TIdMaps { public: TMap& operator[](long long i) { return maps[i]; } @@ -284,7 +294,7 @@ public: explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), profile(p), version(v), - treeRoot(0), + treeRoot(nullptr), resources(TBuiltInResource{}), numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), invertY(false), @@ -744,6 +754,65 @@ public: useVariablePointers = true; processes.addProcess("use-variable-pointers"); } + // Set the global flag for bindless texture + void setBindlessTextureMode(const TString& currentCaller, AstRefType type) + { + // When type is not func, currentCaller should be "" (empty string) + bindlessTextureModeCaller[currentCaller] = type; + } + + // Get the global flag for bindless texture + bool getBindlessTextureMode() const + { + return (bindlessTextureModeCaller.size() > 0); + } + + // Set the global flag for bindless image + void setBindlessImageMode(const TString& currentCaller, AstRefType type) + { + // When type is not func, currentCaller should be "" (empty string) + bindlessImageModeCaller[currentCaller] = type; + } + + // Get the global flag for bindless image + bool getBindlessImageMode() const + { + return (bindlessImageModeCaller.size() > 0); + } + + // Get the global flag for bindless texture + bool resetTopLevelUncalledStatus(const TString& deadCaller) + { + // For reflection collection purpose, currently uniform layout setting and some + // flags introduced by variables (IO, global, etc,.) won't be reset here. + // Remove each global status (AST top level) introduced by uncalled functions. + // If a status is set by several functions, keep those which in call graph. + bool result = false; + + // For two types of bindless mode flag, we would only reset which is set by an uncalled function. + // If one status flag's key in caller vec is empty, it should be come from a non-function setting. + if (!bindlessTextureModeCaller.empty()) { + auto caller = bindlessTextureModeCaller.find(deadCaller); + if (caller != bindlessTextureModeCaller.end() && bindlessTextureModeCaller[deadCaller] == AstRefTypeFunc) { + bindlessTextureModeCaller.erase(caller); + result = true; + } + } + if (!bindlessImageModeCaller.empty()) { + auto caller = bindlessImageModeCaller.find(deadCaller); + if (caller != bindlessImageModeCaller.end() && bindlessImageModeCaller[deadCaller] == AstRefTypeFunc) { + bindlessImageModeCaller.erase(caller); + result = true; + } + } + return result; + } + + bool getBindlessMode() const + { + return getBindlessTextureMode() || getBindlessImageMode(); + } + bool usingVariablePointers() const { return useVariablePointers; } #ifdef ENABLE_HLSL @@ -1188,7 +1257,8 @@ protected: TSpirvRequirement* spirvRequirement; TSpirvExecutionMode* spirvExecutionMode; - + std::map bindlessTextureModeCaller; + std::map bindlessImageModeCaller; std::unordered_map uniformLocationOverrides; int uniformLocationBase; TNumericFeatures numericFeatures; @@ -1198,8 +1268,9 @@ protected: std::unordered_set usedConstantId; // specialization constant ids used std::vector usedAtomics; // sets of bindings used by atomic counters std::vector usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers - std::vector usedIoRT[2]; // sets of used location, one for rayPayload/rayPayloadIN and other - // for callableData/callableDataIn + std::vector usedIoRT[4]; // sets of used location, one for rayPayload/rayPayloadIN, + // one for callableData/callableDataIn, one for hitObjectAttributeNV and + // one for shaderrecordhitobjectNV // set of names of statically read/written I/O that might need extra checking std::set ioAccessed; diff --git a/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp b/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp index 6c182991f..835097234 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp @@ -198,7 +198,7 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node) bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArray, TOperator constructorType, const TType& t, bool singleConstantParam) { - if (root == 0) + if (root == nullptr) return false; TConstTraverser it(unionArray, singleConstantParam, constructorType, t); diff --git a/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h b/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h index 3c52ff1aa..c9f82d05d 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h +++ b/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h @@ -65,7 +65,7 @@ public: infoSink(infoSink), version(version), language(language), spvVersion(spvVersion), - intermediate(interm), messages(messages), numErrors(0), currentScanner(0) { } + intermediate(interm), messages(messages), numErrors(0), currentScanner(nullptr) { } virtual ~TParseVersions() { } void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc); void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc); @@ -226,6 +226,7 @@ public: protected: TMap extensionBehavior; // for each extension string, what its current behavior is TMap extensionMinSpv; // for each extension string, store minimum spirv required + TVector spvUnsupportedExt; // for extensions reserved for spv usage. EShMessages messages; // errors/warnings/rule-sets int numErrors; // number of compile-time errors encountered TInputScanner* currentScanner; diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp index 1363ce2be..70f511978 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -85,7 +85,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace glslang { TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) : - preamble(0), strings(0), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false), + preamble(nullptr), strings(nullptr), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false), rootFileName(rootFileName), currentSourceFile(rootFileName), disableEscapeSequences(false) diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 7ed58703f..e17eeafda 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -121,7 +121,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken if (atom == '#') { if (peekToken('#')) { parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)"); - parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, 0, "token pasting (##)"); + parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)"); currentPos++; atom = PpAtomPaste; } diff --git a/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp b/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp index 9def592ba..a1aa5ea6b 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp @@ -423,7 +423,7 @@ getSymbolToDefinitionMappingAndPreciseSymbolIDs(const glslang::TIntermediate& in ReturnBranchNodeSet()); TIntermNode* root = intermediate.getTreeRoot(); - if (root == 0) + if (root == nullptr) return result_tuple; NodeMapping& symbol_definition_mapping = std::get<0>(result_tuple); diff --git a/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp index 3061ff79e..144f85bdb 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp @@ -682,7 +682,7 @@ public: } // For a binary operation indexing into an aggregate, chase down the base of the aggregate. - // Return 0 if the topology does not fit this situation. + // Return nullptr if the topology does not fit this situation. TIntermSymbol* findBase(const TIntermBinary* node) { TIntermSymbol *base = node->getLeft()->getAsSymbolNode(); diff --git a/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp b/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp index b98df9348..9a31a9aad 100644 --- a/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp +++ b/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp @@ -76,7 +76,7 @@ OS_TLSIndex OS_AllocTLSIndex() // // Create global pool key. // - if ((pthread_key_create(&pPoolIndex, NULL)) != 0) { + if ((pthread_key_create(&pPoolIndex, nullptr)) != 0) { assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage"); return OS_INVALID_TLS_INDEX; } diff --git a/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp b/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp index 870840c56..fa372a2cc 100644 --- a/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp +++ b/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp @@ -113,7 +113,7 @@ HANDLE GlobalLock; void InitGlobalLock() { - GlobalLock = CreateMutex(0, false, 0); + GlobalLock = CreateMutex(nullptr, false, nullptr); } void GetGlobalLock() @@ -128,7 +128,7 @@ void ReleaseGlobalLock() unsigned int __stdcall EnterGenericThread (void* entry) { - return ((TThreadEntrypoint)entry)(0); + return ((TThreadEntrypoint)entry)(nullptr); } //#define DUMP_COUNTERS diff --git a/3rdparty/glslang/glslang/OSDependent/osinclude.h b/3rdparty/glslang/glslang/OSDependent/osinclude.h index fcfeff2cc..7eaa11340 100644 --- a/3rdparty/glslang/glslang/OSDependent/osinclude.h +++ b/3rdparty/glslang/glslang/OSDependent/osinclude.h @@ -41,7 +41,7 @@ namespace glslang { // Thread Local Storage Operations // typedef void* OS_TLSIndex; -#define OS_INVALID_TLS_INDEX ((void*)0) +#define OS_INVALID_TLS_INDEX nullptr OS_TLSIndex OS_AllocTLSIndex(); bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue); From 41c35878a7f5c6a1f097cca44cabdb7dab0eada4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 18:26:49 -0800 Subject: [PATCH 10/86] Updated spirv-headers. --- .../include/spirv/1.0/spirv.hpp11 | 1002 ++++++ .../include/spirv/1.1/spirv.hpp11 | 1024 +++++++ .../include/spirv/1.2/spirv.hpp11 | 1030 +++++++ .../spirv-headers/include/spirv/spir-v.xml | 5 +- .../unified1/NonSemanticClspvReflection.h | 14 +- ...t.nonsemantic.clspvreflection.grammar.json | 68 +- .../spirv/unified1/spirv.core.grammar.json | 566 +++- .../include/spirv/unified1/spirv.h | 82 + .../include/spirv/unified1/spirv.hpp11 | 2700 +++++++++++++++++ .../include/spirv/unified1/spirv.json | 51 +- 10 files changed, 6527 insertions(+), 15 deletions(-) create mode 100644 3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11 create mode 100644 3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11 create mode 100644 3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11 create mode 100644 3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 diff --git a/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11 b/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11 new file mode 100644 index 000000000..8896e81b7 --- /dev/null +++ b/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11 @@ -0,0 +1,1002 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10000 +#define SPV_REVISION 12 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010000; +static const unsigned int Revision = 12; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + Max = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11 b/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11 new file mode 100644 index 000000000..992d43b5f --- /dev/null +++ b/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11 @@ -0,0 +1,1024 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10100 +#define SPV_REVISION 8 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010100; +static const unsigned int Revision = 8; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + Max = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11 b/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11 new file mode 100644 index 000000000..7a875fdb1 --- /dev/null +++ b/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11 @@ -0,0 +1,1030 @@ +// Copyright (c) 2014-2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10200 +#define SPV_REVISION 2 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010200; +static const unsigned int Revision = 2; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + PostDepthCoverage = 4446, + StencilRefReplacingEXT = 5027, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + SubgroupEqMaskKHR = 4416, + SubgroupGeMaskKHR = 4417, + SubgroupGtMaskKHR = 4418, + SubgroupLeMaskKHR = 4419, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + DeviceIndex = 4438, + ViewIndex = 4440, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpSubgroupReadInvocationKHR = 4432, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, + Max = 0x7fffffff, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/3rdparty/spirv-headers/include/spirv/spir-v.xml b/3rdparty/spirv-headers/include/spirv/spir-v.xml index dad141be1..642fdf3b6 100644 --- a/3rdparty/spirv-headers/include/spirv/spir-v.xml +++ b/3rdparty/spirv-headers/include/spirv/spir-v.xml @@ -62,7 +62,7 @@ - + @@ -86,7 +86,8 @@ - + + diff --git a/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h b/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h index 0cdf29d12..1a3154929 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h +++ b/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h @@ -33,7 +33,7 @@ extern "C" { #endif enum { - NonSemanticClspvReflectionRevision = 4, + NonSemanticClspvReflectionRevision = 5, NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff }; @@ -73,10 +73,22 @@ enum NonSemanticClspvReflectionInstructions { NonSemanticClspvReflectionImageArgumentInfoChannelDataTypeUniform = 33, NonSemanticClspvReflectionArgumentStorageTexelBuffer = 34, NonSemanticClspvReflectionArgumentUniformTexelBuffer = 35, + NonSemanticClspvReflectionConstantDataPointerPushConstant = 36, + NonSemanticClspvReflectionProgramScopeVariablePointerPushConstant = 37, + NonSemanticClspvReflectionPrintfInfo = 38, + NonSemanticClspvReflectionPrintfBufferStorageBuffer = 39, + NonSemanticClspvReflectionPrintfBufferPointerPushConstant = 40, NonSemanticClspvReflectionInstructionsMax = 0x7fffffff }; +enum NonSemanticClspvReflectionKernelPropertyFlags { + NonSemanticClspvReflectionNone = 0x0, + NonSemanticClspvReflectionMayUsePrintf = 0x1, + NonSemanticClspvReflectionKernelPropertyFlagsMax = 0x7fffffff +}; + + #ifdef __cplusplus } #endif diff --git a/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json b/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json index b5a663721..d6499cce1 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json @@ -1,12 +1,15 @@ { - "revision" : 4, + "revision" : 5, "instructions" : [ { "opname" : "Kernel", "opcode" : 1, "operands" : [ { "kind" : "IdRef", "name" : "Kernel" }, - { "kind" : "IdRef", "name" : "Name" } + { "kind" : "IdRef", "name" : "Name" }, + { "kind" : "IdRef", "name" : "NumArguments", "quantifier" : "?" }, + { "kind" : "IdRef", "name" : "Flags", "quantifier" : "?" }, + { "kind" : "IdRef", "name" : "Attributes", "quantifier" : "?" } ] }, { @@ -347,6 +350,67 @@ { "kind" : "IdRef", "name" : "Binding" }, { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } ] + }, + { + "opname" : "ConstantDataPointerPushConstant", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "Offset"}, + { "kind" : "IdRef", "name" : "Size"}, + { "kind" : "IdRef", "name" : "Data" } + ] + }, + { + "opname" : "ProgramScopeVariablePointerPushConstant", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "Offset"}, + { "kind" : "IdRef", "name" : "Size"}, + { "kind" : "IdRef", "name" : "Data" } + ] + }, + { + "opname" : "PrintfInfo", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "PrintfID" }, + { "kind" : "IdRef", "name" : "FormatString" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "ArgumentSizes"} + ] + }, + { + "opname" : "PrintfBufferStorageBuffer", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "DescriptorSet" }, + { "kind" : "IdRef", "name" : "Binding" }, + { "kind" : "IdRef", "name" : "BufferSize"} + ] + }, + { + "opname" : "PrintfBufferPointerPushConstant", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "Offset" }, + { "kind" : "IdRef", "name" : "Size"}, + { "kind" : "IdRef", "name" : "BufferSize"} + ] + } + ], + "operand_kinds" : [ + { + "category" : "BitEnum", + "kind" : "KernelPropertyFlags", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0" + }, + { + "enumerant" : "MayUsePrintf", + "value" : "0x1" + } + ] } ] } diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json index c6517c4c4..b23d8a86c 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json @@ -4754,6 +4754,461 @@ "extensions" : [ "SPV_KHR_shader_clock" ], "version" : "None" }, + { + "opname" : "OpHitObjectRecordHitMotionNV", + "class" : "Reserved", + "opcode" : 5249, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Acceleration Structure'" }, + { "kind" : "IdRef", "name" : "'InstanceId'" }, + { "kind" : "IdRef", "name" : "'PrimitiveId'" }, + { "kind" : "IdRef", "name" : "'GeometryIndex'" }, + { "kind" : "IdRef", "name" : "'Hit Kind'" }, + { "kind" : "IdRef", "name" : "'SBT Record Offset'" }, + { "kind" : "IdRef", "name" : "'SBT Record Stride'" }, + { "kind" : "IdRef", "name" : "'Origin'" }, + { "kind" : "IdRef", "name" : "'TMin'" }, + { "kind" : "IdRef", "name" : "'Direction'" }, + { "kind" : "IdRef", "name" : "'TMax'" }, + { "kind" : "IdRef", "name" : "'Current Time'" }, + { "kind" : "IdRef", "name" : "'HitObject Attributes'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectRecordHitWithIndexMotionNV", + "class" : "Reserved", + "opcode" : 5250, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Acceleration Structure'" }, + { "kind" : "IdRef", "name" : "'InstanceId'" }, + { "kind" : "IdRef", "name" : "'PrimitiveId'" }, + { "kind" : "IdRef", "name" : "'GeometryIndex'" }, + { "kind" : "IdRef", "name" : "'Hit Kind'" }, + { "kind" : "IdRef", "name" : "'SBT Record Index'" }, + { "kind" : "IdRef", "name" : "'Origin'" }, + { "kind" : "IdRef", "name" : "'TMin'" }, + { "kind" : "IdRef", "name" : "'Direction'" }, + { "kind" : "IdRef", "name" : "'TMax'" }, + { "kind" : "IdRef", "name" : "'Current Time'" }, + { "kind" : "IdRef", "name" : "'HitObject Attributes'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectRecordMissMotionNV", + "class" : "Reserved", + "opcode" : 5251, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'SBT Index'" }, + { "kind" : "IdRef", "name" : "'Origin'" }, + { "kind" : "IdRef", "name" : "'TMin'" }, + { "kind" : "IdRef", "name" : "'Direction'" }, + { "kind" : "IdRef", "name" : "'TMax'" }, + { "kind" : "IdRef", "name" : "'Current Time'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetWorldToObjectNV", + "class" : "Reserved", + "opcode" : 5252, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetObjectToWorldNV", + "class" : "Reserved", + "opcode" : 5253, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetObjectRayDirectionNV", + "class" : "Reserved", + "opcode" : 5254, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetObjectRayOriginNV", + "class" : "Reserved", + "opcode" : 5255, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectTraceRayMotionNV", + "class" : "Reserved", + "opcode" : 5256, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Acceleration Structure'"}, + { "kind" : "IdRef", "name" : "'RayFlags'"}, + { "kind" : "IdRef", "name" : "'Cullmask'"}, + { "kind" : "IdRef", "name" : "'SBT Record Offset'"}, + { "kind" : "IdRef", "name" : "'SBT Record Stride'"}, + { "kind" : "IdRef", "name" : "'Miss Index'"}, + { "kind" : "IdRef", "name" : "'Origin'"}, + { "kind" : "IdRef", "name" : "'TMin'"}, + { "kind" : "IdRef", "name" : "'Direction'"}, + { "kind" : "IdRef", "name" : "'TMax'"}, + { "kind" : "IdRef", "name" : "'Time'"}, + { "kind" : "IdRef", "name" : "'Payload'"} + ], + "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetShaderRecordBufferHandleNV", + "class" : "Reserved", + "opcode" : 5257, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetShaderBindingTableRecordIndexNV", + "class" : "Reserved", + "opcode" : 5258, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectRecordEmptyNV", + "class" : "Reserved", + "opcode" : 5259, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectTraceRayNV", + "class" : "Reserved", + "opcode" : 5260, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Acceleration Structure'"}, + { "kind" : "IdRef", "name" : "'RayFlags'"}, + { "kind" : "IdRef", "name" : "'Cullmask'"}, + { "kind" : "IdRef", "name" : "'SBT Record Offset'"}, + { "kind" : "IdRef", "name" : "'SBT Record Stride'"}, + { "kind" : "IdRef", "name" : "'Miss Index'"}, + { "kind" : "IdRef", "name" : "'Origin'"}, + { "kind" : "IdRef", "name" : "'TMin'"}, + { "kind" : "IdRef", "name" : "'Direction'"}, + { "kind" : "IdRef", "name" : "'TMax'"}, + { "kind" : "IdRef", "name" : "'Payload'"} + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectRecordHitNV", + "class" : "Reserved", + "opcode" : 5261, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Acceleration Structure'" }, + { "kind" : "IdRef", "name" : "'InstanceId'" }, + { "kind" : "IdRef", "name" : "'PrimitiveId'" }, + { "kind" : "IdRef", "name" : "'GeometryIndex'" }, + { "kind" : "IdRef", "name" : "'Hit Kind'" }, + { "kind" : "IdRef", "name" : "'SBT Record Offset'" }, + { "kind" : "IdRef", "name" : "'SBT Record Stride'" }, + { "kind" : "IdRef", "name" : "'Origin'" }, + { "kind" : "IdRef", "name" : "'TMin'" }, + { "kind" : "IdRef", "name" : "'Direction'" }, + { "kind" : "IdRef", "name" : "'TMax'" }, + { "kind" : "IdRef", "name" : "'HitObject Attributes'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectRecordHitWithIndexNV", + "class" : "Reserved", + "opcode" : 5262, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Acceleration Structure'" }, + { "kind" : "IdRef", "name" : "'InstanceId'" }, + { "kind" : "IdRef", "name" : "'PrimitiveId'" }, + { "kind" : "IdRef", "name" : "'GeometryIndex'" }, + { "kind" : "IdRef", "name" : "'Hit Kind'" }, + { "kind" : "IdRef", "name" : "'SBT Record Index'" }, + { "kind" : "IdRef", "name" : "'Origin'" }, + { "kind" : "IdRef", "name" : "'TMin'" }, + { "kind" : "IdRef", "name" : "'Direction'" }, + { "kind" : "IdRef", "name" : "'TMax'" }, + { "kind" : "IdRef", "name" : "'HitObject Attributes'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectRecordMissNV", + "class" : "Reserved", + "opcode" : 5263, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'SBT Index'" }, + { "kind" : "IdRef", "name" : "'Origin'" }, + { "kind" : "IdRef", "name" : "'TMin'" }, + { "kind" : "IdRef", "name" : "'Direction'" }, + { "kind" : "IdRef", "name" : "'TMax'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectExecuteShaderNV", + "class" : "Reserved", + "opcode" : 5264, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Payload'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetCurrentTimeNV", + "class" : "Reserved", + "opcode" : 5265, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetAttributesNV", + "class" : "Reserved", + "opcode" : 5266, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "name" : "'Hit Object Attribute'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetHitKindNV", + "class" : "Reserved", + "opcode" : 5267, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetPrimitiveIndexNV", + "class" : "Reserved", + "opcode" : 5268, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetGeometryIndexNV", + "class" : "Reserved", + "opcode" : 5269, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetInstanceIdNV", + "class" : "Reserved", + "opcode" : 5270, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetInstanceCustomIndexNV", + "class" : "Reserved", + "opcode" : 5271, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetWorldRayDirectionNV", + "class" : "Reserved", + "opcode" : 5272, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetWorldRayOriginNV", + "class" : "Reserved", + "opcode" : 5273, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetRayTMaxNV", + "class" : "Reserved", + "opcode" : 5274, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectGetRayTMinNV", + "class" : "Reserved", + "opcode" : 5275, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectIsEmptyNV", + "class" : "Reserved", + "opcode" : 5276, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectIsHitNV", + "class" : "Reserved", + "opcode" : 5277, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpHitObjectIsMissNV", + "class" : "Reserved", + "opcode" : 5278, + "operands" : [ + { "kind" : "IdResultType"}, + { "kind" : "IdResult"}, + { "kind" : "IdRef", "name" : "'Hit Object'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpReorderThreadWithHitObjectNV", + "class" : "Reserved", + "opcode" : 5279, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hit Object'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Hint'" }, + { "kind" : "IdRef", "quantifier" : "?", "name" : "'Bits'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpReorderThreadWithHintNV", + "class" : "Reserved", + "opcode" : 5280, + "operands" : [ + { "kind" : "IdRef", "name" : "'Hint'" }, + { "kind" : "IdRef", "name" : "'Bits'" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, + { + "opname" : "OpTypeHitObjectNV", + "class" : "Reserved", + "opcode" : 5281, + "operands" : [ + { "kind" : "IdResult" } + ], + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, { "opname" : "OpImageSampleFootprintNV", "class" : "Image", @@ -9020,7 +9475,6 @@ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" }, { @@ -9030,7 +9484,6 @@ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" }, { @@ -9040,7 +9493,6 @@ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" }, { @@ -9050,7 +9502,6 @@ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" }, { @@ -9060,7 +9511,6 @@ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" }, { @@ -9070,7 +9520,6 @@ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" }, { @@ -9080,17 +9529,30 @@ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" }, { "enumerant" : "NoFusionINTEL", "value" : "0x800000", + "capabilities" : [ "FPGALoopControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "LoopCountINTEL", + "value" : "0x1000000", + "parameters" : [ + { "kind" : "LiteralInteger" } + ], + "capabilities" : [ "FPGALoopControlsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "MaxReinvocationDelayINTEL", + "value" : "0x2000000", "parameters" : [ { "kind" : "LiteralInteger" } ], "capabilities" : [ "FPGALoopControlsINTEL" ], - "extensions" : [ "SPV_INTEL_fpga_loop_controls" ], "version" : "None" } ] @@ -10245,6 +10707,15 @@ "capabilities" : [ "FPGAKernelAttributesINTEL" ], "version" : "None" }, + { + "enumerant" : "StreamingInterfaceINTEL", + "value" : 6154, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'StallFreeReturn'" } + ], + "capabilities" : [ "FPGAKernelAttributesINTEL" ], + "version" : "None" + }, { "enumerant" : "NamedBarrierCountINTEL", "value" : 6417, @@ -10422,6 +10893,12 @@ "capabilities" : [ "PhysicalStorageBufferAddresses" ], "version" : "1.5" }, + { + "enumerant" : "HitObjectAttributeNV", + "value" : 5385, + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, { "enumerant" : "TaskPayloadWorkgroupEXT", "value" : 5402, @@ -11184,6 +11661,11 @@ "enumerant" : "NoReadWrite", "value" : 7, "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "RuntimeAlignedINTEL", + "value" : 5940, + "capabilities" : [ "RuntimeAlignedAttributeINTEL" ] } ] }, @@ -11624,6 +12106,12 @@ "extensions" : [ "SPV_EXT_physical_storage_buffer" ], "version" : "1.5" }, + { + "enumerant" : "HitObjectShaderRecordBufferNV", + "value" : 5386, + "capabilities" : [ "ShaderInvocationReorderNV" ], + "version" : "None" + }, { "enumerant" : "BindlessSamplerNV", "value" : 5398, @@ -11929,6 +12417,16 @@ "capabilities" : [ "LoopFuseINTEL" ], "version" : "None" }, + { + "enumerant" : "MathOpDSPModeINTEL", + "value" : 5909, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Mode'" }, + { "kind" : "LiteralInteger", "name" : "'Propagate'" } + ], + "capabilities" : [ "FPGADSPControlINTEL" ], + "version" : "None" + }, { "enumerant" : "AliasScopeINTEL", "value" : 5914, @@ -11947,6 +12445,33 @@ "capabilities" : [ "MemoryAccessAliasingINTEL" ], "version" : "None" }, + { + "enumerant" : "InitiationIntervalINTEL", + "value" : 5917, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Cycles'" } + ], + "capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ], + "version" : "None" + }, + { + "enumerant" : "MaxConcurrencyINTEL", + "value" : 5918, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Invocations'" } + ], + "capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ], + "version" : "None" + }, + { + "enumerant" : "PipelineEnableINTEL", + "value" : 5919, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Enable'" } + ], + "capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ], + "version" : "None" + }, { "enumerant" : "BufferLocationINTEL", "value" : 5921, @@ -13923,6 +14448,13 @@ "extensions" : [ "SPV_EXT_opacity_micromap" ], "version" : "None" }, + { + "enumerant" : "ShaderInvocationReorderNV", + "value" : 5383, + "capabilities" : [ "RayTracingKHR" ], + "extensions" : [ "SPV_NV_shader_invocation_reorder" ], + "version" : "None" + }, { "enumerant" : "BindlessTextureNV", "value" : 5390, @@ -14124,12 +14656,24 @@ "extensions" : [ "SPV_INTEL_loop_fuse" ], "version" : "None" }, + { + "enumerant" : "FPGADSPControlINTEL", + "value" : 5908, + "extensions" : [ "SPV_INTEL_fpga_dsp_control" ], + "version" : "None" + }, { "enumerant" : "MemoryAccessAliasingINTEL", "value" : 5910, "extensions" : [ "SPV_INTEL_memory_access_aliasing" ], "version" : "None" }, + { + "enumerant" : "FPGAInvocationPipeliningAttributesINTEL", + "value" : 5916, + "extensions" : [ "SPV_INTEL_fpga_invocation_pipelining_attributes" ], + "version" : "None" + }, { "enumerant" : "FPGABufferLocationINTEL", "value" : 5920, @@ -14148,6 +14692,12 @@ "extensions" : [ "SPV_INTEL_usm_storage_classes" ], "version" : "None" }, + { + "enumerant" : "RuntimeAlignedAttributeINTEL", + "value" : 5939, + "extensions" : [ "SPV_INTEL_runtime_aligned" ], + "version" : "None" + }, { "enumerant" : "IOPipesINTEL", "value" : 5943, diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h index af4f06b77..366b55608 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h @@ -199,6 +199,7 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeNoGlobalOffsetINTEL = 5895, SpvExecutionModeNumSIMDWorkitemsINTEL = 5896, SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, + SpvExecutionModeStreamingInterfaceINTEL = 6154, SpvExecutionModeNamedBarrierCountINTEL = 6417, SpvExecutionModeMax = 0x7fffffff, } SpvExecutionMode; @@ -231,6 +232,7 @@ typedef enum SpvStorageClass_ { SpvStorageClassShaderRecordBufferNV = 5343, SpvStorageClassPhysicalStorageBuffer = 5349, SpvStorageClassPhysicalStorageBufferEXT = 5349, + SpvStorageClassHitObjectAttributeNV = 5385, SpvStorageClassTaskPayloadWorkgroupEXT = 5402, SpvStorageClassCodeSectionINTEL = 5605, SpvStorageClassDeviceOnlyINTEL = 5936, @@ -456,6 +458,7 @@ typedef enum SpvFunctionParameterAttribute_ { SpvFunctionParameterAttributeNoCapture = 5, SpvFunctionParameterAttributeNoWrite = 6, SpvFunctionParameterAttributeNoReadWrite = 7, + SpvFunctionParameterAttributeRuntimeAlignedINTEL = 5940, SpvFunctionParameterAttributeMax = 0x7fffffff, } SpvFunctionParameterAttribute; @@ -526,6 +529,7 @@ typedef enum SpvDecoration_ { SpvDecorationRestrictPointerEXT = 5355, SpvDecorationAliasedPointer = 5356, SpvDecorationAliasedPointerEXT = 5356, + SpvDecorationHitObjectShaderRecordBufferNV = 5386, SpvDecorationBindlessSamplerNV = 5398, SpvDecorationBindlessImageNV = 5399, SpvDecorationBoundSamplerNV = 5400, @@ -564,8 +568,12 @@ typedef enum SpvDecoration_ { SpvDecorationPrefetchINTEL = 5902, SpvDecorationStallEnableINTEL = 5905, SpvDecorationFuseLoopsInFunctionINTEL = 5907, + SpvDecorationMathOpDSPModeINTEL = 5909, SpvDecorationAliasScopeINTEL = 5914, SpvDecorationNoAliasINTEL = 5915, + SpvDecorationInitiationIntervalINTEL = 5917, + SpvDecorationMaxConcurrencyINTEL = 5918, + SpvDecorationPipelineEnableINTEL = 5919, SpvDecorationBufferLocationINTEL = 5921, SpvDecorationIOPipeStorageINTEL = 5944, SpvDecorationFunctionFloatingPointModeINTEL = 6080, @@ -740,6 +748,8 @@ typedef enum SpvLoopControlShift_ { SpvLoopControlMaxInterleavingINTELShift = 21, SpvLoopControlSpeculatedIterationsINTELShift = 22, SpvLoopControlNoFusionINTELShift = 23, + SpvLoopControlLoopCountINTELShift = 24, + SpvLoopControlMaxReinvocationDelayINTELShift = 25, SpvLoopControlMax = 0x7fffffff, } SpvLoopControlShift; @@ -762,6 +772,8 @@ typedef enum SpvLoopControlMask_ { SpvLoopControlMaxInterleavingINTELMask = 0x00200000, SpvLoopControlSpeculatedIterationsINTELMask = 0x00400000, SpvLoopControlNoFusionINTELMask = 0x00800000, + SpvLoopControlLoopCountINTELMask = 0x01000000, + SpvLoopControlMaxReinvocationDelayINTELMask = 0x02000000, } SpvLoopControlMask; typedef enum SpvFunctionControlShift_ { @@ -1063,6 +1075,7 @@ typedef enum SpvCapability_ { SpvCapabilityDemoteToHelperInvocation = 5379, SpvCapabilityDemoteToHelperInvocationEXT = 5379, SpvCapabilityRayTracingOpacityMicromapEXT = 5381, + SpvCapabilityShaderInvocationReorderNV = 5383, SpvCapabilityBindlessTextureNV = 5390, SpvCapabilitySubgroupShuffleINTEL = 5568, SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, @@ -1096,10 +1109,13 @@ typedef enum SpvCapability_ { SpvCapabilityFPGAMemoryAccessesINTEL = 5898, SpvCapabilityFPGAClusterAttributesINTEL = 5904, SpvCapabilityLoopFuseINTEL = 5906, + SpvCapabilityFPGADSPControlINTEL = 5908, SpvCapabilityMemoryAccessAliasingINTEL = 5910, + SpvCapabilityFPGAInvocationPipeliningAttributesINTEL = 5916, SpvCapabilityFPGABufferLocationINTEL = 5920, SpvCapabilityArbitraryPrecisionFixedPointINTEL = 5922, SpvCapabilityUSMStorageClassesINTEL = 5935, + SpvCapabilityRuntimeAlignedAttributeINTEL = 5939, SpvCapabilityIOPipesINTEL = 5943, SpvCapabilityBlockingPipesINTEL = 5945, SpvCapabilityFPGARegINTEL = 5948, @@ -1616,6 +1632,39 @@ typedef enum SpvOp_ { SpvOpFragmentMaskFetchAMD = 5011, SpvOpFragmentFetchAMD = 5012, SpvOpReadClockKHR = 5056, + SpvOpHitObjectRecordHitMotionNV = 5249, + SpvOpHitObjectRecordHitWithIndexMotionNV = 5250, + SpvOpHitObjectRecordMissMotionNV = 5251, + SpvOpHitObjectGetWorldToObjectNV = 5252, + SpvOpHitObjectGetObjectToWorldNV = 5253, + SpvOpHitObjectGetObjectRayDirectionNV = 5254, + SpvOpHitObjectGetObjectRayOriginNV = 5255, + SpvOpHitObjectTraceRayMotionNV = 5256, + SpvOpHitObjectGetShaderRecordBufferHandleNV = 5257, + SpvOpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + SpvOpHitObjectRecordEmptyNV = 5259, + SpvOpHitObjectTraceRayNV = 5260, + SpvOpHitObjectRecordHitNV = 5261, + SpvOpHitObjectRecordHitWithIndexNV = 5262, + SpvOpHitObjectRecordMissNV = 5263, + SpvOpHitObjectExecuteShaderNV = 5264, + SpvOpHitObjectGetCurrentTimeNV = 5265, + SpvOpHitObjectGetAttributesNV = 5266, + SpvOpHitObjectGetHitKindNV = 5267, + SpvOpHitObjectGetPrimitiveIndexNV = 5268, + SpvOpHitObjectGetGeometryIndexNV = 5269, + SpvOpHitObjectGetInstanceIdNV = 5270, + SpvOpHitObjectGetInstanceCustomIndexNV = 5271, + SpvOpHitObjectGetWorldRayDirectionNV = 5272, + SpvOpHitObjectGetWorldRayOriginNV = 5273, + SpvOpHitObjectGetRayTMaxNV = 5274, + SpvOpHitObjectGetRayTMinNV = 5275, + SpvOpHitObjectIsEmptyNV = 5276, + SpvOpHitObjectIsHitNV = 5277, + SpvOpHitObjectIsMissNV = 5278, + SpvOpReorderThreadWithHitObjectNV = 5279, + SpvOpReorderThreadWithHintNV = 5280, + SpvOpTypeHitObjectNV = 5281, SpvOpImageSampleFootprintNV = 5283, SpvOpEmitMeshTasksEXT = 5294, SpvOpSetMeshOutputsEXT = 5295, @@ -2291,6 +2340,39 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; case SpvOpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case SpvOpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case SpvOpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case SpvOpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case SpvOpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; case SpvOpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; case SpvOpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; case SpvOpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 new file mode 100644 index 000000000..341d333da --- /dev/null +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 @@ -0,0 +1,2700 @@ +// Copyright (c) 2014-2020 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python, C#, D, Beef +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// - C# will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL +// - Beef will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10600 +#define SPV_REVISION 1 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010600; +static const unsigned int Revision = 1; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + CPP_for_OpenCL = 6, + SYCL = 7, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + TaskNV = 5267, + MeshNV = 5268, + RayGenerationKHR = 5313, + RayGenerationNV = 5313, + IntersectionKHR = 5314, + IntersectionNV = 5314, + AnyHitKHR = 5315, + AnyHitNV = 5315, + ClosestHitKHR = 5316, + ClosestHitNV = 5316, + MissKHR = 5317, + MissNV = 5317, + CallableKHR = 5318, + CallableNV = 5318, + TaskEXT = 5364, + MeshEXT = 5365, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + PhysicalStorageBuffer64 = 5348, + PhysicalStorageBuffer64EXT = 5348, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Vulkan = 3, + VulkanKHR = 3, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + SubgroupUniformControlFlowKHR = 4421, + PostDepthCoverage = 4446, + DenormPreserve = 4459, + DenormFlushToZero = 4460, + SignedZeroInfNanPreserve = 4461, + RoundingModeRTE = 4462, + RoundingModeRTZ = 4463, + EarlyAndLateFragmentTestsAMD = 5017, + StencilRefReplacingEXT = 5027, + StencilRefUnchangedFrontAMD = 5079, + StencilRefGreaterFrontAMD = 5080, + StencilRefLessFrontAMD = 5081, + StencilRefUnchangedBackAMD = 5082, + StencilRefGreaterBackAMD = 5083, + StencilRefLessBackAMD = 5084, + OutputLinesEXT = 5269, + OutputLinesNV = 5269, + OutputPrimitivesEXT = 5270, + OutputPrimitivesNV = 5270, + DerivativeGroupQuadsNV = 5289, + DerivativeGroupLinearNV = 5290, + OutputTrianglesEXT = 5298, + OutputTrianglesNV = 5298, + PixelInterlockOrderedEXT = 5366, + PixelInterlockUnorderedEXT = 5367, + SampleInterlockOrderedEXT = 5368, + SampleInterlockUnorderedEXT = 5369, + ShadingRateInterlockOrderedEXT = 5370, + ShadingRateInterlockUnorderedEXT = 5371, + SharedLocalMemorySizeINTEL = 5618, + RoundingModeRTPINTEL = 5620, + RoundingModeRTNINTEL = 5621, + FloatingPointModeALTINTEL = 5622, + FloatingPointModeIEEEINTEL = 5623, + MaxWorkgroupSizeINTEL = 5893, + MaxWorkDimINTEL = 5894, + NoGlobalOffsetINTEL = 5895, + NumSIMDWorkitemsINTEL = 5896, + SchedulerTargetFmaxMhzINTEL = 5903, + StreamingInterfaceINTEL = 6154, + NamedBarrierCountINTEL = 6417, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + CallableDataKHR = 5328, + CallableDataNV = 5328, + IncomingCallableDataKHR = 5329, + IncomingCallableDataNV = 5329, + RayPayloadKHR = 5338, + RayPayloadNV = 5338, + HitAttributeKHR = 5339, + HitAttributeNV = 5339, + IncomingRayPayloadKHR = 5342, + IncomingRayPayloadNV = 5342, + ShaderRecordBufferKHR = 5343, + ShaderRecordBufferNV = 5343, + PhysicalStorageBuffer = 5349, + PhysicalStorageBufferEXT = 5349, + HitObjectAttributeNV = 5385, + TaskPayloadWorkgroupEXT = 5402, + CodeSectionINTEL = 5605, + DeviceOnlyINTEL = 5936, + HostOnlyINTEL = 5937, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + R64ui = 40, + R64i = 41, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + MakeTexelAvailable = 8, + MakeTexelAvailableKHR = 8, + MakeTexelVisible = 9, + MakeTexelVisibleKHR = 9, + NonPrivateTexel = 10, + NonPrivateTexelKHR = 10, + VolatileTexel = 11, + VolatileTexelKHR = 11, + SignExtend = 12, + ZeroExtend = 13, + Nontemporal = 14, + Offsets = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + MakeTexelAvailable = 0x00000100, + MakeTexelAvailableKHR = 0x00000100, + MakeTexelVisible = 0x00000200, + MakeTexelVisibleKHR = 0x00000200, + NonPrivateTexel = 0x00000400, + NonPrivateTexelKHR = 0x00000400, + VolatileTexel = 0x00000800, + VolatileTexelKHR = 0x00000800, + SignExtend = 0x00001000, + ZeroExtend = 0x00002000, + Nontemporal = 0x00004000, + Offsets = 0x00010000, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + AllowContractFastINTEL = 16, + AllowReassocINTEL = 17, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + AllowContractFastINTEL = 0x00010000, + AllowReassocINTEL = 0x00020000, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + LinkOnceODR = 2, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + RuntimeAlignedINTEL = 5940, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + UniformId = 27, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + NoSignedWrap = 4469, + NoUnsignedWrap = 4470, + ExplicitInterpAMD = 4999, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + PerPrimitiveEXT = 5271, + PerPrimitiveNV = 5271, + PerViewNV = 5272, + PerTaskNV = 5273, + PerVertexKHR = 5285, + PerVertexNV = 5285, + NonUniform = 5300, + NonUniformEXT = 5300, + RestrictPointer = 5355, + RestrictPointerEXT = 5355, + AliasedPointer = 5356, + AliasedPointerEXT = 5356, + HitObjectShaderRecordBufferNV = 5386, + BindlessSamplerNV = 5398, + BindlessImageNV = 5399, + BoundSamplerNV = 5400, + BoundImageNV = 5401, + SIMTCallINTEL = 5599, + ReferencedIndirectlyINTEL = 5602, + ClobberINTEL = 5607, + SideEffectsINTEL = 5608, + VectorComputeVariableINTEL = 5624, + FuncParamIOKindINTEL = 5625, + VectorComputeFunctionINTEL = 5626, + StackCallINTEL = 5627, + GlobalVariableOffsetINTEL = 5628, + CounterBuffer = 5634, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + UserSemantic = 5635, + UserTypeGOOGLE = 5636, + FunctionRoundingModeINTEL = 5822, + FunctionDenormModeINTEL = 5823, + RegisterINTEL = 5825, + MemoryINTEL = 5826, + NumbanksINTEL = 5827, + BankwidthINTEL = 5828, + MaxPrivateCopiesINTEL = 5829, + SinglepumpINTEL = 5830, + DoublepumpINTEL = 5831, + MaxReplicatesINTEL = 5832, + SimpleDualPortINTEL = 5833, + MergeINTEL = 5834, + BankBitsINTEL = 5835, + ForcePow2DepthINTEL = 5836, + BurstCoalesceINTEL = 5899, + CacheSizeINTEL = 5900, + DontStaticallyCoalesceINTEL = 5901, + PrefetchINTEL = 5902, + StallEnableINTEL = 5905, + FuseLoopsInFunctionINTEL = 5907, + MathOpDSPModeINTEL = 5909, + AliasScopeINTEL = 5914, + NoAliasINTEL = 5915, + InitiationIntervalINTEL = 5917, + MaxConcurrencyINTEL = 5918, + PipelineEnableINTEL = 5919, + BufferLocationINTEL = 5921, + IOPipeStorageINTEL = 5944, + FunctionFloatingPointModeINTEL = 6080, + SingleElementVectorINTEL = 6085, + VectorComputeCallableFunctionINTEL = 6087, + MediaBlockIOINTEL = 6140, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + CoreIDARM = 4160, + CoreCountARM = 4161, + CoreMaxIDARM = 4162, + WarpIDARM = 4163, + WarpMaxIDARM = 4164, + SubgroupEqMask = 4416, + SubgroupEqMaskKHR = 4416, + SubgroupGeMask = 4417, + SubgroupGeMaskKHR = 4417, + SubgroupGtMask = 4418, + SubgroupGtMaskKHR = 4418, + SubgroupLeMask = 4419, + SubgroupLeMaskKHR = 4419, + SubgroupLtMask = 4420, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + PrimitiveShadingRateKHR = 4432, + DeviceIndex = 4438, + ViewIndex = 4440, + ShadingRateKHR = 4444, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + FullyCoveredEXT = 5264, + TaskCountNV = 5274, + PrimitiveCountNV = 5275, + PrimitiveIndicesNV = 5276, + ClipDistancePerViewNV = 5277, + CullDistancePerViewNV = 5278, + LayerPerViewNV = 5279, + MeshViewCountNV = 5280, + MeshViewIndicesNV = 5281, + BaryCoordKHR = 5286, + BaryCoordNV = 5286, + BaryCoordNoPerspKHR = 5287, + BaryCoordNoPerspNV = 5287, + FragSizeEXT = 5292, + FragmentSizeNV = 5292, + FragInvocationCountEXT = 5293, + InvocationsPerPixelNV = 5293, + PrimitivePointIndicesEXT = 5294, + PrimitiveLineIndicesEXT = 5295, + PrimitiveTriangleIndicesEXT = 5296, + CullPrimitiveEXT = 5299, + LaunchIdKHR = 5319, + LaunchIdNV = 5319, + LaunchSizeKHR = 5320, + LaunchSizeNV = 5320, + WorldRayOriginKHR = 5321, + WorldRayOriginNV = 5321, + WorldRayDirectionKHR = 5322, + WorldRayDirectionNV = 5322, + ObjectRayOriginKHR = 5323, + ObjectRayOriginNV = 5323, + ObjectRayDirectionKHR = 5324, + ObjectRayDirectionNV = 5324, + RayTminKHR = 5325, + RayTminNV = 5325, + RayTmaxKHR = 5326, + RayTmaxNV = 5326, + InstanceCustomIndexKHR = 5327, + InstanceCustomIndexNV = 5327, + ObjectToWorldKHR = 5330, + ObjectToWorldNV = 5330, + WorldToObjectKHR = 5331, + WorldToObjectNV = 5331, + HitTNV = 5332, + HitKindKHR = 5333, + HitKindNV = 5333, + CurrentRayTimeNV = 5334, + IncomingRayFlagsKHR = 5351, + IncomingRayFlagsNV = 5351, + RayGeometryIndexKHR = 5352, + WarpsPerSMNV = 5374, + SMCountNV = 5375, + WarpIDNV = 5376, + SMIDNV = 5377, + CullMaskKHR = 6021, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + MinIterations = 4, + MaxIterations = 5, + IterationMultiple = 6, + PeelCount = 7, + PartialCount = 8, + InitiationIntervalINTEL = 16, + MaxConcurrencyINTEL = 17, + DependencyArrayINTEL = 18, + PipelineEnableINTEL = 19, + LoopCoalesceINTEL = 20, + MaxInterleavingINTEL = 21, + SpeculatedIterationsINTEL = 22, + NoFusionINTEL = 23, + LoopCountINTEL = 24, + MaxReinvocationDelayINTEL = 25, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, + MinIterations = 0x00000010, + MaxIterations = 0x00000020, + IterationMultiple = 0x00000040, + PeelCount = 0x00000080, + PartialCount = 0x00000100, + InitiationIntervalINTEL = 0x00010000, + MaxConcurrencyINTEL = 0x00020000, + DependencyArrayINTEL = 0x00040000, + PipelineEnableINTEL = 0x00080000, + LoopCoalesceINTEL = 0x00100000, + MaxInterleavingINTEL = 0x00200000, + SpeculatedIterationsINTEL = 0x00400000, + NoFusionINTEL = 0x00800000, + LoopCountINTEL = 0x01000000, + MaxReinvocationDelayINTEL = 0x02000000, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + OptNoneINTEL = 16, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + OptNoneINTEL = 0x00010000, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + OutputMemory = 12, + OutputMemoryKHR = 12, + MakeAvailable = 13, + MakeAvailableKHR = 13, + MakeVisible = 14, + MakeVisibleKHR = 14, + Volatile = 15, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + OutputMemory = 0x00001000, + OutputMemoryKHR = 0x00001000, + MakeAvailable = 0x00002000, + MakeAvailableKHR = 0x00002000, + MakeVisible = 0x00004000, + MakeVisibleKHR = 0x00004000, + Volatile = 0x00008000, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + MakePointerAvailable = 3, + MakePointerAvailableKHR = 3, + MakePointerVisible = 4, + MakePointerVisibleKHR = 4, + NonPrivatePointer = 5, + NonPrivatePointerKHR = 5, + AliasScopeINTELMask = 16, + NoAliasINTELMask = 17, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + MakePointerAvailable = 0x00000008, + MakePointerAvailableKHR = 0x00000008, + MakePointerVisible = 0x00000010, + MakePointerVisibleKHR = 0x00000010, + NonPrivatePointer = 0x00000020, + NonPrivatePointerKHR = 0x00000020, + AliasScopeINTELMask = 0x00010000, + NoAliasINTELMask = 0x00020000, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + QueueFamily = 5, + QueueFamilyKHR = 5, + ShaderCallKHR = 6, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + ClusteredReduce = 3, + PartitionedReduceNV = 6, + PartitionedInclusiveScanNV = 7, + PartitionedExclusiveScanNV = 8, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + GroupNonUniform = 61, + GroupNonUniformVote = 62, + GroupNonUniformArithmetic = 63, + GroupNonUniformBallot = 64, + GroupNonUniformShuffle = 65, + GroupNonUniformShuffleRelative = 66, + GroupNonUniformClustered = 67, + GroupNonUniformQuad = 68, + ShaderLayer = 69, + ShaderViewportIndex = 70, + UniformDecoration = 71, + CoreBuiltinsARM = 4165, + FragmentShadingRateKHR = 4422, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + WorkgroupMemoryExplicitLayoutKHR = 4428, + WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, + WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + StorageBuffer8BitAccess = 4448, + UniformAndStorageBuffer8BitAccess = 4449, + StoragePushConstant8 = 4450, + DenormPreserve = 4464, + DenormFlushToZero = 4465, + SignedZeroInfNanPreserve = 4466, + RoundingModeRTE = 4467, + RoundingModeRTZ = 4468, + RayQueryProvisionalKHR = 4471, + RayQueryKHR = 4472, + RayTraversalPrimitiveCullingKHR = 4478, + RayTracingKHR = 4479, + Float16ImageAMD = 5008, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + Int64ImageEXT = 5016, + ShaderClockKHR = 5055, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + FragmentFullyCoveredEXT = 5265, + MeshShadingNV = 5266, + ImageFootprintNV = 5282, + MeshShadingEXT = 5283, + FragmentBarycentricKHR = 5284, + FragmentBarycentricNV = 5284, + ComputeDerivativeGroupQuadsNV = 5288, + FragmentDensityEXT = 5291, + ShadingRateNV = 5291, + GroupNonUniformPartitionedNV = 5297, + ShaderNonUniform = 5301, + ShaderNonUniformEXT = 5301, + RuntimeDescriptorArray = 5302, + RuntimeDescriptorArrayEXT = 5302, + InputAttachmentArrayDynamicIndexing = 5303, + InputAttachmentArrayDynamicIndexingEXT = 5303, + UniformTexelBufferArrayDynamicIndexing = 5304, + UniformTexelBufferArrayDynamicIndexingEXT = 5304, + StorageTexelBufferArrayDynamicIndexing = 5305, + StorageTexelBufferArrayDynamicIndexingEXT = 5305, + UniformBufferArrayNonUniformIndexing = 5306, + UniformBufferArrayNonUniformIndexingEXT = 5306, + SampledImageArrayNonUniformIndexing = 5307, + SampledImageArrayNonUniformIndexingEXT = 5307, + StorageBufferArrayNonUniformIndexing = 5308, + StorageBufferArrayNonUniformIndexingEXT = 5308, + StorageImageArrayNonUniformIndexing = 5309, + StorageImageArrayNonUniformIndexingEXT = 5309, + InputAttachmentArrayNonUniformIndexing = 5310, + InputAttachmentArrayNonUniformIndexingEXT = 5310, + UniformTexelBufferArrayNonUniformIndexing = 5311, + UniformTexelBufferArrayNonUniformIndexingEXT = 5311, + StorageTexelBufferArrayNonUniformIndexing = 5312, + StorageTexelBufferArrayNonUniformIndexingEXT = 5312, + RayTracingNV = 5340, + RayTracingMotionBlurNV = 5341, + VulkanMemoryModel = 5345, + VulkanMemoryModelKHR = 5345, + VulkanMemoryModelDeviceScope = 5346, + VulkanMemoryModelDeviceScopeKHR = 5346, + PhysicalStorageBufferAddresses = 5347, + PhysicalStorageBufferAddressesEXT = 5347, + ComputeDerivativeGroupLinearNV = 5350, + RayTracingProvisionalKHR = 5353, + CooperativeMatrixNV = 5357, + FragmentShaderSampleInterlockEXT = 5363, + FragmentShaderShadingRateInterlockEXT = 5372, + ShaderSMBuiltinsNV = 5373, + FragmentShaderPixelInterlockEXT = 5378, + DemoteToHelperInvocation = 5379, + DemoteToHelperInvocationEXT = 5379, + RayTracingOpacityMicromapEXT = 5381, + ShaderInvocationReorderNV = 5383, + BindlessTextureNV = 5390, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + SubgroupImageMediaBlockIOINTEL = 5579, + RoundToInfinityINTEL = 5582, + FloatingPointModeINTEL = 5583, + IntegerFunctions2INTEL = 5584, + FunctionPointersINTEL = 5603, + IndirectReferencesINTEL = 5604, + AsmINTEL = 5606, + AtomicFloat32MinMaxEXT = 5612, + AtomicFloat64MinMaxEXT = 5613, + AtomicFloat16MinMaxEXT = 5616, + VectorComputeINTEL = 5617, + VectorAnyINTEL = 5619, + ExpectAssumeKHR = 5629, + SubgroupAvcMotionEstimationINTEL = 5696, + SubgroupAvcMotionEstimationIntraINTEL = 5697, + SubgroupAvcMotionEstimationChromaINTEL = 5698, + VariableLengthArrayINTEL = 5817, + FunctionFloatControlINTEL = 5821, + FPGAMemoryAttributesINTEL = 5824, + FPFastMathModeINTEL = 5837, + ArbitraryPrecisionIntegersINTEL = 5844, + ArbitraryPrecisionFloatingPointINTEL = 5845, + UnstructuredLoopControlsINTEL = 5886, + FPGALoopControlsINTEL = 5888, + KernelAttributesINTEL = 5892, + FPGAKernelAttributesINTEL = 5897, + FPGAMemoryAccessesINTEL = 5898, + FPGAClusterAttributesINTEL = 5904, + LoopFuseINTEL = 5906, + FPGADSPControlINTEL = 5908, + MemoryAccessAliasingINTEL = 5910, + FPGAInvocationPipeliningAttributesINTEL = 5916, + FPGABufferLocationINTEL = 5920, + ArbitraryPrecisionFixedPointINTEL = 5922, + USMStorageClassesINTEL = 5935, + RuntimeAlignedAttributeINTEL = 5939, + IOPipesINTEL = 5943, + BlockingPipesINTEL = 5945, + FPGARegINTEL = 5948, + DotProductInputAll = 6016, + DotProductInputAllKHR = 6016, + DotProductInput4x8Bit = 6017, + DotProductInput4x8BitKHR = 6017, + DotProductInput4x8BitPacked = 6018, + DotProductInput4x8BitPackedKHR = 6018, + DotProduct = 6019, + DotProductKHR = 6019, + RayCullMaskKHR = 6020, + BitInstructions = 6025, + GroupNonUniformRotateKHR = 6026, + AtomicFloat32AddEXT = 6033, + AtomicFloat64AddEXT = 6034, + LongConstantCompositeINTEL = 6089, + OptNoneINTEL = 6094, + AtomicFloat16AddEXT = 6095, + DebugInfoModuleINTEL = 6114, + SplitBarrierINTEL = 6141, + GroupUniformArithmeticKHR = 6400, + Max = 0x7fffffff, +}; + +enum class RayFlagsShift : unsigned { + OpaqueKHR = 0, + NoOpaqueKHR = 1, + TerminateOnFirstHitKHR = 2, + SkipClosestHitShaderKHR = 3, + CullBackFacingTrianglesKHR = 4, + CullFrontFacingTrianglesKHR = 5, + CullOpaqueKHR = 6, + CullNoOpaqueKHR = 7, + SkipTrianglesKHR = 8, + SkipAABBsKHR = 9, + ForceOpacityMicromap2StateEXT = 10, + Max = 0x7fffffff, +}; + +enum class RayFlagsMask : unsigned { + MaskNone = 0, + OpaqueKHR = 0x00000001, + NoOpaqueKHR = 0x00000002, + TerminateOnFirstHitKHR = 0x00000004, + SkipClosestHitShaderKHR = 0x00000008, + CullBackFacingTrianglesKHR = 0x00000010, + CullFrontFacingTrianglesKHR = 0x00000020, + CullOpaqueKHR = 0x00000040, + CullNoOpaqueKHR = 0x00000080, + SkipTrianglesKHR = 0x00000100, + SkipAABBsKHR = 0x00000200, + ForceOpacityMicromap2StateEXT = 0x00000400, +}; + +enum class RayQueryIntersection : unsigned { + RayQueryCandidateIntersectionKHR = 0, + RayQueryCommittedIntersectionKHR = 1, + Max = 0x7fffffff, +}; + +enum class RayQueryCommittedIntersectionType : unsigned { + RayQueryCommittedIntersectionNoneKHR = 0, + RayQueryCommittedIntersectionTriangleKHR = 1, + RayQueryCommittedIntersectionGeneratedKHR = 2, + Max = 0x7fffffff, +}; + +enum class RayQueryCandidateIntersectionType : unsigned { + RayQueryCandidateIntersectionTriangleKHR = 0, + RayQueryCandidateIntersectionAABBKHR = 1, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateShift : unsigned { + Vertical2Pixels = 0, + Vertical4Pixels = 1, + Horizontal2Pixels = 2, + Horizontal4Pixels = 3, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateMask : unsigned { + MaskNone = 0, + Vertical2Pixels = 0x00000001, + Vertical4Pixels = 0x00000002, + Horizontal2Pixels = 0x00000004, + Horizontal4Pixels = 0x00000008, +}; + +enum class FPDenormMode : unsigned { + Preserve = 0, + FlushToZero = 1, + Max = 0x7fffffff, +}; + +enum class FPOperationMode : unsigned { + IEEE = 0, + ALT = 1, + Max = 0x7fffffff, +}; + +enum class QuantizationModes : unsigned { + TRN = 0, + TRN_ZERO = 1, + RND = 2, + RND_ZERO = 3, + RND_INF = 4, + RND_MIN_INF = 5, + RND_CONV = 6, + RND_CONV_ODD = 7, + Max = 0x7fffffff, +}; + +enum class OverflowModes : unsigned { + WRAP = 0, + SAT = 1, + SAT_ZERO = 2, + SAT_SYM = 3, + Max = 0x7fffffff, +}; + +enum class PackedVectorFormat : unsigned { + PackedVectorFormat4x8Bit = 0, + PackedVectorFormat4x8BitKHR = 0, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpCopyLogical = 400, + OpPtrEqual = 401, + OpPtrNotEqual = 402, + OpPtrDiff = 403, + OpTerminateInvocation = 4416, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpGroupNonUniformRotateKHR = 4431, + OpSubgroupReadInvocationKHR = 4432, + OpTraceRayKHR = 4445, + OpExecuteCallableKHR = 4446, + OpConvertUToAccelerationStructureKHR = 4447, + OpIgnoreIntersectionKHR = 4448, + OpTerminateRayKHR = 4449, + OpSDot = 4450, + OpSDotKHR = 4450, + OpUDot = 4451, + OpUDotKHR = 4451, + OpSUDot = 4452, + OpSUDotKHR = 4452, + OpSDotAccSat = 4453, + OpSDotAccSatKHR = 4453, + OpUDotAccSat = 4454, + OpUDotAccSatKHR = 4454, + OpSUDotAccSat = 4455, + OpSUDotAccSatKHR = 4455, + OpTypeRayQueryKHR = 4472, + OpRayQueryInitializeKHR = 4473, + OpRayQueryTerminateKHR = 4474, + OpRayQueryGenerateIntersectionKHR = 4475, + OpRayQueryConfirmIntersectionKHR = 4476, + OpRayQueryProceedKHR = 4477, + OpRayQueryGetIntersectionTypeKHR = 4479, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpReadClockKHR = 5056, + OpHitObjectRecordHitMotionNV = 5249, + OpHitObjectRecordHitWithIndexMotionNV = 5250, + OpHitObjectRecordMissMotionNV = 5251, + OpHitObjectGetWorldToObjectNV = 5252, + OpHitObjectGetObjectToWorldNV = 5253, + OpHitObjectGetObjectRayDirectionNV = 5254, + OpHitObjectGetObjectRayOriginNV = 5255, + OpHitObjectTraceRayMotionNV = 5256, + OpHitObjectGetShaderRecordBufferHandleNV = 5257, + OpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + OpHitObjectRecordEmptyNV = 5259, + OpHitObjectTraceRayNV = 5260, + OpHitObjectRecordHitNV = 5261, + OpHitObjectRecordHitWithIndexNV = 5262, + OpHitObjectRecordMissNV = 5263, + OpHitObjectExecuteShaderNV = 5264, + OpHitObjectGetCurrentTimeNV = 5265, + OpHitObjectGetAttributesNV = 5266, + OpHitObjectGetHitKindNV = 5267, + OpHitObjectGetPrimitiveIndexNV = 5268, + OpHitObjectGetGeometryIndexNV = 5269, + OpHitObjectGetInstanceIdNV = 5270, + OpHitObjectGetInstanceCustomIndexNV = 5271, + OpHitObjectGetWorldRayDirectionNV = 5272, + OpHitObjectGetWorldRayOriginNV = 5273, + OpHitObjectGetRayTMaxNV = 5274, + OpHitObjectGetRayTMinNV = 5275, + OpHitObjectIsEmptyNV = 5276, + OpHitObjectIsHitNV = 5277, + OpHitObjectIsMissNV = 5278, + OpReorderThreadWithHitObjectNV = 5279, + OpReorderThreadWithHintNV = 5280, + OpTypeHitObjectNV = 5281, + OpImageSampleFootprintNV = 5283, + OpEmitMeshTasksEXT = 5294, + OpSetMeshOutputsEXT = 5295, + OpGroupNonUniformPartitionNV = 5296, + OpWritePackedPrimitiveIndices4x8NV = 5299, + OpReportIntersectionKHR = 5334, + OpReportIntersectionNV = 5334, + OpIgnoreIntersectionNV = 5335, + OpTerminateRayNV = 5336, + OpTraceNV = 5337, + OpTraceMotionNV = 5338, + OpTraceRayMotionNV = 5339, + OpTypeAccelerationStructureKHR = 5341, + OpTypeAccelerationStructureNV = 5341, + OpExecuteCallableNV = 5344, + OpTypeCooperativeMatrixNV = 5358, + OpCooperativeMatrixLoadNV = 5359, + OpCooperativeMatrixStoreNV = 5360, + OpCooperativeMatrixMulAddNV = 5361, + OpCooperativeMatrixLengthNV = 5362, + OpBeginInvocationInterlockEXT = 5364, + OpEndInvocationInterlockEXT = 5365, + OpDemoteToHelperInvocation = 5380, + OpDemoteToHelperInvocationEXT = 5380, + OpIsHelperInvocationEXT = 5381, + OpConvertUToImageNV = 5391, + OpConvertUToSamplerNV = 5392, + OpConvertImageToUNV = 5393, + OpConvertSamplerToUNV = 5394, + OpConvertUToSampledImageNV = 5395, + OpConvertSampledImageToUNV = 5396, + OpSamplerImageAddressingModeNV = 5397, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpSubgroupImageMediaBlockReadINTEL = 5580, + OpSubgroupImageMediaBlockWriteINTEL = 5581, + OpUCountLeadingZerosINTEL = 5585, + OpUCountTrailingZerosINTEL = 5586, + OpAbsISubINTEL = 5587, + OpAbsUSubINTEL = 5588, + OpIAddSatINTEL = 5589, + OpUAddSatINTEL = 5590, + OpIAverageINTEL = 5591, + OpUAverageINTEL = 5592, + OpIAverageRoundedINTEL = 5593, + OpUAverageRoundedINTEL = 5594, + OpISubSatINTEL = 5595, + OpUSubSatINTEL = 5596, + OpIMul32x16INTEL = 5597, + OpUMul32x16INTEL = 5598, + OpConstantFunctionPointerINTEL = 5600, + OpFunctionPointerCallINTEL = 5601, + OpAsmTargetINTEL = 5609, + OpAsmINTEL = 5610, + OpAsmCallINTEL = 5611, + OpAtomicFMinEXT = 5614, + OpAtomicFMaxEXT = 5615, + OpAssumeTrueKHR = 5630, + OpExpectKHR = 5631, + OpDecorateString = 5632, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateString = 5633, + OpMemberDecorateStringGOOGLE = 5633, + OpVmeImageINTEL = 5699, + OpTypeVmeImageINTEL = 5700, + OpTypeAvcImePayloadINTEL = 5701, + OpTypeAvcRefPayloadINTEL = 5702, + OpTypeAvcSicPayloadINTEL = 5703, + OpTypeAvcMcePayloadINTEL = 5704, + OpTypeAvcMceResultINTEL = 5705, + OpTypeAvcImeResultINTEL = 5706, + OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + OpTypeAvcImeDualReferenceStreaminINTEL = 5710, + OpTypeAvcRefResultINTEL = 5711, + OpTypeAvcSicResultINTEL = 5712, + OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + OpSubgroupAvcMceConvertToImeResultINTEL = 5733, + OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + OpSubgroupAvcMceConvertToRefResultINTEL = 5735, + OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + OpSubgroupAvcMceConvertToSicResultINTEL = 5737, + OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + OpSubgroupAvcImeInitializeINTEL = 5747, + OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + OpSubgroupAvcImeSetDualReferenceINTEL = 5749, + OpSubgroupAvcImeRefWindowSizeINTEL = 5750, + OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + OpSubgroupAvcImeSetWeightedSadINTEL = 5756, + OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + OpSubgroupAvcImeConvertToMceResultINTEL = 5765, + OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + OpSubgroupAvcImeGetBorderReachedINTEL = 5776, + OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + OpSubgroupAvcFmeInitializeINTEL = 5781, + OpSubgroupAvcBmeInitializeINTEL = 5782, + OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + OpSubgroupAvcRefConvertToMceResultINTEL = 5790, + OpSubgroupAvcSicInitializeINTEL = 5791, + OpSubgroupAvcSicConfigureSkcINTEL = 5792, + OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + OpSubgroupAvcSicEvaluateIpeINTEL = 5803, + OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + OpSubgroupAvcSicConvertToMceResultINTEL = 5808, + OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, + OpVariableLengthArrayINTEL = 5818, + OpSaveMemoryINTEL = 5819, + OpRestoreMemoryINTEL = 5820, + OpArbitraryFloatSinCosPiINTEL = 5840, + OpArbitraryFloatCastINTEL = 5841, + OpArbitraryFloatCastFromIntINTEL = 5842, + OpArbitraryFloatCastToIntINTEL = 5843, + OpArbitraryFloatAddINTEL = 5846, + OpArbitraryFloatSubINTEL = 5847, + OpArbitraryFloatMulINTEL = 5848, + OpArbitraryFloatDivINTEL = 5849, + OpArbitraryFloatGTINTEL = 5850, + OpArbitraryFloatGEINTEL = 5851, + OpArbitraryFloatLTINTEL = 5852, + OpArbitraryFloatLEINTEL = 5853, + OpArbitraryFloatEQINTEL = 5854, + OpArbitraryFloatRecipINTEL = 5855, + OpArbitraryFloatRSqrtINTEL = 5856, + OpArbitraryFloatCbrtINTEL = 5857, + OpArbitraryFloatHypotINTEL = 5858, + OpArbitraryFloatSqrtINTEL = 5859, + OpArbitraryFloatLogINTEL = 5860, + OpArbitraryFloatLog2INTEL = 5861, + OpArbitraryFloatLog10INTEL = 5862, + OpArbitraryFloatLog1pINTEL = 5863, + OpArbitraryFloatExpINTEL = 5864, + OpArbitraryFloatExp2INTEL = 5865, + OpArbitraryFloatExp10INTEL = 5866, + OpArbitraryFloatExpm1INTEL = 5867, + OpArbitraryFloatSinINTEL = 5868, + OpArbitraryFloatCosINTEL = 5869, + OpArbitraryFloatSinCosINTEL = 5870, + OpArbitraryFloatSinPiINTEL = 5871, + OpArbitraryFloatCosPiINTEL = 5872, + OpArbitraryFloatASinINTEL = 5873, + OpArbitraryFloatASinPiINTEL = 5874, + OpArbitraryFloatACosINTEL = 5875, + OpArbitraryFloatACosPiINTEL = 5876, + OpArbitraryFloatATanINTEL = 5877, + OpArbitraryFloatATanPiINTEL = 5878, + OpArbitraryFloatATan2INTEL = 5879, + OpArbitraryFloatPowINTEL = 5880, + OpArbitraryFloatPowRINTEL = 5881, + OpArbitraryFloatPowNINTEL = 5882, + OpLoopControlINTEL = 5887, + OpAliasDomainDeclINTEL = 5911, + OpAliasScopeDeclINTEL = 5912, + OpAliasScopeListDeclINTEL = 5913, + OpFixedSqrtINTEL = 5923, + OpFixedRecipINTEL = 5924, + OpFixedRsqrtINTEL = 5925, + OpFixedSinINTEL = 5926, + OpFixedCosINTEL = 5927, + OpFixedSinCosINTEL = 5928, + OpFixedSinPiINTEL = 5929, + OpFixedCosPiINTEL = 5930, + OpFixedSinCosPiINTEL = 5931, + OpFixedLogINTEL = 5932, + OpFixedExpINTEL = 5933, + OpPtrCastToCrossWorkgroupINTEL = 5934, + OpCrossWorkgroupCastToPtrINTEL = 5938, + OpReadPipeBlockingINTEL = 5946, + OpWritePipeBlockingINTEL = 5947, + OpFPGARegINTEL = 5949, + OpRayQueryGetRayTMinKHR = 6016, + OpRayQueryGetRayFlagsKHR = 6017, + OpRayQueryGetIntersectionTKHR = 6018, + OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, + OpRayQueryGetIntersectionInstanceIdKHR = 6020, + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, + OpRayQueryGetIntersectionGeometryIndexKHR = 6022, + OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, + OpRayQueryGetIntersectionBarycentricsKHR = 6024, + OpRayQueryGetIntersectionFrontFaceKHR = 6025, + OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, + OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, + OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, + OpRayQueryGetWorldRayDirectionKHR = 6029, + OpRayQueryGetWorldRayOriginKHR = 6030, + OpRayQueryGetIntersectionObjectToWorldKHR = 6031, + OpRayQueryGetIntersectionWorldToObjectKHR = 6032, + OpAtomicFAddEXT = 6035, + OpTypeBufferSurfaceINTEL = 6086, + OpTypeStructContinuedINTEL = 6090, + OpConstantCompositeContinuedINTEL = 6091, + OpSpecConstantCompositeContinuedINTEL = 6092, + OpControlBarrierArriveINTEL = 6142, + OpControlBarrierWaitINTEL = 6143, + OpGroupIMulKHR = 6401, + OpGroupFMulKHR = 6402, + OpGroupBitwiseAndKHR = 6403, + OpGroupBitwiseOrKHR = 6404, + OpGroupBitwiseXorKHR = 6405, + OpGroupLogicalAndKHR = 6406, + OpGroupLogicalOrKHR = 6407, + OpGroupLogicalXorKHR = 6408, + Max = 0x7fffffff, +}; + +#ifdef SPV_ENABLE_UTILITY_CODE +#ifndef __cplusplus +#include +#endif +inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case Op::OpNop: *hasResult = false; *hasResultType = false; break; + case Op::OpUndef: *hasResult = true; *hasResultType = true; break; + case Op::OpSourceContinued: *hasResult = false; *hasResultType = false; break; + case Op::OpSource: *hasResult = false; *hasResultType = false; break; + case Op::OpSourceExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpName: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberName: *hasResult = false; *hasResultType = false; break; + case Op::OpString: *hasResult = true; *hasResultType = false; break; + case Op::OpLine: *hasResult = false; *hasResultType = false; break; + case Op::OpExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpExtInstImport: *hasResult = true; *hasResultType = false; break; + case Op::OpExtInst: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryModel: *hasResult = false; *hasResultType = false; break; + case Op::OpEntryPoint: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionMode: *hasResult = false; *hasResultType = false; break; + case Op::OpCapability: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeVoid: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeBool: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeInt: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFloat: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeVector: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampler: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStruct: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePointer: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFunction: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeQueue: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePipe: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantSampler: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantNull: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case Op::OpFunction: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case Op::OpFunctionCall: *hasResult = true; *hasResultType = true; break; + case Op::OpVariable: *hasResult = true; *hasResultType = true; break; + case Op::OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case Op::OpLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpStore: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemory: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case Op::OpAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpArrayLength: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case Op::OpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyObject: *hasResult = true; *hasResultType = true; break; + case Op::OpTranspose: *hasResult = true; *hasResultType = true; break; + case Op::OpSampledImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageRead: *hasResult = true; *hasResultType = true; break; + case Op::OpImageWrite: *hasResult = false; *hasResultType = false; break; + case Op::OpImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToU: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSToF: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToF: *hasResult = true; *hasResultType = true; break; + case Op::OpUConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpSConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpFConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case Op::OpBitcast: *hasResult = true; *hasResultType = true; break; + case Op::OpSNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpFNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpISub: *hasResult = true; *hasResultType = true; break; + case Op::OpFSub: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpUDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpSDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpFDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpUMod: *hasResult = true; *hasResultType = true; break; + case Op::OpSRem: *hasResult = true; *hasResultType = true; break; + case Op::OpSMod: *hasResult = true; *hasResultType = true; break; + case Op::OpFRem: *hasResult = true; *hasResultType = true; break; + case Op::OpFMod: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpOuterProduct: *hasResult = true; *hasResultType = true; break; + case Op::OpDot: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddCarry: *hasResult = true; *hasResultType = true; break; + case Op::OpISubBorrow: *hasResult = true; *hasResultType = true; break; + case Op::OpUMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpSMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpAny: *hasResult = true; *hasResultType = true; break; + case Op::OpAll: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNan: *hasResult = true; *hasResultType = true; break; + case Op::OpIsInf: *hasResult = true; *hasResultType = true; break; + case Op::OpIsFinite: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNormal: *hasResult = true; *hasResultType = true; break; + case Op::OpSignBitSet: *hasResult = true; *hasResultType = true; break; + case Op::OpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case Op::OpOrdered: *hasResult = true; *hasResultType = true; break; + case Op::OpUnordered: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNot: *hasResult = true; *hasResultType = true; break; + case Op::OpSelect: *hasResult = true; *hasResultType = true; break; + case Op::OpIEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpINotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpNot: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitReverse: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdx: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdy: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidth: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyFine: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicStore: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicISub: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicOr: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicXor: *hasResult = true; *hasResultType = true; break; + case Op::OpPhi: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpLabel: *hasResult = true; *hasResultType = false; break; + case Op::OpBranch: *hasResult = false; *hasResultType = false; break; + case Op::OpBranchConditional: *hasResult = false; *hasResultType = false; break; + case Op::OpSwitch: *hasResult = false; *hasResultType = false; break; + case Op::OpKill: *hasResult = false; *hasResultType = false; break; + case Op::OpReturn: *hasResult = false; *hasResultType = false; break; + case Op::OpReturnValue: *hasResult = false; *hasResultType = false; break; + case Op::OpUnreachable: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case Op::OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case Op::OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case Op::OpRetainEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case Op::OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case Op::OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case Op::OpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case Op::OpNoLine: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case Op::OpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case Op::OpSizeOf: *hasResult = true; *hasResultType = true; break; + case Op::OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case Op::OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case Op::OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorateId: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpSDot: *hasResult = true; *hasResultType = true; break; + case Op::OpUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case Op::OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; + case Op::OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case Op::OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; + case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExpectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; + } +} +#endif /* SPV_ENABLE_UTILITY_CODE */ + +// Overload bitwise operators for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); } +inline ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); } +inline ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); } +inline FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); } +inline FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); } +inline SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); } +inline SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); } +inline LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); } +inline LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); } +inline FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); } +inline FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); } +inline MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); } +inline MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); } +inline MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); } +inline MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); } +inline KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); } +inline KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); } +inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } +inline RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); } +inline RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); } +inline RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); } +inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } +inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } +inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } +inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json index 466f0b097..4cd00db24 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json @@ -214,6 +214,7 @@ "NoGlobalOffsetINTEL": 5895, "NumSIMDWorkitemsINTEL": 5896, "SchedulerTargetFmaxMhzINTEL": 5903, + "StreamingInterfaceINTEL": 6154, "NamedBarrierCountINTEL": 6417 } }, @@ -249,6 +250,7 @@ "ShaderRecordBufferNV": 5343, "PhysicalStorageBuffer": 5349, "PhysicalStorageBufferEXT": 5349, + "HitObjectAttributeNV": 5385, "TaskPayloadWorkgroupEXT": 5402, "CodeSectionINTEL": 5605, "DeviceOnlyINTEL": 5936, @@ -474,7 +476,8 @@ "NoAlias": 4, "NoCapture": 5, "NoWrite": 6, - "NoReadWrite": 7 + "NoReadWrite": 7, + "RuntimeAlignedINTEL": 5940 } }, { @@ -548,6 +551,7 @@ "RestrictPointerEXT": 5355, "AliasedPointer": 5356, "AliasedPointerEXT": 5356, + "HitObjectShaderRecordBufferNV": 5386, "BindlessSamplerNV": 5398, "BindlessImageNV": 5399, "BoundSamplerNV": 5400, @@ -586,8 +590,12 @@ "PrefetchINTEL": 5902, "StallEnableINTEL": 5905, "FuseLoopsInFunctionINTEL": 5907, + "MathOpDSPModeINTEL": 5909, "AliasScopeINTEL": 5914, "NoAliasINTEL": 5915, + "InitiationIntervalINTEL": 5917, + "MaxConcurrencyINTEL": 5918, + "PipelineEnableINTEL": 5919, "BufferLocationINTEL": 5921, "IOPipeStorageINTEL": 5944, "FunctionFloatingPointModeINTEL": 6080, @@ -764,7 +772,9 @@ "LoopCoalesceINTEL": 20, "MaxInterleavingINTEL": 21, "SpeculatedIterationsINTEL": 22, - "NoFusionINTEL": 23 + "NoFusionINTEL": 23, + "LoopCountINTEL": 24, + "MaxReinvocationDelayINTEL": 25 } }, { @@ -1041,6 +1051,7 @@ "DemoteToHelperInvocation": 5379, "DemoteToHelperInvocationEXT": 5379, "RayTracingOpacityMicromapEXT": 5381, + "ShaderInvocationReorderNV": 5383, "BindlessTextureNV": 5390, "SubgroupShuffleINTEL": 5568, "SubgroupBufferBlockIOINTEL": 5569, @@ -1074,10 +1085,13 @@ "FPGAMemoryAccessesINTEL": 5898, "FPGAClusterAttributesINTEL": 5904, "LoopFuseINTEL": 5906, + "FPGADSPControlINTEL": 5908, "MemoryAccessAliasingINTEL": 5910, + "FPGAInvocationPipeliningAttributesINTEL": 5916, "FPGABufferLocationINTEL": 5920, "ArbitraryPrecisionFixedPointINTEL": 5922, "USMStorageClassesINTEL": 5935, + "RuntimeAlignedAttributeINTEL": 5939, "IOPipesINTEL": 5943, "BlockingPipesINTEL": 5945, "FPGARegINTEL": 5948, @@ -1604,6 +1618,39 @@ "OpFragmentMaskFetchAMD": 5011, "OpFragmentFetchAMD": 5012, "OpReadClockKHR": 5056, + "OpHitObjectRecordHitMotionNV": 5249, + "OpHitObjectRecordHitWithIndexMotionNV": 5250, + "OpHitObjectRecordMissMotionNV": 5251, + "OpHitObjectGetWorldToObjectNV": 5252, + "OpHitObjectGetObjectToWorldNV": 5253, + "OpHitObjectGetObjectRayDirectionNV": 5254, + "OpHitObjectGetObjectRayOriginNV": 5255, + "OpHitObjectTraceRayMotionNV": 5256, + "OpHitObjectGetShaderRecordBufferHandleNV": 5257, + "OpHitObjectGetShaderBindingTableRecordIndexNV": 5258, + "OpHitObjectRecordEmptyNV": 5259, + "OpHitObjectTraceRayNV": 5260, + "OpHitObjectRecordHitNV": 5261, + "OpHitObjectRecordHitWithIndexNV": 5262, + "OpHitObjectRecordMissNV": 5263, + "OpHitObjectExecuteShaderNV": 5264, + "OpHitObjectGetCurrentTimeNV": 5265, + "OpHitObjectGetAttributesNV": 5266, + "OpHitObjectGetHitKindNV": 5267, + "OpHitObjectGetPrimitiveIndexNV": 5268, + "OpHitObjectGetGeometryIndexNV": 5269, + "OpHitObjectGetInstanceIdNV": 5270, + "OpHitObjectGetInstanceCustomIndexNV": 5271, + "OpHitObjectGetWorldRayDirectionNV": 5272, + "OpHitObjectGetWorldRayOriginNV": 5273, + "OpHitObjectGetRayTMaxNV": 5274, + "OpHitObjectGetRayTMinNV": 5275, + "OpHitObjectIsEmptyNV": 5276, + "OpHitObjectIsHitNV": 5277, + "OpHitObjectIsMissNV": 5278, + "OpReorderThreadWithHitObjectNV": 5279, + "OpReorderThreadWithHintNV": 5280, + "OpTypeHitObjectNV": 5281, "OpImageSampleFootprintNV": 5283, "OpEmitMeshTasksEXT": 5294, "OpSetMeshOutputsEXT": 5295, From 2d52b5f9af5c8d1f584cb8bb89807f555794a135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 18:27:08 -0800 Subject: [PATCH 11/86] Updated spirv-tools. --- .../include/generated/build-version.inc | 2 +- .../include/generated/core.insts-unified1.inc | 1527 +++++++++-------- .../include/generated/enum_string_mapping.inc | 430 ++--- .../include/generated/extension_enum.inc | 4 + .../include/generated/generators.inc | 3 +- .../include/generated/glsl.std.450.insts.inc | 4 +- .../nonsemantic.clspvreflection.insts.inc | 9 +- .../generated/operand.kinds-unified1.inc | 292 ++-- .../include/spirv-tools/instrument.hpp | 17 +- .../include/spirv-tools/optimizer.hpp | 64 +- .../spirv-tools/source/assembly_grammar.cpp | 16 +- .../spirv-tools/source/assembly_grammar.h | 9 +- 3rdparty/spirv-tools/source/binary.cpp | 31 +- 3rdparty/spirv-tools/source/diff/diff.cpp | 325 ++-- 3rdparty/spirv-tools/source/disassemble.cpp | 10 +- 3rdparty/spirv-tools/source/enum_set.h | 4 +- .../spirv-tools/source/enum_string_mapping.h | 2 +- 3rdparty/spirv-tools/source/extensions.cpp | 4 +- 3rdparty/spirv-tools/source/instruction.h | 2 +- .../source/latest_version_spirv_header.h | 2 +- 3rdparty/spirv-tools/source/link/linker.cpp | 57 +- .../source/lint/divergence_analysis.cpp | 43 +- .../lint/lint_divergent_derivatives.cpp | 46 +- 3rdparty/spirv-tools/source/lint/linter.cpp | 1 - 3rdparty/spirv-tools/source/name_mapper.cpp | 58 +- 3rdparty/spirv-tools/source/opcode.cpp | 770 ++++----- 3rdparty/spirv-tools/source/opcode.h | 65 +- 3rdparty/spirv-tools/source/operand.cpp | 54 +- 3rdparty/spirv-tools/source/operand.h | 2 +- .../opt/aggressive_dead_code_elim_pass.cpp | 223 +-- .../opt/aggressive_dead_code_elim_pass.h | 13 +- .../spirv-tools/source/opt/amd_ext_to_khr.cpp | 234 +-- .../source/opt/analyze_live_input_pass.cpp | 45 + .../source/opt/analyze_live_input_pass.h | 57 + .../spirv-tools/source/opt/basic_block.cpp | 45 +- 3rdparty/spirv-tools/source/opt/basic_block.h | 2 +- .../source/opt/block_merge_util.cpp | 36 +- 3rdparty/spirv-tools/source/opt/ccp_pass.cpp | 15 +- 3rdparty/spirv-tools/source/opt/cfg.cpp | 12 +- 3rdparty/spirv-tools/source/opt/code_sink.cpp | 85 +- .../source/opt/combine_access_chains.cpp | 54 +- .../source/opt/combine_access_chains.h | 4 +- .../source/opt/const_folding_rules.cpp | 257 ++- .../source/opt/const_folding_rules.h | 10 +- 3rdparty/spirv-tools/source/opt/constants.cpp | 76 +- 3rdparty/spirv-tools/source/opt/constants.h | 15 +- .../source/opt/control_dependence.cpp | 5 +- .../source/opt/convert_to_half_pass.cpp | 229 +-- .../source/opt/convert_to_half_pass.h | 14 +- .../opt/convert_to_sampled_image_pass.cpp | 63 +- .../opt/convert_to_sampled_image_pass.h | 4 +- .../source/opt/copy_prop_arrays.cpp | 108 +- .../spirv-tools/source/opt/copy_prop_arrays.h | 4 +- 3rdparty/spirv-tools/source/opt/dataflow.cpp | 2 +- .../source/opt/dead_branch_elim_pass.cpp | 56 +- .../source/opt/dead_insert_elim_pass.cpp | 57 +- .../source/opt/dead_variable_elimination.cpp | 15 +- .../source/opt/debug_info_manager.cpp | 88 +- .../source/opt/decoration_manager.cpp | 103 +- .../source/opt/decoration_manager.h | 25 +- 3rdparty/spirv-tools/source/opt/desc_sroa.cpp | 49 +- .../spirv-tools/source/opt/desc_sroa_util.cpp | 31 +- .../source/opt/dominator_analysis.cpp | 2 +- .../spirv-tools/source/opt/dominator_tree.cpp | 9 +- .../opt/eliminate_dead_constant_pass.cpp | 8 +- .../opt/eliminate_dead_functions_util.cpp | 4 +- .../eliminate_dead_input_components_pass.cpp | 189 -- .../opt/eliminate_dead_io_components_pass.cpp | 258 +++ ....h => eliminate_dead_io_components_pass.h} | 22 +- .../opt/eliminate_dead_members_pass.cpp | 236 +-- .../opt/eliminate_dead_output_stores_pass.cpp | 237 +++ .../opt/eliminate_dead_output_stores_pass.h | 87 + .../source/opt/feature_manager.cpp | 14 +- .../spirv-tools/source/opt/feature_manager.h | 6 +- .../source/opt/fix_func_call_arguments.cpp | 9 +- .../source/opt/fix_storage_class.cpp | 110 +- .../source/opt/fix_storage_class.h | 8 +- .../source/opt/flatten_decoration_pass.cpp | 18 +- 3rdparty/spirv-tools/source/opt/fold.cpp | 207 +-- 3rdparty/spirv-tools/source/opt/fold.h | 14 +- ...ld_spec_constant_op_and_composite_pass.cpp | 34 +- .../spirv-tools/source/opt/folding_rules.cpp | 637 +++---- .../spirv-tools/source/opt/folding_rules.h | 10 +- .../opt/freeze_spec_constant_value_pass.cpp | 18 +- 3rdparty/spirv-tools/source/opt/function.cpp | 2 +- 3rdparty/spirv-tools/source/opt/function.h | 2 +- .../opt/graphics_robust_access_pass.cpp | 88 +- .../source/opt/graphics_robust_access_pass.h | 2 +- .../spirv-tools/source/opt/if_conversion.cpp | 33 +- .../source/opt/inline_opaque_pass.cpp | 16 +- .../spirv-tools/source/opt/inline_pass.cpp | 82 +- 3rdparty/spirv-tools/source/opt/inline_pass.h | 2 +- .../source/opt/inst_bindless_check_pass.cpp | 287 ++-- .../source/opt/inst_buff_addr_check_pass.cpp | 175 +- .../source/opt/inst_debug_printf_pass.cpp | 35 +- .../spirv-tools/source/opt/instruction.cpp | 462 ++--- 3rdparty/spirv-tools/source/opt/instruction.h | 32 +- .../source/opt/instrument_pass.cpp | 305 ++-- .../spirv-tools/source/opt/instrument_pass.h | 9 +- .../source/opt/interface_var_sroa.cpp | 178 +- .../source/opt/interface_var_sroa.h | 8 +- .../source/opt/interp_fixup_pass.cpp | 11 +- 3rdparty/spirv-tools/source/opt/ir_builder.h | 78 +- .../spirv-tools/source/opt/ir_context.cpp | 612 +++---- 3rdparty/spirv-tools/source/opt/ir_context.h | 81 +- 3rdparty/spirv-tools/source/opt/ir_loader.cpp | 54 +- 3rdparty/spirv-tools/source/opt/licm_pass.cpp | 4 +- 3rdparty/spirv-tools/source/opt/liveness.cpp | 332 ++++ 3rdparty/spirv-tools/source/opt/liveness.h | 99 ++ .../opt/local_access_chain_convert_pass.cpp | 57 +- .../opt/local_access_chain_convert_pass.h | 2 +- .../opt/local_single_block_elim_pass.cpp | 33 +- .../opt/local_single_store_elim_pass.cpp | 53 +- .../source/opt/loop_dependence.cpp | 11 +- .../source/opt/loop_dependence_helpers.cpp | 36 +- .../source/opt/loop_descriptor.cpp | 86 +- .../spirv-tools/source/opt/loop_descriptor.h | 8 +- .../spirv-tools/source/opt/loop_fission.cpp | 32 +- .../spirv-tools/source/opt/loop_fusion.cpp | 37 +- .../spirv-tools/source/opt/loop_peeling.cpp | 84 +- .../spirv-tools/source/opt/loop_unroller.cpp | 23 +- .../source/opt/loop_unswitch_pass.cpp | 34 +- .../spirv-tools/source/opt/loop_utils.cpp | 21 +- 3rdparty/spirv-tools/source/opt/mem_pass.cpp | 102 +- 3rdparty/spirv-tools/source/opt/mem_pass.h | 6 +- .../source/opt/merge_return_pass.cpp | 113 +- 3rdparty/spirv-tools/source/opt/module.cpp | 23 +- 3rdparty/spirv-tools/source/opt/module.h | 4 +- 3rdparty/spirv-tools/source/opt/optimizer.cpp | 42 +- 3rdparty/spirv-tools/source/opt/pass.cpp | 13 +- 3rdparty/spirv-tools/source/opt/passes.h | 4 +- .../source/opt/private_to_local_pass.cpp | 41 +- .../spirv-tools/source/opt/propagator.cpp | 4 +- 3rdparty/spirv-tools/source/opt/propagator.h | 4 +- .../source/opt/reduce_load_size.cpp | 33 +- 3rdparty/spirv-tools/source/opt/reflect.h | 62 +- .../source/opt/register_pressure.cpp | 23 +- .../source/opt/relax_float_ops_pass.cpp | 140 +- .../source/opt/relax_float_ops_pass.h | 12 +- .../source/opt/remove_dontinline_pass.cpp | 5 +- .../source/opt/remove_duplicates_pass.cpp | 9 +- ...remove_unused_interface_variables_pass.cpp | 13 +- ...lace_desc_array_access_using_var_index.cpp | 49 +- .../source/opt/replace_invalid_opc.cpp | 81 +- .../source/opt/replace_invalid_opc.h | 8 +- .../source/opt/scalar_analysis.cpp | 30 +- .../source/opt/scalar_replacement_pass.cpp | 242 +-- .../source/opt/scalar_replacement_pass.h | 10 +- .../set_spec_constant_default_value_pass.cpp | 35 +- .../source/opt/simplification_pass.cpp | 16 +- .../source/opt/spread_volatile_semantics.cpp | 99 +- .../source/opt/spread_volatile_semantics.h | 5 +- .../source/opt/ssa_rewrite_pass.cpp | 17 +- .../source/opt/strength_reduction_pass.cpp | 20 +- .../source/opt/strip_debug_info_pass.cpp | 7 +- .../opt/strip_nonsemantic_info_pass.cpp | 26 +- .../source/opt/struct_cfg_analysis.cpp | 17 +- .../spirv-tools/source/opt/type_manager.cpp | 159 +- .../spirv-tools/source/opt/type_manager.h | 21 +- 3rdparty/spirv-tools/source/opt/types.cpp | 21 +- 3rdparty/spirv-tools/source/opt/types.h | 40 +- .../source/opt/unify_const_pass.cpp | 19 +- .../source/opt/upgrade_memory_model.cpp | 210 +-- .../source/opt/upgrade_memory_model.h | 8 +- .../source/opt/value_number_table.cpp | 12 +- .../spirv-tools/source/opt/vector_dce.cpp | 20 +- .../spirv-tools/source/opt/workaround1209.cpp | 4 +- .../spirv-tools/source/opt/wrap_opkill.cpp | 28 +- 3rdparty/spirv-tools/source/opt/wrap_opkill.h | 2 +- ..._conditional_branch_opportunity_finder.cpp | 4 +- .../merge_blocks_reduction_opportunity.cpp | 2 +- ..._to_const_reduction_opportunity_finder.cpp | 2 +- ..._to_undef_reduction_opportunity_finder.cpp | 6 +- .../source/reduce/reduction_util.cpp | 20 +- ...selection_reduction_opportunity_finder.cpp | 4 +- ...ve_struct_member_reduction_opportunity.cpp | 28 +- ...struction_reduction_opportunity_finder.cpp | 28 +- ...ct_member_reduction_opportunity_finder.cpp | 26 +- ...al_branch_to_branch_opportunity_finder.cpp | 6 +- ...branch_to_branch_reduction_opportunity.cpp | 5 +- ...nstruct_to_block_reduction_opportunity.cpp | 2 +- ...oop_to_selection_reduction_opportunity.cpp | 23 +- 3rdparty/spirv-tools/source/table.h | 8 +- 3rdparty/spirv-tools/source/text.cpp | 17 +- 3rdparty/spirv-tools/source/text_handler.cpp | 4 +- 3rdparty/spirv-tools/source/util/hex_float.h | 75 +- 3rdparty/spirv-tools/source/val/construct.cpp | 24 +- 3rdparty/spirv-tools/source/val/decoration.h | 12 +- 3rdparty/spirv-tools/source/val/function.cpp | 8 +- 3rdparty/spirv-tools/source/val/function.h | 16 +- 3rdparty/spirv-tools/source/val/instruction.h | 6 +- 3rdparty/spirv-tools/source/val/validate.cpp | 40 +- 3rdparty/spirv-tools/source/val/validate.h | 7 +- .../source/val/validate_adjacency.cpp | 31 +- .../source/val/validate_annotation.cpp | 296 ++-- .../source/val/validate_arithmetics.cpp | 68 +- .../source/val/validate_atomics.cpp | 197 +-- .../source/val/validate_barriers.cpp | 26 +- .../source/val/validate_bitwise.cpp | 30 +- .../source/val/validate_builtins.cpp | 1088 ++++++------ .../source/val/validate_capability.cpp | 278 +-- .../spirv-tools/source/val/validate_cfg.cpp | 147 +- .../source/val/validate_composites.cpp | 90 +- .../source/val/validate_constants.cpp | 122 +- .../source/val/validate_conversion.cpp | 109 +- .../spirv-tools/source/val/validate_debug.cpp | 8 +- .../source/val/validate_decorations.cpp | 501 +++--- .../source/val/validate_derivatives.cpp | 35 +- .../val/validate_execution_limitations.cpp | 2 +- .../source/val/validate_extensions.cpp | 562 ++++-- .../source/val/validate_function.cpp | 105 +- .../spirv-tools/source/val/validate_id.cpp | 30 +- .../spirv-tools/source/val/validate_image.cpp | 697 ++++---- .../source/val/validate_instruction.cpp | 99 +- .../source/val/validate_interfaces.cpp | 120 +- .../source/val/validate_layout.cpp | 27 +- .../source/val/validate_logicals.cpp | 106 +- .../source/val/validate_memory.cpp | 659 +++---- .../source/val/validate_memory_semantics.cpp | 124 +- .../source/val/validate_mesh_shading.cpp | 22 +- .../spirv-tools/source/val/validate_misc.cpp | 41 +- .../source/val/validate_mode_setting.cpp | 452 ++--- .../source/val/validate_non_uniform.cpp | 14 +- .../source/val/validate_primitives.cpp | 18 +- .../source/val/validate_ray_query.cpp | 73 +- .../source/val/validate_ray_tracing.cpp | 52 +- .../val/validate_ray_tracing_reorder.cpp | 625 +++++++ .../source/val/validate_scopes.cpp | 149 +- .../source/val/validate_small_type_uses.cpp | 16 +- .../spirv-tools/source/val/validate_type.cpp | 116 +- .../source/val/validation_state.cpp | 501 +++--- .../spirv-tools/source/val/validation_state.h | 58 +- 232 files changed, 12089 insertions(+), 9369 deletions(-) create mode 100644 3rdparty/spirv-tools/source/opt/analyze_live_input_pass.cpp create mode 100644 3rdparty/spirv-tools/source/opt/analyze_live_input_pass.h delete mode 100644 3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp create mode 100644 3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp rename 3rdparty/spirv-tools/source/opt/{eliminate_dead_input_components_pass.h => eliminate_dead_io_components_pass.h} (69%) create mode 100644 3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp create mode 100644 3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h create mode 100644 3rdparty/spirv-tools/source/opt/liveness.cpp create mode 100644 3rdparty/spirv-tools/source/opt/liveness.h create mode 100644 3rdparty/spirv-tools/source/val/validate_ray_tracing_reorder.cpp diff --git a/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/spirv-tools/include/generated/build-version.inc index af6113d9f..d0561b53c 100644 --- a/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2022.5-dev", "SPIRV-Tools v2022.5-dev 01f246880b501c751d62ad543d886e08bfa756b5" +"v2022.5-dev", "SPIRV-Tools v2022.5-dev 466c6a4e95f6c2ebd61040d6fe2f6418e45b7e20" diff --git a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc index 88d806909..1a45cbba5 100644 --- a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc @@ -1,79 +1,81 @@ -static const SpvCapability pygen_variable_caps_Addresses[] = {SpvCapabilityAddresses}; -static const SpvCapability pygen_variable_caps_AddressesPhysicalStorageBufferAddresses[] = {SpvCapabilityAddresses, SpvCapabilityPhysicalStorageBufferAddresses}; -static const SpvCapability pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer[] = {SpvCapabilityAddresses, SpvCapabilityVariablePointers, SpvCapabilityVariablePointersStorageBuffer}; -static const SpvCapability pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBufferPhysicalStorageBufferAddresses[] = {SpvCapabilityAddresses, SpvCapabilityVariablePointers, SpvCapabilityVariablePointersStorageBuffer, SpvCapabilityPhysicalStorageBufferAddresses}; -static const SpvCapability pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL[] = {SpvCapabilityArbitraryPrecisionFixedPointINTEL}; -static const SpvCapability pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL[] = {SpvCapabilityArbitraryPrecisionFloatingPointINTEL}; -static const SpvCapability pygen_variable_caps_AsmINTEL[] = {SpvCapabilityAsmINTEL}; -static const SpvCapability pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXT[] = {SpvCapabilityAtomicFloat16AddEXT, SpvCapabilityAtomicFloat32AddEXT, SpvCapabilityAtomicFloat64AddEXT}; -static const SpvCapability pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT[] = {SpvCapabilityAtomicFloat16MinMaxEXT, SpvCapabilityAtomicFloat32MinMaxEXT, SpvCapabilityAtomicFloat64MinMaxEXT}; -static const SpvCapability pygen_variable_caps_BindlessTextureNV[] = {SpvCapabilityBindlessTextureNV}; -static const SpvCapability pygen_variable_caps_BlockingPipesINTEL[] = {SpvCapabilityBlockingPipesINTEL}; -static const SpvCapability pygen_variable_caps_CooperativeMatrixNV[] = {SpvCapabilityCooperativeMatrixNV}; -static const SpvCapability pygen_variable_caps_DemoteToHelperInvocation[] = {SpvCapabilityDemoteToHelperInvocation}; -static const SpvCapability pygen_variable_caps_DemoteToHelperInvocationEXT[] = {SpvCapabilityDemoteToHelperInvocationEXT}; -static const SpvCapability pygen_variable_caps_DerivativeControl[] = {SpvCapabilityDerivativeControl}; -static const SpvCapability pygen_variable_caps_DeviceEnqueue[] = {SpvCapabilityDeviceEnqueue}; -static const SpvCapability pygen_variable_caps_DotProduct[] = {SpvCapabilityDotProduct}; -static const SpvCapability pygen_variable_caps_DotProductKHR[] = {SpvCapabilityDotProductKHR}; -static const SpvCapability pygen_variable_caps_ExpectAssumeKHR[] = {SpvCapabilityExpectAssumeKHR}; -static const SpvCapability pygen_variable_caps_FPGARegINTEL[] = {SpvCapabilityFPGARegINTEL}; -static const SpvCapability pygen_variable_caps_FragmentMaskAMD[] = {SpvCapabilityFragmentMaskAMD}; -static const SpvCapability pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT[] = {SpvCapabilityFragmentShaderSampleInterlockEXT, SpvCapabilityFragmentShaderPixelInterlockEXT, SpvCapabilityFragmentShaderShadingRateInterlockEXT}; -static const SpvCapability pygen_variable_caps_FunctionPointersINTEL[] = {SpvCapabilityFunctionPointersINTEL}; -static const SpvCapability pygen_variable_caps_Geometry[] = {SpvCapabilityGeometry}; -static const SpvCapability pygen_variable_caps_GeometryStreams[] = {SpvCapabilityGeometryStreams}; -static const SpvCapability pygen_variable_caps_GroupNonUniform[] = {SpvCapabilityGroupNonUniform}; -static const SpvCapability pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV[] = {SpvCapabilityGroupNonUniformArithmetic, SpvCapabilityGroupNonUniformClustered, SpvCapabilityGroupNonUniformPartitionedNV}; -static const SpvCapability pygen_variable_caps_GroupNonUniformBallot[] = {SpvCapabilityGroupNonUniformBallot}; -static const SpvCapability pygen_variable_caps_GroupNonUniformPartitionedNV[] = {SpvCapabilityGroupNonUniformPartitionedNV}; -static const SpvCapability pygen_variable_caps_GroupNonUniformQuad[] = {SpvCapabilityGroupNonUniformQuad}; -static const SpvCapability pygen_variable_caps_GroupNonUniformRotateKHR[] = {SpvCapabilityGroupNonUniformRotateKHR}; -static const SpvCapability pygen_variable_caps_GroupNonUniformShuffle[] = {SpvCapabilityGroupNonUniformShuffle}; -static const SpvCapability pygen_variable_caps_GroupNonUniformShuffleRelative[] = {SpvCapabilityGroupNonUniformShuffleRelative}; -static const SpvCapability pygen_variable_caps_GroupNonUniformVote[] = {SpvCapabilityGroupNonUniformVote}; -static const SpvCapability pygen_variable_caps_GroupUniformArithmeticKHR[] = {SpvCapabilityGroupUniformArithmeticKHR}; -static const SpvCapability pygen_variable_caps_Groups[] = {SpvCapabilityGroups}; -static const SpvCapability pygen_variable_caps_ImageFootprintNV[] = {SpvCapabilityImageFootprintNV}; -static const SpvCapability pygen_variable_caps_ImageQuery[] = {SpvCapabilityImageQuery}; -static const SpvCapability pygen_variable_caps_IntegerFunctions2INTEL[] = {SpvCapabilityIntegerFunctions2INTEL}; -static const SpvCapability pygen_variable_caps_Kernel[] = {SpvCapabilityKernel}; -static const SpvCapability pygen_variable_caps_KernelImageQuery[] = {SpvCapabilityKernel, SpvCapabilityImageQuery}; -static const SpvCapability pygen_variable_caps_LiteralSampler[] = {SpvCapabilityLiteralSampler}; -static const SpvCapability pygen_variable_caps_LongConstantCompositeINTEL[] = {SpvCapabilityLongConstantCompositeINTEL}; -static const SpvCapability pygen_variable_caps_Matrix[] = {SpvCapabilityMatrix}; -static const SpvCapability pygen_variable_caps_MemoryAccessAliasingINTEL[] = {SpvCapabilityMemoryAccessAliasingINTEL}; -static const SpvCapability pygen_variable_caps_MeshShadingEXT[] = {SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_MeshShadingNV[] = {SpvCapabilityMeshShadingNV}; -static const SpvCapability pygen_variable_caps_NamedBarrier[] = {SpvCapabilityNamedBarrier}; -static const SpvCapability pygen_variable_caps_PipeStorage[] = {SpvCapabilityPipeStorage}; -static const SpvCapability pygen_variable_caps_Pipes[] = {SpvCapabilityPipes}; -static const SpvCapability pygen_variable_caps_RayQueryKHR[] = {SpvCapabilityRayQueryKHR}; -static const SpvCapability pygen_variable_caps_RayTracingKHR[] = {SpvCapabilityRayTracingKHR}; -static const SpvCapability pygen_variable_caps_RayTracingKHRRayQueryKHR[] = {SpvCapabilityRayTracingKHR, SpvCapabilityRayQueryKHR}; -static const SpvCapability pygen_variable_caps_RayTracingMotionBlurNV[] = {SpvCapabilityRayTracingMotionBlurNV}; -static const SpvCapability pygen_variable_caps_RayTracingNV[] = {SpvCapabilityRayTracingNV}; -static const SpvCapability pygen_variable_caps_RayTracingNVRayTracingKHR[] = {SpvCapabilityRayTracingNV, SpvCapabilityRayTracingKHR}; -static const SpvCapability pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR[] = {SpvCapabilityRayTracingNV, SpvCapabilityRayTracingKHR, SpvCapabilityRayQueryKHR}; -static const SpvCapability pygen_variable_caps_Shader[] = {SpvCapabilityShader}; -static const SpvCapability pygen_variable_caps_ShaderBitInstructions[] = {SpvCapabilityShader, SpvCapabilityBitInstructions}; -static const SpvCapability pygen_variable_caps_ShaderClockKHR[] = {SpvCapabilityShaderClockKHR}; -static const SpvCapability pygen_variable_caps_SparseResidency[] = {SpvCapabilitySparseResidency}; -static const SpvCapability pygen_variable_caps_SplitBarrierINTEL[] = {SpvCapabilitySplitBarrierINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupAvcMotionEstimationINTEL[] = {SpvCapabilitySubgroupAvcMotionEstimationINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL[] = {SpvCapabilitySubgroupAvcMotionEstimationINTEL, SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL[] = {SpvCapabilitySubgroupAvcMotionEstimationINTEL, SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupBallotKHR[] = {SpvCapabilitySubgroupBallotKHR}; -static const SpvCapability pygen_variable_caps_SubgroupBufferBlockIOINTEL[] = {SpvCapabilitySubgroupBufferBlockIOINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupDispatch[] = {SpvCapabilitySubgroupDispatch}; -static const SpvCapability pygen_variable_caps_SubgroupImageBlockIOINTEL[] = {SpvCapabilitySubgroupImageBlockIOINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupImageMediaBlockIOINTEL[] = {SpvCapabilitySubgroupImageMediaBlockIOINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupShuffleINTEL[] = {SpvCapabilitySubgroupShuffleINTEL}; -static const SpvCapability pygen_variable_caps_SubgroupVoteKHR[] = {SpvCapabilitySubgroupVoteKHR}; -static const SpvCapability pygen_variable_caps_USMStorageClassesINTEL[] = {SpvCapabilityUSMStorageClassesINTEL}; -static const SpvCapability pygen_variable_caps_UnstructuredLoopControlsINTEL[] = {SpvCapabilityUnstructuredLoopControlsINTEL}; -static const SpvCapability pygen_variable_caps_VariableLengthArrayINTEL[] = {SpvCapabilityVariableLengthArrayINTEL}; -static const SpvCapability pygen_variable_caps_VectorComputeINTEL[] = {SpvCapabilityVectorComputeINTEL}; +static const spv::Capability pygen_variable_caps_Addresses[] = {spv::Capability::Addresses}; +static const spv::Capability pygen_variable_caps_AddressesPhysicalStorageBufferAddresses[] = {spv::Capability::Addresses, spv::Capability::PhysicalStorageBufferAddresses}; +static const spv::Capability pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer[] = {spv::Capability::Addresses, spv::Capability::VariablePointers, spv::Capability::VariablePointersStorageBuffer}; +static const spv::Capability pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBufferPhysicalStorageBufferAddresses[] = {spv::Capability::Addresses, spv::Capability::VariablePointers, spv::Capability::VariablePointersStorageBuffer, spv::Capability::PhysicalStorageBufferAddresses}; +static const spv::Capability pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL[] = {spv::Capability::ArbitraryPrecisionFixedPointINTEL}; +static const spv::Capability pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL[] = {spv::Capability::ArbitraryPrecisionFloatingPointINTEL}; +static const spv::Capability pygen_variable_caps_AsmINTEL[] = {spv::Capability::AsmINTEL}; +static const spv::Capability pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXT[] = {spv::Capability::AtomicFloat16AddEXT, spv::Capability::AtomicFloat32AddEXT, spv::Capability::AtomicFloat64AddEXT}; +static const spv::Capability pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT[] = {spv::Capability::AtomicFloat16MinMaxEXT, spv::Capability::AtomicFloat32MinMaxEXT, spv::Capability::AtomicFloat64MinMaxEXT}; +static const spv::Capability pygen_variable_caps_BindlessTextureNV[] = {spv::Capability::BindlessTextureNV}; +static const spv::Capability pygen_variable_caps_BlockingPipesINTEL[] = {spv::Capability::BlockingPipesINTEL}; +static const spv::Capability pygen_variable_caps_CooperativeMatrixNV[] = {spv::Capability::CooperativeMatrixNV}; +static const spv::Capability pygen_variable_caps_DemoteToHelperInvocation[] = {spv::Capability::DemoteToHelperInvocation}; +static const spv::Capability pygen_variable_caps_DemoteToHelperInvocationEXT[] = {spv::Capability::DemoteToHelperInvocationEXT}; +static const spv::Capability pygen_variable_caps_DerivativeControl[] = {spv::Capability::DerivativeControl}; +static const spv::Capability pygen_variable_caps_DeviceEnqueue[] = {spv::Capability::DeviceEnqueue}; +static const spv::Capability pygen_variable_caps_DotProduct[] = {spv::Capability::DotProduct}; +static const spv::Capability pygen_variable_caps_DotProductKHR[] = {spv::Capability::DotProductKHR}; +static const spv::Capability pygen_variable_caps_ExpectAssumeKHR[] = {spv::Capability::ExpectAssumeKHR}; +static const spv::Capability pygen_variable_caps_FPGARegINTEL[] = {spv::Capability::FPGARegINTEL}; +static const spv::Capability pygen_variable_caps_FragmentMaskAMD[] = {spv::Capability::FragmentMaskAMD}; +static const spv::Capability pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT[] = {spv::Capability::FragmentShaderSampleInterlockEXT, spv::Capability::FragmentShaderPixelInterlockEXT, spv::Capability::FragmentShaderShadingRateInterlockEXT}; +static const spv::Capability pygen_variable_caps_FunctionPointersINTEL[] = {spv::Capability::FunctionPointersINTEL}; +static const spv::Capability pygen_variable_caps_Geometry[] = {spv::Capability::Geometry}; +static const spv::Capability pygen_variable_caps_GeometryStreams[] = {spv::Capability::GeometryStreams}; +static const spv::Capability pygen_variable_caps_GroupNonUniform[] = {spv::Capability::GroupNonUniform}; +static const spv::Capability pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV[] = {spv::Capability::GroupNonUniformArithmetic, spv::Capability::GroupNonUniformClustered, spv::Capability::GroupNonUniformPartitionedNV}; +static const spv::Capability pygen_variable_caps_GroupNonUniformBallot[] = {spv::Capability::GroupNonUniformBallot}; +static const spv::Capability pygen_variable_caps_GroupNonUniformPartitionedNV[] = {spv::Capability::GroupNonUniformPartitionedNV}; +static const spv::Capability pygen_variable_caps_GroupNonUniformQuad[] = {spv::Capability::GroupNonUniformQuad}; +static const spv::Capability pygen_variable_caps_GroupNonUniformRotateKHR[] = {spv::Capability::GroupNonUniformRotateKHR}; +static const spv::Capability pygen_variable_caps_GroupNonUniformShuffle[] = {spv::Capability::GroupNonUniformShuffle}; +static const spv::Capability pygen_variable_caps_GroupNonUniformShuffleRelative[] = {spv::Capability::GroupNonUniformShuffleRelative}; +static const spv::Capability pygen_variable_caps_GroupNonUniformVote[] = {spv::Capability::GroupNonUniformVote}; +static const spv::Capability pygen_variable_caps_GroupUniformArithmeticKHR[] = {spv::Capability::GroupUniformArithmeticKHR}; +static const spv::Capability pygen_variable_caps_Groups[] = {spv::Capability::Groups}; +static const spv::Capability pygen_variable_caps_ImageFootprintNV[] = {spv::Capability::ImageFootprintNV}; +static const spv::Capability pygen_variable_caps_ImageQuery[] = {spv::Capability::ImageQuery}; +static const spv::Capability pygen_variable_caps_IntegerFunctions2INTEL[] = {spv::Capability::IntegerFunctions2INTEL}; +static const spv::Capability pygen_variable_caps_Kernel[] = {spv::Capability::Kernel}; +static const spv::Capability pygen_variable_caps_KernelImageQuery[] = {spv::Capability::Kernel, spv::Capability::ImageQuery}; +static const spv::Capability pygen_variable_caps_LiteralSampler[] = {spv::Capability::LiteralSampler}; +static const spv::Capability pygen_variable_caps_LongConstantCompositeINTEL[] = {spv::Capability::LongConstantCompositeINTEL}; +static const spv::Capability pygen_variable_caps_Matrix[] = {spv::Capability::Matrix}; +static const spv::Capability pygen_variable_caps_MemoryAccessAliasingINTEL[] = {spv::Capability::MemoryAccessAliasingINTEL}; +static const spv::Capability pygen_variable_caps_MeshShadingEXT[] = {spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_MeshShadingNV[] = {spv::Capability::MeshShadingNV}; +static const spv::Capability pygen_variable_caps_NamedBarrier[] = {spv::Capability::NamedBarrier}; +static const spv::Capability pygen_variable_caps_PipeStorage[] = {spv::Capability::PipeStorage}; +static const spv::Capability pygen_variable_caps_Pipes[] = {spv::Capability::Pipes}; +static const spv::Capability pygen_variable_caps_RayQueryKHR[] = {spv::Capability::RayQueryKHR}; +static const spv::Capability pygen_variable_caps_RayTracingKHR[] = {spv::Capability::RayTracingKHR}; +static const spv::Capability pygen_variable_caps_RayTracingKHRRayQueryKHR[] = {spv::Capability::RayTracingKHR, spv::Capability::RayQueryKHR}; +static const spv::Capability pygen_variable_caps_RayTracingMotionBlurNV[] = {spv::Capability::RayTracingMotionBlurNV}; +static const spv::Capability pygen_variable_caps_RayTracingNV[] = {spv::Capability::RayTracingNV}; +static const spv::Capability pygen_variable_caps_RayTracingNVRayTracingKHR[] = {spv::Capability::RayTracingNV, spv::Capability::RayTracingKHR}; +static const spv::Capability pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR[] = {spv::Capability::RayTracingNV, spv::Capability::RayTracingKHR, spv::Capability::RayQueryKHR}; +static const spv::Capability pygen_variable_caps_Shader[] = {spv::Capability::Shader}; +static const spv::Capability pygen_variable_caps_ShaderBitInstructions[] = {spv::Capability::Shader, spv::Capability::BitInstructions}; +static const spv::Capability pygen_variable_caps_ShaderClockKHR[] = {spv::Capability::ShaderClockKHR}; +static const spv::Capability pygen_variable_caps_ShaderInvocationReorderNV[] = {spv::Capability::ShaderInvocationReorderNV}; +static const spv::Capability pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV[] = {spv::Capability::ShaderInvocationReorderNV, spv::Capability::RayTracingMotionBlurNV}; +static const spv::Capability pygen_variable_caps_SparseResidency[] = {spv::Capability::SparseResidency}; +static const spv::Capability pygen_variable_caps_SplitBarrierINTEL[] = {spv::Capability::SplitBarrierINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupAvcMotionEstimationINTEL[] = {spv::Capability::SubgroupAvcMotionEstimationINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL[] = {spv::Capability::SubgroupAvcMotionEstimationINTEL, spv::Capability::SubgroupAvcMotionEstimationChromaINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL[] = {spv::Capability::SubgroupAvcMotionEstimationINTEL, spv::Capability::SubgroupAvcMotionEstimationIntraINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupBallotKHR[] = {spv::Capability::SubgroupBallotKHR}; +static const spv::Capability pygen_variable_caps_SubgroupBufferBlockIOINTEL[] = {spv::Capability::SubgroupBufferBlockIOINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupDispatch[] = {spv::Capability::SubgroupDispatch}; +static const spv::Capability pygen_variable_caps_SubgroupImageBlockIOINTEL[] = {spv::Capability::SubgroupImageBlockIOINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupImageMediaBlockIOINTEL[] = {spv::Capability::SubgroupImageMediaBlockIOINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupShuffleINTEL[] = {spv::Capability::SubgroupShuffleINTEL}; +static const spv::Capability pygen_variable_caps_SubgroupVoteKHR[] = {spv::Capability::SubgroupVoteKHR}; +static const spv::Capability pygen_variable_caps_USMStorageClassesINTEL[] = {spv::Capability::USMStorageClassesINTEL}; +static const spv::Capability pygen_variable_caps_UnstructuredLoopControlsINTEL[] = {spv::Capability::UnstructuredLoopControlsINTEL}; +static const spv::Capability pygen_variable_caps_VariableLengthArrayINTEL[] = {spv::Capability::VariableLengthArrayINTEL}; +static const spv::Capability pygen_variable_caps_VectorComputeINTEL[] = {spv::Capability::VectorComputeINTEL}; static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_ballot[] = {spvtools::Extension::kSPV_AMD_shader_ballot}; static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_fragment_mask[] = {spvtools::Extension::kSPV_AMD_shader_fragment_mask}; @@ -106,674 +108,707 @@ static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_image_footpri static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_subgroup_partitioned[] = {spvtools::Extension::kSPV_NV_shader_subgroup_partitioned}; static const spv_opcode_desc_t kOpcodeTableEntries[] = { - {"Nop", SpvOpNop, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Undef", SpvOpUndef, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SourceContinued", SpvOpSourceContinued, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Source", SpvOpSource, 0, nullptr, 4, {SPV_OPERAND_TYPE_SOURCE_LANGUAGE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SourceExtension", SpvOpSourceExtension, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Name", SpvOpName, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"MemberName", SpvOpMemberName, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"String", SpvOpString, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Line", SpvOpLine, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Extension", SpvOpExtension, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ExtInstImport", SpvOpExtInstImport, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ExtInst", SpvOpExtInst, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"MemoryModel", SpvOpMemoryModel, 0, nullptr, 2, {SPV_OPERAND_TYPE_ADDRESSING_MODEL, SPV_OPERAND_TYPE_MEMORY_MODEL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"EntryPoint", SpvOpEntryPoint, 0, nullptr, 4, {SPV_OPERAND_TYPE_EXECUTION_MODEL, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ExecutionMode", SpvOpExecutionMode, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Capability", SpvOpCapability, 0, nullptr, 1, {SPV_OPERAND_TYPE_CAPABILITY}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeVoid", SpvOpTypeVoid, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeBool", SpvOpTypeBool, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeInt", SpvOpTypeInt, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeFloat", SpvOpTypeFloat, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeVector", SpvOpTypeVector, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeMatrix", SpvOpTypeMatrix, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeImage", SpvOpTypeImage, 0, nullptr, 9, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeSampler", SpvOpTypeSampler, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeSampledImage", SpvOpTypeSampledImage, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeArray", SpvOpTypeArray, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeRuntimeArray", SpvOpTypeRuntimeArray, 1, pygen_variable_caps_Shader, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeStruct", SpvOpTypeStruct, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeOpaque", SpvOpTypeOpaque, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypePointer", SpvOpTypePointer, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeFunction", SpvOpTypeFunction, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeEvent", SpvOpTypeEvent, 1, pygen_variable_caps_Kernel, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeDeviceEvent", SpvOpTypeDeviceEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeReserveId", SpvOpTypeReserveId, 1, pygen_variable_caps_Pipes, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeQueue", SpvOpTypeQueue, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypePipe", SpvOpTypePipe, 1, pygen_variable_caps_Pipes, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"TypeForwardPointer", SpvOpTypeForwardPointer, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConstantTrue", SpvOpConstantTrue, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConstantFalse", SpvOpConstantFalse, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Constant", SpvOpConstant, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConstantComposite", SpvOpConstantComposite, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConstantSampler", SpvOpConstantSampler, 1, pygen_variable_caps_LiteralSampler, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConstantNull", SpvOpConstantNull, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SpecConstantTrue", SpvOpSpecConstantTrue, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SpecConstantFalse", SpvOpSpecConstantFalse, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SpecConstant", SpvOpSpecConstant, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SpecConstantComposite", SpvOpSpecConstantComposite, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SpecConstantOp", SpvOpSpecConstantOp, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Function", SpvOpFunction, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_FUNCTION_CONTROL, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FunctionParameter", SpvOpFunctionParameter, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FunctionEnd", SpvOpFunctionEnd, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FunctionCall", SpvOpFunctionCall, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Variable", SpvOpVariable, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageTexelPointer", SpvOpImageTexelPointer, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Load", SpvOpLoad, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Store", SpvOpStore, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CopyMemory", SpvOpCopyMemory, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CopyMemorySized", SpvOpCopyMemorySized, 1, pygen_variable_caps_Addresses, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AccessChain", SpvOpAccessChain, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"InBoundsAccessChain", SpvOpInBoundsAccessChain, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"PtrAccessChain", SpvOpPtrAccessChain, 4, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBufferPhysicalStorageBufferAddresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ArrayLength", SpvOpArrayLength, 1, pygen_variable_caps_Shader, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GenericPtrMemSemantics", SpvOpGenericPtrMemSemantics, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"InBoundsPtrAccessChain", SpvOpInBoundsPtrAccessChain, 1, pygen_variable_caps_Addresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Decorate", SpvOpDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"MemberDecorate", SpvOpMemberDecorate, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"DecorationGroup", SpvOpDecorationGroup, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupDecorate", SpvOpGroupDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupMemberDecorate", SpvOpGroupMemberDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"VectorExtractDynamic", SpvOpVectorExtractDynamic, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"VectorInsertDynamic", SpvOpVectorInsertDynamic, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"VectorShuffle", SpvOpVectorShuffle, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CompositeConstruct", SpvOpCompositeConstruct, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CompositeExtract", SpvOpCompositeExtract, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CompositeInsert", SpvOpCompositeInsert, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CopyObject", SpvOpCopyObject, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Transpose", SpvOpTranspose, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SampledImage", SpvOpSampledImage, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleImplicitLod", SpvOpImageSampleImplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleExplicitLod", SpvOpImageSampleExplicitLod, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleDrefImplicitLod", SpvOpImageSampleDrefImplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleDrefExplicitLod", SpvOpImageSampleDrefExplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleProjImplicitLod", SpvOpImageSampleProjImplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleProjExplicitLod", SpvOpImageSampleProjExplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleProjDrefImplicitLod", SpvOpImageSampleProjDrefImplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSampleProjDrefExplicitLod", SpvOpImageSampleProjDrefExplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageFetch", SpvOpImageFetch, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageGather", SpvOpImageGather, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageDrefGather", SpvOpImageDrefGather, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageRead", SpvOpImageRead, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageWrite", SpvOpImageWrite, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Image", SpvOpImage, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageQueryFormat", SpvOpImageQueryFormat, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageQueryOrder", SpvOpImageQueryOrder, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageQuerySizeLod", SpvOpImageQuerySizeLod, 2, pygen_variable_caps_KernelImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageQuerySize", SpvOpImageQuerySize, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageQueryLod", SpvOpImageQueryLod, 1, pygen_variable_caps_ImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageQueryLevels", SpvOpImageQueryLevels, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageQuerySamples", SpvOpImageQuerySamples, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConvertFToU", SpvOpConvertFToU, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConvertFToS", SpvOpConvertFToS, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConvertSToF", SpvOpConvertSToF, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConvertUToF", SpvOpConvertUToF, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UConvert", SpvOpUConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SConvert", SpvOpSConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FConvert", SpvOpFConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"QuantizeToF16", SpvOpQuantizeToF16, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConvertPtrToU", SpvOpConvertPtrToU, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SatConvertSToU", SpvOpSatConvertSToU, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SatConvertUToS", SpvOpSatConvertUToS, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ConvertUToPtr", SpvOpConvertUToPtr, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"PtrCastToGeneric", SpvOpPtrCastToGeneric, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GenericCastToPtr", SpvOpGenericCastToPtr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GenericCastToPtrExplicit", SpvOpGenericCastToPtrExplicit, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Bitcast", SpvOpBitcast, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SNegate", SpvOpSNegate, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FNegate", SpvOpFNegate, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IAdd", SpvOpIAdd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FAdd", SpvOpFAdd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ISub", SpvOpISub, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FSub", SpvOpFSub, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IMul", SpvOpIMul, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FMul", SpvOpFMul, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UDiv", SpvOpUDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SDiv", SpvOpSDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FDiv", SpvOpFDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UMod", SpvOpUMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SRem", SpvOpSRem, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SMod", SpvOpSMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FRem", SpvOpFRem, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FMod", SpvOpFMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"VectorTimesScalar", SpvOpVectorTimesScalar, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"MatrixTimesScalar", SpvOpMatrixTimesScalar, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"VectorTimesMatrix", SpvOpVectorTimesMatrix, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"MatrixTimesVector", SpvOpMatrixTimesVector, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"MatrixTimesMatrix", SpvOpMatrixTimesMatrix, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"OuterProduct", SpvOpOuterProduct, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Dot", SpvOpDot, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IAddCarry", SpvOpIAddCarry, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ISubBorrow", SpvOpISubBorrow, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UMulExtended", SpvOpUMulExtended, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SMulExtended", SpvOpSMulExtended, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Any", SpvOpAny, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"All", SpvOpAll, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IsNan", SpvOpIsNan, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IsInf", SpvOpIsInf, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IsFinite", SpvOpIsFinite, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IsNormal", SpvOpIsNormal, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SignBitSet", SpvOpSignBitSet, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LessOrGreater", SpvOpLessOrGreater, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), SPV_SPIRV_VERSION_WORD(1,5)}, - {"Ordered", SpvOpOrdered, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Unordered", SpvOpUnordered, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LogicalEqual", SpvOpLogicalEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LogicalNotEqual", SpvOpLogicalNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LogicalOr", SpvOpLogicalOr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LogicalAnd", SpvOpLogicalAnd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LogicalNot", SpvOpLogicalNot, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Select", SpvOpSelect, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IEqual", SpvOpIEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"INotEqual", SpvOpINotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UGreaterThan", SpvOpUGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SGreaterThan", SpvOpSGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"UGreaterThanEqual", SpvOpUGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SGreaterThanEqual", SpvOpSGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ULessThan", SpvOpULessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SLessThan", SpvOpSLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ULessThanEqual", SpvOpULessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SLessThanEqual", SpvOpSLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FOrdEqual", SpvOpFOrdEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FUnordEqual", SpvOpFUnordEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FOrdNotEqual", SpvOpFOrdNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FUnordNotEqual", SpvOpFUnordNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FOrdLessThan", SpvOpFOrdLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FUnordLessThan", SpvOpFUnordLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FOrdGreaterThan", SpvOpFOrdGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FUnordGreaterThan", SpvOpFUnordGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FOrdLessThanEqual", SpvOpFOrdLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FUnordLessThanEqual", SpvOpFUnordLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FOrdGreaterThanEqual", SpvOpFOrdGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FUnordGreaterThanEqual", SpvOpFUnordGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ShiftRightLogical", SpvOpShiftRightLogical, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ShiftRightArithmetic", SpvOpShiftRightArithmetic, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ShiftLeftLogical", SpvOpShiftLeftLogical, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitwiseOr", SpvOpBitwiseOr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitwiseXor", SpvOpBitwiseXor, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitwiseAnd", SpvOpBitwiseAnd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Not", SpvOpNot, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitFieldInsert", SpvOpBitFieldInsert, 2, pygen_variable_caps_ShaderBitInstructions, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitFieldSExtract", SpvOpBitFieldSExtract, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitFieldUExtract", SpvOpBitFieldUExtract, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitReverse", SpvOpBitReverse, 2, pygen_variable_caps_ShaderBitInstructions, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BitCount", SpvOpBitCount, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"DPdx", SpvOpDPdx, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"DPdy", SpvOpDPdy, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Fwidth", SpvOpFwidth, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"DPdxFine", SpvOpDPdxFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"DPdyFine", SpvOpDPdyFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FwidthFine", SpvOpFwidthFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"DPdxCoarse", SpvOpDPdxCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"DPdyCoarse", SpvOpDPdyCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"FwidthCoarse", SpvOpFwidthCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"EmitVertex", SpvOpEmitVertex, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"EndPrimitive", SpvOpEndPrimitive, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"EmitStreamVertex", SpvOpEmitStreamVertex, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"EndStreamPrimitive", SpvOpEndStreamPrimitive, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ControlBarrier", SpvOpControlBarrier, 0, nullptr, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"MemoryBarrier", SpvOpMemoryBarrier, 0, nullptr, 2, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicLoad", SpvOpAtomicLoad, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicStore", SpvOpAtomicStore, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicExchange", SpvOpAtomicExchange, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicCompareExchange", SpvOpAtomicCompareExchange, 0, nullptr, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicCompareExchangeWeak", SpvOpAtomicCompareExchangeWeak, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), SPV_SPIRV_VERSION_WORD(1,3)}, - {"AtomicIIncrement", SpvOpAtomicIIncrement, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicIDecrement", SpvOpAtomicIDecrement, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicIAdd", SpvOpAtomicIAdd, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicISub", SpvOpAtomicISub, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicSMin", SpvOpAtomicSMin, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicUMin", SpvOpAtomicUMin, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicSMax", SpvOpAtomicSMax, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicUMax", SpvOpAtomicUMax, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicAnd", SpvOpAtomicAnd, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicOr", SpvOpAtomicOr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicXor", SpvOpAtomicXor, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Phi", SpvOpPhi, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LoopMerge", SpvOpLoopMerge, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LOOP_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SelectionMerge", SpvOpSelectionMerge, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SELECTION_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Label", SpvOpLabel, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Branch", SpvOpBranch, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BranchConditional", SpvOpBranchConditional, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Switch", SpvOpSwitch, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Kill", SpvOpKill, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Return", SpvOpReturn, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ReturnValue", SpvOpReturnValue, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Unreachable", SpvOpUnreachable, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LifetimeStart", SpvOpLifetimeStart, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"LifetimeStop", SpvOpLifetimeStop, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupAsyncCopy", SpvOpGroupAsyncCopy, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupWaitEvents", SpvOpGroupWaitEvents, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupAll", SpvOpGroupAll, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupAny", SpvOpGroupAny, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupBroadcast", SpvOpGroupBroadcast, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupIAdd", SpvOpGroupIAdd, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupFAdd", SpvOpGroupFAdd, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupFMin", SpvOpGroupFMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupUMin", SpvOpGroupUMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupSMin", SpvOpGroupSMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupFMax", SpvOpGroupFMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupUMax", SpvOpGroupUMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupSMax", SpvOpGroupSMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ReadPipe", SpvOpReadPipe, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"WritePipe", SpvOpWritePipe, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ReservedReadPipe", SpvOpReservedReadPipe, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ReservedWritePipe", SpvOpReservedWritePipe, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ReserveReadPipePackets", SpvOpReserveReadPipePackets, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ReserveWritePipePackets", SpvOpReserveWritePipePackets, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CommitReadPipe", SpvOpCommitReadPipe, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CommitWritePipe", SpvOpCommitWritePipe, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IsValidReserveId", SpvOpIsValidReserveId, 1, pygen_variable_caps_Pipes, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GetNumPipePackets", SpvOpGetNumPipePackets, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GetMaxPipePackets", SpvOpGetMaxPipePackets, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupReserveReadPipePackets", SpvOpGroupReserveReadPipePackets, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupReserveWritePipePackets", SpvOpGroupReserveWritePipePackets, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupCommitReadPipe", SpvOpGroupCommitReadPipe, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GroupCommitWritePipe", SpvOpGroupCommitWritePipe, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"EnqueueMarker", SpvOpEnqueueMarker, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"EnqueueKernel", SpvOpEnqueueKernel, 1, pygen_variable_caps_DeviceEnqueue, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GetKernelNDrangeSubGroupCount", SpvOpGetKernelNDrangeSubGroupCount, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GetKernelNDrangeMaxSubGroupSize", SpvOpGetKernelNDrangeMaxSubGroupSize, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GetKernelWorkGroupSize", SpvOpGetKernelWorkGroupSize, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GetKernelPreferredWorkGroupSizeMultiple", SpvOpGetKernelPreferredWorkGroupSizeMultiple, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"RetainEvent", SpvOpRetainEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ReleaseEvent", SpvOpReleaseEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CreateUserEvent", SpvOpCreateUserEvent, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"IsValidEvent", SpvOpIsValidEvent, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SetUserEventStatus", SpvOpSetUserEventStatus, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"CaptureEventProfilingInfo", SpvOpCaptureEventProfilingInfo, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"GetDefaultQueue", SpvOpGetDefaultQueue, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"BuildNDRange", SpvOpBuildNDRange, 1, pygen_variable_caps_DeviceEnqueue, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseSampleImplicitLod", SpvOpImageSparseSampleImplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseSampleExplicitLod", SpvOpImageSparseSampleExplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseSampleDrefImplicitLod", SpvOpImageSparseSampleDrefImplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseSampleDrefExplicitLod", SpvOpImageSparseSampleDrefExplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseSampleProjImplicitLod", SpvOpImageSparseSampleProjImplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseSampleProjExplicitLod", SpvOpImageSparseSampleProjExplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseSampleProjDrefImplicitLod", SpvOpImageSparseSampleProjDrefImplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseSampleProjDrefExplicitLod", SpvOpImageSparseSampleProjDrefExplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ImageSparseFetch", SpvOpImageSparseFetch, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseGather", SpvOpImageSparseGather, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseDrefGather", SpvOpImageSparseDrefGather, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseTexelsResident", SpvOpImageSparseTexelsResident, 1, pygen_variable_caps_SparseResidency, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"NoLine", SpvOpNoLine, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicFlagTestAndSet", SpvOpAtomicFlagTestAndSet, 1, pygen_variable_caps_Kernel, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"AtomicFlagClear", SpvOpAtomicFlagClear, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"ImageSparseRead", SpvOpImageSparseRead, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SizeOf", SpvOpSizeOf, 1, pygen_variable_caps_Addresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"TypePipeStorage", SpvOpTypePipeStorage, 1, pygen_variable_caps_PipeStorage, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"ConstantPipeStorage", SpvOpConstantPipeStorage, 1, pygen_variable_caps_PipeStorage, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"CreatePipeFromPipeStorage", SpvOpCreatePipeFromPipeStorage, 1, pygen_variable_caps_PipeStorage, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"GetKernelLocalSizeForSubgroupCount", SpvOpGetKernelLocalSizeForSubgroupCount, 1, pygen_variable_caps_SubgroupDispatch, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"GetKernelMaxNumSubgroups", SpvOpGetKernelMaxNumSubgroups, 1, pygen_variable_caps_SubgroupDispatch, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"TypeNamedBarrier", SpvOpTypeNamedBarrier, 1, pygen_variable_caps_NamedBarrier, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"NamedBarrierInitialize", SpvOpNamedBarrierInitialize, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"MemoryNamedBarrier", SpvOpMemoryNamedBarrier, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"ModuleProcessed", SpvOpModuleProcessed, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, - {"ExecutionModeId", SpvOpExecutionModeId, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"DecorateId", SpvOpDecorateId, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, - {"GroupNonUniformElect", SpvOpGroupNonUniformElect, 1, pygen_variable_caps_GroupNonUniform, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformAll", SpvOpGroupNonUniformAll, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformAny", SpvOpGroupNonUniformAny, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformAllEqual", SpvOpGroupNonUniformAllEqual, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBroadcast", SpvOpGroupNonUniformBroadcast, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBroadcastFirst", SpvOpGroupNonUniformBroadcastFirst, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallot", SpvOpGroupNonUniformBallot, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformInverseBallot", SpvOpGroupNonUniformInverseBallot, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotBitExtract", SpvOpGroupNonUniformBallotBitExtract, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotBitCount", SpvOpGroupNonUniformBallotBitCount, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotFindLSB", SpvOpGroupNonUniformBallotFindLSB, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBallotFindMSB", SpvOpGroupNonUniformBallotFindMSB, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffle", SpvOpGroupNonUniformShuffle, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffleXor", SpvOpGroupNonUniformShuffleXor, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffleUp", SpvOpGroupNonUniformShuffleUp, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformShuffleDown", SpvOpGroupNonUniformShuffleDown, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformIAdd", SpvOpGroupNonUniformIAdd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFAdd", SpvOpGroupNonUniformFAdd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformIMul", SpvOpGroupNonUniformIMul, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFMul", SpvOpGroupNonUniformFMul, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformSMin", SpvOpGroupNonUniformSMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformUMin", SpvOpGroupNonUniformUMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFMin", SpvOpGroupNonUniformFMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformSMax", SpvOpGroupNonUniformSMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformUMax", SpvOpGroupNonUniformUMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformFMax", SpvOpGroupNonUniformFMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBitwiseAnd", SpvOpGroupNonUniformBitwiseAnd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBitwiseOr", SpvOpGroupNonUniformBitwiseOr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformBitwiseXor", SpvOpGroupNonUniformBitwiseXor, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformLogicalAnd", SpvOpGroupNonUniformLogicalAnd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformLogicalOr", SpvOpGroupNonUniformLogicalOr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformLogicalXor", SpvOpGroupNonUniformLogicalXor, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformQuadBroadcast", SpvOpGroupNonUniformQuadBroadcast, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"GroupNonUniformQuadSwap", SpvOpGroupNonUniformQuadSwap, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, - {"CopyLogical", SpvOpCopyLogical, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PtrEqual", SpvOpPtrEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PtrNotEqual", SpvOpPtrNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"PtrDiff", SpvOpPtrDiff, 3, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"TerminateInvocation", SpvOpTerminateInvocation, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_terminate_invocation, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SubgroupBallotKHR", SpvOpSubgroupBallotKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"SubgroupFirstInvocationKHR", SpvOpSubgroupFirstInvocationKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"SubgroupAllKHR", SpvOpSubgroupAllKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, - {"SubgroupAnyKHR", SpvOpSubgroupAnyKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, - {"SubgroupAllEqualKHR", SpvOpSubgroupAllEqualKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, - {"GroupNonUniformRotateKHR", SpvOpGroupNonUniformRotateKHR, 1, pygen_variable_caps_GroupNonUniformRotateKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupReadInvocationKHR", SpvOpSubgroupReadInvocationKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"TraceRayKHR", SpvOpTraceRayKHR, 1, pygen_variable_caps_RayTracingKHR, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"ExecuteCallableKHR", SpvOpExecuteCallableKHR, 1, pygen_variable_caps_RayTracingKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"ConvertUToAccelerationStructureKHR", SpvOpConvertUToAccelerationStructureKHR, 2, pygen_variable_caps_RayTracingKHRRayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"IgnoreIntersectionKHR", SpvOpIgnoreIntersectionKHR, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TerminateRayKHR", SpvOpTerminateRayKHR, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"SDot", SpvOpSDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SDotKHR", SpvOpSDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDot", SpvOpUDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDotKHR", SpvOpUDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDot", SpvOpSUDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDotKHR", SpvOpSUDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SDotAccSat", SpvOpSDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SDotAccSatKHR", SpvOpSDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDotAccSat", SpvOpUDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"UDotAccSatKHR", SpvOpUDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDotAccSat", SpvOpSUDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"SUDotAccSatKHR", SpvOpSUDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"TypeRayQueryKHR", SpvOpTypeRayQueryKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryInitializeKHR", SpvOpRayQueryInitializeKHR, 1, pygen_variable_caps_RayQueryKHR, 8, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryTerminateKHR", SpvOpRayQueryTerminateKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGenerateIntersectionKHR", SpvOpRayQueryGenerateIntersectionKHR, 1, pygen_variable_caps_RayQueryKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryConfirmIntersectionKHR", SpvOpRayQueryConfirmIntersectionKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryProceedKHR", SpvOpRayQueryProceedKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionTypeKHR", SpvOpRayQueryGetIntersectionTypeKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"GroupIAddNonUniformAMD", SpvOpGroupIAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupFAddNonUniformAMD", SpvOpGroupFAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupFMinNonUniformAMD", SpvOpGroupFMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupUMinNonUniformAMD", SpvOpGroupUMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupSMinNonUniformAMD", SpvOpGroupSMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupFMaxNonUniformAMD", SpvOpGroupFMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupUMaxNonUniformAMD", SpvOpGroupUMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"GroupSMaxNonUniformAMD", SpvOpGroupSMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, - {"FragmentMaskFetchAMD", SpvOpFragmentMaskFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, - {"FragmentFetchAMD", SpvOpFragmentFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, - {"ReadClockKHR", SpvOpReadClockKHR, 1, pygen_variable_caps_ShaderClockKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_clock, 0xffffffffu, 0xffffffffu}, - {"ImageSampleFootprintNV", SpvOpImageSampleFootprintNV, 1, pygen_variable_caps_ImageFootprintNV, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_image_footprint, 0xffffffffu, 0xffffffffu}, - {"EmitMeshTasksEXT", SpvOpEmitMeshTasksEXT, 1, pygen_variable_caps_MeshShadingEXT, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SetMeshOutputsEXT", SpvOpSetMeshOutputsEXT, 1, pygen_variable_caps_MeshShadingEXT, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupNonUniformPartitionNV", SpvOpGroupNonUniformPartitionNV, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, 0xffffffffu, 0xffffffffu}, - {"WritePackedPrimitiveIndices4x8NV", SpvOpWritePackedPrimitiveIndices4x8NV, 1, pygen_variable_caps_MeshShadingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_mesh_shader, 0xffffffffu, 0xffffffffu}, - {"ReportIntersectionKHR", SpvOpReportIntersectionKHR, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"ReportIntersectionNV", SpvOpReportIntersectionNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"IgnoreIntersectionNV", SpvOpIgnoreIntersectionNV, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TerminateRayNV", SpvOpTerminateRayNV, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TraceNV", SpvOpTraceNV, 1, pygen_variable_caps_RayTracingNV, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TraceMotionNV", SpvOpTraceMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, - {"TraceRayMotionNV", SpvOpTraceRayMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, - {"TypeAccelerationStructureKHR", SpvOpTypeAccelerationStructureKHR, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"TypeAccelerationStructureNV", SpvOpTypeAccelerationStructureNV, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"ExecuteCallableNV", SpvOpExecuteCallableNV, 1, pygen_variable_caps_RayTracingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, - {"TypeCooperativeMatrixNV", SpvOpTypeCooperativeMatrixNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixLoadNV", SpvOpCooperativeMatrixLoadNV, 1, pygen_variable_caps_CooperativeMatrixNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixStoreNV", SpvOpCooperativeMatrixStoreNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixMulAddNV", SpvOpCooperativeMatrixMulAddNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"CooperativeMatrixLengthNV", SpvOpCooperativeMatrixLengthNV, 1, pygen_variable_caps_CooperativeMatrixNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, - {"BeginInvocationInterlockEXT", SpvOpBeginInvocationInterlockEXT, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, - {"EndInvocationInterlockEXT", SpvOpEndInvocationInterlockEXT, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, - {"DemoteToHelperInvocation", SpvOpDemoteToHelperInvocation, 1, pygen_variable_caps_DemoteToHelperInvocation, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"DemoteToHelperInvocationEXT", SpvOpDemoteToHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocationEXT, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, - {"IsHelperInvocationEXT", SpvOpIsHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocationEXT, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, 0xffffffffu, 0xffffffffu}, - {"ConvertUToImageNV", SpvOpConvertUToImageNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertUToSamplerNV", SpvOpConvertUToSamplerNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertImageToUNV", SpvOpConvertImageToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertSamplerToUNV", SpvOpConvertSamplerToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertUToSampledImageNV", SpvOpConvertUToSampledImageNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConvertSampledImageToUNV", SpvOpConvertSampledImageToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SamplerImageAddressingModeNV", SpvOpSamplerImageAddressingModeNV, 1, pygen_variable_caps_BindlessTextureNV, 1, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleINTEL", SpvOpSubgroupShuffleINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleDownINTEL", SpvOpSubgroupShuffleDownINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleUpINTEL", SpvOpSubgroupShuffleUpINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupShuffleXorINTEL", SpvOpSubgroupShuffleXorINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupBlockReadINTEL", SpvOpSubgroupBlockReadINTEL, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupBlockWriteINTEL", SpvOpSubgroupBlockWriteINTEL, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageBlockReadINTEL", SpvOpSubgroupImageBlockReadINTEL, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageBlockWriteINTEL", SpvOpSubgroupImageBlockWriteINTEL, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageMediaBlockReadINTEL", SpvOpSubgroupImageMediaBlockReadINTEL, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupImageMediaBlockWriteINTEL", SpvOpSubgroupImageMediaBlockWriteINTEL, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UCountLeadingZerosINTEL", SpvOpUCountLeadingZerosINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UCountTrailingZerosINTEL", SpvOpUCountTrailingZerosINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AbsISubINTEL", SpvOpAbsISubINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AbsUSubINTEL", SpvOpAbsUSubINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IAddSatINTEL", SpvOpIAddSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UAddSatINTEL", SpvOpUAddSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IAverageINTEL", SpvOpIAverageINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UAverageINTEL", SpvOpUAverageINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IAverageRoundedINTEL", SpvOpIAverageRoundedINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UAverageRoundedINTEL", SpvOpUAverageRoundedINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ISubSatINTEL", SpvOpISubSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"USubSatINTEL", SpvOpUSubSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"IMul32x16INTEL", SpvOpIMul32x16INTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"UMul32x16INTEL", SpvOpUMul32x16INTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConstantFunctionPointerINTEL", SpvOpConstantFunctionPointerINTEL, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, - {"FunctionPointerCallINTEL", SpvOpFunctionPointerCallINTEL, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, - {"AsmTargetINTEL", SpvOpAsmTargetINTEL, 1, pygen_variable_caps_AsmINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AsmINTEL", SpvOpAsmINTEL, 1, pygen_variable_caps_AsmINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AsmCallINTEL", SpvOpAsmCallINTEL, 1, pygen_variable_caps_AsmINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AtomicFMinEXT", SpvOpAtomicFMinEXT, 3, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AtomicFMaxEXT", SpvOpAtomicFMaxEXT, 3, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"AssumeTrueKHR", SpvOpAssumeTrueKHR, 1, pygen_variable_caps_ExpectAssumeKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, - {"ExpectKHR", SpvOpExpectKHR, 1, pygen_variable_caps_ExpectAssumeKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, - {"DecorateString", SpvOpDecorateString, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"DecorateStringGOOGLE", SpvOpDecorateStringGOOGLE, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"MemberDecorateString", SpvOpMemberDecorateString, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"MemberDecorateStringGOOGLE", SpvOpMemberDecorateStringGOOGLE, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"VmeImageINTEL", SpvOpVmeImageINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeVmeImageINTEL", SpvOpTypeVmeImageINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImePayloadINTEL", SpvOpTypeAvcImePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcRefPayloadINTEL", SpvOpTypeAvcRefPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcSicPayloadINTEL", SpvOpTypeAvcSicPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcMcePayloadINTEL", SpvOpTypeAvcMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcMceResultINTEL", SpvOpTypeAvcMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeResultINTEL", SpvOpTypeAvcImeResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeResultSingleReferenceStreamoutINTEL", SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeResultDualReferenceStreamoutINTEL", SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeSingleReferenceStreaminINTEL", SpvOpTypeAvcImeSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcImeDualReferenceStreaminINTEL", SpvOpTypeAvcImeDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcRefResultINTEL", SpvOpTypeAvcRefResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeAvcSicResultINTEL", SpvOpTypeAvcSicResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL", SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL", SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterShapePenaltyINTEL", SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetInterShapePenaltyINTEL", SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL", SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetInterDirectionPenaltyINTEL", SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL", SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL", SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL", SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL", SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL", SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetMotionVectorCostFunctionINTEL", SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL", SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL", SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL", SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetAcOnlyHaarINTEL", SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL", SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL", SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL", SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToImePayloadINTEL", SpvOpSubgroupAvcMceConvertToImePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToImeResultINTEL", SpvOpSubgroupAvcMceConvertToImeResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToRefPayloadINTEL", SpvOpSubgroupAvcMceConvertToRefPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToRefResultINTEL", SpvOpSubgroupAvcMceConvertToRefResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToSicPayloadINTEL", SpvOpSubgroupAvcMceConvertToSicPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceConvertToSicResultINTEL", SpvOpSubgroupAvcMceConvertToSicResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetMotionVectorsINTEL", SpvOpSubgroupAvcMceGetMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterDistortionsINTEL", SpvOpSubgroupAvcMceGetInterDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetBestInterDistortionsINTEL", SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterMajorShapeINTEL", SpvOpSubgroupAvcMceGetInterMajorShapeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterMinorShapeINTEL", SpvOpSubgroupAvcMceGetInterMinorShapeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterDirectionsINTEL", SpvOpSubgroupAvcMceGetInterDirectionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterMotionVectorCountINTEL", SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterReferenceIdsINTEL", SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL", SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeInitializeINTEL", SpvOpSubgroupAvcImeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetSingleReferenceINTEL", SpvOpSubgroupAvcImeSetSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetDualReferenceINTEL", SpvOpSubgroupAvcImeSetDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeRefWindowSizeINTEL", SpvOpSubgroupAvcImeRefWindowSizeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeAdjustRefOffsetINTEL", SpvOpSubgroupAvcImeAdjustRefOffsetINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeConvertToMcePayloadINTEL", SpvOpSubgroupAvcImeConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetMaxMotionVectorCountINTEL", SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetUnidirectionalMixDisableINTEL", SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetEarlySearchTerminationThresholdINTEL", SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeSetWeightedSadINTEL", SpvOpSubgroupAvcImeSetWeightedSadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceINTEL", SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceINTEL", SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL", SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL", SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL", SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL", SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL", SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL", SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeConvertToMceResultINTEL", SpvOpSubgroupAvcImeConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetSingleReferenceStreaminINTEL", SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetDualReferenceStreaminINTEL", SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeStripSingleReferenceStreamoutINTEL", SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeStripDualReferenceStreamoutINTEL", SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL", SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL", SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL", SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL", SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL", SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL", SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetBorderReachedINTEL", SpvOpSubgroupAvcImeGetBorderReachedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetTruncatedSearchIndicationINTEL", SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL", SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL", SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL", SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcFmeInitializeINTEL", SpvOpSubgroupAvcFmeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcBmeInitializeINTEL", SpvOpSubgroupAvcBmeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefConvertToMcePayloadINTEL", SpvOpSubgroupAvcRefConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefSetBidirectionalMixDisableINTEL", SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefSetBilinearFilterEnableINTEL", SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithSingleReferenceINTEL", SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithDualReferenceINTEL", SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithMultiReferenceINTEL", SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL", SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcRefConvertToMceResultINTEL", SpvOpSubgroupAvcRefConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicInitializeINTEL", SpvOpSubgroupAvcSicInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConfigureSkcINTEL", SpvOpSubgroupAvcSicConfigureSkcINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConfigureIpeLumaINTEL", SpvOpSubgroupAvcSicConfigureIpeLumaINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConfigureIpeLumaChromaINTEL", SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetMotionVectorMaskINTEL", SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConvertToMcePayloadINTEL", SpvOpSubgroupAvcSicConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetIntraLumaShapePenaltyINTEL", SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetIntraLumaModeCostFunctionINTEL", SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetIntraChromaModeCostFunctionINTEL", SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetBilinearFilterEnableINTEL", SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetSkcForwardTransformEnableINTEL", SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicSetBlockBasedRawSkipSadINTEL", SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateIpeINTEL", SpvOpSubgroupAvcSicEvaluateIpeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithSingleReferenceINTEL", SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithDualReferenceINTEL", SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithMultiReferenceINTEL", SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL", SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicConvertToMceResultINTEL", SpvOpSubgroupAvcSicConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetIpeLumaShapeINTEL", SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetBestIpeLumaDistortionINTEL", SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetBestIpeChromaDistortionINTEL", SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetPackedIpeLumaModesINTEL", SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetIpeChromaModeINTEL", SpvOpSubgroupAvcSicGetIpeChromaModeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL", SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL", SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SubgroupAvcSicGetInterRawSadsINTEL", SpvOpSubgroupAvcSicGetInterRawSadsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"VariableLengthArrayINTEL", SpvOpVariableLengthArrayINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SaveMemoryINTEL", SpvOpSaveMemoryINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"RestoreMemoryINTEL", SpvOpRestoreMemoryINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinCosPiINTEL", SpvOpArbitraryFloatSinCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCastINTEL", SpvOpArbitraryFloatCastINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCastFromIntINTEL", SpvOpArbitraryFloatCastFromIntINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCastToIntINTEL", SpvOpArbitraryFloatCastToIntINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatAddINTEL", SpvOpArbitraryFloatAddINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSubINTEL", SpvOpArbitraryFloatSubINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatMulINTEL", SpvOpArbitraryFloatMulINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatDivINTEL", SpvOpArbitraryFloatDivINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatGTINTEL", SpvOpArbitraryFloatGTINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatGEINTEL", SpvOpArbitraryFloatGEINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLTINTEL", SpvOpArbitraryFloatLTINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLEINTEL", SpvOpArbitraryFloatLEINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatEQINTEL", SpvOpArbitraryFloatEQINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatRecipINTEL", SpvOpArbitraryFloatRecipINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatRSqrtINTEL", SpvOpArbitraryFloatRSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCbrtINTEL", SpvOpArbitraryFloatCbrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatHypotINTEL", SpvOpArbitraryFloatHypotINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSqrtINTEL", SpvOpArbitraryFloatSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLogINTEL", SpvOpArbitraryFloatLogINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLog2INTEL", SpvOpArbitraryFloatLog2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLog10INTEL", SpvOpArbitraryFloatLog10INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatLog1pINTEL", SpvOpArbitraryFloatLog1pINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExpINTEL", SpvOpArbitraryFloatExpINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExp2INTEL", SpvOpArbitraryFloatExp2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExp10INTEL", SpvOpArbitraryFloatExp10INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatExpm1INTEL", SpvOpArbitraryFloatExpm1INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinINTEL", SpvOpArbitraryFloatSinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCosINTEL", SpvOpArbitraryFloatCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinCosINTEL", SpvOpArbitraryFloatSinCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatSinPiINTEL", SpvOpArbitraryFloatSinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatCosPiINTEL", SpvOpArbitraryFloatCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatASinINTEL", SpvOpArbitraryFloatASinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatASinPiINTEL", SpvOpArbitraryFloatASinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatACosINTEL", SpvOpArbitraryFloatACosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatACosPiINTEL", SpvOpArbitraryFloatACosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatATanINTEL", SpvOpArbitraryFloatATanINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatATanPiINTEL", SpvOpArbitraryFloatATanPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatATan2INTEL", SpvOpArbitraryFloatATan2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatPowINTEL", SpvOpArbitraryFloatPowINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatPowRINTEL", SpvOpArbitraryFloatPowRINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ArbitraryFloatPowNINTEL", SpvOpArbitraryFloatPowNINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"LoopControlINTEL", SpvOpLoopControlINTEL, 1, pygen_variable_caps_UnstructuredLoopControlsINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 1, pygen_variable_exts_SPV_INTEL_unstructured_loop_controls, 0xffffffffu, 0xffffffffu}, - {"AliasDomainDeclINTEL", SpvOpAliasDomainDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, - {"AliasScopeDeclINTEL", SpvOpAliasScopeDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, - {"AliasScopeListDeclINTEL", SpvOpAliasScopeListDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, - {"FixedSqrtINTEL", SpvOpFixedSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedRecipINTEL", SpvOpFixedRecipINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedRsqrtINTEL", SpvOpFixedRsqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinINTEL", SpvOpFixedSinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedCosINTEL", SpvOpFixedCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinCosINTEL", SpvOpFixedSinCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinPiINTEL", SpvOpFixedSinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedCosPiINTEL", SpvOpFixedCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedSinCosPiINTEL", SpvOpFixedSinCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedLogINTEL", SpvOpFixedLogINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"FixedExpINTEL", SpvOpFixedExpINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"PtrCastToCrossWorkgroupINTEL", SpvOpPtrCastToCrossWorkgroupINTEL, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"CrossWorkgroupCastToPtrINTEL", SpvOpCrossWorkgroupCastToPtrINTEL, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ReadPipeBlockingINTEL", SpvOpReadPipeBlockingINTEL, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, - {"WritePipeBlockingINTEL", SpvOpWritePipeBlockingINTEL, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, - {"FPGARegINTEL", SpvOpFPGARegINTEL, 1, pygen_variable_caps_FPGARegINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_fpga_reg, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetRayTMinKHR", SpvOpRayQueryGetRayTMinKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetRayFlagsKHR", SpvOpRayQueryGetRayFlagsKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionTKHR", SpvOpRayQueryGetIntersectionTKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionInstanceCustomIndexKHR", SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionInstanceIdKHR", SpvOpRayQueryGetIntersectionInstanceIdKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR", SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionGeometryIndexKHR", SpvOpRayQueryGetIntersectionGeometryIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionPrimitiveIndexKHR", SpvOpRayQueryGetIntersectionPrimitiveIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionBarycentricsKHR", SpvOpRayQueryGetIntersectionBarycentricsKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionFrontFaceKHR", SpvOpRayQueryGetIntersectionFrontFaceKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionCandidateAABBOpaqueKHR", SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionObjectRayDirectionKHR", SpvOpRayQueryGetIntersectionObjectRayDirectionKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionObjectRayOriginKHR", SpvOpRayQueryGetIntersectionObjectRayOriginKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetWorldRayDirectionKHR", SpvOpRayQueryGetWorldRayDirectionKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetWorldRayOriginKHR", SpvOpRayQueryGetWorldRayOriginKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionObjectToWorldKHR", SpvOpRayQueryGetIntersectionObjectToWorldKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"RayQueryGetIntersectionWorldToObjectKHR", SpvOpRayQueryGetIntersectionWorldToObjectKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, - {"AtomicFAddEXT", SpvOpAtomicFAddEXT, 3, pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, 0xffffffffu, 0xffffffffu}, - {"TypeBufferSurfaceINTEL", SpvOpTypeBufferSurfaceINTEL, 1, pygen_variable_caps_VectorComputeINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"TypeStructContinuedINTEL", SpvOpTypeStructContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ConstantCompositeContinuedINTEL", SpvOpConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"SpecConstantCompositeContinuedINTEL", SpvOpSpecConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ControlBarrierArriveINTEL", SpvOpControlBarrierArriveINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"ControlBarrierWaitINTEL", SpvOpControlBarrierWaitINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupIMulKHR", SpvOpGroupIMulKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupFMulKHR", SpvOpGroupFMulKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupBitwiseAndKHR", SpvOpGroupBitwiseAndKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupBitwiseOrKHR", SpvOpGroupBitwiseOrKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupBitwiseXorKHR", SpvOpGroupBitwiseXorKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupLogicalAndKHR", SpvOpGroupLogicalAndKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupLogicalOrKHR", SpvOpGroupLogicalOrKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, - {"GroupLogicalXorKHR", SpvOpGroupLogicalXorKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu} + {"Nop", spv::Op::OpNop, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Undef", spv::Op::OpUndef, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SourceContinued", spv::Op::OpSourceContinued, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Source", spv::Op::OpSource, 0, nullptr, 4, {SPV_OPERAND_TYPE_SOURCE_LANGUAGE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SourceExtension", spv::Op::OpSourceExtension, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Name", spv::Op::OpName, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"MemberName", spv::Op::OpMemberName, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"String", spv::Op::OpString, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Line", spv::Op::OpLine, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Extension", spv::Op::OpExtension, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ExtInstImport", spv::Op::OpExtInstImport, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ExtInst", spv::Op::OpExtInst, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"MemoryModel", spv::Op::OpMemoryModel, 0, nullptr, 2, {SPV_OPERAND_TYPE_ADDRESSING_MODEL, SPV_OPERAND_TYPE_MEMORY_MODEL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"EntryPoint", spv::Op::OpEntryPoint, 0, nullptr, 4, {SPV_OPERAND_TYPE_EXECUTION_MODEL, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ExecutionMode", spv::Op::OpExecutionMode, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Capability", spv::Op::OpCapability, 0, nullptr, 1, {SPV_OPERAND_TYPE_CAPABILITY}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeVoid", spv::Op::OpTypeVoid, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeBool", spv::Op::OpTypeBool, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeInt", spv::Op::OpTypeInt, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeFloat", spv::Op::OpTypeFloat, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeVector", spv::Op::OpTypeVector, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeMatrix", spv::Op::OpTypeMatrix, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeImage", spv::Op::OpTypeImage, 0, nullptr, 9, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DIMENSIONALITY, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeSampler", spv::Op::OpTypeSampler, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeSampledImage", spv::Op::OpTypeSampledImage, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeArray", spv::Op::OpTypeArray, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeRuntimeArray", spv::Op::OpTypeRuntimeArray, 1, pygen_variable_caps_Shader, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeStruct", spv::Op::OpTypeStruct, 0, nullptr, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeOpaque", spv::Op::OpTypeOpaque, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypePointer", spv::Op::OpTypePointer, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeFunction", spv::Op::OpTypeFunction, 0, nullptr, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeEvent", spv::Op::OpTypeEvent, 1, pygen_variable_caps_Kernel, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeDeviceEvent", spv::Op::OpTypeDeviceEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeReserveId", spv::Op::OpTypeReserveId, 1, pygen_variable_caps_Pipes, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeQueue", spv::Op::OpTypeQueue, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypePipe", spv::Op::OpTypePipe, 1, pygen_variable_caps_Pipes, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TypeForwardPointer", spv::Op::OpTypeForwardPointer, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConstantTrue", spv::Op::OpConstantTrue, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConstantFalse", spv::Op::OpConstantFalse, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Constant", spv::Op::OpConstant, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConstantComposite", spv::Op::OpConstantComposite, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConstantSampler", spv::Op::OpConstantSampler, 1, pygen_variable_caps_LiteralSampler, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConstantNull", spv::Op::OpConstantNull, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SpecConstantTrue", spv::Op::OpSpecConstantTrue, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SpecConstantFalse", spv::Op::OpSpecConstantFalse, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SpecConstant", spv::Op::OpSpecConstant, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SpecConstantComposite", spv::Op::OpSpecConstantComposite, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SpecConstantOp", spv::Op::OpSpecConstantOp, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Function", spv::Op::OpFunction, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_FUNCTION_CONTROL, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FunctionParameter", spv::Op::OpFunctionParameter, 0, nullptr, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FunctionEnd", spv::Op::OpFunctionEnd, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FunctionCall", spv::Op::OpFunctionCall, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Variable", spv::Op::OpVariable, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageTexelPointer", spv::Op::OpImageTexelPointer, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Load", spv::Op::OpLoad, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Store", spv::Op::OpStore, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CopyMemory", spv::Op::OpCopyMemory, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CopyMemorySized", spv::Op::OpCopyMemorySized, 1, pygen_variable_caps_Addresses, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AccessChain", spv::Op::OpAccessChain, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"InBoundsAccessChain", spv::Op::OpInBoundsAccessChain, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"PtrAccessChain", spv::Op::OpPtrAccessChain, 4, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBufferPhysicalStorageBufferAddresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ArrayLength", spv::Op::OpArrayLength, 1, pygen_variable_caps_Shader, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GenericPtrMemSemantics", spv::Op::OpGenericPtrMemSemantics, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"InBoundsPtrAccessChain", spv::Op::OpInBoundsPtrAccessChain, 1, pygen_variable_caps_Addresses, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Decorate", spv::Op::OpDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"MemberDecorate", spv::Op::OpMemberDecorate, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"DecorationGroup", spv::Op::OpDecorationGroup, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupDecorate", spv::Op::OpGroupDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupMemberDecorate", spv::Op::OpGroupMemberDecorate, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"VectorExtractDynamic", spv::Op::OpVectorExtractDynamic, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"VectorInsertDynamic", spv::Op::OpVectorInsertDynamic, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"VectorShuffle", spv::Op::OpVectorShuffle, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CompositeConstruct", spv::Op::OpCompositeConstruct, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CompositeExtract", spv::Op::OpCompositeExtract, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CompositeInsert", spv::Op::OpCompositeInsert, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CopyObject", spv::Op::OpCopyObject, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Transpose", spv::Op::OpTranspose, 1, pygen_variable_caps_Matrix, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SampledImage", spv::Op::OpSampledImage, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleImplicitLod", spv::Op::OpImageSampleImplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleExplicitLod", spv::Op::OpImageSampleExplicitLod, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleDrefImplicitLod", spv::Op::OpImageSampleDrefImplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleDrefExplicitLod", spv::Op::OpImageSampleDrefExplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleProjImplicitLod", spv::Op::OpImageSampleProjImplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleProjExplicitLod", spv::Op::OpImageSampleProjExplicitLod, 1, pygen_variable_caps_Shader, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleProjDrefImplicitLod", spv::Op::OpImageSampleProjDrefImplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSampleProjDrefExplicitLod", spv::Op::OpImageSampleProjDrefExplicitLod, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageFetch", spv::Op::OpImageFetch, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageGather", spv::Op::OpImageGather, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageDrefGather", spv::Op::OpImageDrefGather, 1, pygen_variable_caps_Shader, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageRead", spv::Op::OpImageRead, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageWrite", spv::Op::OpImageWrite, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Image", spv::Op::OpImage, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageQueryFormat", spv::Op::OpImageQueryFormat, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageQueryOrder", spv::Op::OpImageQueryOrder, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageQuerySizeLod", spv::Op::OpImageQuerySizeLod, 2, pygen_variable_caps_KernelImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageQuerySize", spv::Op::OpImageQuerySize, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageQueryLod", spv::Op::OpImageQueryLod, 1, pygen_variable_caps_ImageQuery, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageQueryLevels", spv::Op::OpImageQueryLevels, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageQuerySamples", spv::Op::OpImageQuerySamples, 2, pygen_variable_caps_KernelImageQuery, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConvertFToU", spv::Op::OpConvertFToU, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConvertFToS", spv::Op::OpConvertFToS, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConvertSToF", spv::Op::OpConvertSToF, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConvertUToF", spv::Op::OpConvertUToF, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UConvert", spv::Op::OpUConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SConvert", spv::Op::OpSConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FConvert", spv::Op::OpFConvert, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"QuantizeToF16", spv::Op::OpQuantizeToF16, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConvertPtrToU", spv::Op::OpConvertPtrToU, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SatConvertSToU", spv::Op::OpSatConvertSToU, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SatConvertUToS", spv::Op::OpSatConvertUToS, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ConvertUToPtr", spv::Op::OpConvertUToPtr, 2, pygen_variable_caps_AddressesPhysicalStorageBufferAddresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"PtrCastToGeneric", spv::Op::OpPtrCastToGeneric, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GenericCastToPtr", spv::Op::OpGenericCastToPtr, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GenericCastToPtrExplicit", spv::Op::OpGenericCastToPtrExplicit, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_STORAGE_CLASS}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Bitcast", spv::Op::OpBitcast, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SNegate", spv::Op::OpSNegate, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FNegate", spv::Op::OpFNegate, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IAdd", spv::Op::OpIAdd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FAdd", spv::Op::OpFAdd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ISub", spv::Op::OpISub, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FSub", spv::Op::OpFSub, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IMul", spv::Op::OpIMul, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FMul", spv::Op::OpFMul, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UDiv", spv::Op::OpUDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SDiv", spv::Op::OpSDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FDiv", spv::Op::OpFDiv, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UMod", spv::Op::OpUMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SRem", spv::Op::OpSRem, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SMod", spv::Op::OpSMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FRem", spv::Op::OpFRem, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FMod", spv::Op::OpFMod, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"VectorTimesScalar", spv::Op::OpVectorTimesScalar, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"MatrixTimesScalar", spv::Op::OpMatrixTimesScalar, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"VectorTimesMatrix", spv::Op::OpVectorTimesMatrix, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"MatrixTimesVector", spv::Op::OpMatrixTimesVector, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"MatrixTimesMatrix", spv::Op::OpMatrixTimesMatrix, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"OuterProduct", spv::Op::OpOuterProduct, 1, pygen_variable_caps_Matrix, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Dot", spv::Op::OpDot, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IAddCarry", spv::Op::OpIAddCarry, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ISubBorrow", spv::Op::OpISubBorrow, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UMulExtended", spv::Op::OpUMulExtended, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SMulExtended", spv::Op::OpSMulExtended, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Any", spv::Op::OpAny, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"All", spv::Op::OpAll, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IsNan", spv::Op::OpIsNan, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IsInf", spv::Op::OpIsInf, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IsFinite", spv::Op::OpIsFinite, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IsNormal", spv::Op::OpIsNormal, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SignBitSet", spv::Op::OpSignBitSet, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LessOrGreater", spv::Op::OpLessOrGreater, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), SPV_SPIRV_VERSION_WORD(1,5)}, + {"Ordered", spv::Op::OpOrdered, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Unordered", spv::Op::OpUnordered, 1, pygen_variable_caps_Kernel, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LogicalEqual", spv::Op::OpLogicalEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LogicalNotEqual", spv::Op::OpLogicalNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LogicalOr", spv::Op::OpLogicalOr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LogicalAnd", spv::Op::OpLogicalAnd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LogicalNot", spv::Op::OpLogicalNot, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Select", spv::Op::OpSelect, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IEqual", spv::Op::OpIEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"INotEqual", spv::Op::OpINotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UGreaterThan", spv::Op::OpUGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SGreaterThan", spv::Op::OpSGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"UGreaterThanEqual", spv::Op::OpUGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SGreaterThanEqual", spv::Op::OpSGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ULessThan", spv::Op::OpULessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SLessThan", spv::Op::OpSLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ULessThanEqual", spv::Op::OpULessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SLessThanEqual", spv::Op::OpSLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FOrdEqual", spv::Op::OpFOrdEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FUnordEqual", spv::Op::OpFUnordEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FOrdNotEqual", spv::Op::OpFOrdNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FUnordNotEqual", spv::Op::OpFUnordNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FOrdLessThan", spv::Op::OpFOrdLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FUnordLessThan", spv::Op::OpFUnordLessThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FOrdGreaterThan", spv::Op::OpFOrdGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FUnordGreaterThan", spv::Op::OpFUnordGreaterThan, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FOrdLessThanEqual", spv::Op::OpFOrdLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FUnordLessThanEqual", spv::Op::OpFUnordLessThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FOrdGreaterThanEqual", spv::Op::OpFOrdGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FUnordGreaterThanEqual", spv::Op::OpFUnordGreaterThanEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ShiftRightLogical", spv::Op::OpShiftRightLogical, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ShiftRightArithmetic", spv::Op::OpShiftRightArithmetic, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ShiftLeftLogical", spv::Op::OpShiftLeftLogical, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitwiseOr", spv::Op::OpBitwiseOr, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitwiseXor", spv::Op::OpBitwiseXor, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitwiseAnd", spv::Op::OpBitwiseAnd, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Not", spv::Op::OpNot, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitFieldInsert", spv::Op::OpBitFieldInsert, 2, pygen_variable_caps_ShaderBitInstructions, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitFieldSExtract", spv::Op::OpBitFieldSExtract, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitFieldUExtract", spv::Op::OpBitFieldUExtract, 2, pygen_variable_caps_ShaderBitInstructions, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitReverse", spv::Op::OpBitReverse, 2, pygen_variable_caps_ShaderBitInstructions, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BitCount", spv::Op::OpBitCount, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"DPdx", spv::Op::OpDPdx, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"DPdy", spv::Op::OpDPdy, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Fwidth", spv::Op::OpFwidth, 1, pygen_variable_caps_Shader, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"DPdxFine", spv::Op::OpDPdxFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"DPdyFine", spv::Op::OpDPdyFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FwidthFine", spv::Op::OpFwidthFine, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"DPdxCoarse", spv::Op::OpDPdxCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"DPdyCoarse", spv::Op::OpDPdyCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"FwidthCoarse", spv::Op::OpFwidthCoarse, 1, pygen_variable_caps_DerivativeControl, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"EmitVertex", spv::Op::OpEmitVertex, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"EndPrimitive", spv::Op::OpEndPrimitive, 1, pygen_variable_caps_Geometry, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"EmitStreamVertex", spv::Op::OpEmitStreamVertex, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"EndStreamPrimitive", spv::Op::OpEndStreamPrimitive, 1, pygen_variable_caps_GeometryStreams, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ControlBarrier", spv::Op::OpControlBarrier, 0, nullptr, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"MemoryBarrier", spv::Op::OpMemoryBarrier, 0, nullptr, 2, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicLoad", spv::Op::OpAtomicLoad, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicStore", spv::Op::OpAtomicStore, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicExchange", spv::Op::OpAtomicExchange, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicCompareExchange", spv::Op::OpAtomicCompareExchange, 0, nullptr, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicCompareExchangeWeak", spv::Op::OpAtomicCompareExchangeWeak, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), SPV_SPIRV_VERSION_WORD(1,3)}, + {"AtomicIIncrement", spv::Op::OpAtomicIIncrement, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicIDecrement", spv::Op::OpAtomicIDecrement, 0, nullptr, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicIAdd", spv::Op::OpAtomicIAdd, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicISub", spv::Op::OpAtomicISub, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicSMin", spv::Op::OpAtomicSMin, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicUMin", spv::Op::OpAtomicUMin, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicSMax", spv::Op::OpAtomicSMax, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicUMax", spv::Op::OpAtomicUMax, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicAnd", spv::Op::OpAtomicAnd, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicOr", spv::Op::OpAtomicOr, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicXor", spv::Op::OpAtomicXor, 0, nullptr, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Phi", spv::Op::OpPhi, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LoopMerge", spv::Op::OpLoopMerge, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LOOP_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SelectionMerge", spv::Op::OpSelectionMerge, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SELECTION_CONTROL}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Label", spv::Op::OpLabel, 0, nullptr, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Branch", spv::Op::OpBranch, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BranchConditional", spv::Op::OpBranchConditional, 0, nullptr, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Switch", spv::Op::OpSwitch, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Kill", spv::Op::OpKill, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Return", spv::Op::OpReturn, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ReturnValue", spv::Op::OpReturnValue, 0, nullptr, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Unreachable", spv::Op::OpUnreachable, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LifetimeStart", spv::Op::OpLifetimeStart, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"LifetimeStop", spv::Op::OpLifetimeStop, 1, pygen_variable_caps_Kernel, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupAsyncCopy", spv::Op::OpGroupAsyncCopy, 1, pygen_variable_caps_Kernel, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupWaitEvents", spv::Op::OpGroupWaitEvents, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupAll", spv::Op::OpGroupAll, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupAny", spv::Op::OpGroupAny, 1, pygen_variable_caps_Groups, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupBroadcast", spv::Op::OpGroupBroadcast, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupIAdd", spv::Op::OpGroupIAdd, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupFAdd", spv::Op::OpGroupFAdd, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupFMin", spv::Op::OpGroupFMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupUMin", spv::Op::OpGroupUMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupSMin", spv::Op::OpGroupSMin, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupFMax", spv::Op::OpGroupFMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupUMax", spv::Op::OpGroupUMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupSMax", spv::Op::OpGroupSMax, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ReadPipe", spv::Op::OpReadPipe, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"WritePipe", spv::Op::OpWritePipe, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ReservedReadPipe", spv::Op::OpReservedReadPipe, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ReservedWritePipe", spv::Op::OpReservedWritePipe, 1, pygen_variable_caps_Pipes, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ReserveReadPipePackets", spv::Op::OpReserveReadPipePackets, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ReserveWritePipePackets", spv::Op::OpReserveWritePipePackets, 1, pygen_variable_caps_Pipes, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CommitReadPipe", spv::Op::OpCommitReadPipe, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CommitWritePipe", spv::Op::OpCommitWritePipe, 1, pygen_variable_caps_Pipes, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IsValidReserveId", spv::Op::OpIsValidReserveId, 1, pygen_variable_caps_Pipes, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GetNumPipePackets", spv::Op::OpGetNumPipePackets, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GetMaxPipePackets", spv::Op::OpGetMaxPipePackets, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupReserveReadPipePackets", spv::Op::OpGroupReserveReadPipePackets, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupReserveWritePipePackets", spv::Op::OpGroupReserveWritePipePackets, 1, pygen_variable_caps_Pipes, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupCommitReadPipe", spv::Op::OpGroupCommitReadPipe, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GroupCommitWritePipe", spv::Op::OpGroupCommitWritePipe, 1, pygen_variable_caps_Pipes, 5, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"EnqueueMarker", spv::Op::OpEnqueueMarker, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"EnqueueKernel", spv::Op::OpEnqueueKernel, 1, pygen_variable_caps_DeviceEnqueue, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GetKernelNDrangeSubGroupCount", spv::Op::OpGetKernelNDrangeSubGroupCount, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GetKernelNDrangeMaxSubGroupSize", spv::Op::OpGetKernelNDrangeMaxSubGroupSize, 1, pygen_variable_caps_DeviceEnqueue, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GetKernelWorkGroupSize", spv::Op::OpGetKernelWorkGroupSize, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GetKernelPreferredWorkGroupSizeMultiple", spv::Op::OpGetKernelPreferredWorkGroupSizeMultiple, 1, pygen_variable_caps_DeviceEnqueue, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"RetainEvent", spv::Op::OpRetainEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ReleaseEvent", spv::Op::OpReleaseEvent, 1, pygen_variable_caps_DeviceEnqueue, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CreateUserEvent", spv::Op::OpCreateUserEvent, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"IsValidEvent", spv::Op::OpIsValidEvent, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SetUserEventStatus", spv::Op::OpSetUserEventStatus, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"CaptureEventProfilingInfo", spv::Op::OpCaptureEventProfilingInfo, 1, pygen_variable_caps_DeviceEnqueue, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"GetDefaultQueue", spv::Op::OpGetDefaultQueue, 1, pygen_variable_caps_DeviceEnqueue, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"BuildNDRange", spv::Op::OpBuildNDRange, 1, pygen_variable_caps_DeviceEnqueue, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseSampleImplicitLod", spv::Op::OpImageSparseSampleImplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseSampleExplicitLod", spv::Op::OpImageSparseSampleExplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseSampleDrefImplicitLod", spv::Op::OpImageSparseSampleDrefImplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseSampleDrefExplicitLod", spv::Op::OpImageSparseSampleDrefExplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseSampleProjImplicitLod", spv::Op::OpImageSparseSampleProjImplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseSampleProjExplicitLod", spv::Op::OpImageSparseSampleProjExplicitLod, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseSampleProjDrefImplicitLod", spv::Op::OpImageSparseSampleProjDrefImplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseSampleProjDrefExplicitLod", spv::Op::OpImageSparseSampleProjDrefExplicitLod, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_IMAGE}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSparseFetch", spv::Op::OpImageSparseFetch, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseGather", spv::Op::OpImageSparseGather, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseDrefGather", spv::Op::OpImageSparseDrefGather, 1, pygen_variable_caps_SparseResidency, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseTexelsResident", spv::Op::OpImageSparseTexelsResident, 1, pygen_variable_caps_SparseResidency, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"NoLine", spv::Op::OpNoLine, 0, nullptr, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicFlagTestAndSet", spv::Op::OpAtomicFlagTestAndSet, 1, pygen_variable_caps_Kernel, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"AtomicFlagClear", spv::Op::OpAtomicFlagClear, 1, pygen_variable_caps_Kernel, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"ImageSparseRead", spv::Op::OpImageSparseRead, 1, pygen_variable_caps_SparseResidency, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"SizeOf", spv::Op::OpSizeOf, 1, pygen_variable_caps_Addresses, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"TypePipeStorage", spv::Op::OpTypePipeStorage, 1, pygen_variable_caps_PipeStorage, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"ConstantPipeStorage", spv::Op::OpConstantPipeStorage, 1, pygen_variable_caps_PipeStorage, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"CreatePipeFromPipeStorage", spv::Op::OpCreatePipeFromPipeStorage, 1, pygen_variable_caps_PipeStorage, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"GetKernelLocalSizeForSubgroupCount", spv::Op::OpGetKernelLocalSizeForSubgroupCount, 1, pygen_variable_caps_SubgroupDispatch, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"GetKernelMaxNumSubgroups", spv::Op::OpGetKernelMaxNumSubgroups, 1, pygen_variable_caps_SubgroupDispatch, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"TypeNamedBarrier", spv::Op::OpTypeNamedBarrier, 1, pygen_variable_caps_NamedBarrier, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"NamedBarrierInitialize", spv::Op::OpNamedBarrierInitialize, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"MemoryNamedBarrier", spv::Op::OpMemoryNamedBarrier, 1, pygen_variable_caps_NamedBarrier, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"ModuleProcessed", spv::Op::OpModuleProcessed, 0, nullptr, 1, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,1), 0xffffffffu}, + {"ExecutionModeId", spv::Op::OpExecutionModeId, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_EXECUTION_MODE}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"DecorateId", spv::Op::OpDecorateId, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 1, pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"GroupNonUniformElect", spv::Op::OpGroupNonUniformElect, 1, pygen_variable_caps_GroupNonUniform, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformAll", spv::Op::OpGroupNonUniformAll, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformAny", spv::Op::OpGroupNonUniformAny, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformAllEqual", spv::Op::OpGroupNonUniformAllEqual, 1, pygen_variable_caps_GroupNonUniformVote, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBroadcast", spv::Op::OpGroupNonUniformBroadcast, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBroadcastFirst", spv::Op::OpGroupNonUniformBroadcastFirst, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallot", spv::Op::OpGroupNonUniformBallot, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformInverseBallot", spv::Op::OpGroupNonUniformInverseBallot, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotBitExtract", spv::Op::OpGroupNonUniformBallotBitExtract, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotBitCount", spv::Op::OpGroupNonUniformBallotBitCount, 1, pygen_variable_caps_GroupNonUniformBallot, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotFindLSB", spv::Op::OpGroupNonUniformBallotFindLSB, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBallotFindMSB", spv::Op::OpGroupNonUniformBallotFindMSB, 1, pygen_variable_caps_GroupNonUniformBallot, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffle", spv::Op::OpGroupNonUniformShuffle, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffleXor", spv::Op::OpGroupNonUniformShuffleXor, 1, pygen_variable_caps_GroupNonUniformShuffle, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffleUp", spv::Op::OpGroupNonUniformShuffleUp, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformShuffleDown", spv::Op::OpGroupNonUniformShuffleDown, 1, pygen_variable_caps_GroupNonUniformShuffleRelative, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformIAdd", spv::Op::OpGroupNonUniformIAdd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFAdd", spv::Op::OpGroupNonUniformFAdd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformIMul", spv::Op::OpGroupNonUniformIMul, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFMul", spv::Op::OpGroupNonUniformFMul, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformSMin", spv::Op::OpGroupNonUniformSMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformUMin", spv::Op::OpGroupNonUniformUMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFMin", spv::Op::OpGroupNonUniformFMin, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformSMax", spv::Op::OpGroupNonUniformSMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformUMax", spv::Op::OpGroupNonUniformUMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformFMax", spv::Op::OpGroupNonUniformFMax, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBitwiseAnd", spv::Op::OpGroupNonUniformBitwiseAnd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBitwiseOr", spv::Op::OpGroupNonUniformBitwiseOr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformBitwiseXor", spv::Op::OpGroupNonUniformBitwiseXor, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformLogicalAnd", spv::Op::OpGroupNonUniformLogicalAnd, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformLogicalOr", spv::Op::OpGroupNonUniformLogicalOr, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformLogicalXor", spv::Op::OpGroupNonUniformLogicalXor, 3, pygen_variable_caps_GroupNonUniformArithmeticGroupNonUniformClusteredGroupNonUniformPartitionedNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformQuadBroadcast", spv::Op::OpGroupNonUniformQuadBroadcast, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"GroupNonUniformQuadSwap", spv::Op::OpGroupNonUniformQuadSwap, 1, pygen_variable_caps_GroupNonUniformQuad, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"CopyLogical", spv::Op::OpCopyLogical, 0, nullptr, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PtrEqual", spv::Op::OpPtrEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PtrNotEqual", spv::Op::OpPtrNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"PtrDiff", spv::Op::OpPtrDiff, 3, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"TerminateInvocation", spv::Op::OpTerminateInvocation, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_terminate_invocation, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SubgroupBallotKHR", spv::Op::OpSubgroupBallotKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"SubgroupFirstInvocationKHR", spv::Op::OpSubgroupFirstInvocationKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"SubgroupAllKHR", spv::Op::OpSubgroupAllKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, + {"SubgroupAnyKHR", spv::Op::OpSubgroupAnyKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, + {"SubgroupAllEqualKHR", spv::Op::OpSubgroupAllEqualKHR, 1, pygen_variable_caps_SubgroupVoteKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_subgroup_vote, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformRotateKHR", spv::Op::OpGroupNonUniformRotateKHR, 1, pygen_variable_caps_GroupNonUniformRotateKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupReadInvocationKHR", spv::Op::OpSubgroupReadInvocationKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"TraceRayKHR", spv::Op::OpTraceRayKHR, 1, pygen_variable_caps_RayTracingKHR, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"ExecuteCallableKHR", spv::Op::OpExecuteCallableKHR, 1, pygen_variable_caps_RayTracingKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"ConvertUToAccelerationStructureKHR", spv::Op::OpConvertUToAccelerationStructureKHR, 2, pygen_variable_caps_RayTracingKHRRayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"IgnoreIntersectionKHR", spv::Op::OpIgnoreIntersectionKHR, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TerminateRayKHR", spv::Op::OpTerminateRayKHR, 1, pygen_variable_caps_RayTracingKHR, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"SDot", spv::Op::OpSDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SDotKHR", spv::Op::OpSDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"UDot", spv::Op::OpUDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"UDotKHR", spv::Op::OpUDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SUDot", spv::Op::OpSUDot, 1, pygen_variable_caps_DotProduct, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SUDotKHR", spv::Op::OpSUDotKHR, 1, pygen_variable_caps_DotProductKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SDotAccSat", spv::Op::OpSDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SDotAccSatKHR", spv::Op::OpSDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"UDotAccSat", spv::Op::OpUDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"UDotAccSatKHR", spv::Op::OpUDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SUDotAccSat", spv::Op::OpSUDotAccSat, 1, pygen_variable_caps_DotProduct, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"SUDotAccSatKHR", spv::Op::OpSUDotAccSatKHR, 1, pygen_variable_caps_DotProductKHR, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT}, 1, 1, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"TypeRayQueryKHR", spv::Op::OpTypeRayQueryKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryInitializeKHR", spv::Op::OpRayQueryInitializeKHR, 1, pygen_variable_caps_RayQueryKHR, 8, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryTerminateKHR", spv::Op::OpRayQueryTerminateKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGenerateIntersectionKHR", spv::Op::OpRayQueryGenerateIntersectionKHR, 1, pygen_variable_caps_RayQueryKHR, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryConfirmIntersectionKHR", spv::Op::OpRayQueryConfirmIntersectionKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryProceedKHR", spv::Op::OpRayQueryProceedKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionTypeKHR", spv::Op::OpRayQueryGetIntersectionTypeKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"GroupIAddNonUniformAMD", spv::Op::OpGroupIAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupFAddNonUniformAMD", spv::Op::OpGroupFAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupFMinNonUniformAMD", spv::Op::OpGroupFMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupUMinNonUniformAMD", spv::Op::OpGroupUMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupSMinNonUniformAMD", spv::Op::OpGroupSMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupFMaxNonUniformAMD", spv::Op::OpGroupFMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupUMaxNonUniformAMD", spv::Op::OpGroupUMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"GroupSMaxNonUniformAMD", spv::Op::OpGroupSMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, + {"FragmentMaskFetchAMD", spv::Op::OpFragmentMaskFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, + {"FragmentFetchAMD", spv::Op::OpFragmentFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, + {"ReadClockKHR", spv::Op::OpReadClockKHR, 1, pygen_variable_caps_ShaderClockKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_clock, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitMotionNV", spv::Op::OpHitObjectRecordHitMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 14, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitWithIndexMotionNV", spv::Op::OpHitObjectRecordHitWithIndexMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordMissMotionNV", spv::Op::OpHitObjectRecordMissMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 7, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetWorldToObjectNV", spv::Op::OpHitObjectGetWorldToObjectNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetObjectToWorldNV", spv::Op::OpHitObjectGetObjectToWorldNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetObjectRayDirectionNV", spv::Op::OpHitObjectGetObjectRayDirectionNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetObjectRayOriginNV", spv::Op::OpHitObjectGetObjectRayOriginNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectTraceRayMotionNV", spv::Op::OpHitObjectTraceRayMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetShaderRecordBufferHandleNV", spv::Op::OpHitObjectGetShaderRecordBufferHandleNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetShaderBindingTableRecordIndexNV", spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordEmptyNV", spv::Op::OpHitObjectRecordEmptyNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectTraceRayNV", spv::Op::OpHitObjectTraceRayNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitNV", spv::Op::OpHitObjectRecordHitNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordHitWithIndexNV", spv::Op::OpHitObjectRecordHitWithIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectRecordMissNV", spv::Op::OpHitObjectRecordMissNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 6, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectExecuteShaderNV", spv::Op::OpHitObjectExecuteShaderNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetCurrentTimeNV", spv::Op::OpHitObjectGetCurrentTimeNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetAttributesNV", spv::Op::OpHitObjectGetAttributesNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetHitKindNV", spv::Op::OpHitObjectGetHitKindNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetPrimitiveIndexNV", spv::Op::OpHitObjectGetPrimitiveIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetGeometryIndexNV", spv::Op::OpHitObjectGetGeometryIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetInstanceIdNV", spv::Op::OpHitObjectGetInstanceIdNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetInstanceCustomIndexNV", spv::Op::OpHitObjectGetInstanceCustomIndexNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetWorldRayDirectionNV", spv::Op::OpHitObjectGetWorldRayDirectionNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetWorldRayOriginNV", spv::Op::OpHitObjectGetWorldRayOriginNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetRayTMaxNV", spv::Op::OpHitObjectGetRayTMaxNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectGetRayTMinNV", spv::Op::OpHitObjectGetRayTMinNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectIsEmptyNV", spv::Op::OpHitObjectIsEmptyNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectIsHitNV", spv::Op::OpHitObjectIsHitNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"HitObjectIsMissNV", spv::Op::OpHitObjectIsMissNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ReorderThreadWithHitObjectNV", spv::Op::OpReorderThreadWithHitObjectNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ReorderThreadWithHintNV", spv::Op::OpReorderThreadWithHintNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeHitObjectNV", spv::Op::OpTypeHitObjectNV, 1, pygen_variable_caps_ShaderInvocationReorderNV, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageSampleFootprintNV", spv::Op::OpImageSampleFootprintNV, 1, pygen_variable_caps_ImageFootprintNV, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_IMAGE}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_image_footprint, 0xffffffffu, 0xffffffffu}, + {"EmitMeshTasksEXT", spv::Op::OpEmitMeshTasksEXT, 1, pygen_variable_caps_MeshShadingEXT, 4, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SetMeshOutputsEXT", spv::Op::OpSetMeshOutputsEXT, 1, pygen_variable_caps_MeshShadingEXT, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupNonUniformPartitionNV", spv::Op::OpGroupNonUniformPartitionNV, 1, pygen_variable_caps_GroupNonUniformPartitionedNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_shader_subgroup_partitioned, 0xffffffffu, 0xffffffffu}, + {"WritePackedPrimitiveIndices4x8NV", spv::Op::OpWritePackedPrimitiveIndices4x8NV, 1, pygen_variable_caps_MeshShadingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_mesh_shader, 0xffffffffu, 0xffffffffu}, + {"ReportIntersectionKHR", spv::Op::OpReportIntersectionKHR, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"ReportIntersectionNV", spv::Op::OpReportIntersectionNV, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 2, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"IgnoreIntersectionNV", spv::Op::OpIgnoreIntersectionNV, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TerminateRayNV", spv::Op::OpTerminateRayNV, 1, pygen_variable_caps_RayTracingNV, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TraceNV", spv::Op::OpTraceNV, 1, pygen_variable_caps_RayTracingNV, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TraceMotionNV", spv::Op::OpTraceMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, + {"TraceRayMotionNV", spv::Op::OpTraceRayMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, + {"TypeAccelerationStructureKHR", spv::Op::OpTypeAccelerationStructureKHR, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"TypeAccelerationStructureNV", spv::Op::OpTypeAccelerationStructureNV, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"ExecuteCallableNV", spv::Op::OpExecuteCallableNV, 1, pygen_variable_caps_RayTracingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, + {"TypeCooperativeMatrixNV", spv::Op::OpTypeCooperativeMatrixNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixLoadNV", spv::Op::OpCooperativeMatrixLoadNV, 1, pygen_variable_caps_CooperativeMatrixNV, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixStoreNV", spv::Op::OpCooperativeMatrixStoreNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS}, 0, 0, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixMulAddNV", spv::Op::OpCooperativeMatrixMulAddNV, 1, pygen_variable_caps_CooperativeMatrixNV, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"CooperativeMatrixLengthNV", spv::Op::OpCooperativeMatrixLengthNV, 1, pygen_variable_caps_CooperativeMatrixNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_NV_cooperative_matrix, 0xffffffffu, 0xffffffffu}, + {"BeginInvocationInterlockEXT", spv::Op::OpBeginInvocationInterlockEXT, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, + {"EndInvocationInterlockEXT", spv::Op::OpEndInvocationInterlockEXT, 3, pygen_variable_caps_FragmentShaderSampleInterlockEXTFragmentShaderPixelInterlockEXTFragmentShaderShadingRateInterlockEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, 0xffffffffu, 0xffffffffu}, + {"DemoteToHelperInvocation", spv::Op::OpDemoteToHelperInvocation, 1, pygen_variable_caps_DemoteToHelperInvocation, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"DemoteToHelperInvocationEXT", spv::Op::OpDemoteToHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocationEXT, 0, {}, 0, 0, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, + {"IsHelperInvocationEXT", spv::Op::OpIsHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocationEXT, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, 0xffffffffu, 0xffffffffu}, + {"ConvertUToImageNV", spv::Op::OpConvertUToImageNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertUToSamplerNV", spv::Op::OpConvertUToSamplerNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertImageToUNV", spv::Op::OpConvertImageToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertSamplerToUNV", spv::Op::OpConvertSamplerToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertUToSampledImageNV", spv::Op::OpConvertUToSampledImageNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertSampledImageToUNV", spv::Op::OpConvertSampledImageToUNV, 1, pygen_variable_caps_BindlessTextureNV, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SamplerImageAddressingModeNV", spv::Op::OpSamplerImageAddressingModeNV, 1, pygen_variable_caps_BindlessTextureNV, 1, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleINTEL", spv::Op::OpSubgroupShuffleINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleDownINTEL", spv::Op::OpSubgroupShuffleDownINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleUpINTEL", spv::Op::OpSubgroupShuffleUpINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupShuffleXorINTEL", spv::Op::OpSubgroupShuffleXorINTEL, 1, pygen_variable_caps_SubgroupShuffleINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupBlockReadINTEL", spv::Op::OpSubgroupBlockReadINTEL, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupBlockWriteINTEL", spv::Op::OpSubgroupBlockWriteINTEL, 1, pygen_variable_caps_SubgroupBufferBlockIOINTEL, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageBlockReadINTEL", spv::Op::OpSubgroupImageBlockReadINTEL, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageBlockWriteINTEL", spv::Op::OpSubgroupImageBlockWriteINTEL, 1, pygen_variable_caps_SubgroupImageBlockIOINTEL, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageMediaBlockReadINTEL", spv::Op::OpSubgroupImageMediaBlockReadINTEL, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupImageMediaBlockWriteINTEL", spv::Op::OpSubgroupImageMediaBlockWriteINTEL, 1, pygen_variable_caps_SubgroupImageMediaBlockIOINTEL, 5, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UCountLeadingZerosINTEL", spv::Op::OpUCountLeadingZerosINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UCountTrailingZerosINTEL", spv::Op::OpUCountTrailingZerosINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AbsISubINTEL", spv::Op::OpAbsISubINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AbsUSubINTEL", spv::Op::OpAbsUSubINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IAddSatINTEL", spv::Op::OpIAddSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UAddSatINTEL", spv::Op::OpUAddSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IAverageINTEL", spv::Op::OpIAverageINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UAverageINTEL", spv::Op::OpUAverageINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IAverageRoundedINTEL", spv::Op::OpIAverageRoundedINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UAverageRoundedINTEL", spv::Op::OpUAverageRoundedINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ISubSatINTEL", spv::Op::OpISubSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"USubSatINTEL", spv::Op::OpUSubSatINTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"IMul32x16INTEL", spv::Op::OpIMul32x16INTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"UMul32x16INTEL", spv::Op::OpUMul32x16INTEL, 1, pygen_variable_caps_IntegerFunctions2INTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConstantFunctionPointerINTEL", spv::Op::OpConstantFunctionPointerINTEL, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, + {"FunctionPointerCallINTEL", spv::Op::OpFunctionPointerCallINTEL, 1, pygen_variable_caps_FunctionPointersINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_function_pointers, 0xffffffffu, 0xffffffffu}, + {"AsmTargetINTEL", spv::Op::OpAsmTargetINTEL, 1, pygen_variable_caps_AsmINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AsmINTEL", spv::Op::OpAsmINTEL, 1, pygen_variable_caps_AsmINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LITERAL_STRING}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AsmCallINTEL", spv::Op::OpAsmCallINTEL, 1, pygen_variable_caps_AsmINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AtomicFMinEXT", spv::Op::OpAtomicFMinEXT, 3, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AtomicFMaxEXT", spv::Op::OpAtomicFMaxEXT, 3, pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"AssumeTrueKHR", spv::Op::OpAssumeTrueKHR, 1, pygen_variable_caps_ExpectAssumeKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, + {"ExpectKHR", spv::Op::OpExpectKHR, 1, pygen_variable_caps_ExpectAssumeKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_expect_assume, 0xffffffffu, 0xffffffffu}, + {"DecorateString", spv::Op::OpDecorateString, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"DecorateStringGOOGLE", spv::Op::OpDecorateStringGOOGLE, 0, nullptr, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"MemberDecorateString", spv::Op::OpMemberDecorateString, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"MemberDecorateStringGOOGLE", spv::Op::OpMemberDecorateStringGOOGLE, 0, nullptr, 3, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_DECORATION}, 0, 0, 2, pygen_variable_exts_SPV_GOOGLE_decorate_stringSPV_GOOGLE_hlsl_functionality1, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"VmeImageINTEL", spv::Op::OpVmeImageINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeVmeImageINTEL", spv::Op::OpTypeVmeImageINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImePayloadINTEL", spv::Op::OpTypeAvcImePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcRefPayloadINTEL", spv::Op::OpTypeAvcRefPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcSicPayloadINTEL", spv::Op::OpTypeAvcSicPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcMcePayloadINTEL", spv::Op::OpTypeAvcMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcMceResultINTEL", spv::Op::OpTypeAvcMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeResultINTEL", spv::Op::OpTypeAvcImeResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeResultSingleReferenceStreamoutINTEL", spv::Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeResultDualReferenceStreamoutINTEL", spv::Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeSingleReferenceStreaminINTEL", spv::Op::OpTypeAvcImeSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcImeDualReferenceStreaminINTEL", spv::Op::OpTypeAvcImeDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcRefResultINTEL", spv::Op::OpTypeAvcRefResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeAvcSicResultINTEL", spv::Op::OpTypeAvcSicResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetInterShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetInterDirectionPenaltyINTEL", spv::Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL", spv::Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetMotionVectorCostFunctionINTEL", spv::Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL", spv::Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetAcOnlyHaarINTEL", spv::Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL", spv::Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL", spv::Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL", spv::Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToImePayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToImePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToImeResultINTEL", spv::Op::OpSubgroupAvcMceConvertToImeResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToRefPayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToRefPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToRefResultINTEL", spv::Op::OpSubgroupAvcMceConvertToRefResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToSicPayloadINTEL", spv::Op::OpSubgroupAvcMceConvertToSicPayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceConvertToSicResultINTEL", spv::Op::OpSubgroupAvcMceConvertToSicResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetMotionVectorsINTEL", spv::Op::OpSubgroupAvcMceGetMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterDistortionsINTEL", spv::Op::OpSubgroupAvcMceGetInterDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetBestInterDistortionsINTEL", spv::Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterMajorShapeINTEL", spv::Op::OpSubgroupAvcMceGetInterMajorShapeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterMinorShapeINTEL", spv::Op::OpSubgroupAvcMceGetInterMinorShapeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterDirectionsINTEL", spv::Op::OpSubgroupAvcMceGetInterDirectionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterMotionVectorCountINTEL", spv::Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterReferenceIdsINTEL", spv::Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL", spv::Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeInitializeINTEL", spv::Op::OpSubgroupAvcImeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetSingleReferenceINTEL", spv::Op::OpSubgroupAvcImeSetSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetDualReferenceINTEL", spv::Op::OpSubgroupAvcImeSetDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeRefWindowSizeINTEL", spv::Op::OpSubgroupAvcImeRefWindowSizeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeAdjustRefOffsetINTEL", spv::Op::OpSubgroupAvcImeAdjustRefOffsetINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcImeConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetMaxMotionVectorCountINTEL", spv::Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetUnidirectionalMixDisableINTEL", spv::Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetEarlySearchTerminationThresholdINTEL", spv::Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeSetWeightedSadINTEL", spv::Op::OpSubgroupAvcImeSetWeightedSadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL", spv::Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeConvertToMceResultINTEL", spv::Op::OpSubgroupAvcImeConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetSingleReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetDualReferenceStreaminINTEL", spv::Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeStripSingleReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeStripDualReferenceStreamoutINTEL", spv::Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL", spv::Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetBorderReachedINTEL", spv::Op::OpSubgroupAvcImeGetBorderReachedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetTruncatedSearchIndicationINTEL", spv::Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL", spv::Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL", spv::Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL", spv::Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcFmeInitializeINTEL", spv::Op::OpSubgroupAvcFmeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcBmeInitializeINTEL", spv::Op::OpSubgroupAvcBmeInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcRefConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefSetBidirectionalMixDisableINTEL", spv::Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefSetBilinearFilterEnableINTEL", spv::Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithMultiReferenceINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL", spv::Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcRefConvertToMceResultINTEL", spv::Op::OpSubgroupAvcRefConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicInitializeINTEL", spv::Op::OpSubgroupAvcSicInitializeINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConfigureSkcINTEL", spv::Op::OpSubgroupAvcSicConfigureSkcINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConfigureIpeLumaINTEL", spv::Op::OpSubgroupAvcSicConfigureIpeLumaINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConfigureIpeLumaChromaINTEL", spv::Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 13, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetMotionVectorMaskINTEL", spv::Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConvertToMcePayloadINTEL", spv::Op::OpSubgroupAvcSicConvertToMcePayloadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetIntraLumaShapePenaltyINTEL", spv::Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetIntraLumaModeCostFunctionINTEL", spv::Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetIntraChromaModeCostFunctionINTEL", spv::Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetBilinearFilterEnableINTEL", spv::Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetSkcForwardTransformEnableINTEL", spv::Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicSetBlockBasedRawSkipSadINTEL", spv::Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateIpeINTEL", spv::Op::OpSubgroupAvcSicEvaluateIpeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithSingleReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithDualReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithMultiReferenceINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL", spv::Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicConvertToMceResultINTEL", spv::Op::OpSubgroupAvcSicConvertToMceResultINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetIpeLumaShapeINTEL", spv::Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetBestIpeLumaDistortionINTEL", spv::Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetBestIpeChromaDistortionINTEL", spv::Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetPackedIpeLumaModesINTEL", spv::Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetIpeChromaModeINTEL", spv::Op::OpSubgroupAvcSicGetIpeChromaModeINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationChromaINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL", spv::Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL", spv::Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL, 2, pygen_variable_caps_SubgroupAvcMotionEstimationINTELSubgroupAvcMotionEstimationIntraINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SubgroupAvcSicGetInterRawSadsINTEL", spv::Op::OpSubgroupAvcSicGetInterRawSadsINTEL, 1, pygen_variable_caps_SubgroupAvcMotionEstimationINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"VariableLengthArrayINTEL", spv::Op::OpVariableLengthArrayINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SaveMemoryINTEL", spv::Op::OpSaveMemoryINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 2, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"RestoreMemoryINTEL", spv::Op::OpRestoreMemoryINTEL, 1, pygen_variable_caps_VariableLengthArrayINTEL, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinCosPiINTEL", spv::Op::OpArbitraryFloatSinCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCastINTEL", spv::Op::OpArbitraryFloatCastINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCastFromIntINTEL", spv::Op::OpArbitraryFloatCastFromIntINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCastToIntINTEL", spv::Op::OpArbitraryFloatCastToIntINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatAddINTEL", spv::Op::OpArbitraryFloatAddINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSubINTEL", spv::Op::OpArbitraryFloatSubINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatMulINTEL", spv::Op::OpArbitraryFloatMulINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatDivINTEL", spv::Op::OpArbitraryFloatDivINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatGTINTEL", spv::Op::OpArbitraryFloatGTINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatGEINTEL", spv::Op::OpArbitraryFloatGEINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLTINTEL", spv::Op::OpArbitraryFloatLTINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLEINTEL", spv::Op::OpArbitraryFloatLEINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatEQINTEL", spv::Op::OpArbitraryFloatEQINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatRecipINTEL", spv::Op::OpArbitraryFloatRecipINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatRSqrtINTEL", spv::Op::OpArbitraryFloatRSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCbrtINTEL", spv::Op::OpArbitraryFloatCbrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatHypotINTEL", spv::Op::OpArbitraryFloatHypotINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSqrtINTEL", spv::Op::OpArbitraryFloatSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLogINTEL", spv::Op::OpArbitraryFloatLogINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLog2INTEL", spv::Op::OpArbitraryFloatLog2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLog10INTEL", spv::Op::OpArbitraryFloatLog10INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatLog1pINTEL", spv::Op::OpArbitraryFloatLog1pINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExpINTEL", spv::Op::OpArbitraryFloatExpINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExp2INTEL", spv::Op::OpArbitraryFloatExp2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExp10INTEL", spv::Op::OpArbitraryFloatExp10INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatExpm1INTEL", spv::Op::OpArbitraryFloatExpm1INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinINTEL", spv::Op::OpArbitraryFloatSinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCosINTEL", spv::Op::OpArbitraryFloatCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinCosINTEL", spv::Op::OpArbitraryFloatSinCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatSinPiINTEL", spv::Op::OpArbitraryFloatSinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatCosPiINTEL", spv::Op::OpArbitraryFloatCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatASinINTEL", spv::Op::OpArbitraryFloatASinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatASinPiINTEL", spv::Op::OpArbitraryFloatASinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatACosINTEL", spv::Op::OpArbitraryFloatACosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatACosPiINTEL", spv::Op::OpArbitraryFloatACosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatATanINTEL", spv::Op::OpArbitraryFloatATanINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatATanPiINTEL", spv::Op::OpArbitraryFloatATanPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 8, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatATan2INTEL", spv::Op::OpArbitraryFloatATan2INTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatPowINTEL", spv::Op::OpArbitraryFloatPowINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatPowRINTEL", spv::Op::OpArbitraryFloatPowRINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 10, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ArbitraryFloatPowNINTEL", spv::Op::OpArbitraryFloatPowNINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFloatingPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"LoopControlINTEL", spv::Op::OpLoopControlINTEL, 1, pygen_variable_caps_UnstructuredLoopControlsINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER}, 0, 0, 1, pygen_variable_exts_SPV_INTEL_unstructured_loop_controls, 0xffffffffu, 0xffffffffu}, + {"AliasDomainDeclINTEL", spv::Op::OpAliasDomainDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, + {"AliasScopeDeclINTEL", spv::Op::OpAliasScopeDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 3, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, + {"AliasScopeListDeclINTEL", spv::Op::OpAliasScopeListDeclINTEL, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_VARIABLE_ID}, 1, 0, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, 0xffffffffu, 0xffffffffu}, + {"FixedSqrtINTEL", spv::Op::OpFixedSqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedRecipINTEL", spv::Op::OpFixedRecipINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedRsqrtINTEL", spv::Op::OpFixedRsqrtINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinINTEL", spv::Op::OpFixedSinINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedCosINTEL", spv::Op::OpFixedCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinCosINTEL", spv::Op::OpFixedSinCosINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinPiINTEL", spv::Op::OpFixedSinPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedCosPiINTEL", spv::Op::OpFixedCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedSinCosPiINTEL", spv::Op::OpFixedSinCosPiINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedLogINTEL", spv::Op::OpFixedLogINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"FixedExpINTEL", spv::Op::OpFixedExpINTEL, 1, pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL, 9, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"PtrCastToCrossWorkgroupINTEL", spv::Op::OpPtrCastToCrossWorkgroupINTEL, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"CrossWorkgroupCastToPtrINTEL", spv::Op::OpCrossWorkgroupCastToPtrINTEL, 1, pygen_variable_caps_USMStorageClassesINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ReadPipeBlockingINTEL", spv::Op::OpReadPipeBlockingINTEL, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, + {"WritePipeBlockingINTEL", spv::Op::OpWritePipeBlockingINTEL, 1, pygen_variable_caps_BlockingPipesINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, 0xffffffffu, 0xffffffffu}, + {"FPGARegINTEL", spv::Op::OpFPGARegINTEL, 1, pygen_variable_caps_FPGARegINTEL, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_INTEL_fpga_reg, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetRayTMinKHR", spv::Op::OpRayQueryGetRayTMinKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetRayFlagsKHR", spv::Op::OpRayQueryGetRayFlagsKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionTKHR", spv::Op::OpRayQueryGetIntersectionTKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionInstanceCustomIndexKHR", spv::Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionInstanceIdKHR", spv::Op::OpRayQueryGetIntersectionInstanceIdKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR", spv::Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionGeometryIndexKHR", spv::Op::OpRayQueryGetIntersectionGeometryIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionPrimitiveIndexKHR", spv::Op::OpRayQueryGetIntersectionPrimitiveIndexKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionBarycentricsKHR", spv::Op::OpRayQueryGetIntersectionBarycentricsKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionFrontFaceKHR", spv::Op::OpRayQueryGetIntersectionFrontFaceKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionCandidateAABBOpaqueKHR", spv::Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionObjectRayDirectionKHR", spv::Op::OpRayQueryGetIntersectionObjectRayDirectionKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionObjectRayOriginKHR", spv::Op::OpRayQueryGetIntersectionObjectRayOriginKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetWorldRayDirectionKHR", spv::Op::OpRayQueryGetWorldRayDirectionKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetWorldRayOriginKHR", spv::Op::OpRayQueryGetWorldRayOriginKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionObjectToWorldKHR", spv::Op::OpRayQueryGetIntersectionObjectToWorldKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionWorldToObjectKHR", spv::Op::OpRayQueryGetIntersectionWorldToObjectKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"AtomicFAddEXT", spv::Op::OpAtomicFAddEXT, 3, pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXT, 6, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, 0xffffffffu, 0xffffffffu}, + {"TypeBufferSurfaceINTEL", spv::Op::OpTypeBufferSurfaceINTEL, 1, pygen_variable_caps_VectorComputeINTEL, 2, {SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 1, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"TypeStructContinuedINTEL", spv::Op::OpTypeStructContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConstantCompositeContinuedINTEL", spv::Op::OpConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"SpecConstantCompositeContinuedINTEL", spv::Op::OpSpecConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ControlBarrierArriveINTEL", spv::Op::OpControlBarrierArriveINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ControlBarrierWaitINTEL", spv::Op::OpControlBarrierWaitINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupIMulKHR", spv::Op::OpGroupIMulKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupFMulKHR", spv::Op::OpGroupFMulKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupBitwiseAndKHR", spv::Op::OpGroupBitwiseAndKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupBitwiseOrKHR", spv::Op::OpGroupBitwiseOrKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupBitwiseXorKHR", spv::Op::OpGroupBitwiseXorKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupLogicalAndKHR", spv::Op::OpGroupLogicalAndKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupLogicalOrKHR", spv::Op::OpGroupLogicalOrKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"GroupLogicalXorKHR", spv::Op::OpGroupLogicalXorKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu} }; \ No newline at end of file diff --git a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc index 4e60e7cc0..967dbb6a3 100644 --- a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc +++ b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc @@ -78,6 +78,10 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_fpga_buffer_location"; case Extension::kSPV_INTEL_fpga_cluster_attributes: return "SPV_INTEL_fpga_cluster_attributes"; + case Extension::kSPV_INTEL_fpga_dsp_control: + return "SPV_INTEL_fpga_dsp_control"; + case Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes: + return "SPV_INTEL_fpga_invocation_pipelining_attributes"; case Extension::kSPV_INTEL_fpga_loop_controls: return "SPV_INTEL_fpga_loop_controls"; case Extension::kSPV_INTEL_fpga_memory_accesses: @@ -104,6 +108,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_memory_access_aliasing"; case Extension::kSPV_INTEL_optnone: return "SPV_INTEL_optnone"; + case Extension::kSPV_INTEL_runtime_aligned: + return "SPV_INTEL_runtime_aligned"; case Extension::kSPV_INTEL_shader_integer_functions2: return "SPV_INTEL_shader_integer_functions2"; case Extension::kSPV_INTEL_split_barrier: @@ -202,6 +208,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_NV_sample_mask_override_coverage"; case Extension::kSPV_NV_shader_image_footprint: return "SPV_NV_shader_image_footprint"; + case Extension::kSPV_NV_shader_invocation_reorder: + return "SPV_NV_shader_invocation_reorder"; case Extension::kSPV_NV_shader_sm_builtins: return "SPV_NV_shader_sm_builtins"; case Extension::kSPV_NV_shader_subgroup_partitioned: @@ -221,8 +229,8 @@ const char* ExtensionToString(Extension extension) { bool GetExtensionFromString(const char* str, Extension* extension) { - static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_VALIDATOR_ignore_type_decl_unique" }; - static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; + static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_VALIDATOR_ignore_type_decl_unique" }; + static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; const auto b = std::begin(known_ext_strs); const auto e = std::end(known_ext_strs); const auto found = std::equal_range( @@ -236,414 +244,422 @@ const char* ExtensionToString(Extension extension) { } -const char* CapabilityToString(SpvCapability capability) { +const char* CapabilityToString(spv::Capability capability) { switch (capability) { - case SpvCapabilityMatrix: + case spv::Capability::Matrix: return "Matrix"; - case SpvCapabilityShader: + case spv::Capability::Shader: return "Shader"; - case SpvCapabilityGeometry: + case spv::Capability::Geometry: return "Geometry"; - case SpvCapabilityTessellation: + case spv::Capability::Tessellation: return "Tessellation"; - case SpvCapabilityAddresses: + case spv::Capability::Addresses: return "Addresses"; - case SpvCapabilityLinkage: + case spv::Capability::Linkage: return "Linkage"; - case SpvCapabilityKernel: + case spv::Capability::Kernel: return "Kernel"; - case SpvCapabilityVector16: + case spv::Capability::Vector16: return "Vector16"; - case SpvCapabilityFloat16Buffer: + case spv::Capability::Float16Buffer: return "Float16Buffer"; - case SpvCapabilityFloat16: + case spv::Capability::Float16: return "Float16"; - case SpvCapabilityFloat64: + case spv::Capability::Float64: return "Float64"; - case SpvCapabilityInt64: + case spv::Capability::Int64: return "Int64"; - case SpvCapabilityInt64Atomics: + case spv::Capability::Int64Atomics: return "Int64Atomics"; - case SpvCapabilityImageBasic: + case spv::Capability::ImageBasic: return "ImageBasic"; - case SpvCapabilityImageReadWrite: + case spv::Capability::ImageReadWrite: return "ImageReadWrite"; - case SpvCapabilityImageMipmap: + case spv::Capability::ImageMipmap: return "ImageMipmap"; - case SpvCapabilityPipes: + case spv::Capability::Pipes: return "Pipes"; - case SpvCapabilityGroups: + case spv::Capability::Groups: return "Groups"; - case SpvCapabilityDeviceEnqueue: + case spv::Capability::DeviceEnqueue: return "DeviceEnqueue"; - case SpvCapabilityLiteralSampler: + case spv::Capability::LiteralSampler: return "LiteralSampler"; - case SpvCapabilityAtomicStorage: + case spv::Capability::AtomicStorage: return "AtomicStorage"; - case SpvCapabilityInt16: + case spv::Capability::Int16: return "Int16"; - case SpvCapabilityTessellationPointSize: + case spv::Capability::TessellationPointSize: return "TessellationPointSize"; - case SpvCapabilityGeometryPointSize: + case spv::Capability::GeometryPointSize: return "GeometryPointSize"; - case SpvCapabilityImageGatherExtended: + case spv::Capability::ImageGatherExtended: return "ImageGatherExtended"; - case SpvCapabilityStorageImageMultisample: + case spv::Capability::StorageImageMultisample: return "StorageImageMultisample"; - case SpvCapabilityUniformBufferArrayDynamicIndexing: + case spv::Capability::UniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; - case SpvCapabilitySampledImageArrayDynamicIndexing: + case spv::Capability::SampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; - case SpvCapabilityStorageBufferArrayDynamicIndexing: + case spv::Capability::StorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; - case SpvCapabilityStorageImageArrayDynamicIndexing: + case spv::Capability::StorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; - case SpvCapabilityClipDistance: + case spv::Capability::ClipDistance: return "ClipDistance"; - case SpvCapabilityCullDistance: + case spv::Capability::CullDistance: return "CullDistance"; - case SpvCapabilityImageCubeArray: + case spv::Capability::ImageCubeArray: return "ImageCubeArray"; - case SpvCapabilitySampleRateShading: + case spv::Capability::SampleRateShading: return "SampleRateShading"; - case SpvCapabilityImageRect: + case spv::Capability::ImageRect: return "ImageRect"; - case SpvCapabilitySampledRect: + case spv::Capability::SampledRect: return "SampledRect"; - case SpvCapabilityGenericPointer: + case spv::Capability::GenericPointer: return "GenericPointer"; - case SpvCapabilityInt8: + case spv::Capability::Int8: return "Int8"; - case SpvCapabilityInputAttachment: + case spv::Capability::InputAttachment: return "InputAttachment"; - case SpvCapabilitySparseResidency: + case spv::Capability::SparseResidency: return "SparseResidency"; - case SpvCapabilityMinLod: + case spv::Capability::MinLod: return "MinLod"; - case SpvCapabilitySampled1D: + case spv::Capability::Sampled1D: return "Sampled1D"; - case SpvCapabilityImage1D: + case spv::Capability::Image1D: return "Image1D"; - case SpvCapabilitySampledCubeArray: + case spv::Capability::SampledCubeArray: return "SampledCubeArray"; - case SpvCapabilitySampledBuffer: + case spv::Capability::SampledBuffer: return "SampledBuffer"; - case SpvCapabilityImageBuffer: + case spv::Capability::ImageBuffer: return "ImageBuffer"; - case SpvCapabilityImageMSArray: + case spv::Capability::ImageMSArray: return "ImageMSArray"; - case SpvCapabilityStorageImageExtendedFormats: + case spv::Capability::StorageImageExtendedFormats: return "StorageImageExtendedFormats"; - case SpvCapabilityImageQuery: + case spv::Capability::ImageQuery: return "ImageQuery"; - case SpvCapabilityDerivativeControl: + case spv::Capability::DerivativeControl: return "DerivativeControl"; - case SpvCapabilityInterpolationFunction: + case spv::Capability::InterpolationFunction: return "InterpolationFunction"; - case SpvCapabilityTransformFeedback: + case spv::Capability::TransformFeedback: return "TransformFeedback"; - case SpvCapabilityGeometryStreams: + case spv::Capability::GeometryStreams: return "GeometryStreams"; - case SpvCapabilityStorageImageReadWithoutFormat: + case spv::Capability::StorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; - case SpvCapabilityStorageImageWriteWithoutFormat: + case spv::Capability::StorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; - case SpvCapabilityMultiViewport: + case spv::Capability::MultiViewport: return "MultiViewport"; - case SpvCapabilitySubgroupDispatch: + case spv::Capability::SubgroupDispatch: return "SubgroupDispatch"; - case SpvCapabilityNamedBarrier: + case spv::Capability::NamedBarrier: return "NamedBarrier"; - case SpvCapabilityPipeStorage: + case spv::Capability::PipeStorage: return "PipeStorage"; - case SpvCapabilityGroupNonUniform: + case spv::Capability::GroupNonUniform: return "GroupNonUniform"; - case SpvCapabilityGroupNonUniformVote: + case spv::Capability::GroupNonUniformVote: return "GroupNonUniformVote"; - case SpvCapabilityGroupNonUniformArithmetic: + case spv::Capability::GroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; - case SpvCapabilityGroupNonUniformBallot: + case spv::Capability::GroupNonUniformBallot: return "GroupNonUniformBallot"; - case SpvCapabilityGroupNonUniformShuffle: + case spv::Capability::GroupNonUniformShuffle: return "GroupNonUniformShuffle"; - case SpvCapabilityGroupNonUniformShuffleRelative: + case spv::Capability::GroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; - case SpvCapabilityGroupNonUniformClustered: + case spv::Capability::GroupNonUniformClustered: return "GroupNonUniformClustered"; - case SpvCapabilityGroupNonUniformQuad: + case spv::Capability::GroupNonUniformQuad: return "GroupNonUniformQuad"; - case SpvCapabilityShaderLayer: + case spv::Capability::ShaderLayer: return "ShaderLayer"; - case SpvCapabilityShaderViewportIndex: + case spv::Capability::ShaderViewportIndex: return "ShaderViewportIndex"; - case SpvCapabilityUniformDecoration: + case spv::Capability::UniformDecoration: return "UniformDecoration"; - case SpvCapabilityCoreBuiltinsARM: + case spv::Capability::CoreBuiltinsARM: return "CoreBuiltinsARM"; - case SpvCapabilityFragmentShadingRateKHR: + case spv::Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; - case SpvCapabilitySubgroupBallotKHR: + case spv::Capability::SubgroupBallotKHR: return "SubgroupBallotKHR"; - case SpvCapabilityDrawParameters: + case spv::Capability::DrawParameters: return "DrawParameters"; - case SpvCapabilityWorkgroupMemoryExplicitLayoutKHR: + case spv::Capability::WorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; - case SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: + case spv::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; - case SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: + case spv::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; - case SpvCapabilitySubgroupVoteKHR: + case spv::Capability::SubgroupVoteKHR: return "SubgroupVoteKHR"; - case SpvCapabilityStorageBuffer16BitAccess: + case spv::Capability::StorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; - case SpvCapabilityUniformAndStorageBuffer16BitAccess: + case spv::Capability::UniformAndStorageBuffer16BitAccess: return "UniformAndStorageBuffer16BitAccess"; - case SpvCapabilityStoragePushConstant16: + case spv::Capability::StoragePushConstant16: return "StoragePushConstant16"; - case SpvCapabilityStorageInputOutput16: + case spv::Capability::StorageInputOutput16: return "StorageInputOutput16"; - case SpvCapabilityDeviceGroup: + case spv::Capability::DeviceGroup: return "DeviceGroup"; - case SpvCapabilityMultiView: + case spv::Capability::MultiView: return "MultiView"; - case SpvCapabilityVariablePointersStorageBuffer: + case spv::Capability::VariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; - case SpvCapabilityVariablePointers: + case spv::Capability::VariablePointers: return "VariablePointers"; - case SpvCapabilityAtomicStorageOps: + case spv::Capability::AtomicStorageOps: return "AtomicStorageOps"; - case SpvCapabilitySampleMaskPostDepthCoverage: + case spv::Capability::SampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; - case SpvCapabilityStorageBuffer8BitAccess: + case spv::Capability::StorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; - case SpvCapabilityUniformAndStorageBuffer8BitAccess: + case spv::Capability::UniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; - case SpvCapabilityStoragePushConstant8: + case spv::Capability::StoragePushConstant8: return "StoragePushConstant8"; - case SpvCapabilityDenormPreserve: + case spv::Capability::DenormPreserve: return "DenormPreserve"; - case SpvCapabilityDenormFlushToZero: + case spv::Capability::DenormFlushToZero: return "DenormFlushToZero"; - case SpvCapabilitySignedZeroInfNanPreserve: + case spv::Capability::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; - case SpvCapabilityRoundingModeRTE: + case spv::Capability::RoundingModeRTE: return "RoundingModeRTE"; - case SpvCapabilityRoundingModeRTZ: + case spv::Capability::RoundingModeRTZ: return "RoundingModeRTZ"; - case SpvCapabilityRayQueryProvisionalKHR: + case spv::Capability::RayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; - case SpvCapabilityRayQueryKHR: + case spv::Capability::RayQueryKHR: return "RayQueryKHR"; - case SpvCapabilityRayTraversalPrimitiveCullingKHR: + case spv::Capability::RayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; - case SpvCapabilityRayTracingKHR: + case spv::Capability::RayTracingKHR: return "RayTracingKHR"; - case SpvCapabilityFloat16ImageAMD: + case spv::Capability::Float16ImageAMD: return "Float16ImageAMD"; - case SpvCapabilityImageGatherBiasLodAMD: + case spv::Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; - case SpvCapabilityFragmentMaskAMD: + case spv::Capability::FragmentMaskAMD: return "FragmentMaskAMD"; - case SpvCapabilityStencilExportEXT: + case spv::Capability::StencilExportEXT: return "StencilExportEXT"; - case SpvCapabilityImageReadWriteLodAMD: + case spv::Capability::ImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; - case SpvCapabilityInt64ImageEXT: + case spv::Capability::Int64ImageEXT: return "Int64ImageEXT"; - case SpvCapabilityShaderClockKHR: + case spv::Capability::ShaderClockKHR: return "ShaderClockKHR"; - case SpvCapabilitySampleMaskOverrideCoverageNV: + case spv::Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; - case SpvCapabilityGeometryShaderPassthroughNV: + case spv::Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; - case SpvCapabilityShaderViewportIndexLayerEXT: + case spv::Capability::ShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; - case SpvCapabilityShaderViewportMaskNV: + case spv::Capability::ShaderViewportMaskNV: return "ShaderViewportMaskNV"; - case SpvCapabilityShaderStereoViewNV: + case spv::Capability::ShaderStereoViewNV: return "ShaderStereoViewNV"; - case SpvCapabilityPerViewAttributesNV: + case spv::Capability::PerViewAttributesNV: return "PerViewAttributesNV"; - case SpvCapabilityFragmentFullyCoveredEXT: + case spv::Capability::FragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; - case SpvCapabilityMeshShadingNV: + case spv::Capability::MeshShadingNV: return "MeshShadingNV"; - case SpvCapabilityImageFootprintNV: + case spv::Capability::ImageFootprintNV: return "ImageFootprintNV"; - case SpvCapabilityMeshShadingEXT: + case spv::Capability::MeshShadingEXT: return "MeshShadingEXT"; - case SpvCapabilityFragmentBarycentricKHR: + case spv::Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR"; - case SpvCapabilityComputeDerivativeGroupQuadsNV: + case spv::Capability::ComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; - case SpvCapabilityFragmentDensityEXT: + case spv::Capability::FragmentDensityEXT: return "FragmentDensityEXT"; - case SpvCapabilityGroupNonUniformPartitionedNV: + case spv::Capability::GroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; - case SpvCapabilityShaderNonUniform: + case spv::Capability::ShaderNonUniform: return "ShaderNonUniform"; - case SpvCapabilityRuntimeDescriptorArray: + case spv::Capability::RuntimeDescriptorArray: return "RuntimeDescriptorArray"; - case SpvCapabilityInputAttachmentArrayDynamicIndexing: + case spv::Capability::InputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; - case SpvCapabilityUniformTexelBufferArrayDynamicIndexing: + case spv::Capability::UniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; - case SpvCapabilityStorageTexelBufferArrayDynamicIndexing: + case spv::Capability::StorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; - case SpvCapabilityUniformBufferArrayNonUniformIndexing: + case spv::Capability::UniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; - case SpvCapabilitySampledImageArrayNonUniformIndexing: + case spv::Capability::SampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; - case SpvCapabilityStorageBufferArrayNonUniformIndexing: + case spv::Capability::StorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; - case SpvCapabilityStorageImageArrayNonUniformIndexing: + case spv::Capability::StorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; - case SpvCapabilityInputAttachmentArrayNonUniformIndexing: + case spv::Capability::InputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; - case SpvCapabilityUniformTexelBufferArrayNonUniformIndexing: + case spv::Capability::UniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; - case SpvCapabilityStorageTexelBufferArrayNonUniformIndexing: + case spv::Capability::StorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; - case SpvCapabilityRayTracingNV: + case spv::Capability::RayTracingNV: return "RayTracingNV"; - case SpvCapabilityRayTracingMotionBlurNV: + case spv::Capability::RayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; - case SpvCapabilityVulkanMemoryModel: + case spv::Capability::VulkanMemoryModel: return "VulkanMemoryModel"; - case SpvCapabilityVulkanMemoryModelDeviceScope: + case spv::Capability::VulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; - case SpvCapabilityPhysicalStorageBufferAddresses: + case spv::Capability::PhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; - case SpvCapabilityComputeDerivativeGroupLinearNV: + case spv::Capability::ComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; - case SpvCapabilityRayTracingProvisionalKHR: + case spv::Capability::RayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; - case SpvCapabilityCooperativeMatrixNV: + case spv::Capability::CooperativeMatrixNV: return "CooperativeMatrixNV"; - case SpvCapabilityFragmentShaderSampleInterlockEXT: + case spv::Capability::FragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; - case SpvCapabilityFragmentShaderShadingRateInterlockEXT: + case spv::Capability::FragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; - case SpvCapabilityShaderSMBuiltinsNV: + case spv::Capability::ShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; - case SpvCapabilityFragmentShaderPixelInterlockEXT: + case spv::Capability::FragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; - case SpvCapabilityDemoteToHelperInvocation: + case spv::Capability::DemoteToHelperInvocation: return "DemoteToHelperInvocation"; - case SpvCapabilityRayTracingOpacityMicromapEXT: + case spv::Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; - case SpvCapabilityBindlessTextureNV: + case spv::Capability::ShaderInvocationReorderNV: + return "ShaderInvocationReorderNV"; + case spv::Capability::BindlessTextureNV: return "BindlessTextureNV"; - case SpvCapabilitySubgroupShuffleINTEL: + case spv::Capability::SubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; - case SpvCapabilitySubgroupBufferBlockIOINTEL: + case spv::Capability::SubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; - case SpvCapabilitySubgroupImageBlockIOINTEL: + case spv::Capability::SubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; - case SpvCapabilitySubgroupImageMediaBlockIOINTEL: + case spv::Capability::SubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; - case SpvCapabilityRoundToInfinityINTEL: + case spv::Capability::RoundToInfinityINTEL: return "RoundToInfinityINTEL"; - case SpvCapabilityFloatingPointModeINTEL: + case spv::Capability::FloatingPointModeINTEL: return "FloatingPointModeINTEL"; - case SpvCapabilityIntegerFunctions2INTEL: + case spv::Capability::IntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; - case SpvCapabilityFunctionPointersINTEL: + case spv::Capability::FunctionPointersINTEL: return "FunctionPointersINTEL"; - case SpvCapabilityIndirectReferencesINTEL: + case spv::Capability::IndirectReferencesINTEL: return "IndirectReferencesINTEL"; - case SpvCapabilityAsmINTEL: + case spv::Capability::AsmINTEL: return "AsmINTEL"; - case SpvCapabilityAtomicFloat32MinMaxEXT: + case spv::Capability::AtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; - case SpvCapabilityAtomicFloat64MinMaxEXT: + case spv::Capability::AtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; - case SpvCapabilityAtomicFloat16MinMaxEXT: + case spv::Capability::AtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; - case SpvCapabilityVectorComputeINTEL: + case spv::Capability::VectorComputeINTEL: return "VectorComputeINTEL"; - case SpvCapabilityVectorAnyINTEL: + case spv::Capability::VectorAnyINTEL: return "VectorAnyINTEL"; - case SpvCapabilityExpectAssumeKHR: + case spv::Capability::ExpectAssumeKHR: return "ExpectAssumeKHR"; - case SpvCapabilitySubgroupAvcMotionEstimationINTEL: + case spv::Capability::SubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; - case SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL: + case spv::Capability::SubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; - case SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL: + case spv::Capability::SubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; - case SpvCapabilityVariableLengthArrayINTEL: + case spv::Capability::VariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; - case SpvCapabilityFunctionFloatControlINTEL: + case spv::Capability::FunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; - case SpvCapabilityFPGAMemoryAttributesINTEL: + case spv::Capability::FPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; - case SpvCapabilityFPFastMathModeINTEL: + case spv::Capability::FPFastMathModeINTEL: return "FPFastMathModeINTEL"; - case SpvCapabilityArbitraryPrecisionIntegersINTEL: + case spv::Capability::ArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; - case SpvCapabilityArbitraryPrecisionFloatingPointINTEL: + case spv::Capability::ArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; - case SpvCapabilityUnstructuredLoopControlsINTEL: + case spv::Capability::UnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; - case SpvCapabilityFPGALoopControlsINTEL: + case spv::Capability::FPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; - case SpvCapabilityKernelAttributesINTEL: + case spv::Capability::KernelAttributesINTEL: return "KernelAttributesINTEL"; - case SpvCapabilityFPGAKernelAttributesINTEL: + case spv::Capability::FPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; - case SpvCapabilityFPGAMemoryAccessesINTEL: + case spv::Capability::FPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; - case SpvCapabilityFPGAClusterAttributesINTEL: + case spv::Capability::FPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; - case SpvCapabilityLoopFuseINTEL: + case spv::Capability::LoopFuseINTEL: return "LoopFuseINTEL"; - case SpvCapabilityMemoryAccessAliasingINTEL: + case spv::Capability::FPGADSPControlINTEL: + return "FPGADSPControlINTEL"; + case spv::Capability::MemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; - case SpvCapabilityFPGABufferLocationINTEL: + case spv::Capability::FPGAInvocationPipeliningAttributesINTEL: + return "FPGAInvocationPipeliningAttributesINTEL"; + case spv::Capability::FPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; - case SpvCapabilityArbitraryPrecisionFixedPointINTEL: + case spv::Capability::ArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; - case SpvCapabilityUSMStorageClassesINTEL: + case spv::Capability::USMStorageClassesINTEL: return "USMStorageClassesINTEL"; - case SpvCapabilityIOPipesINTEL: + case spv::Capability::RuntimeAlignedAttributeINTEL: + return "RuntimeAlignedAttributeINTEL"; + case spv::Capability::IOPipesINTEL: return "IOPipesINTEL"; - case SpvCapabilityBlockingPipesINTEL: + case spv::Capability::BlockingPipesINTEL: return "BlockingPipesINTEL"; - case SpvCapabilityFPGARegINTEL: + case spv::Capability::FPGARegINTEL: return "FPGARegINTEL"; - case SpvCapabilityDotProductInputAll: + case spv::Capability::DotProductInputAll: return "DotProductInputAll"; - case SpvCapabilityDotProductInput4x8Bit: + case spv::Capability::DotProductInput4x8Bit: return "DotProductInput4x8Bit"; - case SpvCapabilityDotProductInput4x8BitPacked: + case spv::Capability::DotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; - case SpvCapabilityDotProduct: + case spv::Capability::DotProduct: return "DotProduct"; - case SpvCapabilityRayCullMaskKHR: + case spv::Capability::RayCullMaskKHR: return "RayCullMaskKHR"; - case SpvCapabilityBitInstructions: + case spv::Capability::BitInstructions: return "BitInstructions"; - case SpvCapabilityGroupNonUniformRotateKHR: + case spv::Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; - case SpvCapabilityAtomicFloat32AddEXT: + case spv::Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; - case SpvCapabilityAtomicFloat64AddEXT: + case spv::Capability::AtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; - case SpvCapabilityLongConstantCompositeINTEL: + case spv::Capability::LongConstantCompositeINTEL: return "LongConstantCompositeINTEL"; - case SpvCapabilityOptNoneINTEL: + case spv::Capability::OptNoneINTEL: return "OptNoneINTEL"; - case SpvCapabilityAtomicFloat16AddEXT: + case spv::Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; - case SpvCapabilityDebugInfoModuleINTEL: + case spv::Capability::DebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; - case SpvCapabilitySplitBarrierINTEL: + case spv::Capability::SplitBarrierINTEL: return "SplitBarrierINTEL"; - case SpvCapabilityGroupUniformArithmeticKHR: + case spv::Capability::GroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; - case SpvCapabilityMax: - assert(0 && "Attempting to convert SpvCapabilityMax to string"); + case spv::Capability::Max: + assert(0 && "Attempting to convert spv::Capability::Max to string"); return ""; } diff --git a/3rdparty/spirv-tools/include/generated/extension_enum.inc b/3rdparty/spirv-tools/include/generated/extension_enum.inc index 5597f09a6..cc785937c 100644 --- a/3rdparty/spirv-tools/include/generated/extension_enum.inc +++ b/3rdparty/spirv-tools/include/generated/extension_enum.inc @@ -37,6 +37,8 @@ kSPV_INTEL_float_controls2, kSPV_INTEL_fp_fast_math_mode, kSPV_INTEL_fpga_buffer_location, kSPV_INTEL_fpga_cluster_attributes, +kSPV_INTEL_fpga_dsp_control, +kSPV_INTEL_fpga_invocation_pipelining_attributes, kSPV_INTEL_fpga_loop_controls, kSPV_INTEL_fpga_memory_accesses, kSPV_INTEL_fpga_memory_attributes, @@ -50,6 +52,7 @@ kSPV_INTEL_loop_fuse, kSPV_INTEL_media_block_io, kSPV_INTEL_memory_access_aliasing, kSPV_INTEL_optnone, +kSPV_INTEL_runtime_aligned, kSPV_INTEL_shader_integer_functions2, kSPV_INTEL_split_barrier, kSPV_INTEL_subgroups, @@ -99,6 +102,7 @@ kSPV_NV_ray_tracing, kSPV_NV_ray_tracing_motion_blur, kSPV_NV_sample_mask_override_coverage, kSPV_NV_shader_image_footprint, +kSPV_NV_shader_invocation_reorder, kSPV_NV_shader_sm_builtins, kSPV_NV_shader_subgroup_partitioned, kSPV_NV_shading_rate, diff --git a/3rdparty/spirv-tools/include/generated/generators.inc b/3rdparty/spirv-tools/include/generated/generators.inc index a0ff5fefb..c8178b404 100644 --- a/3rdparty/spirv-tools/include/generated/generators.inc +++ b/3rdparty/spirv-tools/include/generated/generators.inc @@ -33,4 +33,5 @@ {32, "TornadoVM", "SPIRV Beehive Toolkit", "TornadoVM SPIRV Beehive Toolkit"}, {33, "DragonJoker", "ShaderWriter", "DragonJoker ShaderWriter"}, {34, "Rayan Hatout", "SPIRVSmith", "Rayan Hatout SPIRVSmith"}, -{35, "Saarland University", "Shady", "Saarland University Shady"}, \ No newline at end of file +{35, "Saarland University", "Shady", "Saarland University Shady"}, +{36, "Taichi Graphics", "Taichi", "Taichi Graphics Taichi"}, \ No newline at end of file diff --git a/3rdparty/spirv-tools/include/generated/glsl.std.450.insts.inc b/3rdparty/spirv-tools/include/generated/glsl.std.450.insts.inc index 7d3866d80..89fe94805 100644 --- a/3rdparty/spirv-tools/include/generated/glsl.std.450.insts.inc +++ b/3rdparty/spirv-tools/include/generated/glsl.std.450.insts.inc @@ -1,5 +1,5 @@ -static const SpvCapability pygen_variable_caps_Float64[] = {SpvCapabilityFloat64}; -static const SpvCapability pygen_variable_caps_InterpolationFunction[] = {SpvCapabilityInterpolationFunction}; +static const spv::Capability pygen_variable_caps_Float64[] = {spv::Capability::Float64}; +static const spv::Capability pygen_variable_caps_InterpolationFunction[] = {spv::Capability::InterpolationFunction}; static const spv_ext_inst_desc_t glsl_entries[] = { {"Round", 1, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, diff --git a/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc b/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc index c3e38dd4c..f774297d2 100644 --- a/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc +++ b/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc @@ -1,7 +1,7 @@ static const spv_ext_inst_desc_t nonsemantic_clspvreflection_entries[] = { - {"Kernel", 1, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"Kernel", 1, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}}, {"ArgumentInfo", 2, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}}, {"ArgumentStorageBuffer", 3, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}}, {"ArgumentUniform", 4, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}}, @@ -35,5 +35,10 @@ static const spv_ext_inst_desc_t nonsemantic_clspvreflection_entries[] = { {"ImageArgumentInfoChannelOrderUniform", 32, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, {"ImageArgumentInfoChannelDataTypeUniform", 33, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, {"ArgumentStorageTexelBuffer", 34, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}}, - {"ArgumentUniformTexelBuffer", 35, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}} + {"ArgumentUniformTexelBuffer", 35, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}}, + {"ConstantDataPointerPushConstant", 36, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"ProgramScopeVariablePointerPushConstant", 37, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"PrintfInfo", 38, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_VARIABLE_ID, SPV_OPERAND_TYPE_NONE}}, + {"PrintfBufferStorageBuffer", 39, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}, + {"PrintfBufferPointerPushConstant", 40, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}} }; \ No newline at end of file diff --git a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc index 543a6e99f..b6d9c6b7a 100644 --- a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc @@ -1,129 +1,133 @@ -static const SpvCapability pygen_variable_caps_Addresses[] = {SpvCapabilityAddresses}; -static const SpvCapability pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL[] = {SpvCapabilityArbitraryPrecisionFixedPointINTEL}; -static const SpvCapability pygen_variable_caps_AsmINTEL[] = {SpvCapabilityAsmINTEL}; -static const SpvCapability pygen_variable_caps_AtomicStorage[] = {SpvCapabilityAtomicStorage}; -static const SpvCapability pygen_variable_caps_BindlessTextureNV[] = {SpvCapabilityBindlessTextureNV}; -static const SpvCapability pygen_variable_caps_ClipDistance[] = {SpvCapabilityClipDistance}; -static const SpvCapability pygen_variable_caps_ComputeDerivativeGroupLinearNV[] = {SpvCapabilityComputeDerivativeGroupLinearNV}; -static const SpvCapability pygen_variable_caps_ComputeDerivativeGroupQuadsNV[] = {SpvCapabilityComputeDerivativeGroupQuadsNV}; -static const SpvCapability pygen_variable_caps_CoreBuiltinsARM[] = {SpvCapabilityCoreBuiltinsARM}; -static const SpvCapability pygen_variable_caps_CullDistance[] = {SpvCapabilityCullDistance}; -static const SpvCapability pygen_variable_caps_DenormFlushToZero[] = {SpvCapabilityDenormFlushToZero}; -static const SpvCapability pygen_variable_caps_DenormPreserve[] = {SpvCapabilityDenormPreserve}; -static const SpvCapability pygen_variable_caps_DeviceEnqueue[] = {SpvCapabilityDeviceEnqueue}; -static const SpvCapability pygen_variable_caps_DeviceGroup[] = {SpvCapabilityDeviceGroup}; -static const SpvCapability pygen_variable_caps_DrawParameters[] = {SpvCapabilityDrawParameters}; -static const SpvCapability pygen_variable_caps_DrawParametersMeshShadingNVMeshShadingEXT[] = {SpvCapabilityDrawParameters, SpvCapabilityMeshShadingNV, SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_FPFastMathModeINTEL[] = {SpvCapabilityFPFastMathModeINTEL}; -static const SpvCapability pygen_variable_caps_FPGABufferLocationINTEL[] = {SpvCapabilityFPGABufferLocationINTEL}; -static const SpvCapability pygen_variable_caps_FPGAClusterAttributesINTEL[] = {SpvCapabilityFPGAClusterAttributesINTEL}; -static const SpvCapability pygen_variable_caps_FPGAKernelAttributesINTEL[] = {SpvCapabilityFPGAKernelAttributesINTEL}; -static const SpvCapability pygen_variable_caps_FPGALoopControlsINTEL[] = {SpvCapabilityFPGALoopControlsINTEL}; -static const SpvCapability pygen_variable_caps_FPGAMemoryAccessesINTEL[] = {SpvCapabilityFPGAMemoryAccessesINTEL}; -static const SpvCapability pygen_variable_caps_FPGAMemoryAttributesINTEL[] = {SpvCapabilityFPGAMemoryAttributesINTEL}; -static const SpvCapability pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR[] = {SpvCapabilityFragmentBarycentricNV, SpvCapabilityFragmentBarycentricKHR}; -static const SpvCapability pygen_variable_caps_FragmentDensityEXTShadingRateNV[] = {SpvCapabilityFragmentDensityEXT, SpvCapabilityShadingRateNV}; -static const SpvCapability pygen_variable_caps_FragmentFullyCoveredEXT[] = {SpvCapabilityFragmentFullyCoveredEXT}; -static const SpvCapability pygen_variable_caps_FragmentShaderPixelInterlockEXT[] = {SpvCapabilityFragmentShaderPixelInterlockEXT}; -static const SpvCapability pygen_variable_caps_FragmentShaderSampleInterlockEXT[] = {SpvCapabilityFragmentShaderSampleInterlockEXT}; -static const SpvCapability pygen_variable_caps_FragmentShaderShadingRateInterlockEXT[] = {SpvCapabilityFragmentShaderShadingRateInterlockEXT}; -static const SpvCapability pygen_variable_caps_FragmentShadingRateKHR[] = {SpvCapabilityFragmentShadingRateKHR}; -static const SpvCapability pygen_variable_caps_FunctionFloatControlINTEL[] = {SpvCapabilityFunctionFloatControlINTEL}; -static const SpvCapability pygen_variable_caps_FunctionPointersINTEL[] = {SpvCapabilityFunctionPointersINTEL}; -static const SpvCapability pygen_variable_caps_GenericPointer[] = {SpvCapabilityGenericPointer}; -static const SpvCapability pygen_variable_caps_Geometry[] = {SpvCapabilityGeometry}; -static const SpvCapability pygen_variable_caps_GeometryMeshShadingNVMeshShadingEXT[] = {SpvCapabilityGeometry, SpvCapabilityMeshShadingNV, SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_GeometryShaderLayerShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT[] = {SpvCapabilityGeometry, SpvCapabilityShaderLayer, SpvCapabilityShaderViewportIndexLayerEXT, SpvCapabilityMeshShadingNV, SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_GeometryTessellation[] = {SpvCapabilityGeometry, SpvCapabilityTessellation}; -static const SpvCapability pygen_variable_caps_GeometryTessellationMeshShadingNVMeshShadingEXT[] = {SpvCapabilityGeometry, SpvCapabilityTessellation, SpvCapabilityMeshShadingNV, SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_GeometryTessellationRayTracingNVRayTracingKHRMeshShadingNVMeshShadingEXT[] = {SpvCapabilityGeometry, SpvCapabilityTessellation, SpvCapabilityRayTracingNV, SpvCapabilityRayTracingKHR, SpvCapabilityMeshShadingNV, SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_GeometryShaderPassthroughNV[] = {SpvCapabilityGeometryShaderPassthroughNV}; -static const SpvCapability pygen_variable_caps_GeometryStreams[] = {SpvCapabilityGeometryStreams}; -static const SpvCapability pygen_variable_caps_GroupNonUniform[] = {SpvCapabilityGroupNonUniform}; -static const SpvCapability pygen_variable_caps_GroupNonUniformClustered[] = {SpvCapabilityGroupNonUniformClustered}; -static const SpvCapability pygen_variable_caps_GroupNonUniformPartitionedNV[] = {SpvCapabilityGroupNonUniformPartitionedNV}; -static const SpvCapability pygen_variable_caps_IOPipesINTEL[] = {SpvCapabilityIOPipesINTEL}; -static const SpvCapability pygen_variable_caps_ImageBasic[] = {SpvCapabilityImageBasic}; -static const SpvCapability pygen_variable_caps_ImageBuffer[] = {SpvCapabilityImageBuffer}; -static const SpvCapability pygen_variable_caps_ImageBufferShaderNonUniform[] = {SpvCapabilityImageBuffer, SpvCapabilityShaderNonUniform}; -static const SpvCapability pygen_variable_caps_ImageGatherExtended[] = {SpvCapabilityImageGatherExtended}; -static const SpvCapability pygen_variable_caps_IndirectReferencesINTEL[] = {SpvCapabilityIndirectReferencesINTEL}; -static const SpvCapability pygen_variable_caps_InputAttachment[] = {SpvCapabilityInputAttachment}; -static const SpvCapability pygen_variable_caps_InputAttachmentShaderNonUniform[] = {SpvCapabilityInputAttachment, SpvCapabilityShaderNonUniform}; -static const SpvCapability pygen_variable_caps_Int64[] = {SpvCapabilityInt64}; -static const SpvCapability pygen_variable_caps_Int64ImageEXT[] = {SpvCapabilityInt64ImageEXT}; -static const SpvCapability pygen_variable_caps_Int8[] = {SpvCapabilityInt8}; -static const SpvCapability pygen_variable_caps_Kernel[] = {SpvCapabilityKernel}; -static const SpvCapability pygen_variable_caps_KernelGroupNonUniform[] = {SpvCapabilityKernel, SpvCapabilityGroupNonUniform}; -static const SpvCapability pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR[] = {SpvCapabilityKernel, SpvCapabilityGroupNonUniform, SpvCapabilitySubgroupBallotKHR}; -static const SpvCapability pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot[] = {SpvCapabilityKernel, SpvCapabilityGroupNonUniformArithmetic, SpvCapabilityGroupNonUniformBallot}; -static const SpvCapability pygen_variable_caps_KernelAttributesINTEL[] = {SpvCapabilityKernelAttributesINTEL}; -static const SpvCapability pygen_variable_caps_Linkage[] = {SpvCapabilityLinkage}; -static const SpvCapability pygen_variable_caps_LoopFuseINTEL[] = {SpvCapabilityLoopFuseINTEL}; -static const SpvCapability pygen_variable_caps_Matrix[] = {SpvCapabilityMatrix}; -static const SpvCapability pygen_variable_caps_MemoryAccessAliasingINTEL[] = {SpvCapabilityMemoryAccessAliasingINTEL}; -static const SpvCapability pygen_variable_caps_MeshShadingEXT[] = {SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_MeshShadingNV[] = {SpvCapabilityMeshShadingNV}; -static const SpvCapability pygen_variable_caps_MeshShadingNVMeshShadingEXT[] = {SpvCapabilityMeshShadingNV, SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_MinLod[] = {SpvCapabilityMinLod}; -static const SpvCapability pygen_variable_caps_MultiView[] = {SpvCapabilityMultiView}; -static const SpvCapability pygen_variable_caps_MultiViewport[] = {SpvCapabilityMultiViewport}; -static const SpvCapability pygen_variable_caps_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT[] = {SpvCapabilityMultiViewport, SpvCapabilityShaderViewportIndex, SpvCapabilityShaderViewportIndexLayerEXT, SpvCapabilityMeshShadingNV, SpvCapabilityMeshShadingEXT}; -static const SpvCapability pygen_variable_caps_OptNoneINTEL[] = {SpvCapabilityOptNoneINTEL}; -static const SpvCapability pygen_variable_caps_PerViewAttributesNVMeshShadingNV[] = {SpvCapabilityPerViewAttributesNV, SpvCapabilityMeshShadingNV}; -static const SpvCapability pygen_variable_caps_PhysicalStorageBufferAddresses[] = {SpvCapabilityPhysicalStorageBufferAddresses}; -static const SpvCapability pygen_variable_caps_Pipes[] = {SpvCapabilityPipes}; -static const SpvCapability pygen_variable_caps_RayCullMaskKHR[] = {SpvCapabilityRayCullMaskKHR}; -static const SpvCapability pygen_variable_caps_RayQueryKHR[] = {SpvCapabilityRayQueryKHR}; -static const SpvCapability pygen_variable_caps_RayQueryKHRRayTracingKHR[] = {SpvCapabilityRayQueryKHR, SpvCapabilityRayTracingKHR}; -static const SpvCapability pygen_variable_caps_RayTracingKHR[] = {SpvCapabilityRayTracingKHR}; -static const SpvCapability pygen_variable_caps_RayTracingMotionBlurNV[] = {SpvCapabilityRayTracingMotionBlurNV}; -static const SpvCapability pygen_variable_caps_RayTracingNV[] = {SpvCapabilityRayTracingNV}; -static const SpvCapability pygen_variable_caps_RayTracingNVRayTracingKHR[] = {SpvCapabilityRayTracingNV, SpvCapabilityRayTracingKHR}; -static const SpvCapability pygen_variable_caps_RayTracingOpacityMicromapEXT[] = {SpvCapabilityRayTracingOpacityMicromapEXT}; -static const SpvCapability pygen_variable_caps_RayTraversalPrimitiveCullingKHR[] = {SpvCapabilityRayTraversalPrimitiveCullingKHR}; -static const SpvCapability pygen_variable_caps_RoundToInfinityINTEL[] = {SpvCapabilityRoundToInfinityINTEL}; -static const SpvCapability pygen_variable_caps_RoundingModeRTE[] = {SpvCapabilityRoundingModeRTE}; -static const SpvCapability pygen_variable_caps_RoundingModeRTZ[] = {SpvCapabilityRoundingModeRTZ}; -static const SpvCapability pygen_variable_caps_SampleMaskOverrideCoverageNV[] = {SpvCapabilitySampleMaskOverrideCoverageNV}; -static const SpvCapability pygen_variable_caps_SampleMaskPostDepthCoverage[] = {SpvCapabilitySampleMaskPostDepthCoverage}; -static const SpvCapability pygen_variable_caps_SampleRateShading[] = {SpvCapabilitySampleRateShading}; -static const SpvCapability pygen_variable_caps_Sampled1D[] = {SpvCapabilitySampled1D}; -static const SpvCapability pygen_variable_caps_Sampled1DImage1D[] = {SpvCapabilitySampled1D, SpvCapabilityImage1D}; -static const SpvCapability pygen_variable_caps_SampledBuffer[] = {SpvCapabilitySampledBuffer}; -static const SpvCapability pygen_variable_caps_SampledBufferImageBuffer[] = {SpvCapabilitySampledBuffer, SpvCapabilityImageBuffer}; -static const SpvCapability pygen_variable_caps_SampledBufferShaderNonUniform[] = {SpvCapabilitySampledBuffer, SpvCapabilityShaderNonUniform}; -static const SpvCapability pygen_variable_caps_SampledCubeArray[] = {SpvCapabilitySampledCubeArray}; -static const SpvCapability pygen_variable_caps_SampledRect[] = {SpvCapabilitySampledRect}; -static const SpvCapability pygen_variable_caps_SampledRectImageRect[] = {SpvCapabilitySampledRect, SpvCapabilityImageRect}; -static const SpvCapability pygen_variable_caps_Shader[] = {SpvCapabilityShader}; -static const SpvCapability pygen_variable_caps_ShaderImageCubeArray[] = {SpvCapabilityShader, SpvCapabilityImageCubeArray}; -static const SpvCapability pygen_variable_caps_ShaderKernel[] = {SpvCapabilityShader, SpvCapabilityKernel}; -static const SpvCapability pygen_variable_caps_ShaderKernelImageMSArray[] = {SpvCapabilityShader, SpvCapabilityKernel, SpvCapabilityImageMSArray}; -static const SpvCapability pygen_variable_caps_ShaderUniformDecoration[] = {SpvCapabilityShader, SpvCapabilityUniformDecoration}; -static const SpvCapability pygen_variable_caps_ShaderVectorComputeINTEL[] = {SpvCapabilityShader, SpvCapabilityVectorComputeINTEL}; -static const SpvCapability pygen_variable_caps_ShaderNonUniform[] = {SpvCapabilityShaderNonUniform}; -static const SpvCapability pygen_variable_caps_ShaderSMBuiltinsNV[] = {SpvCapabilityShaderSMBuiltinsNV}; -static const SpvCapability pygen_variable_caps_ShaderStereoViewNV[] = {SpvCapabilityShaderStereoViewNV}; -static const SpvCapability pygen_variable_caps_ShaderViewportIndexLayerNV[] = {SpvCapabilityShaderViewportIndexLayerNV}; -static const SpvCapability pygen_variable_caps_ShaderViewportMaskNV[] = {SpvCapabilityShaderViewportMaskNV}; -static const SpvCapability pygen_variable_caps_ShaderViewportMaskNVMeshShadingNV[] = {SpvCapabilityShaderViewportMaskNV, SpvCapabilityMeshShadingNV}; -static const SpvCapability pygen_variable_caps_ShadingRateNVFragmentDensityEXT[] = {SpvCapabilityShadingRateNV, SpvCapabilityFragmentDensityEXT}; -static const SpvCapability pygen_variable_caps_SignedZeroInfNanPreserve[] = {SpvCapabilitySignedZeroInfNanPreserve}; -static const SpvCapability pygen_variable_caps_StencilExportEXT[] = {SpvCapabilityStencilExportEXT}; -static const SpvCapability pygen_variable_caps_StorageBuffer16BitAccessStorageUniformBufferBlock16[] = {SpvCapabilityStorageBuffer16BitAccess, SpvCapabilityStorageUniformBufferBlock16}; -static const SpvCapability pygen_variable_caps_StorageBuffer8BitAccess[] = {SpvCapabilityStorageBuffer8BitAccess}; -static const SpvCapability pygen_variable_caps_StorageImageExtendedFormats[] = {SpvCapabilityStorageImageExtendedFormats}; -static const SpvCapability pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot[] = {SpvCapabilitySubgroupBallotKHR, SpvCapabilityGroupNonUniformBallot}; -static const SpvCapability pygen_variable_caps_SubgroupDispatch[] = {SpvCapabilitySubgroupDispatch}; -static const SpvCapability pygen_variable_caps_Tessellation[] = {SpvCapabilityTessellation}; -static const SpvCapability pygen_variable_caps_TransformFeedback[] = {SpvCapabilityTransformFeedback}; -static const SpvCapability pygen_variable_caps_USMStorageClassesINTEL[] = {SpvCapabilityUSMStorageClassesINTEL}; -static const SpvCapability pygen_variable_caps_VariablePointersStorageBuffer[] = {SpvCapabilityVariablePointersStorageBuffer}; -static const SpvCapability pygen_variable_caps_VectorAnyINTEL[] = {SpvCapabilityVectorAnyINTEL}; -static const SpvCapability pygen_variable_caps_VectorComputeINTEL[] = {SpvCapabilityVectorComputeINTEL}; -static const SpvCapability pygen_variable_caps_VulkanMemoryModel[] = {SpvCapabilityVulkanMemoryModel}; -static const SpvCapability pygen_variable_caps_WorkgroupMemoryExplicitLayoutKHR[] = {SpvCapabilityWorkgroupMemoryExplicitLayoutKHR}; +static const spv::Capability pygen_variable_caps_Addresses[] = {spv::Capability::Addresses}; +static const spv::Capability pygen_variable_caps_ArbitraryPrecisionFixedPointINTEL[] = {spv::Capability::ArbitraryPrecisionFixedPointINTEL}; +static const spv::Capability pygen_variable_caps_AsmINTEL[] = {spv::Capability::AsmINTEL}; +static const spv::Capability pygen_variable_caps_AtomicStorage[] = {spv::Capability::AtomicStorage}; +static const spv::Capability pygen_variable_caps_BindlessTextureNV[] = {spv::Capability::BindlessTextureNV}; +static const spv::Capability pygen_variable_caps_ClipDistance[] = {spv::Capability::ClipDistance}; +static const spv::Capability pygen_variable_caps_ComputeDerivativeGroupLinearNV[] = {spv::Capability::ComputeDerivativeGroupLinearNV}; +static const spv::Capability pygen_variable_caps_ComputeDerivativeGroupQuadsNV[] = {spv::Capability::ComputeDerivativeGroupQuadsNV}; +static const spv::Capability pygen_variable_caps_CoreBuiltinsARM[] = {spv::Capability::CoreBuiltinsARM}; +static const spv::Capability pygen_variable_caps_CullDistance[] = {spv::Capability::CullDistance}; +static const spv::Capability pygen_variable_caps_DenormFlushToZero[] = {spv::Capability::DenormFlushToZero}; +static const spv::Capability pygen_variable_caps_DenormPreserve[] = {spv::Capability::DenormPreserve}; +static const spv::Capability pygen_variable_caps_DeviceEnqueue[] = {spv::Capability::DeviceEnqueue}; +static const spv::Capability pygen_variable_caps_DeviceGroup[] = {spv::Capability::DeviceGroup}; +static const spv::Capability pygen_variable_caps_DrawParameters[] = {spv::Capability::DrawParameters}; +static const spv::Capability pygen_variable_caps_DrawParametersMeshShadingNVMeshShadingEXT[] = {spv::Capability::DrawParameters, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_FPFastMathModeINTEL[] = {spv::Capability::FPFastMathModeINTEL}; +static const spv::Capability pygen_variable_caps_FPGABufferLocationINTEL[] = {spv::Capability::FPGABufferLocationINTEL}; +static const spv::Capability pygen_variable_caps_FPGAClusterAttributesINTEL[] = {spv::Capability::FPGAClusterAttributesINTEL}; +static const spv::Capability pygen_variable_caps_FPGADSPControlINTEL[] = {spv::Capability::FPGADSPControlINTEL}; +static const spv::Capability pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL[] = {spv::Capability::FPGAInvocationPipeliningAttributesINTEL}; +static const spv::Capability pygen_variable_caps_FPGAKernelAttributesINTEL[] = {spv::Capability::FPGAKernelAttributesINTEL}; +static const spv::Capability pygen_variable_caps_FPGALoopControlsINTEL[] = {spv::Capability::FPGALoopControlsINTEL}; +static const spv::Capability pygen_variable_caps_FPGAMemoryAccessesINTEL[] = {spv::Capability::FPGAMemoryAccessesINTEL}; +static const spv::Capability pygen_variable_caps_FPGAMemoryAttributesINTEL[] = {spv::Capability::FPGAMemoryAttributesINTEL}; +static const spv::Capability pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR[] = {spv::Capability::FragmentBarycentricNV, spv::Capability::FragmentBarycentricKHR}; +static const spv::Capability pygen_variable_caps_FragmentDensityEXTShadingRateNV[] = {spv::Capability::FragmentDensityEXT, spv::Capability::ShadingRateNV}; +static const spv::Capability pygen_variable_caps_FragmentFullyCoveredEXT[] = {spv::Capability::FragmentFullyCoveredEXT}; +static const spv::Capability pygen_variable_caps_FragmentShaderPixelInterlockEXT[] = {spv::Capability::FragmentShaderPixelInterlockEXT}; +static const spv::Capability pygen_variable_caps_FragmentShaderSampleInterlockEXT[] = {spv::Capability::FragmentShaderSampleInterlockEXT}; +static const spv::Capability pygen_variable_caps_FragmentShaderShadingRateInterlockEXT[] = {spv::Capability::FragmentShaderShadingRateInterlockEXT}; +static const spv::Capability pygen_variable_caps_FragmentShadingRateKHR[] = {spv::Capability::FragmentShadingRateKHR}; +static const spv::Capability pygen_variable_caps_FunctionFloatControlINTEL[] = {spv::Capability::FunctionFloatControlINTEL}; +static const spv::Capability pygen_variable_caps_FunctionPointersINTEL[] = {spv::Capability::FunctionPointersINTEL}; +static const spv::Capability pygen_variable_caps_GenericPointer[] = {spv::Capability::GenericPointer}; +static const spv::Capability pygen_variable_caps_Geometry[] = {spv::Capability::Geometry}; +static const spv::Capability pygen_variable_caps_GeometryMeshShadingNVMeshShadingEXT[] = {spv::Capability::Geometry, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_GeometryShaderLayerShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT[] = {spv::Capability::Geometry, spv::Capability::ShaderLayer, spv::Capability::ShaderViewportIndexLayerEXT, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_GeometryTessellation[] = {spv::Capability::Geometry, spv::Capability::Tessellation}; +static const spv::Capability pygen_variable_caps_GeometryTessellationMeshShadingNVMeshShadingEXT[] = {spv::Capability::Geometry, spv::Capability::Tessellation, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_GeometryTessellationRayTracingNVRayTracingKHRMeshShadingNVMeshShadingEXT[] = {spv::Capability::Geometry, spv::Capability::Tessellation, spv::Capability::RayTracingNV, spv::Capability::RayTracingKHR, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_GeometryShaderPassthroughNV[] = {spv::Capability::GeometryShaderPassthroughNV}; +static const spv::Capability pygen_variable_caps_GeometryStreams[] = {spv::Capability::GeometryStreams}; +static const spv::Capability pygen_variable_caps_GroupNonUniform[] = {spv::Capability::GroupNonUniform}; +static const spv::Capability pygen_variable_caps_GroupNonUniformClustered[] = {spv::Capability::GroupNonUniformClustered}; +static const spv::Capability pygen_variable_caps_GroupNonUniformPartitionedNV[] = {spv::Capability::GroupNonUniformPartitionedNV}; +static const spv::Capability pygen_variable_caps_IOPipesINTEL[] = {spv::Capability::IOPipesINTEL}; +static const spv::Capability pygen_variable_caps_ImageBasic[] = {spv::Capability::ImageBasic}; +static const spv::Capability pygen_variable_caps_ImageBuffer[] = {spv::Capability::ImageBuffer}; +static const spv::Capability pygen_variable_caps_ImageBufferShaderNonUniform[] = {spv::Capability::ImageBuffer, spv::Capability::ShaderNonUniform}; +static const spv::Capability pygen_variable_caps_ImageGatherExtended[] = {spv::Capability::ImageGatherExtended}; +static const spv::Capability pygen_variable_caps_IndirectReferencesINTEL[] = {spv::Capability::IndirectReferencesINTEL}; +static const spv::Capability pygen_variable_caps_InputAttachment[] = {spv::Capability::InputAttachment}; +static const spv::Capability pygen_variable_caps_InputAttachmentShaderNonUniform[] = {spv::Capability::InputAttachment, spv::Capability::ShaderNonUniform}; +static const spv::Capability pygen_variable_caps_Int64[] = {spv::Capability::Int64}; +static const spv::Capability pygen_variable_caps_Int64ImageEXT[] = {spv::Capability::Int64ImageEXT}; +static const spv::Capability pygen_variable_caps_Int8[] = {spv::Capability::Int8}; +static const spv::Capability pygen_variable_caps_Kernel[] = {spv::Capability::Kernel}; +static const spv::Capability pygen_variable_caps_KernelGroupNonUniform[] = {spv::Capability::Kernel, spv::Capability::GroupNonUniform}; +static const spv::Capability pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR[] = {spv::Capability::Kernel, spv::Capability::GroupNonUniform, spv::Capability::SubgroupBallotKHR}; +static const spv::Capability pygen_variable_caps_KernelGroupNonUniformArithmeticGroupNonUniformBallot[] = {spv::Capability::Kernel, spv::Capability::GroupNonUniformArithmetic, spv::Capability::GroupNonUniformBallot}; +static const spv::Capability pygen_variable_caps_KernelAttributesINTEL[] = {spv::Capability::KernelAttributesINTEL}; +static const spv::Capability pygen_variable_caps_Linkage[] = {spv::Capability::Linkage}; +static const spv::Capability pygen_variable_caps_LoopFuseINTEL[] = {spv::Capability::LoopFuseINTEL}; +static const spv::Capability pygen_variable_caps_Matrix[] = {spv::Capability::Matrix}; +static const spv::Capability pygen_variable_caps_MemoryAccessAliasingINTEL[] = {spv::Capability::MemoryAccessAliasingINTEL}; +static const spv::Capability pygen_variable_caps_MeshShadingEXT[] = {spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_MeshShadingNV[] = {spv::Capability::MeshShadingNV}; +static const spv::Capability pygen_variable_caps_MeshShadingNVMeshShadingEXT[] = {spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_MinLod[] = {spv::Capability::MinLod}; +static const spv::Capability pygen_variable_caps_MultiView[] = {spv::Capability::MultiView}; +static const spv::Capability pygen_variable_caps_MultiViewport[] = {spv::Capability::MultiViewport}; +static const spv::Capability pygen_variable_caps_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT[] = {spv::Capability::MultiViewport, spv::Capability::ShaderViewportIndex, spv::Capability::ShaderViewportIndexLayerEXT, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; +static const spv::Capability pygen_variable_caps_OptNoneINTEL[] = {spv::Capability::OptNoneINTEL}; +static const spv::Capability pygen_variable_caps_PerViewAttributesNVMeshShadingNV[] = {spv::Capability::PerViewAttributesNV, spv::Capability::MeshShadingNV}; +static const spv::Capability pygen_variable_caps_PhysicalStorageBufferAddresses[] = {spv::Capability::PhysicalStorageBufferAddresses}; +static const spv::Capability pygen_variable_caps_Pipes[] = {spv::Capability::Pipes}; +static const spv::Capability pygen_variable_caps_RayCullMaskKHR[] = {spv::Capability::RayCullMaskKHR}; +static const spv::Capability pygen_variable_caps_RayQueryKHR[] = {spv::Capability::RayQueryKHR}; +static const spv::Capability pygen_variable_caps_RayQueryKHRRayTracingKHR[] = {spv::Capability::RayQueryKHR, spv::Capability::RayTracingKHR}; +static const spv::Capability pygen_variable_caps_RayTracingKHR[] = {spv::Capability::RayTracingKHR}; +static const spv::Capability pygen_variable_caps_RayTracingMotionBlurNV[] = {spv::Capability::RayTracingMotionBlurNV}; +static const spv::Capability pygen_variable_caps_RayTracingNV[] = {spv::Capability::RayTracingNV}; +static const spv::Capability pygen_variable_caps_RayTracingNVRayTracingKHR[] = {spv::Capability::RayTracingNV, spv::Capability::RayTracingKHR}; +static const spv::Capability pygen_variable_caps_RayTracingOpacityMicromapEXT[] = {spv::Capability::RayTracingOpacityMicromapEXT}; +static const spv::Capability pygen_variable_caps_RayTraversalPrimitiveCullingKHR[] = {spv::Capability::RayTraversalPrimitiveCullingKHR}; +static const spv::Capability pygen_variable_caps_RoundToInfinityINTEL[] = {spv::Capability::RoundToInfinityINTEL}; +static const spv::Capability pygen_variable_caps_RoundingModeRTE[] = {spv::Capability::RoundingModeRTE}; +static const spv::Capability pygen_variable_caps_RoundingModeRTZ[] = {spv::Capability::RoundingModeRTZ}; +static const spv::Capability pygen_variable_caps_RuntimeAlignedAttributeINTEL[] = {spv::Capability::RuntimeAlignedAttributeINTEL}; +static const spv::Capability pygen_variable_caps_SampleMaskOverrideCoverageNV[] = {spv::Capability::SampleMaskOverrideCoverageNV}; +static const spv::Capability pygen_variable_caps_SampleMaskPostDepthCoverage[] = {spv::Capability::SampleMaskPostDepthCoverage}; +static const spv::Capability pygen_variable_caps_SampleRateShading[] = {spv::Capability::SampleRateShading}; +static const spv::Capability pygen_variable_caps_Sampled1D[] = {spv::Capability::Sampled1D}; +static const spv::Capability pygen_variable_caps_Sampled1DImage1D[] = {spv::Capability::Sampled1D, spv::Capability::Image1D}; +static const spv::Capability pygen_variable_caps_SampledBuffer[] = {spv::Capability::SampledBuffer}; +static const spv::Capability pygen_variable_caps_SampledBufferImageBuffer[] = {spv::Capability::SampledBuffer, spv::Capability::ImageBuffer}; +static const spv::Capability pygen_variable_caps_SampledBufferShaderNonUniform[] = {spv::Capability::SampledBuffer, spv::Capability::ShaderNonUniform}; +static const spv::Capability pygen_variable_caps_SampledCubeArray[] = {spv::Capability::SampledCubeArray}; +static const spv::Capability pygen_variable_caps_SampledRect[] = {spv::Capability::SampledRect}; +static const spv::Capability pygen_variable_caps_SampledRectImageRect[] = {spv::Capability::SampledRect, spv::Capability::ImageRect}; +static const spv::Capability pygen_variable_caps_Shader[] = {spv::Capability::Shader}; +static const spv::Capability pygen_variable_caps_ShaderImageCubeArray[] = {spv::Capability::Shader, spv::Capability::ImageCubeArray}; +static const spv::Capability pygen_variable_caps_ShaderKernel[] = {spv::Capability::Shader, spv::Capability::Kernel}; +static const spv::Capability pygen_variable_caps_ShaderKernelImageMSArray[] = {spv::Capability::Shader, spv::Capability::Kernel, spv::Capability::ImageMSArray}; +static const spv::Capability pygen_variable_caps_ShaderUniformDecoration[] = {spv::Capability::Shader, spv::Capability::UniformDecoration}; +static const spv::Capability pygen_variable_caps_ShaderVectorComputeINTEL[] = {spv::Capability::Shader, spv::Capability::VectorComputeINTEL}; +static const spv::Capability pygen_variable_caps_ShaderInvocationReorderNV[] = {spv::Capability::ShaderInvocationReorderNV}; +static const spv::Capability pygen_variable_caps_ShaderNonUniform[] = {spv::Capability::ShaderNonUniform}; +static const spv::Capability pygen_variable_caps_ShaderSMBuiltinsNV[] = {spv::Capability::ShaderSMBuiltinsNV}; +static const spv::Capability pygen_variable_caps_ShaderStereoViewNV[] = {spv::Capability::ShaderStereoViewNV}; +static const spv::Capability pygen_variable_caps_ShaderViewportIndexLayerNV[] = {spv::Capability::ShaderViewportIndexLayerNV}; +static const spv::Capability pygen_variable_caps_ShaderViewportMaskNV[] = {spv::Capability::ShaderViewportMaskNV}; +static const spv::Capability pygen_variable_caps_ShaderViewportMaskNVMeshShadingNV[] = {spv::Capability::ShaderViewportMaskNV, spv::Capability::MeshShadingNV}; +static const spv::Capability pygen_variable_caps_ShadingRateNVFragmentDensityEXT[] = {spv::Capability::ShadingRateNV, spv::Capability::FragmentDensityEXT}; +static const spv::Capability pygen_variable_caps_SignedZeroInfNanPreserve[] = {spv::Capability::SignedZeroInfNanPreserve}; +static const spv::Capability pygen_variable_caps_StencilExportEXT[] = {spv::Capability::StencilExportEXT}; +static const spv::Capability pygen_variable_caps_StorageBuffer16BitAccessStorageUniformBufferBlock16[] = {spv::Capability::StorageBuffer16BitAccess, spv::Capability::StorageUniformBufferBlock16}; +static const spv::Capability pygen_variable_caps_StorageBuffer8BitAccess[] = {spv::Capability::StorageBuffer8BitAccess}; +static const spv::Capability pygen_variable_caps_StorageImageExtendedFormats[] = {spv::Capability::StorageImageExtendedFormats}; +static const spv::Capability pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot[] = {spv::Capability::SubgroupBallotKHR, spv::Capability::GroupNonUniformBallot}; +static const spv::Capability pygen_variable_caps_SubgroupDispatch[] = {spv::Capability::SubgroupDispatch}; +static const spv::Capability pygen_variable_caps_Tessellation[] = {spv::Capability::Tessellation}; +static const spv::Capability pygen_variable_caps_TransformFeedback[] = {spv::Capability::TransformFeedback}; +static const spv::Capability pygen_variable_caps_USMStorageClassesINTEL[] = {spv::Capability::USMStorageClassesINTEL}; +static const spv::Capability pygen_variable_caps_VariablePointersStorageBuffer[] = {spv::Capability::VariablePointersStorageBuffer}; +static const spv::Capability pygen_variable_caps_VectorAnyINTEL[] = {spv::Capability::VectorAnyINTEL}; +static const spv::Capability pygen_variable_caps_VectorComputeINTEL[] = {spv::Capability::VectorComputeINTEL}; +static const spv::Capability pygen_variable_caps_VulkanMemoryModel[] = {spv::Capability::VulkanMemoryModel}; +static const spv::Capability pygen_variable_caps_WorkgroupMemoryExplicitLayoutKHR[] = {spv::Capability::WorkgroupMemoryExplicitLayoutKHR}; static const spvtools::Extension pygen_variable_exts_SPV_AMD_gpu_shader_half_float_fetch[] = {spvtools::Extension::kSPV_AMD_gpu_shader_half_float_fetch}; static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_ballot[] = {spvtools::Extension::kSPV_AMD_shader_ballot}; @@ -162,6 +166,8 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_float_controls2[] static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fp_fast_math_mode[] = {spvtools::Extension::kSPV_INTEL_fp_fast_math_mode}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_buffer_location[] = {spvtools::Extension::kSPV_INTEL_fpga_buffer_location}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_cluster_attributes[] = {spvtools::Extension::kSPV_INTEL_fpga_cluster_attributes}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_dsp_control[] = {spvtools::Extension::kSPV_INTEL_fpga_dsp_control}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_invocation_pipelining_attributes[] = {spvtools::Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_loop_controls[] = {spvtools::Extension::kSPV_INTEL_fpga_loop_controls}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_memory_accesses[] = {spvtools::Extension::kSPV_INTEL_fpga_memory_accesses}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_memory_attributes[] = {spvtools::Extension::kSPV_INTEL_fpga_memory_attributes}; @@ -175,6 +181,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_loop_fuse[] = {sp static const spvtools::Extension pygen_variable_exts_SPV_INTEL_media_block_io[] = {spvtools::Extension::kSPV_INTEL_media_block_io}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_memory_access_aliasing[] = {spvtools::Extension::kSPV_INTEL_memory_access_aliasing}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_optnone[] = {spvtools::Extension::kSPV_INTEL_optnone}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_runtime_aligned[] = {spvtools::Extension::kSPV_INTEL_runtime_aligned}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_shader_integer_functions2[] = {spvtools::Extension::kSPV_INTEL_shader_integer_functions2}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_split_barrier[] = {spvtools::Extension::kSPV_INTEL_split_barrier}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_subgroups[] = {spvtools::Extension::kSPV_INTEL_subgroups}; @@ -224,6 +231,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_NV_ray_tracing[] = {spv static const spvtools::Extension pygen_variable_exts_SPV_NV_ray_tracing_motion_blur[] = {spvtools::Extension::kSPV_NV_ray_tracing_motion_blur}; static const spvtools::Extension pygen_variable_exts_SPV_NV_sample_mask_override_coverage[] = {spvtools::Extension::kSPV_NV_sample_mask_override_coverage}; static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_image_footprint[] = {spvtools::Extension::kSPV_NV_shader_image_footprint}; +static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_invocation_reorder[] = {spvtools::Extension::kSPV_NV_shader_invocation_reorder}; static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_sm_builtins[] = {spvtools::Extension::kSPV_NV_shader_sm_builtins}; static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_subgroup_partitioned[] = {spvtools::Extension::kSPV_NV_shader_subgroup_partitioned}; static const spvtools::Extension pygen_variable_exts_SPV_NV_stereo_view_rendering[] = {spvtools::Extension::kSPV_NV_stereo_view_rendering}; @@ -281,14 +289,16 @@ static const spv_operand_desc_t pygen_variable_LoopControlEntries[] = { {"IterationMultiple", 0x0040, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, {"PeelCount", 0x0080, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, {"PartialCount", 0x0100, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, - {"InitiationIntervalINTEL", 0x10000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxConcurrencyINTEL", 0x20000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"DependencyArrayINTEL", 0x40000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"PipelineEnableINTEL", 0x80000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"LoopCoalesceINTEL", 0x100000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"MaxInterleavingINTEL", 0x200000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"SpeculatedIterationsINTEL", 0x400000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, - {"NoFusionINTEL", 0x800000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 1, pygen_variable_exts_SPV_INTEL_fpga_loop_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu} + {"InitiationIntervalINTEL", 0x10000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxConcurrencyINTEL", 0x20000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"DependencyArrayINTEL", 0x40000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"PipelineEnableINTEL", 0x80000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"LoopCoalesceINTEL", 0x100000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxInterleavingINTEL", 0x200000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"SpeculatedIterationsINTEL", 0x400000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"NoFusionINTEL", 0x800000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"LoopCountINTEL", 0x1000000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxReinvocationDelayINTEL", 0x2000000, 1, pygen_variable_caps_FPGALoopControlsINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_FunctionControlEntries[] = { @@ -495,6 +505,7 @@ static const spv_operand_desc_t pygen_variable_ExecutionModeEntries[] = { {"NoGlobalOffsetINTEL", 5895, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, {"NumSIMDWorkitemsINTEL", 5896, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"SchedulerTargetFmaxMhzINTEL", 5903, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"StreamingInterfaceINTEL", 6154, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"NamedBarrierCountINTEL", 6417, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu} }; @@ -526,6 +537,7 @@ static const spv_operand_desc_t pygen_variable_StorageClassEntries[] = { {"ShaderRecordBufferKHR", 5343, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"PhysicalStorageBuffer", 5349, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, {"PhysicalStorageBufferEXT", 5349, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"HitObjectAttributeNV", 5385, 1, pygen_variable_caps_ShaderInvocationReorderNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"TaskPayloadWorkgroupEXT", 5402, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, {"CodeSectionINTEL", 5605, 1, pygen_variable_caps_FunctionPointersINTEL, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu}, {"DeviceOnlyINTEL", 5936, 1, pygen_variable_caps_USMStorageClassesINTEL, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu}, @@ -698,7 +710,8 @@ static const spv_operand_desc_t pygen_variable_FunctionParameterAttributeEntries {"NoAlias", 4, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"NoCapture", 5, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"NoWrite", 6, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"NoReadWrite", 7, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"NoReadWrite", 7, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"RuntimeAlignedINTEL", 5940, 1, pygen_variable_caps_RuntimeAlignedAttributeINTEL, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_DecorationEntries[] = { @@ -768,6 +781,7 @@ static const spv_operand_desc_t pygen_variable_DecorationEntries[] = { {"RestrictPointerEXT", 5355, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, {"AliasedPointer", 5356, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, {"AliasedPointerEXT", 5356, 1, pygen_variable_caps_PhysicalStorageBufferAddresses, 2, pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"HitObjectShaderRecordBufferNV", 5386, 1, pygen_variable_caps_ShaderInvocationReorderNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"BindlessSamplerNV", 5398, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"BindlessImageNV", 5399, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"BoundSamplerNV", 5400, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, @@ -806,8 +820,12 @@ static const spv_operand_desc_t pygen_variable_DecorationEntries[] = { {"PrefetchINTEL", 5902, 1, pygen_variable_caps_FPGAMemoryAccessesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"StallEnableINTEL", 5905, 1, pygen_variable_caps_FPGAClusterAttributesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"FuseLoopsInFunctionINTEL", 5907, 1, pygen_variable_caps_LoopFuseINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MathOpDSPModeINTEL", 5909, 1, pygen_variable_caps_FPGADSPControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"AliasScopeINTEL", 5914, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, {"NoAliasINTEL", 5915, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}, + {"InitiationIntervalINTEL", 5917, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MaxConcurrencyINTEL", 5918, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"PipelineEnableINTEL", 5919, 1, pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"BufferLocationINTEL", 5921, 1, pygen_variable_caps_FPGABufferLocationINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"IOPipeStorageINTEL", 5944, 1, pygen_variable_caps_IOPipesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"FunctionFloatingPointModeINTEL", 6080, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FPOPERATION_MODE}, 0xffffffffu, 0xffffffffu}, @@ -1146,6 +1164,7 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"DemoteToHelperInvocation", 5379, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, {"DemoteToHelperInvocationEXT", 5379, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, {"RayTracingOpacityMicromapEXT", 5381, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 1, pygen_variable_exts_SPV_EXT_opacity_micromap, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderInvocationReorderNV", 5383, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_NV_shader_invocation_reorder, {}, 0xffffffffu, 0xffffffffu}, {"BindlessTextureNV", 5390, 0, nullptr, 1, pygen_variable_exts_SPV_NV_bindless_texture, {}, 0xffffffffu, 0xffffffffu}, {"SubgroupShuffleINTEL", 5568, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, {"SubgroupBufferBlockIOINTEL", 5569, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, @@ -1179,10 +1198,13 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"FPGAMemoryAccessesINTEL", 5898, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_memory_accesses, {}, 0xffffffffu, 0xffffffffu}, {"FPGAClusterAttributesINTEL", 5904, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_cluster_attributes, {}, 0xffffffffu, 0xffffffffu}, {"LoopFuseINTEL", 5906, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_loop_fuse, {}, 0xffffffffu, 0xffffffffu}, + {"FPGADSPControlINTEL", 5908, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_dsp_control, {}, 0xffffffffu, 0xffffffffu}, {"MemoryAccessAliasingINTEL", 5910, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAInvocationPipeliningAttributesINTEL", 5916, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_invocation_pipelining_attributes, {}, 0xffffffffu, 0xffffffffu}, {"FPGABufferLocationINTEL", 5920, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_buffer_location, {}, 0xffffffffu, 0xffffffffu}, {"ArbitraryPrecisionFixedPointINTEL", 5922, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_arbitrary_precision_fixed_point, {}, 0xffffffffu, 0xffffffffu}, {"USMStorageClassesINTEL", 5935, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu}, + {"RuntimeAlignedAttributeINTEL", 5939, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_runtime_aligned, {}, 0xffffffffu, 0xffffffffu}, {"IOPipesINTEL", 5943, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_io_pipes, {}, 0xffffffffu, 0xffffffffu}, {"BlockingPipesINTEL", 5945, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_blocking_pipes, {}, 0xffffffffu, 0xffffffffu}, {"FPGARegINTEL", 5948, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_reg, {}, 0xffffffffu, 0xffffffffu}, diff --git a/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp b/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp index a19491fd3..a75561b50 100644 --- a/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp +++ b/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp @@ -36,16 +36,25 @@ namespace spvtools { // generated by InstrumentPass::GenDebugStreamWrite. This method is utilized // by InstBindlessCheckPass, InstBuffAddrCheckPass, and InstDebugPrintfPass. // -// The first member of the debug output buffer contains the next available word +// The 1st member of the debug output buffer contains a set of flags +// controlling the behavior of instrumentation code. +static const int kDebugOutputFlagsOffset = 0; + +// Values stored at kDebugOutputFlagsOffset +enum kInstFlags : unsigned int { + kInstBufferOOBEnable = 0x1, +}; + +// The 2nd member of the debug output buffer contains the next available word // in the data stream to be written. Shaders will atomically read and update // this value so as not to overwrite each others records. This value must be // initialized to zero -static const int kDebugOutputSizeOffset = 0; +static const int kDebugOutputSizeOffset = 1; -// The second member of the output buffer is the start of the stream of records +// The 3rd member of the output buffer is the start of the stream of records // written by the instrumented shaders. Each record represents a validation // error. The format of the records is documented below. -static const int kDebugOutputDataOffset = 1; +static const int kDebugOutputDataOffset = 2; // Common Stream Record Offsets // diff --git a/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp b/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp index 949735608..aa6a614ea 100644 --- a/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp +++ b/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -520,8 +521,12 @@ Optimizer::PassToken CreateDeadInsertElimPass(); // interface are considered live and are not eliminated. This mode is needed // by GPU-Assisted validation instrumentation, where a change in the interface // is not allowed. -Optimizer::PassToken CreateAggressiveDCEPass(); -Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface); +// +// If |remove_outputs| is true, allow outputs to be removed from the interface. +// This is only safe if the caller knows that there is no corresponding input +// variable in the following shader. It is false by default. +Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface = false, + bool remove_outputs = false); // Creates a remove-unused-interface-variables pass. // Removes variables referenced on the |OpEntryPoint| instruction that are not @@ -887,12 +892,59 @@ Optimizer::PassToken CreateAmdExtToKhrPass(); Optimizer::PassToken CreateInterpolateFixupPass(); // Removes unused components from composite input variables. Current -// implementation just removes trailing unused components from input arrays. -// The pass performs best after maximizing dead code removal. A subsequent dead -// code elimination pass would be beneficial in removing newly unused component -// types. +// implementation just removes trailing unused components from input arrays +// and structs. The pass performs best after maximizing dead code removal. +// A subsequent dead code elimination pass would be beneficial in removing +// newly unused component types. +// +// WARNING: This pass can only be safely applied standalone to vertex shaders +// as it can otherwise cause interface incompatibilities with the preceding +// shader in the pipeline. If applied to non-vertex shaders, the user should +// follow by applying EliminateDeadOutputStores and +// EliminateDeadOutputComponents to the preceding shader. Optimizer::PassToken CreateEliminateDeadInputComponentsPass(); +// Removes unused components from composite output variables. Current +// implementation just removes trailing unused components from output arrays +// and structs. The pass performs best after eliminating dead output stores. +// A subsequent dead code elimination pass would be beneficial in removing +// newly unused component types. Currently only supports vertex and fragment +// shaders. +// +// WARNING: This pass cannot be safely applied standalone as it can cause +// interface incompatibility with the following shader in the pipeline. The +// user should first apply EliminateDeadInputComponents to the following +// shader, then apply EliminateDeadOutputStores to this shader. +Optimizer::PassToken CreateEliminateDeadOutputComponentsPass(); + +// Removes unused components from composite input variables. This safe +// version will not cause interface incompatibilities since it only changes +// vertex shaders. The current implementation just removes trailing unused +// components from input structs and input arrays. The pass performs best +// after maximizing dead code removal. A subsequent dead code elimination +// pass would be beneficial in removing newly unused component types. +Optimizer::PassToken CreateEliminateDeadInputComponentsSafePass(); + +// Analyzes shader and populates |live_locs| and |live_builtins|. Best results +// will be obtained if shader has all dead code eliminated first. |live_locs| +// and |live_builtins| are subsequently used when calling +// CreateEliminateDeadOutputStoresPass on the preceding shader. Currently only +// supports tesc, tese, geom, and frag shaders. +Optimizer::PassToken CreateAnalyzeLiveInputPass( + std::unordered_set* live_locs, + std::unordered_set* live_builtins); + +// Removes stores to output locations not listed in |live_locs| or +// |live_builtins|. Best results are obtained if constant propagation is +// performed first. A subsequent call to ADCE will eliminate any dead code +// created by the removal of the stores. A subsequent call to +// CreateEliminateDeadOutputComponentsPass will eliminate any dead output +// components created by the elimination of the stores. Currently only supports +// vert, tesc, tese, and geom shaders. +Optimizer::PassToken CreateEliminateDeadOutputStoresPass( + std::unordered_set* live_locs, + std::unordered_set* live_builtins); + // Creates a convert-to-sampled-image pass to convert images and/or // samplers with given pairs of descriptor set and binding to sampled image. // If a pair of an image and a sampler have the same pair of descriptor set and diff --git a/3rdparty/spirv-tools/source/assembly_grammar.cpp b/3rdparty/spirv-tools/source/assembly_grammar.cpp index 4f5942ab4..6df823e30 100644 --- a/3rdparty/spirv-tools/source/assembly_grammar.cpp +++ b/3rdparty/spirv-tools/source/assembly_grammar.cpp @@ -78,16 +78,16 @@ spv_result_t spvTextParseMaskOperand(spv_target_env env, // Associates an opcode with its name. struct SpecConstantOpcodeEntry { - SpvOp opcode; + spv::Op opcode; const char* name; }; // All the opcodes allowed as the operation for OpSpecConstantOp. -// The name does not have the usual "Op" prefix. For example opcode SpvOpIAdd -// is associated with the name "IAdd". +// The name does not have the usual "Op" prefix. For example opcode +// spv::Op::IAdd is associated with the name "IAdd". // // clang-format off -#define CASE(NAME) { SpvOp##NAME, #NAME } +#define CASE(NAME) { spv::Op::Op##NAME, #NAME } const SpecConstantOpcodeEntry kOpSpecConstantOpcodes[] = { // Conversion CASE(SConvert), @@ -173,7 +173,7 @@ bool AssemblyGrammar::isValid() const { } CapabilitySet AssemblyGrammar::filterCapsAgainstTargetEnv( - const SpvCapability* cap_array, uint32_t count) const { + const spv::Capability* cap_array, uint32_t count) const { CapabilitySet cap_set; for (uint32_t i = 0; i < count; ++i) { spv_operand_desc cap_desc = {}; @@ -194,7 +194,7 @@ spv_result_t AssemblyGrammar::lookupOpcode(const char* name, return spvOpcodeTableNameLookup(target_env_, opcodeTable_, name, desc); } -spv_result_t AssemblyGrammar::lookupOpcode(SpvOp opcode, +spv_result_t AssemblyGrammar::lookupOpcode(spv::Op opcode, spv_opcode_desc* desc) const { return spvOpcodeTableValueLookup(target_env_, opcodeTable_, opcode, desc); } @@ -214,7 +214,7 @@ spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type, } spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name, - SpvOp* opcode) const { + spv::Op* opcode) const { const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes; const auto* found = std::find_if(kOpSpecConstantOpcodes, last, @@ -226,7 +226,7 @@ spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name, return SPV_SUCCESS; } -spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(SpvOp opcode) const { +spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(spv::Op opcode) const { const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes; const auto* found = std::find_if(kOpSpecConstantOpcodes, last, diff --git a/3rdparty/spirv-tools/source/assembly_grammar.h b/3rdparty/spirv-tools/source/assembly_grammar.h index 17c2bd3ba..36fdd08a6 100644 --- a/3rdparty/spirv-tools/source/assembly_grammar.h +++ b/3rdparty/spirv-tools/source/assembly_grammar.h @@ -41,7 +41,7 @@ class AssemblyGrammar { // Removes capabilities not available in the current target environment and // returns the rest. - CapabilitySet filterCapsAgainstTargetEnv(const SpvCapability* cap_array, + CapabilitySet filterCapsAgainstTargetEnv(const spv::Capability* cap_array, uint32_t count) const; // Fills in the desc parameter with the information about the opcode @@ -52,7 +52,7 @@ class AssemblyGrammar { // Fills in the desc parameter with the information about the opcode // of the valid. Returns SPV_SUCCESS if the opcode was found, and // SPV_ERROR_INVALID_LOOKUP if the opcode does not exist. - spv_result_t lookupOpcode(SpvOp opcode, spv_opcode_desc* desc) const; + spv_result_t lookupOpcode(spv::Op opcode, spv_opcode_desc* desc) const; // Fills in the desc parameter with the information about the given // operand. Returns SPV_SUCCESS if the operand was found, and @@ -82,11 +82,12 @@ class AssemblyGrammar { // the integer add opcode for OpSpecConstantOp. On success, returns // SPV_SUCCESS and sends the discovered operation code through the opcode // parameter. On failure, returns SPV_ERROR_INVALID_LOOKUP. - spv_result_t lookupSpecConstantOpcode(const char* name, SpvOp* opcode) const; + spv_result_t lookupSpecConstantOpcode(const char* name, + spv::Op* opcode) const; // Returns SPV_SUCCESS if the given opcode is valid as the opcode operand // to OpSpecConstantOp. - spv_result_t lookupSpecConstantOpcode(SpvOp opcode) const; + spv_result_t lookupSpecConstantOpcode(spv::Op opcode) const; // Parses a mask expression string for the given operand type. // diff --git a/3rdparty/spirv-tools/source/binary.cpp b/3rdparty/spirv-tools/source/binary.cpp index 24d32f8c4..beb56be7b 100644 --- a/3rdparty/spirv-tools/source/binary.cpp +++ b/3rdparty/spirv-tools/source/binary.cpp @@ -156,7 +156,7 @@ class Parser { // Issues a diagnostic describing an exhaustion of input condition when // trying to decode an instruction operand, and returns // SPV_ERROR_INVALID_BINARY. - spv_result_t exhaustedInputDiagnostic(size_t inst_offset, SpvOp opcode, + spv_result_t exhaustedInputDiagnostic(size_t inst_offset, spv::Op opcode, spv_operand_type_t type) { return diagnostic() << "End of input reached while decoding Op" << spvOpcodeString(opcode) << " starting at word " @@ -318,7 +318,7 @@ spv_result_t Parser::parseInstruction() { << inst_word_count; } spv_opcode_desc opcode_desc; - if (grammar_.lookupOpcode(static_cast(inst.opcode), &opcode_desc)) + if (grammar_.lookupOpcode(static_cast(inst.opcode), &opcode_desc)) return diagnostic() << "Invalid opcode: " << inst.opcode; // Advance past the opcode word. But remember the of the start @@ -418,7 +418,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, std::vector* words, std::vector* operands, spv_operand_pattern_t* expected_operands) { - const SpvOp opcode = static_cast(inst->opcode); + const spv::Op opcode = static_cast(inst->opcode); // We'll fill in this result as we go along. spv_parsed_operand_t parsed_operand; parsed_operand.offset = uint16_t(_.word_index - inst_offset); @@ -473,7 +473,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, if (!word) return diagnostic(SPV_ERROR_INVALID_ID) << "Id is 0"; parsed_operand.type = SPV_OPERAND_TYPE_ID; - if (opcode == SpvOpExtInst && parsed_operand.offset == 3) { + if (opcode == spv::Op::OpExtInst && parsed_operand.offset == 3) { // The current word is the extended instruction set Id. // Set the extended instruction set type for the current instruction. auto ext_inst_type_iter = _.import_id_to_ext_inst_type.find(word); @@ -494,7 +494,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, break; case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: { - assert(SpvOpExtInst == opcode); + assert(spv::Op::OpExtInst == opcode); assert(inst->ext_inst_type != SPV_EXT_INST_TYPE_NONE); spv_ext_inst_desc ext_inst; if (grammar_.lookupExtInst(inst->ext_inst_type, word, &ext_inst) == @@ -516,14 +516,14 @@ spv_result_t Parser::parseOperand(size_t inst_offset, } break; case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { - assert(SpvOpSpecConstantOp == opcode); - if (word > static_cast(SpvOp::SpvOpMax) || - grammar_.lookupSpecConstantOpcode(SpvOp(word))) { + assert(spv::Op::OpSpecConstantOp == opcode); + if (word > static_cast(spv::Op::Max) || + grammar_.lookupSpecConstantOpcode(spv::Op(word))) { return diagnostic() << "Invalid " << spvOperandTypeStr(type) << ": " << word; } spv_opcode_desc opcode_entry = nullptr; - if (grammar_.lookupOpcode(SpvOp(word), &opcode_entry)) { + if (grammar_.lookupOpcode(spv::Op(word), &opcode_entry)) { return diagnostic(SPV_ERROR_INTERNAL) << "OpSpecConstant opcode table out of sync"; } @@ -549,7 +549,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: parsed_operand.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER; - if (opcode == SpvOpSwitch) { + if (opcode == spv::Op::OpSwitch) { // The literal operands have the same type as the value // referenced by the selector Id. const uint32_t selector_id = peekAt(inst_offset + 1); @@ -575,7 +575,8 @@ spv_result_t Parser::parseOperand(size_t inst_offset, << " is not a scalar integer"; } } else { - assert(opcode == SpvOpConstant || opcode == SpvOpSpecConstant); + assert(opcode == spv::Op::OpConstant || + opcode == spv::Op::OpSpecConstant); // The literal number type is determined by the type Id for the // constant. assert(inst->type_id); @@ -607,7 +608,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, parsed_operand.num_words = uint16_t(string_num_words); parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_STRING; - if (SpvOpExtInstImport == opcode) { + if (spv::Op::OpExtInstImport == opcode) { // Record the extended instruction type for the ID for this import. // There is only one string literal argument to OpExtInstImport, // so it's sufficient to guard this just on the opcode. @@ -789,14 +790,14 @@ spv_result_t Parser::setNumericTypeInfoForType( void Parser::recordNumberType(size_t inst_offset, const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); + const spv::Op opcode = static_cast(inst->opcode); if (spvOpcodeGeneratesType(opcode)) { NumberType info = {SPV_NUMBER_NONE, 0}; - if (SpvOpTypeInt == opcode) { + if (spv::Op::OpTypeInt == opcode) { const bool is_signed = peekAt(inst_offset + 3) != 0; info.type = is_signed ? SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT; info.bit_width = peekAt(inst_offset + 2); - } else if (SpvOpTypeFloat == opcode) { + } else if (spv::Op::OpTypeFloat == opcode) { info.type = SPV_NUMBER_FLOATING; info.bit_width = peekAt(inst_offset + 2); } diff --git a/3rdparty/spirv-tools/source/diff/diff.cpp b/3rdparty/spirv-tools/source/diff/diff.cpp index 7ed41de58..6daed321d 100644 --- a/3rdparty/spirv-tools/source/diff/diff.cpp +++ b/3rdparty/spirv-tools/source/diff/diff.cpp @@ -44,8 +44,8 @@ using IdGroup = std::vector; // different implementations produce identical results. using IdGroupMapByName = std::map; using IdGroupMapByTypeId = std::map; -using IdGroupMapByOp = std::map; -using IdGroupMapByStorageClass = std::map; +using IdGroupMapByOp = std::map; +using IdGroupMapByStorageClass = std::map; // A set of potential id mappings that haven't been resolved yet. Any id in src // may map in any id in dst. Note that ids are added in the same order as they @@ -301,10 +301,10 @@ class Differ { // Get various properties from an id. These Helper functions are passed to // `GroupIds` and `GroupIdsAndMatch` below (as the `get_group` argument). uint32_t GroupIdsHelperGetTypeId(const IdInstructions& id_to, uint32_t id); - SpvStorageClass GroupIdsHelperGetTypePointerStorageClass( + spv::StorageClass GroupIdsHelperGetTypePointerStorageClass( const IdInstructions& id_to, uint32_t id); - SpvOp GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to, - uint32_t id); + spv::Op GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to, + uint32_t id); // Given a list of ids, groups them based on some value. The `get_group` // function extracts a piece of information corresponding to each id, and the @@ -414,8 +414,8 @@ class Differ { // Helper functions to retrieve information pertaining to an id const opt::Instruction* GetInst(const IdInstructions& id_to, uint32_t id); uint32_t GetConstantUint(const IdInstructions& id_to, uint32_t constant_id); - SpvExecutionModel GetExecutionModel(const opt::Module* module, - uint32_t entry_point_id); + spv::ExecutionModel GetExecutionModel(const opt::Module* module, + uint32_t entry_point_id); bool HasName(const IdInstructions& id_to, uint32_t id); // Get the OpName associated with an id std::string GetName(const IdInstructions& id_to, uint32_t id, bool* has_name); @@ -424,20 +424,21 @@ class Differ { // string, and this improves diff between SPIR-V from those tools and others. std::string GetSanitizedName(const IdInstructions& id_to, uint32_t id); uint32_t GetVarTypeId(const IdInstructions& id_to, uint32_t var_id, - SpvStorageClass* storage_class); + spv::StorageClass* storage_class); bool GetDecorationValue(const IdInstructions& id_to, uint32_t id, - SpvDecoration decoration, uint32_t* decoration_value); + spv::Decoration decoration, + uint32_t* decoration_value); const opt::Instruction* GetForwardPointerInst(const IdInstructions& id_to, uint32_t id); bool IsIntType(const IdInstructions& id_to, uint32_t type_id); bool IsFloatType(const IdInstructions& id_to, uint32_t type_id); bool IsConstantUint(const IdInstructions& id_to, uint32_t id); bool IsVariable(const IdInstructions& id_to, uint32_t pointer_id); - bool IsOp(const IdInstructions& id_to, uint32_t id, SpvOp opcode); + bool IsOp(const IdInstructions& id_to, uint32_t id, spv::Op opcode); bool IsPerVertexType(const IdInstructions& id_to, uint32_t type_id); bool IsPerVertexVariable(const IdInstructions& id_to, uint32_t type_id); - SpvStorageClass GetPerVertexStorageClass(const opt::Module* module, - uint32_t type_id); + spv::StorageClass GetPerVertexStorageClass(const opt::Module* module, + uint32_t type_id); spv_ext_inst_type_t GetExtInstType(const IdInstructions& id_to, uint32_t set_id); spv_number_kind_t GetNumberKind(const IdInstructions& id_to, @@ -561,19 +562,19 @@ void IdInstructions::MapIdsToInfos( uint32_t id_operand = 0; switch (inst.opcode()) { - case SpvOpName: + case spv::Op::OpName: info_map = &name_map_; break; - case SpvOpMemberName: + case spv::Op::OpMemberName: info_map = &name_map_; break; - case SpvOpDecorate: + case spv::Op::OpDecorate: info_map = &decoration_map_; break; - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: info_map = &decoration_map_; break; - case SpvOpTypeForwardPointer: { + case spv::Op::OpTypeForwardPointer: { uint32_t id = inst.GetSingleWordOperand(0); assert(id != 0); @@ -731,10 +732,10 @@ int Differ::ComparePreambleInstructions(const opt::Instruction* a, // Instead of comparing OpExecutionMode entry point ids as ids, compare them // through their corresponding execution model. This simplifies traversing // the sorted list of instructions between src and dst modules. - if (a->opcode() == SpvOpExecutionMode) { - const SpvExecutionModel src_model = + if (a->opcode() == spv::Op::OpExecutionMode) { + const spv::ExecutionModel src_model = GetExecutionModel(src_inst_module, a->GetSingleWordOperand(0)); - const SpvExecutionModel dst_model = + const spv::ExecutionModel dst_model = GetExecutionModel(dst_inst_module, b->GetSingleWordOperand(0)); if (src_model < dst_model) { @@ -818,17 +819,17 @@ uint32_t Differ::GroupIdsHelperGetTypeId(const IdInstructions& id_to, return GetInst(id_to, id)->type_id(); } -SpvStorageClass Differ::GroupIdsHelperGetTypePointerStorageClass( +spv::StorageClass Differ::GroupIdsHelperGetTypePointerStorageClass( const IdInstructions& id_to, uint32_t id) { const opt::Instruction* inst = GetInst(id_to, id); - assert(inst && inst->opcode() == SpvOpTypePointer); - return SpvStorageClass(inst->GetSingleWordInOperand(0)); + assert(inst && inst->opcode() == spv::Op::OpTypePointer); + return spv::StorageClass(inst->GetSingleWordInOperand(0)); } -SpvOp Differ::GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to, - uint32_t id) { +spv::Op Differ::GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to, + uint32_t id) { const opt::Instruction* inst = GetInst(id_to, id); - assert(inst && inst->opcode() == SpvOpTypePointer); + assert(inst && inst->opcode() == spv::Op::OpTypePointer); const uint32_t type_id = inst->GetSingleWordInOperand(1); const opt::Instruction* type_inst = GetInst(id_to, type_id); @@ -1020,7 +1021,7 @@ bool Differ::DoInstructionsMatchFuzzy(const opt::Instruction* src_inst, } // For external instructions, make sure the set and opcode of the external // instruction matches too. - if (src_inst->opcode() == SpvOpExtInst) { + if (src_inst->opcode() == spv::Op::OpExtInst) { if (!DoOperandsMatch(src_inst, dst_inst, 0, 2)) { return false; } @@ -1064,26 +1065,26 @@ bool Differ::DoDebugAndAnnotationInstructionsMatch( } switch (src_inst->opcode()) { - case SpvOpString: - case SpvOpSourceExtension: - case SpvOpModuleProcessed: + case spv::Op::OpString: + case spv::Op::OpSourceExtension: + case spv::Op::OpModuleProcessed: return DoesOperandMatch(src_inst->GetOperand(0), dst_inst->GetOperand(0)); - case SpvOpSource: + case spv::Op::OpSource: return DoOperandsMatch(src_inst, dst_inst, 0, 2); - case SpvOpSourceContinued: + case spv::Op::OpSourceContinued: return true; - case SpvOpName: + case spv::Op::OpName: return DoOperandsMatch(src_inst, dst_inst, 0, 1); - case SpvOpMemberName: + case spv::Op::OpMemberName: return DoOperandsMatch(src_inst, dst_inst, 0, 2); - case SpvOpDecorate: + case spv::Op::OpDecorate: return DoOperandsMatch(src_inst, dst_inst, 0, 2); - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: return DoOperandsMatch(src_inst, dst_inst, 0, 3); - case SpvOpExtInst: - case SpvOpDecorationGroup: - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: + case spv::Op::OpExtInst: + case spv::Op::OpDecorationGroup: + case spv::Op::OpGroupDecorate: + case spv::Op::OpGroupMemberDecorate: return false; default: return false; @@ -1095,9 +1096,9 @@ bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id, // Variables must match by their built-in decorations. uint32_t src_built_in_decoration = 0, dst_built_in_decoration = 0; const bool src_is_built_in = GetDecorationValue( - src_id_to_, src_id, SpvDecorationBuiltIn, &src_built_in_decoration); + src_id_to_, src_id, spv::Decoration::BuiltIn, &src_built_in_decoration); const bool dst_is_built_in = GetDecorationValue( - dst_id_to_, dst_id, SpvDecorationBuiltIn, &dst_built_in_decoration); + dst_id_to_, dst_id, spv::Decoration::BuiltIn, &dst_built_in_decoration); if (src_is_built_in != dst_is_built_in) { return false; @@ -1107,7 +1108,7 @@ bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id, } // Check their types and storage classes. - SpvStorageClass src_storage_class, dst_storage_class; + spv::StorageClass src_storage_class, dst_storage_class; const uint32_t src_type_id = GetVarTypeId(src_id_to_, src_id, &src_storage_class); const uint32_t dst_type_id = @@ -1127,12 +1128,14 @@ bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id, // Allow one of the two to be Private while the other is Input or // Output, this allows matching in/out variables that have been turned // global as part of linking two stages (as done in ANGLE). - const bool src_is_io = src_storage_class == SpvStorageClassInput || - src_storage_class == SpvStorageClassOutput; - const bool dst_is_io = dst_storage_class == SpvStorageClassInput || - dst_storage_class == SpvStorageClassOutput; - const bool src_is_private = src_storage_class == SpvStorageClassPrivate; - const bool dst_is_private = dst_storage_class == SpvStorageClassPrivate; + const bool src_is_io = src_storage_class == spv::StorageClass::Input || + src_storage_class == spv::StorageClass::Output; + const bool dst_is_io = dst_storage_class == spv::StorageClass::Input || + dst_storage_class == spv::StorageClass::Output; + const bool src_is_private = + src_storage_class == spv::StorageClass::Private; + const bool dst_is_private = + dst_storage_class == spv::StorageClass::Private; if (!((src_is_io && dst_is_private) || (src_is_private && dst_is_io))) { return false; @@ -1277,16 +1280,16 @@ bool Differ::MatchOpSpecConstant(const opt::Instruction* src_inst, // Otherwise, match them by SpecId. uint32_t src_spec_id, dst_spec_id; - if (GetDecorationValue(src_id_to_, src_id, SpvDecorationSpecId, + if (GetDecorationValue(src_id_to_, src_id, spv::Decoration::SpecId, &src_spec_id) && - GetDecorationValue(dst_id_to_, dst_id, SpvDecorationSpecId, + GetDecorationValue(dst_id_to_, dst_id, spv::Decoration::SpecId, &dst_spec_id)) { return src_spec_id == dst_spec_id; } // There is no SpecId decoration, while not practical, still valid. // SpecConstantOp don't have SpecId and can be matched by operands - if (src_inst->opcode() == SpvOpSpecConstantOp) { + if (src_inst->opcode() == spv::Op::OpSpecConstantOp) { if (src_inst->NumInOperandWords() == dst_inst->NumInOperandWords()) { return DoOperandsMatch(src_inst, dst_inst, 0, src_inst->NumInOperandWords()); @@ -1327,13 +1330,13 @@ bool Differ::MatchOpVariable(const opt::Instruction* src_inst, // built-in decorations. uint32_t src_built_in_decoration; const bool src_is_built_in = GetDecorationValue( - src_id_to_, src_id, SpvDecorationBuiltIn, &src_built_in_decoration); + src_id_to_, src_id, spv::Decoration::BuiltIn, &src_built_in_decoration); if (src_is_built_in && AreVariablesMatchable(src_id, dst_id, flexibility)) { return true; } - SpvStorageClass src_storage_class, dst_storage_class; + spv::StorageClass src_storage_class, dst_storage_class; GetVarTypeId(src_id_to_, src_id, &src_storage_class); GetVarTypeId(dst_id_to_, dst_id, &dst_storage_class); @@ -1348,13 +1351,13 @@ bool Differ::MatchOpVariable(const opt::Instruction* src_inst, uint32_t src_binding = 0, dst_binding = 0; const bool src_has_set = GetDecorationValue( - src_id_to_, src_id, SpvDecorationDescriptorSet, &src_set); + src_id_to_, src_id, spv::Decoration::DescriptorSet, &src_set); const bool dst_has_set = GetDecorationValue( - dst_id_to_, dst_id, SpvDecorationDescriptorSet, &dst_set); - const bool src_has_binding = - GetDecorationValue(src_id_to_, src_id, SpvDecorationBinding, &src_set); - const bool dst_has_binding = - GetDecorationValue(dst_id_to_, dst_id, SpvDecorationBinding, &dst_set); + dst_id_to_, dst_id, spv::Decoration::DescriptorSet, &dst_set); + const bool src_has_binding = GetDecorationValue( + src_id_to_, src_id, spv::Decoration::Binding, &src_set); + const bool dst_has_binding = GetDecorationValue( + dst_id_to_, dst_id, spv::Decoration::Binding, &dst_set); if (src_has_set && dst_has_set && src_has_binding && dst_has_binding) { return src_set == dst_set && src_binding == dst_binding; @@ -1367,9 +1370,9 @@ bool Differ::MatchOpVariable(const opt::Instruction* src_inst, uint32_t src_location, dst_location; const bool src_has_location = GetDecorationValue( - src_id_to_, src_id, SpvDecorationLocation, &src_location); + src_id_to_, src_id, spv::Decoration::Location, &src_location); const bool dst_has_location = GetDecorationValue( - dst_id_to_, dst_id, SpvDecorationLocation, &dst_location); + dst_id_to_, dst_id, spv::Decoration::Location, &dst_location); if (src_has_location && dst_has_location) { return src_location == dst_location; @@ -1384,25 +1387,25 @@ bool Differ::MatchPerVertexType(uint32_t src_type_id, uint32_t dst_type_id) { // For gl_PerVertex, find the type pointer of this type (array) and make sure // the storage classes of src and dst match; geometry and tessellation shaders // have two instances of gl_PerVertex. - SpvStorageClass src_storage_class = + spv::StorageClass src_storage_class = GetPerVertexStorageClass(src_, src_type_id); - SpvStorageClass dst_storage_class = + spv::StorageClass dst_storage_class = GetPerVertexStorageClass(dst_, dst_type_id); - assert(src_storage_class == SpvStorageClassInput || - src_storage_class == SpvStorageClassOutput); - assert(dst_storage_class == SpvStorageClassInput || - dst_storage_class == SpvStorageClassOutput); + assert(src_storage_class == spv::StorageClass::Input || + src_storage_class == spv::StorageClass::Output); + assert(dst_storage_class == spv::StorageClass::Input || + dst_storage_class == spv::StorageClass::Output); return src_storage_class == dst_storage_class; } bool Differ::MatchPerVertexVariable(const opt::Instruction* src_inst, const opt::Instruction* dst_inst) { - SpvStorageClass src_storage_class = - SpvStorageClass(src_inst->GetSingleWordInOperand(0)); - SpvStorageClass dst_storage_class = - SpvStorageClass(dst_inst->GetSingleWordInOperand(0)); + spv::StorageClass src_storage_class = + spv::StorageClass(src_inst->GetSingleWordInOperand(0)); + spv::StorageClass dst_storage_class = + spv::StorageClass(dst_inst->GetSingleWordInOperand(0)); return src_storage_class == dst_storage_class; } @@ -1479,7 +1482,7 @@ InstructionList Differ::GetFunctionHeader(const opt::Function& function) { InstructionList body; function.WhileEachInst( [&body](const opt::Instruction* inst) { - if (inst->opcode() == SpvOpLabel) { + if (inst->opcode() == spv::Op::OpLabel) { return false; } body.push_back(inst); @@ -1694,12 +1697,12 @@ void Differ::MatchVariablesUsedByMatchedInstructions( default: // TODO: match functions based on OpFunctionCall? break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: - case SpvOpLoad: - case SpvOpStore: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: + case spv::Op::OpLoad: + case spv::Op::OpStore: const uint32_t src_pointer_id = src_inst->GetSingleWordInOperand(0); const uint32_t dst_pointer_id = dst_inst->GetSingleWordInOperand(0); if (IsVariable(src_id_to_, src_pointer_id) && @@ -1727,23 +1730,24 @@ const opt::Instruction* Differ::GetInst(const IdInstructions& id_to, uint32_t Differ::GetConstantUint(const IdInstructions& id_to, uint32_t constant_id) { const opt::Instruction* constant_inst = GetInst(id_to, constant_id); - assert(constant_inst->opcode() == SpvOpConstant); - assert(GetInst(id_to, constant_inst->type_id())->opcode() == SpvOpTypeInt); + assert(constant_inst->opcode() == spv::Op::OpConstant); + assert(GetInst(id_to, constant_inst->type_id())->opcode() == + spv::Op::OpTypeInt); return constant_inst->GetSingleWordInOperand(0); } -SpvExecutionModel Differ::GetExecutionModel(const opt::Module* module, - uint32_t entry_point_id) { +spv::ExecutionModel Differ::GetExecutionModel(const opt::Module* module, + uint32_t entry_point_id) { for (const opt::Instruction& inst : module->entry_points()) { - assert(inst.opcode() == SpvOpEntryPoint); + assert(inst.opcode() == spv::Op::OpEntryPoint); if (inst.GetSingleWordOperand(1) == entry_point_id) { - return SpvExecutionModel(inst.GetSingleWordOperand(0)); + return spv::ExecutionModel(inst.GetSingleWordOperand(0)); } } assert(false && "Unreachable"); - return SpvExecutionModel(0xFFF); + return spv::ExecutionModel(0xFFF); } bool Differ::HasName(const IdInstructions& id_to, uint32_t id) { @@ -1751,7 +1755,7 @@ bool Differ::HasName(const IdInstructions& id_to, uint32_t id) { assert(id < id_to.name_map_.size()); for (const opt::Instruction* inst : id_to.name_map_[id]) { - if (inst->opcode() == SpvOpName) { + if (inst->opcode() == spv::Op::OpName) { return true; } } @@ -1765,7 +1769,7 @@ std::string Differ::GetName(const IdInstructions& id_to, uint32_t id, assert(id < id_to.name_map_.size()); for (const opt::Instruction* inst : id_to.name_map_[id]) { - if (inst->opcode() == SpvOpName) { + if (inst->opcode() == spv::Op::OpName) { *has_name = true; return inst->GetOperand(1).AsString(); } @@ -1788,11 +1792,11 @@ std::string Differ::GetSanitizedName(const IdInstructions& id_to, uint32_t id) { } uint32_t Differ::GetVarTypeId(const IdInstructions& id_to, uint32_t var_id, - SpvStorageClass* storage_class) { + spv::StorageClass* storage_class) { const opt::Instruction* var_inst = GetInst(id_to, var_id); - assert(var_inst->opcode() == SpvOpVariable); + assert(var_inst->opcode() == spv::Op::OpVariable); - *storage_class = SpvStorageClass(var_inst->GetSingleWordInOperand(0)); + *storage_class = spv::StorageClass(var_inst->GetSingleWordInOperand(0)); // Get the type pointer from the variable. const uint32_t type_pointer_id = var_inst->type_id(); @@ -1803,15 +1807,15 @@ uint32_t Differ::GetVarTypeId(const IdInstructions& id_to, uint32_t var_id, } bool Differ::GetDecorationValue(const IdInstructions& id_to, uint32_t id, - SpvDecoration decoration, + spv::Decoration decoration, uint32_t* decoration_value) { assert(id != 0); assert(id < id_to.decoration_map_.size()); for (const opt::Instruction* inst : id_to.decoration_map_[id]) { - if (inst->opcode() == SpvOpDecorate && + if (inst->opcode() == spv::Op::OpDecorate && inst->GetSingleWordOperand(0) == id && - inst->GetSingleWordOperand(1) == decoration) { + spv::Decoration(inst->GetSingleWordOperand(1)) == decoration) { *decoration_value = inst->GetSingleWordOperand(2); return true; } @@ -1828,28 +1832,28 @@ const opt::Instruction* Differ::GetForwardPointerInst( } bool Differ::IsIntType(const IdInstructions& id_to, uint32_t type_id) { - return IsOp(id_to, type_id, SpvOpTypeInt); + return IsOp(id_to, type_id, spv::Op::OpTypeInt); } bool Differ::IsFloatType(const IdInstructions& id_to, uint32_t type_id) { - return IsOp(id_to, type_id, SpvOpTypeFloat); + return IsOp(id_to, type_id, spv::Op::OpTypeFloat); } bool Differ::IsConstantUint(const IdInstructions& id_to, uint32_t id) { const opt::Instruction* constant_inst = GetInst(id_to, id); - if (constant_inst->opcode() != SpvOpConstant) { + if (constant_inst->opcode() != spv::Op::OpConstant) { return false; } const opt::Instruction* type_inst = GetInst(id_to, constant_inst->type_id()); - return type_inst->opcode() == SpvOpTypeInt; + return type_inst->opcode() == spv::Op::OpTypeInt; } bool Differ::IsVariable(const IdInstructions& id_to, uint32_t pointer_id) { - return IsOp(id_to, pointer_id, SpvOpVariable); + return IsOp(id_to, pointer_id, spv::Op::OpVariable); } -bool Differ::IsOp(const IdInstructions& id_to, uint32_t id, SpvOp op) { +bool Differ::IsOp(const IdInstructions& id_to, uint32_t id, spv::Op op) { return GetInst(id_to, id)->opcode() == op; } @@ -1858,17 +1862,18 @@ bool Differ::IsPerVertexType(const IdInstructions& id_to, uint32_t type_id) { assert(type_id < id_to.decoration_map_.size()); for (const opt::Instruction* inst : id_to.decoration_map_[type_id]) { - if (inst->opcode() == SpvOpMemberDecorate && + if (inst->opcode() == spv::Op::OpMemberDecorate && inst->GetSingleWordOperand(0) == type_id && - inst->GetSingleWordOperand(2) == SpvDecorationBuiltIn) { - SpvBuiltIn built_in = SpvBuiltIn(inst->GetSingleWordOperand(3)); + spv::Decoration(inst->GetSingleWordOperand(2)) == + spv::Decoration::BuiltIn) { + spv::BuiltIn built_in = spv::BuiltIn(inst->GetSingleWordOperand(3)); // Only gl_PerVertex can have, and it can only have, the following // built-in decorations. - return built_in == SpvBuiltInPosition || - built_in == SpvBuiltInPointSize || - built_in == SpvBuiltInClipDistance || - built_in == SpvBuiltInCullDistance; + return built_in == spv::BuiltIn::Position || + built_in == spv::BuiltIn::PointSize || + built_in == spv::BuiltIn::ClipDistance || + built_in == spv::BuiltIn::CullDistance; } } @@ -1877,12 +1882,12 @@ bool Differ::IsPerVertexType(const IdInstructions& id_to, uint32_t type_id) { bool Differ::IsPerVertexVariable(const IdInstructions& id_to, uint32_t var_id) { // Get the type from the type pointer. - SpvStorageClass storage_class; + spv::StorageClass storage_class; uint32_t type_id = GetVarTypeId(id_to, var_id, &storage_class); const opt::Instruction* type_inst = GetInst(id_to, type_id); // If array, get the element type. - if (type_inst->opcode() == SpvOpTypeArray) { + if (type_inst->opcode() == spv::Op::OpTypeArray) { type_id = type_inst->GetSingleWordInOperand(0); } @@ -1890,21 +1895,21 @@ bool Differ::IsPerVertexVariable(const IdInstructions& id_to, uint32_t var_id) { return IsPerVertexType(id_to, type_id); } -SpvStorageClass Differ::GetPerVertexStorageClass(const opt::Module* module, - uint32_t type_id) { +spv::StorageClass Differ::GetPerVertexStorageClass(const opt::Module* module, + uint32_t type_id) { for (const opt::Instruction& inst : module->types_values()) { switch (inst.opcode()) { - case SpvOpTypeArray: + case spv::Op::OpTypeArray: // The gl_PerVertex instance could be an array, look for a variable of // the array type instead. if (inst.GetSingleWordInOperand(0) == type_id) { type_id = inst.result_id(); } break; - case SpvOpTypePointer: + case spv::Op::OpTypePointer: // Find the storage class of the pointer to this type. if (inst.GetSingleWordInOperand(1) == type_id) { - return SpvStorageClass(inst.GetSingleWordInOperand(0)); + return spv::StorageClass(inst.GetSingleWordInOperand(0)); } break; default: @@ -1915,7 +1920,7 @@ SpvStorageClass Differ::GetPerVertexStorageClass(const opt::Module* module, // gl_PerVertex is declared, but is unused. Return either of Input or Output // classes just so it matches one in the other module. This should be highly // unlikely, perhaps except for ancient GS-used-to-emulate-CS scenarios. - return SpvStorageClassOutput; + return spv::StorageClass::Output; } spv_ext_inst_type_t Differ::GetExtInstType(const IdInstructions& id_to, @@ -1941,9 +1946,9 @@ spv_number_kind_t Differ::GetNumberKind(const IdInstructions& id_to, case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER: switch (inst.opcode()) { - case SpvOpSwitch: - case SpvOpConstant: - case SpvOpSpecConstant: + case spv::Op::OpSwitch: + case spv::Op::OpConstant: + case spv::Op::OpSpecConstant: // Same kind of number as the selector (OpSwitch) or the type // (Op*Constant). return GetTypeNumberKind(id_to, inst.GetSingleWordOperand(0), @@ -1969,12 +1974,12 @@ spv_number_kind_t Differ::GetTypeNumberKind(const IdInstructions& id_to, } switch (type_inst->opcode()) { - case SpvOpTypeInt: + case spv::Op::OpTypeInt: *number_bit_width = type_inst->GetSingleWordOperand(1); return type_inst->GetSingleWordOperand(2) == 0 ? SPV_NUMBER_UNSIGNED_INT : SPV_NUMBER_SIGNED_INT; break; - case SpvOpTypeFloat: + case spv::Op::OpTypeFloat: *number_bit_width = type_inst->GetSingleWordOperand(1); return SPV_NUMBER_FLOATING; default: @@ -2092,7 +2097,7 @@ void Differ::MatchTypeForwardPointers() { return inst.GetSingleWordOperand(0); }; auto accept_type_forward_pointer_ops = [](const opt::Instruction& inst) { - return inst.opcode() == SpvOpTypeForwardPointer; + return inst.opcode() == spv::Op::OpTypeForwardPointer; }; PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true, @@ -2116,17 +2121,17 @@ void Differ::MatchTypeForwardPointers() { // - If leftover is unique, match // Group forwarded pointers by storage class first and loop over them. - GroupIdsAndMatch( - potential_id_map.src_ids, potential_id_map.dst_ids, SpvStorageClassMax, - &Differ::GroupIdsHelperGetTypePointerStorageClass, + GroupIdsAndMatch( + potential_id_map.src_ids, potential_id_map.dst_ids, + spv::StorageClass::Max, &Differ::GroupIdsHelperGetTypePointerStorageClass, [this](const IdGroup& src_group_by_storage_class, const IdGroup& dst_group_by_storage_class) { // Group them further by the type they are pointing to and loop over // them. - GroupIdsAndMatch( - src_group_by_storage_class, dst_group_by_storage_class, SpvOpMax, - &Differ::GroupIdsHelperGetTypePointerTypeOp, + GroupIdsAndMatch( + src_group_by_storage_class, dst_group_by_storage_class, + spv::Op::Max, &Differ::GroupIdsHelperGetTypePointerTypeOp, [this](const IdGroup& src_group_by_type_op, const IdGroup& dst_group_by_type_op) { @@ -2182,8 +2187,8 @@ void Differ::MatchTypeIds() { MatchIds(potential_id_map, [this, flexibility]( const opt::Instruction* src_inst, const opt::Instruction* dst_inst) { - const SpvOp src_op = src_inst->opcode(); - const SpvOp dst_op = dst_inst->opcode(); + const spv::Op src_op = src_inst->opcode(); + const spv::Op dst_op = dst_inst->opcode(); // Don't match if the opcode is not the same. if (src_op != dst_op) { @@ -2191,26 +2196,26 @@ void Differ::MatchTypeIds() { } switch (src_op) { - case SpvOpTypeVoid: - case SpvOpTypeBool: - case SpvOpTypeSampler: + case spv::Op::OpTypeVoid: + case spv::Op::OpTypeBool: + case spv::Op::OpTypeSampler: // void, bool and sampler are unique, match them. return true; - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeSampledImage: - case SpvOpTypeRuntimeArray: - case SpvOpTypePointer: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypePointer: // Match these instructions when all operands match. assert(src_inst->NumInOperandWords() == dst_inst->NumInOperandWords()); return DoOperandsMatch(src_inst, dst_inst, 0, src_inst->NumInOperandWords()); - case SpvOpTypeFunction: - case SpvOpTypeImage: + case spv::Op::OpTypeFunction: + case spv::Op::OpTypeImage: // Match function types only if they have the same number of operands, // and they all match. // Match image types similarly, expecting the optional final parameter @@ -2221,7 +2226,7 @@ void Differ::MatchTypeIds() { return DoOperandsMatch(src_inst, dst_inst, 0, src_inst->NumInOperandWords()); - case SpvOpTypeArray: + case spv::Op::OpTypeArray: // Match arrays only if the element type and length match. The length // is an id of a constant, so the actual constant it's defining is // compared instead. @@ -2238,7 +2243,7 @@ void Differ::MatchTypeIds() { // example if a spec contant is used). return DoOperandsMatch(src_inst, dst_inst, 1, 1); - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: return MatchOpTypeStruct(src_inst, dst_inst, flexibility); default: @@ -2270,8 +2275,8 @@ void Differ::MatchConstants() { MatchIds(potential_id_map, [this, flexibility]( const opt::Instruction* src_inst, const opt::Instruction* dst_inst) { - const SpvOp src_op = src_inst->opcode(); - const SpvOp dst_op = dst_inst->opcode(); + const spv::Op src_op = src_inst->opcode(); + const spv::Op dst_op = dst_inst->opcode(); // Don't match if the opcode is not the same. if (src_op != dst_op) { @@ -2279,14 +2284,14 @@ void Differ::MatchConstants() { } switch (src_op) { - case SpvOpConstantTrue: - case SpvOpConstantFalse: + case spv::Op::OpConstantTrue: + case spv::Op::OpConstantFalse: // true and false are unique, match them. return true; - case SpvOpConstant: + case spv::Op::OpConstant: return MatchOpConstant(src_inst, dst_inst, flexibility); - case SpvOpConstantComposite: - case SpvOpSpecConstantComposite: + case spv::Op::OpConstantComposite: + case spv::Op::OpSpecConstantComposite: // Composite constants must match in type and value. // // TODO: match OpConstantNull with OpConstantComposite with all zeros @@ -2299,7 +2304,7 @@ void Differ::MatchConstants() { dst_inst->GetOperand(0)) && DoOperandsMatch(src_inst, dst_inst, 0, src_inst->NumInOperandWords()); - case SpvOpConstantSampler: + case spv::Op::OpConstantSampler: // Match sampler constants exactly. // TODO: Allow flexibility in parameters to better diff shaders where // the sampler param has changed. @@ -2307,15 +2312,15 @@ void Differ::MatchConstants() { dst_inst->NumInOperandWords()); return DoOperandsMatch(src_inst, dst_inst, 0, src_inst->NumInOperandWords()); - case SpvOpConstantNull: + case spv::Op::OpConstantNull: // Match null constants as long as the type matches. return DoesOperandMatch(src_inst->GetOperand(0), dst_inst->GetOperand(0)); - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: - case SpvOpSpecConstant: - case SpvOpSpecConstantOp: + case spv::Op::OpSpecConstantTrue: + case spv::Op::OpSpecConstantFalse: + case spv::Op::OpSpecConstant: + case spv::Op::OpSpecConstantOp: // Match spec constants by name if available, then by the SpecId // decoration. return MatchOpSpecConstant(src_inst, dst_inst); @@ -2334,7 +2339,7 @@ void Differ::MatchVariableIds() { return inst.result_id(); }; auto accept_type_ops = [](const opt::Instruction& inst) { - return inst.opcode() == SpvOpVariable; + return inst.opcode() == spv::Op::OpVariable; }; PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true, @@ -2350,8 +2355,8 @@ void Differ::MatchVariableIds() { MatchIds(potential_id_map, [this, flexibility](const opt::Instruction* src_inst, const opt::Instruction* dst_inst) { - assert(src_inst->opcode() == SpvOpVariable); - assert(dst_inst->opcode() == SpvOpVariable); + assert(src_inst->opcode() == spv::Op::OpVariable); + assert(dst_inst->opcode() == spv::Op::OpVariable); return MatchOpVariable(src_inst, dst_inst, flexibility); }); @@ -2597,7 +2602,7 @@ void Differ::ToParsedInstruction( parsed_inst->num_words = static_cast(inst_binary.size()); parsed_inst->opcode = static_cast(inst.opcode()); parsed_inst->ext_inst_type = - inst.opcode() == SpvOpExtInst + inst.opcode() == spv::Op::OpExtInst ? GetExtInstType(id_to, original_inst.GetSingleWordInOperand(0)) : SPV_EXT_INST_TYPE_NONE; parsed_inst->type_id = diff --git a/3rdparty/spirv-tools/source/disassemble.cpp b/3rdparty/spirv-tools/source/disassemble.cpp index 1d61b9f9e..f862efd56 100644 --- a/3rdparty/spirv-tools/source/disassemble.cpp +++ b/3rdparty/spirv-tools/source/disassemble.cpp @@ -244,7 +244,7 @@ void InstructionDisassembler::EmitHeaderSchema(uint32_t schema) { void InstructionDisassembler::EmitInstruction( const spv_parsed_instruction_t& inst, size_t inst_byte_offset) { - auto opcode = static_cast(inst.opcode); + auto opcode = static_cast(inst.opcode); if (inst.result_id) { SetBlue(); @@ -268,7 +268,7 @@ void InstructionDisassembler::EmitInstruction( EmitOperand(inst, i); } - if (comment_ && opcode == SpvOpName) { + if (comment_ && opcode == spv::Op::OpName) { const spv_parsed_operand_t& operand = inst.operands[0]; const uint32_t word = inst.words[operand.offset]; stream_ << " ; id %" << word; @@ -290,8 +290,8 @@ void InstructionDisassembler::EmitInstruction( void InstructionDisassembler::EmitSectionComment( const spv_parsed_instruction_t& inst, bool& inserted_decoration_space, bool& inserted_debug_space, bool& inserted_type_space) { - auto opcode = static_cast(inst.opcode); - if (comment_ && opcode == SpvOpFunction) { + auto opcode = static_cast(inst.opcode); + if (comment_ && opcode == spv::Op::OpFunction) { stream_ << std::endl; stream_ << std::string(indent_, ' '); stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl; @@ -351,7 +351,7 @@ void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst, } break; case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: { spv_opcode_desc opcode_desc; - if (grammar_.lookupOpcode(SpvOp(word), &opcode_desc)) + if (grammar_.lookupOpcode(spv::Op(word), &opcode_desc)) assert(false && "should have caught this earlier"); SetRed(); stream_ << opcode_desc->name; diff --git a/3rdparty/spirv-tools/source/enum_set.h b/3rdparty/spirv-tools/source/enum_set.h index d4d31e332..28ee5fee8 100644 --- a/3rdparty/spirv-tools/source/enum_set.h +++ b/3rdparty/spirv-tools/source/enum_set.h @@ -200,8 +200,8 @@ class EnumSet { std::unique_ptr overflow_ = {}; }; -// A set of SpvCapability, optimized for small capability values. -using CapabilitySet = EnumSet; +// A set of spv::Capability, optimized for small capability values. +using CapabilitySet = EnumSet; } // namespace spvtools diff --git a/3rdparty/spirv-tools/source/enum_string_mapping.h b/3rdparty/spirv-tools/source/enum_string_mapping.h index af8f56b82..b13658406 100644 --- a/3rdparty/spirv-tools/source/enum_string_mapping.h +++ b/3rdparty/spirv-tools/source/enum_string_mapping.h @@ -29,7 +29,7 @@ bool GetExtensionFromString(const char* str, Extension* extension); const char* ExtensionToString(Extension extension); // Returns text string corresponding to |capability|. -const char* CapabilityToString(SpvCapability capability); +const char* CapabilityToString(spv::Capability capability); } // namespace spvtools diff --git a/3rdparty/spirv-tools/source/extensions.cpp b/3rdparty/spirv-tools/source/extensions.cpp index 049a3ad10..ebf6bec06 100644 --- a/3rdparty/spirv-tools/source/extensions.cpp +++ b/3rdparty/spirv-tools/source/extensions.cpp @@ -24,7 +24,9 @@ namespace spvtools { std::string GetExtensionString(const spv_parsed_instruction_t* inst) { - if (inst->opcode != SpvOpExtension) return "ERROR_not_op_extension"; + if (inst->opcode != static_cast(spv::Op::OpExtension)) { + return "ERROR_not_op_extension"; + } assert(inst->num_operands == 1); diff --git a/3rdparty/spirv-tools/source/instruction.h b/3rdparty/spirv-tools/source/instruction.h index 9e7dccd03..2acbb5729 100644 --- a/3rdparty/spirv-tools/source/instruction.h +++ b/3rdparty/spirv-tools/source/instruction.h @@ -26,7 +26,7 @@ struct spv_instruction_t { // Normally, both opcode and extInstType contain valid data. // However, when the assembler parses ! as the first word in // an instruction and opcode and extInstType are invalid. - SpvOp opcode; + spv::Op opcode; spv_ext_inst_type_t extInstType; // The Id of the result type, if this instruction has one. Zero otherwise. diff --git a/3rdparty/spirv-tools/source/latest_version_spirv_header.h b/3rdparty/spirv-tools/source/latest_version_spirv_header.h index e4f28e43e..f6ab5c845 100644 --- a/3rdparty/spirv-tools/source/latest_version_spirv_header.h +++ b/3rdparty/spirv-tools/source/latest_version_spirv_header.h @@ -15,6 +15,6 @@ #ifndef SOURCE_LATEST_VERSION_SPIRV_HEADER_H_ #define SOURCE_LATEST_VERSION_SPIRV_HEADER_H_ -#include "spirv/unified1/spirv.h" +#include "spirv/unified1/spirv.hpp11" #endif // SOURCE_LATEST_VERSION_SPIRV_HEADER_H_ diff --git a/3rdparty/spirv-tools/source/link/linker.cpp b/3rdparty/spirv-tools/source/link/linker.cpp index 3b388cc6e..e50391a1b 100644 --- a/3rdparty/spirv-tools/source/link/linker.cpp +++ b/3rdparty/spirv-tools/source/link/linker.cpp @@ -57,12 +57,12 @@ using opt::analysis::TypeManager; // Stores various information about an imported or exported symbol. struct LinkageSymbolInfo { - SpvId id; // ID of the symbol - SpvId type_id; // ID of the type of the symbol + spv::Id id; // ID of the symbol + spv::Id type_id; // ID of the type of the symbol std::string name; // unique name defining the symbol and used for matching // imports and exports together - std::vector parameter_ids; // ID of the parameters of the symbol, if - // it is a function + std::vector parameter_ids; // ID of the parameters of the symbol, if + // it is a function }; struct LinkageEntry { LinkageSymbolInfo imported_symbol; @@ -226,7 +226,7 @@ spv_result_t GenerateHeader(const MessageConsumer& consumer, << " (input module " << (i + 1) << ")."; } - header->magic_number = SpvMagicNumber; + header->magic_number = spv::MagicNumber; header->version = linked_version; header->generator = SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_LINKER, 0); header->bound = max_id_bound; @@ -367,7 +367,7 @@ spv_result_t MergeModules(const MessageConsumer& consumer, std::vector processed_words = spvtools::utils::MakeVector(processed_string); linked_module->AddDebug3Inst(std::unique_ptr( - new Instruction(linked_context, SpvOpModuleProcessed, 0u, 0u, + new Instruction(linked_context, spv::Op::OpModuleProcessed, 0u, 0u, {{SPV_OPERAND_TYPE_LITERAL_STRING, processed_words}}))); } @@ -377,7 +377,7 @@ spv_result_t MergeModules(const MessageConsumer& consumer, std::unique_ptr(inst.Clone(linked_context))); // TODO(pierremoreau): Since the modules have not been validate, should we - // expect SpvStorageClassFunction variables outside + // expect spv::StorageClass::Function variables outside // functions? for (const auto& module : input_modules) { for (const auto& inst : module->types_values()) { @@ -414,16 +414,18 @@ spv_result_t GetImportExportPairs(const MessageConsumer& consumer, // Figure out the imports and exports for (const auto& decoration : linked_context.annotations()) { - if (decoration.opcode() != SpvOpDecorate || - decoration.GetSingleWordInOperand(1u) != SpvDecorationLinkageAttributes) + if (decoration.opcode() != spv::Op::OpDecorate || + spv::Decoration(decoration.GetSingleWordInOperand(1u)) != + spv::Decoration::LinkageAttributes) continue; - const SpvId id = decoration.GetSingleWordInOperand(0u); + const spv::Id id = decoration.GetSingleWordInOperand(0u); // Ignore if the targeted symbol is a built-in bool is_built_in = false; for (const auto& id_decoration : decoration_manager.GetDecorationsFor(id, false)) { - if (id_decoration->GetSingleWordInOperand(1u) == SpvDecorationBuiltIn) { + if (spv::Decoration(id_decoration->GetSingleWordInOperand(1u)) == + spv::Decoration::BuiltIn) { is_built_in = true; break; } @@ -447,9 +449,9 @@ spv_result_t GetImportExportPairs(const MessageConsumer& consumer, return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_BINARY) << "ID " << id << " is never defined:\n"; - if (def_inst->opcode() == SpvOpVariable) { + if (def_inst->opcode() == spv::Op::OpVariable) { symbol_info.type_id = def_inst->type_id(); - } else if (def_inst->opcode() == SpvOpFunction) { + } else if (def_inst->opcode() == spv::Op::OpFunction) { symbol_info.type_id = def_inst->GetSingleWordInOperand(1u); // range-based for loop calls begin()/end(), but never cbegin()/cend(), @@ -467,9 +469,9 @@ spv_result_t GetImportExportPairs(const MessageConsumer& consumer, << " LinkageAttributes; " << id << " is neither of them.\n"; } - if (type == SpvLinkageTypeImport) + if (spv::LinkageType(type) == spv::LinkageType::Import) imports.push_back(symbol_info); - else if (type == SpvLinkageTypeExport) + else if (spv::LinkageType(type) == spv::LinkageType::Export) exports[symbol_info.name].push_back(symbol_info); } @@ -585,7 +587,7 @@ spv_result_t RemoveLinkageSpecificInstructions( // TODO(pierremoreau): This will not work if the decoration is applied // through a group, but the linker does not support that // either. - std::unordered_set imports; + std::unordered_set imports; if (options.GetAllowPartialLinkage()) { imports.reserve(linkings_to_do.size()); for (const auto& linking_entry : linkings_to_do) @@ -601,9 +603,11 @@ spv_result_t RemoveLinkageSpecificInstructions( // * if we do not allow partial linkage, remove all import annotations; // * otherwise, remove the annotation only if there was a corresponding // export. - if (inst->opcode() == SpvOpDecorate && - inst->GetSingleWordOperand(1u) == SpvDecorationLinkageAttributes && - inst->GetSingleWordOperand(3u) == SpvLinkageTypeImport && + if (inst->opcode() == spv::Op::OpDecorate && + spv::Decoration(inst->GetSingleWordOperand(1u)) == + spv::Decoration::LinkageAttributes && + spv::LinkageType(inst->GetSingleWordOperand(3u)) == + spv::LinkageType::Import && (!options.GetAllowPartialLinkage() || imports.find(inst->GetSingleWordOperand(0u)) != imports.end())) { linked_context->KillInst(&*inst); @@ -616,9 +620,11 @@ spv_result_t RemoveLinkageSpecificInstructions( for (auto inst = next; inst != linked_context->annotation_end(); inst = next) { ++next; - if (inst->opcode() == SpvOpDecorate && - inst->GetSingleWordOperand(1u) == SpvDecorationLinkageAttributes && - inst->GetSingleWordOperand(3u) == SpvLinkageTypeExport) { + if (inst->opcode() == spv::Op::OpDecorate && + spv::Decoration(inst->GetSingleWordOperand(1u)) == + spv::Decoration::LinkageAttributes && + spv::LinkageType(inst->GetSingleWordOperand(3u)) == + spv::LinkageType::Export) { linked_context->KillInst(&*inst); } } @@ -628,10 +634,11 @@ spv_result_t RemoveLinkageSpecificInstructions( // not allowed if (!options.GetCreateLibrary() && !options.GetAllowPartialLinkage()) { for (auto& inst : linked_context->capabilities()) - if (inst.GetSingleWordInOperand(0u) == SpvCapabilityLinkage) { + if (spv::Capability(inst.GetSingleWordInOperand(0u)) == + spv::Capability::Linkage) { linked_context->KillInst(&inst); // The RemoveDuplicatesPass did remove duplicated capabilities, so we - // now there aren’t more SpvCapabilityLinkage further down. + // now there aren’t more spv::Capability::Linkage further down. break; } } @@ -671,7 +678,7 @@ spv_result_t VerifyLimits(const MessageConsumer& consumer, size_t num_global_values = 0u; for (const auto& inst : linked_context.module()->types_values()) { - num_global_values += inst.opcode() == SpvOpVariable; + num_global_values += inst.opcode() == spv::Op::OpVariable; } if (num_global_values >= SPV_LIMIT_GLOBAL_VARIABLES_MAX) DiagnosticStream(position, consumer, "", SPV_WARNING) diff --git a/3rdparty/spirv-tools/source/lint/divergence_analysis.cpp b/3rdparty/spirv-tools/source/lint/divergence_analysis.cpp index b5a72b459..fe32e1ac2 100644 --- a/3rdparty/spirv-tools/source/lint/divergence_analysis.cpp +++ b/3rdparty/spirv-tools/source/lint/divergence_analysis.cpp @@ -19,7 +19,6 @@ #include "source/opt/dataflow.h" #include "source/opt/function.h" #include "source/opt/instruction.h" -#include "spirv/unified1/spirv.h" namespace spvtools { namespace lint { @@ -32,7 +31,7 @@ void DivergenceAnalysis::EnqueueSuccessors(opt::Instruction* inst) { uint32_t block_id; if (inst->IsBlockTerminator()) { block_id = context().get_instr_block(inst)->id(); - } else if (inst->opcode() == SpvOpLabel) { + } else if (inst->opcode() == spv::Op::OpLabel) { block_id = inst->result_id(); opt::BasicBlock* bb = context().cfg()->block(block_id); // Only enqueue phi instructions, as other uses don't affect divergence. @@ -54,7 +53,7 @@ void DivergenceAnalysis::EnqueueSuccessors(opt::Instruction* inst) { opt::DataFlowAnalysis::VisitResult DivergenceAnalysis::Visit( opt::Instruction* inst) { - if (inst->opcode() == SpvOpLabel) { + if (inst->opcode() == spv::Op::OpLabel) { return VisitBlock(inst->result_id()); } else { return VisitInstruction(inst); @@ -128,12 +127,12 @@ DivergenceAnalysis::ComputeInstructionDivergence(opt::Instruction* inst) { // Device/QueueFamily could satisfy fully uniform. uint32_t id = inst->result_id(); // Handle divergence roots. - if (inst->opcode() == SpvOpFunctionParameter) { + if (inst->opcode() == spv::Op::OpFunctionParameter) { divergence_source_[id] = 0; return divergence_[id] = DivergenceLevel::kDivergent; } else if (inst->IsLoad()) { spvtools::opt::Instruction* var = inst->GetBaseAddress(); - if (var->opcode() != SpvOpVariable) { + if (var->opcode() != spv::Op::OpVariable) { // Assume divergent. divergence_source_[id] = 0; return DivergenceLevel::kDivergent; @@ -166,29 +165,30 @@ DivergenceAnalysis::ComputeVariableDivergence(opt::Instruction* var) { uint32_t def_id = var->result_id(); DivergenceLevel ret; switch (type->storage_class()) { - case SpvStorageClassFunction: - case SpvStorageClassGeneric: - case SpvStorageClassAtomicCounter: - case SpvStorageClassStorageBuffer: - case SpvStorageClassPhysicalStorageBuffer: - case SpvStorageClassOutput: - case SpvStorageClassWorkgroup: - case SpvStorageClassImage: // Image atomics probably aren't uniform. - case SpvStorageClassPrivate: + case spv::StorageClass::Function: + case spv::StorageClass::Generic: + case spv::StorageClass::AtomicCounter: + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::PhysicalStorageBuffer: + case spv::StorageClass::Output: + case spv::StorageClass::Workgroup: + case spv::StorageClass::Image: // Image atomics probably aren't uniform. + case spv::StorageClass::Private: ret = DivergenceLevel::kDivergent; break; - case SpvStorageClassInput: + case spv::StorageClass::Input: ret = DivergenceLevel::kDivergent; // If this variable has a Flat decoration, it is partially uniform. // TODO(kuhar): Track access chain indices and also consider Flat members // of a structure. context().get_decoration_mgr()->WhileEachDecoration( - def_id, SpvDecorationFlat, [&ret](const opt::Instruction&) { + def_id, static_cast(spv::Decoration::Flat), + [&ret](const opt::Instruction&) { ret = DivergenceLevel::kPartiallyUniform; return false; }); break; - case SpvStorageClassUniformConstant: + case spv::StorageClass::UniformConstant: // May be a storage image which is also written to; mark those as // divergent. if (!var->IsVulkanStorageImage() || var->IsReadOnlyPointer()) { @@ -197,9 +197,10 @@ DivergenceAnalysis::ComputeVariableDivergence(opt::Instruction* var) { ret = DivergenceLevel::kDivergent; } break; - case SpvStorageClassUniform: - case SpvStorageClassPushConstant: - case SpvStorageClassCrossWorkgroup: // Not for shaders; default uniform. + case spv::StorageClass::Uniform: + case spv::StorageClass::PushConstant: + case spv::StorageClass::CrossWorkgroup: // Not for shaders; default + // uniform. default: ret = DivergenceLevel::kUniform; break; @@ -216,7 +217,7 @@ void DivergenceAnalysis::Setup(opt::Function* function) { function->entry().get(), [this](const opt::BasicBlock* bb) { uint32_t id = bb->id(); if (bb->terminator() == nullptr || - bb->terminator()->opcode() != SpvOpBranch) { + bb->terminator()->opcode() != spv::Op::OpBranch) { follow_unconditional_branches_[id] = id; } else { uint32_t target_id = bb->terminator()->GetSingleWordInOperand(0); diff --git a/3rdparty/spirv-tools/source/lint/lint_divergent_derivatives.cpp b/3rdparty/spirv-tools/source/lint/lint_divergent_derivatives.cpp index 512847b0c..82d5ac634 100644 --- a/3rdparty/spirv-tools/source/lint/lint_divergent_derivatives.cpp +++ b/3rdparty/spirv-tools/source/lint/lint_divergent_derivatives.cpp @@ -27,7 +27,6 @@ #include "source/opt/instruction.h" #include "source/opt/ir_context.h" #include "spirv-tools/libspirv.h" -#include "spirv/unified1/spirv.h" namespace spvtools { namespace lint { @@ -43,7 +42,7 @@ std::string GetFriendlyName(opt::IRContext* context, uint32_t id) { ss << id; } else { opt::Instruction* inst_name = names.begin()->second; - if (inst_name->opcode() == SpvOpName) { + if (inst_name->opcode() == spv::Op::OpName) { ss << names.begin()->second->GetInOperand(0).AsString(); ss << "[" << id << "]"; } else { @@ -54,26 +53,26 @@ std::string GetFriendlyName(opt::IRContext* context, uint32_t id) { } bool InstructionHasDerivative(const opt::Instruction& inst) { - static const SpvOp derivative_opcodes[] = { + static const spv::Op derivative_opcodes[] = { // Implicit derivatives. - SpvOpImageSampleImplicitLod, - SpvOpImageSampleDrefImplicitLod, - SpvOpImageSampleProjImplicitLod, - SpvOpImageSampleProjDrefImplicitLod, - SpvOpImageSparseSampleImplicitLod, - SpvOpImageSparseSampleDrefImplicitLod, - SpvOpImageSparseSampleProjImplicitLod, - SpvOpImageSparseSampleProjDrefImplicitLod, + spv::Op::OpImageSampleImplicitLod, + spv::Op::OpImageSampleDrefImplicitLod, + spv::Op::OpImageSampleProjImplicitLod, + spv::Op::OpImageSampleProjDrefImplicitLod, + spv::Op::OpImageSparseSampleImplicitLod, + spv::Op::OpImageSparseSampleDrefImplicitLod, + spv::Op::OpImageSparseSampleProjImplicitLod, + spv::Op::OpImageSparseSampleProjDrefImplicitLod, // Explicit derivatives. - SpvOpDPdx, - SpvOpDPdy, - SpvOpFwidth, - SpvOpDPdxFine, - SpvOpDPdyFine, - SpvOpFwidthFine, - SpvOpDPdxCoarse, - SpvOpDPdyCoarse, - SpvOpFwidthCoarse, + spv::Op::OpDPdx, + spv::Op::OpDPdy, + spv::Op::OpFwidth, + spv::Op::OpDPdxFine, + spv::Op::OpDPdyFine, + spv::Op::OpFwidthFine, + spv::Op::OpDPdxCoarse, + spv::Op::OpDPdyCoarse, + spv::Op::OpFwidthCoarse, }; return std::find(std::begin(derivative_opcodes), std::end(derivative_opcodes), inst.opcode()) != std::end(derivative_opcodes); @@ -97,13 +96,14 @@ void PrintDivergenceFlow(opt::IRContext* context, DivergenceAnalysis div, opt::analysis::DefUseManager* def_use = context->get_def_use_mgr(); opt::CFG* cfg = context->cfg(); while (id != 0) { - bool is_block = def_use->GetDef(id)->opcode() == SpvOpLabel; + bool is_block = def_use->GetDef(id)->opcode() == spv::Op::OpLabel; if (is_block) { Warn(context, nullptr) << "block " << GetFriendlyName(context, id) << " is divergent"; uint32_t source = div.GetDivergenceSource(id); // Skip intermediate blocks. - while (source != 0 && def_use->GetDef(source)->opcode() == SpvOpLabel) { + while (source != 0 && + def_use->GetDef(source)->opcode() == spv::Op::OpLabel) { id = source; source = div.GetDivergenceSource(id); } @@ -122,7 +122,7 @@ void PrintDivergenceFlow(opt::IRContext* context, DivergenceAnalysis div, opt::Instruction* source_def = source == 0 ? nullptr : def_use->GetDef(source); // First print data -> data dependencies. - while (source != 0 && source_def->opcode() != SpvOpLabel) { + while (source != 0 && source_def->opcode() != spv::Op::OpLabel) { Warn(context, def_use->GetDef(id)) << "because " << GetFriendlyName(context, id) << " uses value " << GetFriendlyName(context, source) diff --git a/3rdparty/spirv-tools/source/lint/linter.cpp b/3rdparty/spirv-tools/source/lint/linter.cpp index e4ed04ea4..748067671 100644 --- a/3rdparty/spirv-tools/source/lint/linter.cpp +++ b/3rdparty/spirv-tools/source/lint/linter.cpp @@ -19,7 +19,6 @@ #include "source/opt/ir_context.h" #include "spirv-tools/libspirv.h" #include "spirv-tools/libspirv.hpp" -#include "spirv/unified1/spirv.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/name_mapper.cpp b/3rdparty/spirv-tools/source/name_mapper.cpp index 3b31d33a8..b2d0f4452 100644 --- a/3rdparty/spirv-tools/source/name_mapper.cpp +++ b/3rdparty/spirv-tools/source/name_mapper.cpp @@ -100,18 +100,18 @@ void FriendlyNameMapper::SaveName(uint32_t id, void FriendlyNameMapper::SaveBuiltInName(uint32_t target_id, uint32_t built_in) { #define GLCASE(name) \ - case SpvBuiltIn##name: \ + case spv::BuiltIn::name: \ SaveName(target_id, "gl_" #name); \ return; #define GLCASE2(name, suggested) \ - case SpvBuiltIn##name: \ + case spv::BuiltIn::name: \ SaveName(target_id, "gl_" #suggested); \ return; #define CASE(name) \ - case SpvBuiltIn##name: \ + case spv::BuiltIn::name: \ SaveName(target_id, #name); \ return; - switch (built_in) { + switch (spv::BuiltIn(built_in)) { GLCASE(Position) GLCASE(PointSize) GLCASE(ClipDistance) @@ -170,28 +170,28 @@ void FriendlyNameMapper::SaveBuiltInName(uint32_t target_id, spv_result_t FriendlyNameMapper::ParseInstruction( const spv_parsed_instruction_t& inst) { const auto result_id = inst.result_id; - switch (inst.opcode) { - case SpvOpName: + switch (spv::Op(inst.opcode)) { + case spv::Op::OpName: SaveName(inst.words[1], spvDecodeLiteralStringOperand(inst, 1)); break; - case SpvOpDecorate: + case spv::Op::OpDecorate: // Decorations come after OpName. So OpName will take precedence over // decorations. // // In theory, we should also handle OpGroupDecorate. But that's unlikely // to occur. - if (inst.words[2] == SpvDecorationBuiltIn) { + if (spv::Decoration(inst.words[2]) == spv::Decoration::BuiltIn) { assert(inst.num_words > 3); SaveBuiltInName(inst.words[1], inst.words[3]); } break; - case SpvOpTypeVoid: + case spv::Op::OpTypeVoid: SaveName(result_id, "void"); break; - case SpvOpTypeBool: + case spv::Op::OpTypeBool: SaveName(result_id, "bool"); break; - case SpvOpTypeInt: { + case spv::Op::OpTypeInt: { std::string signedness; std::string root; const auto bit_width = inst.words[2]; @@ -216,7 +216,7 @@ spv_result_t FriendlyNameMapper::ParseInstruction( if (0 == inst.words[3]) signedness = "u"; SaveName(result_id, signedness + root); } break; - case SpvOpTypeFloat: { + case spv::Op::OpTypeFloat: { const auto bit_width = inst.words[2]; switch (bit_width) { case 16: @@ -233,68 +233,68 @@ spv_result_t FriendlyNameMapper::ParseInstruction( break; } } break; - case SpvOpTypeVector: + case spv::Op::OpTypeVector: SaveName(result_id, std::string("v") + to_string(inst.words[3]) + NameForId(inst.words[2])); break; - case SpvOpTypeMatrix: + case spv::Op::OpTypeMatrix: SaveName(result_id, std::string("mat") + to_string(inst.words[3]) + NameForId(inst.words[2])); break; - case SpvOpTypeArray: + case spv::Op::OpTypeArray: SaveName(result_id, std::string("_arr_") + NameForId(inst.words[2]) + "_" + NameForId(inst.words[3])); break; - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeRuntimeArray: SaveName(result_id, std::string("_runtimearr_") + NameForId(inst.words[2])); break; - case SpvOpTypePointer: + case spv::Op::OpTypePointer: SaveName(result_id, std::string("_ptr_") + NameForEnumOperand(SPV_OPERAND_TYPE_STORAGE_CLASS, inst.words[2]) + "_" + NameForId(inst.words[3])); break; - case SpvOpTypePipe: + case spv::Op::OpTypePipe: SaveName(result_id, std::string("Pipe") + NameForEnumOperand(SPV_OPERAND_TYPE_ACCESS_QUALIFIER, inst.words[2])); break; - case SpvOpTypeEvent: + case spv::Op::OpTypeEvent: SaveName(result_id, "Event"); break; - case SpvOpTypeDeviceEvent: + case spv::Op::OpTypeDeviceEvent: SaveName(result_id, "DeviceEvent"); break; - case SpvOpTypeReserveId: + case spv::Op::OpTypeReserveId: SaveName(result_id, "ReserveId"); break; - case SpvOpTypeQueue: + case spv::Op::OpTypeQueue: SaveName(result_id, "Queue"); break; - case SpvOpTypeOpaque: + case spv::Op::OpTypeOpaque: SaveName(result_id, std::string("Opaque_") + Sanitize(spvDecodeLiteralStringOperand(inst, 1))); break; - case SpvOpTypePipeStorage: + case spv::Op::OpTypePipeStorage: SaveName(result_id, "PipeStorage"); break; - case SpvOpTypeNamedBarrier: + case spv::Op::OpTypeNamedBarrier: SaveName(result_id, "NamedBarrier"); break; - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: // Structs are mapped rather simplisitically. Just indicate that they // are a struct and then give the raw Id number. SaveName(result_id, std::string("_struct_") + to_string(result_id)); break; - case SpvOpConstantTrue: + case spv::Op::OpConstantTrue: SaveName(result_id, "true"); break; - case SpvOpConstantFalse: + case spv::Op::OpConstantFalse: SaveName(result_id, "false"); break; - case SpvOpConstant: { + case spv::Op::OpConstant: { std::ostringstream value; EmitNumericLiteral(&value, inst, inst.operands[2]); auto value_str = value.str(); diff --git a/3rdparty/spirv-tools/source/opcode.cpp b/3rdparty/spirv-tools/source/opcode.cpp index 3f927290e..b1785cccc 100644 --- a/3rdparty/spirv-tools/source/opcode.cpp +++ b/3rdparty/spirv-tools/source/opcode.cpp @@ -64,7 +64,7 @@ const char* spvGeneratorStr(uint32_t generator) { return "Unknown"; } -uint32_t spvOpcodeMake(uint16_t wordCount, SpvOp opcode) { +uint32_t spvOpcodeMake(uint16_t wordCount, spv::Op opcode) { return ((uint32_t)opcode) | (((uint32_t)wordCount) << 16); } @@ -125,7 +125,7 @@ spv_result_t spvOpcodeTableNameLookup(spv_target_env env, spv_result_t spvOpcodeTableValueLookup(spv_target_env env, const spv_opcode_table table, - const SpvOp opcode, + const spv::Op opcode, spv_opcode_desc* pEntry) { if (!table) return SPV_ERROR_INVALID_TABLE; if (!pEntry) return SPV_ERROR_INVALID_POINTER; @@ -166,7 +166,7 @@ spv_result_t spvOpcodeTableValueLookup(spv_target_env env, return SPV_ERROR_INVALID_LOOKUP; } -void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, +void spvInstructionCopy(const uint32_t* words, const spv::Op opcode, const uint16_t wordCount, const spv_endianness_t endian, spv_instruction_t* pInst) { pInst->opcode = opcode; @@ -177,7 +177,7 @@ void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, uint16_t thisWordCount; uint16_t thisOpcode; spvOpcodeSplit(pInst->words[wordIndex], &thisWordCount, &thisOpcode); - assert(opcode == static_cast(thisOpcode) && + assert(opcode == static_cast(thisOpcode) && wordCount == thisWordCount && "Endianness failed!"); } } @@ -186,7 +186,7 @@ void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, const char* spvOpcodeString(const uint32_t opcode) { const auto beg = kOpcodeTableEntries; const auto end = kOpcodeTableEntries + ARRAY_SIZE(kOpcodeTableEntries); - spv_opcode_desc_t needle = {"", static_cast(opcode), + spv_opcode_desc_t needle = {"", static_cast(opcode), 0, nullptr, 0, {}, false, false, @@ -196,7 +196,7 @@ const char* spvOpcodeString(const uint32_t opcode) { return lhs.opcode < rhs.opcode; }; auto it = std::lower_bound(beg, end, needle, comp); - if (it != end && it->opcode == opcode) { + if (it != end && it->opcode == spv::Op(opcode)) { return it->name; } @@ -204,140 +204,145 @@ const char* spvOpcodeString(const uint32_t opcode) { return "unknown"; } -int32_t spvOpcodeIsScalarType(const SpvOp opcode) { +const char* spvOpcodeString(const spv::Op opcode) { + return spvOpcodeString(static_cast(opcode)); +} + +int32_t spvOpcodeIsScalarType(const spv::Op opcode) { switch (opcode) { - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeBool: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeBool: return true; default: return false; } } -int32_t spvOpcodeIsSpecConstant(const SpvOp opcode) { +int32_t spvOpcodeIsSpecConstant(const spv::Op opcode) { switch (opcode) { - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: - case SpvOpSpecConstant: - case SpvOpSpecConstantComposite: - case SpvOpSpecConstantOp: + case spv::Op::OpSpecConstantTrue: + case spv::Op::OpSpecConstantFalse: + case spv::Op::OpSpecConstant: + case spv::Op::OpSpecConstantComposite: + case spv::Op::OpSpecConstantOp: return true; default: return false; } } -int32_t spvOpcodeIsConstant(const SpvOp opcode) { +int32_t spvOpcodeIsConstant(const spv::Op opcode) { switch (opcode) { - case SpvOpConstantTrue: - case SpvOpConstantFalse: - case SpvOpConstant: - case SpvOpConstantComposite: - case SpvOpConstantSampler: - case SpvOpConstantNull: - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: - case SpvOpSpecConstant: - case SpvOpSpecConstantComposite: - case SpvOpSpecConstantOp: + case spv::Op::OpConstantTrue: + case spv::Op::OpConstantFalse: + case spv::Op::OpConstant: + case spv::Op::OpConstantComposite: + case spv::Op::OpConstantSampler: + case spv::Op::OpConstantNull: + case spv::Op::OpSpecConstantTrue: + case spv::Op::OpSpecConstantFalse: + case spv::Op::OpSpecConstant: + case spv::Op::OpSpecConstantComposite: + case spv::Op::OpSpecConstantOp: return true; default: return false; } } -bool spvOpcodeIsConstantOrUndef(const SpvOp opcode) { - return opcode == SpvOpUndef || spvOpcodeIsConstant(opcode); +bool spvOpcodeIsConstantOrUndef(const spv::Op opcode) { + return opcode == spv::Op::OpUndef || spvOpcodeIsConstant(opcode); } -bool spvOpcodeIsScalarSpecConstant(const SpvOp opcode) { +bool spvOpcodeIsScalarSpecConstant(const spv::Op opcode) { switch (opcode) { - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: - case SpvOpSpecConstant: + case spv::Op::OpSpecConstantTrue: + case spv::Op::OpSpecConstantFalse: + case spv::Op::OpSpecConstant: return true; default: return false; } } -int32_t spvOpcodeIsComposite(const SpvOp opcode) { +int32_t spvOpcodeIsComposite(const spv::Op opcode) { switch (opcode) { - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeArray: - case SpvOpTypeStruct: - case SpvOpTypeCooperativeMatrixNV: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeStruct: + case spv::Op::OpTypeCooperativeMatrixNV: return true; default: return false; } } -bool spvOpcodeReturnsLogicalVariablePointer(const SpvOp opcode) { +bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode) { switch (opcode) { - case SpvOpVariable: - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpFunctionParameter: - case SpvOpImageTexelPointer: - case SpvOpCopyObject: - case SpvOpSelect: - case SpvOpPhi: - case SpvOpFunctionCall: - case SpvOpPtrAccessChain: - case SpvOpLoad: - case SpvOpConstantNull: + case spv::Op::OpVariable: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpFunctionParameter: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpCopyObject: + case spv::Op::OpSelect: + case spv::Op::OpPhi: + case spv::Op::OpFunctionCall: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpLoad: + case spv::Op::OpConstantNull: return true; default: return false; } } -int32_t spvOpcodeReturnsLogicalPointer(const SpvOp opcode) { +int32_t spvOpcodeReturnsLogicalPointer(const spv::Op opcode) { switch (opcode) { - case SpvOpVariable: - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpFunctionParameter: - case SpvOpImageTexelPointer: - case SpvOpCopyObject: + case spv::Op::OpVariable: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpFunctionParameter: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpCopyObject: return true; default: return false; } } -int32_t spvOpcodeGeneratesType(SpvOp op) { +int32_t spvOpcodeGeneratesType(spv::Op op) { switch (op) { - case SpvOpTypeVoid: - case SpvOpTypeBool: - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeImage: - case SpvOpTypeSampler: - case SpvOpTypeSampledImage: - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeStruct: - case SpvOpTypeOpaque: - case SpvOpTypePointer: - case SpvOpTypeFunction: - case SpvOpTypeEvent: - case SpvOpTypeDeviceEvent: - case SpvOpTypeReserveId: - case SpvOpTypeQueue: - case SpvOpTypePipe: - case SpvOpTypePipeStorage: - case SpvOpTypeNamedBarrier: - case SpvOpTypeAccelerationStructureNV: - case SpvOpTypeCooperativeMatrixNV: - // case SpvOpTypeAccelerationStructureKHR: covered by - // SpvOpTypeAccelerationStructureNV - case SpvOpTypeRayQueryKHR: + case spv::Op::OpTypeVoid: + case spv::Op::OpTypeBool: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeStruct: + case spv::Op::OpTypeOpaque: + case spv::Op::OpTypePointer: + case spv::Op::OpTypeFunction: + case spv::Op::OpTypeEvent: + case spv::Op::OpTypeDeviceEvent: + case spv::Op::OpTypeReserveId: + case spv::Op::OpTypeQueue: + case spv::Op::OpTypePipe: + case spv::Op::OpTypePipeStorage: + case spv::Op::OpTypeNamedBarrier: + case spv::Op::OpTypeAccelerationStructureNV: + case spv::Op::OpTypeCooperativeMatrixNV: + // case spv::Op::OpTypeAccelerationStructureKHR: covered by + // spv::Op::OpTypeAccelerationStructureNV + case spv::Op::OpTypeRayQueryKHR: + case spv::Op::OpTypeHitObjectNV: return true; default: // In particular, OpTypeForwardPointer does not generate a type, @@ -348,15 +353,15 @@ int32_t spvOpcodeGeneratesType(SpvOp op) { return 0; } -bool spvOpcodeIsDecoration(const SpvOp opcode) { +bool spvOpcodeIsDecoration(const spv::Op opcode) { switch (opcode) { - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpMemberDecorate: - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - case SpvOpDecorateStringGOOGLE: - case SpvOpMemberDecorateStringGOOGLE: + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpMemberDecorate: + case spv::Op::OpGroupDecorate: + case spv::Op::OpGroupMemberDecorate: + case spv::Op::OpDecorateStringGOOGLE: + case spv::Op::OpMemberDecorateStringGOOGLE: return true; default: break; @@ -364,402 +369,403 @@ bool spvOpcodeIsDecoration(const SpvOp opcode) { return false; } -bool spvOpcodeIsLoad(const SpvOp opcode) { +bool spvOpcodeIsLoad(const spv::Op opcode) { switch (opcode) { - case SpvOpLoad: - case SpvOpImageSampleExplicitLod: - case SpvOpImageSampleImplicitLod: - case SpvOpImageSampleDrefImplicitLod: - case SpvOpImageSampleDrefExplicitLod: - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjExplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSampleProjDrefExplicitLod: - case SpvOpImageFetch: - case SpvOpImageGather: - case SpvOpImageDrefGather: - case SpvOpImageRead: - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleExplicitLod: - case SpvOpImageSparseSampleDrefExplicitLod: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageSparseFetch: - case SpvOpImageSparseGather: - case SpvOpImageSparseDrefGather: - case SpvOpImageSparseRead: + case spv::Op::OpLoad: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageFetch: + case spv::Op::OpImageGather: + case spv::Op::OpImageDrefGather: + case spv::Op::OpImageRead: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseFetch: + case spv::Op::OpImageSparseGather: + case spv::Op::OpImageSparseDrefGather: + case spv::Op::OpImageSparseRead: return true; default: return false; } } -bool spvOpcodeIsBranch(SpvOp opcode) { +bool spvOpcodeIsBranch(spv::Op opcode) { switch (opcode) { - case SpvOpBranch: - case SpvOpBranchConditional: - case SpvOpSwitch: + case spv::Op::OpBranch: + case spv::Op::OpBranchConditional: + case spv::Op::OpSwitch: return true; default: return false; } } -bool spvOpcodeIsAtomicWithLoad(const SpvOp opcode) { +bool spvOpcodeIsAtomicWithLoad(const spv::Op opcode) { switch (opcode) { - case SpvOpAtomicLoad: - case SpvOpAtomicExchange: - case SpvOpAtomicCompareExchange: - case SpvOpAtomicCompareExchangeWeak: - case SpvOpAtomicIIncrement: - case SpvOpAtomicIDecrement: - case SpvOpAtomicIAdd: - case SpvOpAtomicFAddEXT: - case SpvOpAtomicISub: - case SpvOpAtomicSMin: - case SpvOpAtomicUMin: - case SpvOpAtomicFMinEXT: - case SpvOpAtomicSMax: - case SpvOpAtomicUMax: - case SpvOpAtomicFMaxEXT: - case SpvOpAtomicAnd: - case SpvOpAtomicOr: - case SpvOpAtomicXor: - case SpvOpAtomicFlagTestAndSet: + case spv::Op::OpAtomicLoad: + case spv::Op::OpAtomicExchange: + case spv::Op::OpAtomicCompareExchange: + case spv::Op::OpAtomicCompareExchangeWeak: + case spv::Op::OpAtomicIIncrement: + case spv::Op::OpAtomicIDecrement: + case spv::Op::OpAtomicIAdd: + case spv::Op::OpAtomicFAddEXT: + case spv::Op::OpAtomicISub: + case spv::Op::OpAtomicSMin: + case spv::Op::OpAtomicUMin: + case spv::Op::OpAtomicFMinEXT: + case spv::Op::OpAtomicSMax: + case spv::Op::OpAtomicUMax: + case spv::Op::OpAtomicFMaxEXT: + case spv::Op::OpAtomicAnd: + case spv::Op::OpAtomicOr: + case spv::Op::OpAtomicXor: + case spv::Op::OpAtomicFlagTestAndSet: return true; default: return false; } } -bool spvOpcodeIsAtomicOp(const SpvOp opcode) { - return (spvOpcodeIsAtomicWithLoad(opcode) || opcode == SpvOpAtomicStore || - opcode == SpvOpAtomicFlagClear); +bool spvOpcodeIsAtomicOp(const spv::Op opcode) { + return (spvOpcodeIsAtomicWithLoad(opcode) || + opcode == spv::Op::OpAtomicStore || + opcode == spv::Op::OpAtomicFlagClear); } -bool spvOpcodeIsReturn(SpvOp opcode) { +bool spvOpcodeIsReturn(spv::Op opcode) { switch (opcode) { - case SpvOpReturn: - case SpvOpReturnValue: + case spv::Op::OpReturn: + case spv::Op::OpReturnValue: return true; default: return false; } } -bool spvOpcodeIsAbort(SpvOp opcode) { +bool spvOpcodeIsAbort(spv::Op opcode) { switch (opcode) { - case SpvOpKill: - case SpvOpUnreachable: - case SpvOpTerminateInvocation: - case SpvOpTerminateRayKHR: - case SpvOpIgnoreIntersectionKHR: - case SpvOpEmitMeshTasksEXT: + case spv::Op::OpKill: + case spv::Op::OpUnreachable: + case spv::Op::OpTerminateInvocation: + case spv::Op::OpTerminateRayKHR: + case spv::Op::OpIgnoreIntersectionKHR: + case spv::Op::OpEmitMeshTasksEXT: return true; default: return false; } } -bool spvOpcodeIsReturnOrAbort(SpvOp opcode) { +bool spvOpcodeIsReturnOrAbort(spv::Op opcode) { return spvOpcodeIsReturn(opcode) || spvOpcodeIsAbort(opcode); } -bool spvOpcodeIsBlockTerminator(SpvOp opcode) { +bool spvOpcodeIsBlockTerminator(spv::Op opcode) { return spvOpcodeIsBranch(opcode) || spvOpcodeIsReturnOrAbort(opcode); } -bool spvOpcodeIsBaseOpaqueType(SpvOp opcode) { +bool spvOpcodeIsBaseOpaqueType(spv::Op opcode) { switch (opcode) { - case SpvOpTypeImage: - case SpvOpTypeSampler: - case SpvOpTypeSampledImage: - case SpvOpTypeOpaque: - case SpvOpTypeEvent: - case SpvOpTypeDeviceEvent: - case SpvOpTypeReserveId: - case SpvOpTypeQueue: - case SpvOpTypePipe: - case SpvOpTypeForwardPointer: - case SpvOpTypePipeStorage: - case SpvOpTypeNamedBarrier: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeOpaque: + case spv::Op::OpTypeEvent: + case spv::Op::OpTypeDeviceEvent: + case spv::Op::OpTypeReserveId: + case spv::Op::OpTypeQueue: + case spv::Op::OpTypePipe: + case spv::Op::OpTypeForwardPointer: + case spv::Op::OpTypePipeStorage: + case spv::Op::OpTypeNamedBarrier: return true; default: return false; } } -bool spvOpcodeIsNonUniformGroupOperation(SpvOp opcode) { +bool spvOpcodeIsNonUniformGroupOperation(spv::Op opcode) { switch (opcode) { - case SpvOpGroupNonUniformElect: - case SpvOpGroupNonUniformAll: - case SpvOpGroupNonUniformAny: - case SpvOpGroupNonUniformAllEqual: - case SpvOpGroupNonUniformBroadcast: - case SpvOpGroupNonUniformBroadcastFirst: - case SpvOpGroupNonUniformBallot: - case SpvOpGroupNonUniformInverseBallot: - case SpvOpGroupNonUniformBallotBitExtract: - case SpvOpGroupNonUniformBallotBitCount: - case SpvOpGroupNonUniformBallotFindLSB: - case SpvOpGroupNonUniformBallotFindMSB: - case SpvOpGroupNonUniformShuffle: - case SpvOpGroupNonUniformShuffleXor: - case SpvOpGroupNonUniformShuffleUp: - case SpvOpGroupNonUniformShuffleDown: - case SpvOpGroupNonUniformIAdd: - case SpvOpGroupNonUniformFAdd: - case SpvOpGroupNonUniformIMul: - case SpvOpGroupNonUniformFMul: - case SpvOpGroupNonUniformSMin: - case SpvOpGroupNonUniformUMin: - case SpvOpGroupNonUniformFMin: - case SpvOpGroupNonUniformSMax: - case SpvOpGroupNonUniformUMax: - case SpvOpGroupNonUniformFMax: - case SpvOpGroupNonUniformBitwiseAnd: - case SpvOpGroupNonUniformBitwiseOr: - case SpvOpGroupNonUniformBitwiseXor: - case SpvOpGroupNonUniformLogicalAnd: - case SpvOpGroupNonUniformLogicalOr: - case SpvOpGroupNonUniformLogicalXor: - case SpvOpGroupNonUniformQuadBroadcast: - case SpvOpGroupNonUniformQuadSwap: - case SpvOpGroupNonUniformRotateKHR: + case spv::Op::OpGroupNonUniformElect: + case spv::Op::OpGroupNonUniformAll: + case spv::Op::OpGroupNonUniformAny: + case spv::Op::OpGroupNonUniformAllEqual: + case spv::Op::OpGroupNonUniformBroadcast: + case spv::Op::OpGroupNonUniformBroadcastFirst: + case spv::Op::OpGroupNonUniformBallot: + case spv::Op::OpGroupNonUniformInverseBallot: + case spv::Op::OpGroupNonUniformBallotBitExtract: + case spv::Op::OpGroupNonUniformBallotBitCount: + case spv::Op::OpGroupNonUniformBallotFindLSB: + case spv::Op::OpGroupNonUniformBallotFindMSB: + case spv::Op::OpGroupNonUniformShuffle: + case spv::Op::OpGroupNonUniformShuffleXor: + case spv::Op::OpGroupNonUniformShuffleUp: + case spv::Op::OpGroupNonUniformShuffleDown: + case spv::Op::OpGroupNonUniformIAdd: + case spv::Op::OpGroupNonUniformFAdd: + case spv::Op::OpGroupNonUniformIMul: + case spv::Op::OpGroupNonUniformFMul: + case spv::Op::OpGroupNonUniformSMin: + case spv::Op::OpGroupNonUniformUMin: + case spv::Op::OpGroupNonUniformFMin: + case spv::Op::OpGroupNonUniformSMax: + case spv::Op::OpGroupNonUniformUMax: + case spv::Op::OpGroupNonUniformFMax: + case spv::Op::OpGroupNonUniformBitwiseAnd: + case spv::Op::OpGroupNonUniformBitwiseOr: + case spv::Op::OpGroupNonUniformBitwiseXor: + case spv::Op::OpGroupNonUniformLogicalAnd: + case spv::Op::OpGroupNonUniformLogicalOr: + case spv::Op::OpGroupNonUniformLogicalXor: + case spv::Op::OpGroupNonUniformQuadBroadcast: + case spv::Op::OpGroupNonUniformQuadSwap: + case spv::Op::OpGroupNonUniformRotateKHR: return true; default: return false; } } -bool spvOpcodeIsScalarizable(SpvOp opcode) { +bool spvOpcodeIsScalarizable(spv::Op opcode) { switch (opcode) { - case SpvOpPhi: - case SpvOpCopyObject: - case SpvOpConvertFToU: - case SpvOpConvertFToS: - case SpvOpConvertSToF: - case SpvOpConvertUToF: - case SpvOpUConvert: - case SpvOpSConvert: - case SpvOpFConvert: - case SpvOpQuantizeToF16: - case SpvOpVectorInsertDynamic: - case SpvOpSNegate: - case SpvOpFNegate: - case SpvOpIAdd: - case SpvOpFAdd: - case SpvOpISub: - case SpvOpFSub: - case SpvOpIMul: - case SpvOpFMul: - case SpvOpUDiv: - case SpvOpSDiv: - case SpvOpFDiv: - case SpvOpUMod: - case SpvOpSRem: - case SpvOpSMod: - case SpvOpFRem: - case SpvOpFMod: - case SpvOpVectorTimesScalar: - case SpvOpIAddCarry: - case SpvOpISubBorrow: - case SpvOpUMulExtended: - case SpvOpSMulExtended: - case SpvOpShiftRightLogical: - case SpvOpShiftRightArithmetic: - case SpvOpShiftLeftLogical: - case SpvOpBitwiseOr: - case SpvOpBitwiseAnd: - case SpvOpNot: - case SpvOpBitFieldInsert: - case SpvOpBitFieldSExtract: - case SpvOpBitFieldUExtract: - case SpvOpBitReverse: - case SpvOpBitCount: - case SpvOpIsNan: - case SpvOpIsInf: - case SpvOpIsFinite: - case SpvOpIsNormal: - case SpvOpSignBitSet: - case SpvOpLessOrGreater: - case SpvOpOrdered: - case SpvOpUnordered: - case SpvOpLogicalEqual: - case SpvOpLogicalNotEqual: - case SpvOpLogicalOr: - case SpvOpLogicalAnd: - case SpvOpLogicalNot: - case SpvOpSelect: - case SpvOpIEqual: - case SpvOpINotEqual: - case SpvOpUGreaterThan: - case SpvOpSGreaterThan: - case SpvOpUGreaterThanEqual: - case SpvOpSGreaterThanEqual: - case SpvOpULessThan: - case SpvOpSLessThan: - case SpvOpULessThanEqual: - case SpvOpSLessThanEqual: - case SpvOpFOrdEqual: - case SpvOpFUnordEqual: - case SpvOpFOrdNotEqual: - case SpvOpFUnordNotEqual: - case SpvOpFOrdLessThan: - case SpvOpFUnordLessThan: - case SpvOpFOrdGreaterThan: - case SpvOpFUnordGreaterThan: - case SpvOpFOrdLessThanEqual: - case SpvOpFUnordLessThanEqual: - case SpvOpFOrdGreaterThanEqual: - case SpvOpFUnordGreaterThanEqual: + case spv::Op::OpPhi: + case spv::Op::OpCopyObject: + case spv::Op::OpConvertFToU: + case spv::Op::OpConvertFToS: + case spv::Op::OpConvertSToF: + case spv::Op::OpConvertUToF: + case spv::Op::OpUConvert: + case spv::Op::OpSConvert: + case spv::Op::OpFConvert: + case spv::Op::OpQuantizeToF16: + case spv::Op::OpVectorInsertDynamic: + case spv::Op::OpSNegate: + case spv::Op::OpFNegate: + case spv::Op::OpIAdd: + case spv::Op::OpFAdd: + case spv::Op::OpISub: + case spv::Op::OpFSub: + case spv::Op::OpIMul: + case spv::Op::OpFMul: + case spv::Op::OpUDiv: + case spv::Op::OpSDiv: + case spv::Op::OpFDiv: + case spv::Op::OpUMod: + case spv::Op::OpSRem: + case spv::Op::OpSMod: + case spv::Op::OpFRem: + case spv::Op::OpFMod: + case spv::Op::OpVectorTimesScalar: + case spv::Op::OpIAddCarry: + case spv::Op::OpISubBorrow: + case spv::Op::OpUMulExtended: + case spv::Op::OpSMulExtended: + case spv::Op::OpShiftRightLogical: + case spv::Op::OpShiftRightArithmetic: + case spv::Op::OpShiftLeftLogical: + case spv::Op::OpBitwiseOr: + case spv::Op::OpBitwiseAnd: + case spv::Op::OpNot: + case spv::Op::OpBitFieldInsert: + case spv::Op::OpBitFieldSExtract: + case spv::Op::OpBitFieldUExtract: + case spv::Op::OpBitReverse: + case spv::Op::OpBitCount: + case spv::Op::OpIsNan: + case spv::Op::OpIsInf: + case spv::Op::OpIsFinite: + case spv::Op::OpIsNormal: + case spv::Op::OpSignBitSet: + case spv::Op::OpLessOrGreater: + case spv::Op::OpOrdered: + case spv::Op::OpUnordered: + case spv::Op::OpLogicalEqual: + case spv::Op::OpLogicalNotEqual: + case spv::Op::OpLogicalOr: + case spv::Op::OpLogicalAnd: + case spv::Op::OpLogicalNot: + case spv::Op::OpSelect: + case spv::Op::OpIEqual: + case spv::Op::OpINotEqual: + case spv::Op::OpUGreaterThan: + case spv::Op::OpSGreaterThan: + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpULessThan: + case spv::Op::OpSLessThan: + case spv::Op::OpULessThanEqual: + case spv::Op::OpSLessThanEqual: + case spv::Op::OpFOrdEqual: + case spv::Op::OpFUnordEqual: + case spv::Op::OpFOrdNotEqual: + case spv::Op::OpFUnordNotEqual: + case spv::Op::OpFOrdLessThan: + case spv::Op::OpFUnordLessThan: + case spv::Op::OpFOrdGreaterThan: + case spv::Op::OpFUnordGreaterThan: + case spv::Op::OpFOrdLessThanEqual: + case spv::Op::OpFUnordLessThanEqual: + case spv::Op::OpFOrdGreaterThanEqual: + case spv::Op::OpFUnordGreaterThanEqual: return true; default: return false; } } -bool spvOpcodeIsDebug(SpvOp opcode) { +bool spvOpcodeIsDebug(spv::Op opcode) { switch (opcode) { - case SpvOpName: - case SpvOpMemberName: - case SpvOpSource: - case SpvOpSourceContinued: - case SpvOpSourceExtension: - case SpvOpString: - case SpvOpLine: - case SpvOpNoLine: - case SpvOpModuleProcessed: + case spv::Op::OpName: + case spv::Op::OpMemberName: + case spv::Op::OpSource: + case spv::Op::OpSourceContinued: + case spv::Op::OpSourceExtension: + case spv::Op::OpString: + case spv::Op::OpLine: + case spv::Op::OpNoLine: + case spv::Op::OpModuleProcessed: return true; default: return false; } } -bool spvOpcodeIsCommutativeBinaryOperator(SpvOp opcode) { +bool spvOpcodeIsCommutativeBinaryOperator(spv::Op opcode) { switch (opcode) { - case SpvOpPtrEqual: - case SpvOpPtrNotEqual: - case SpvOpIAdd: - case SpvOpFAdd: - case SpvOpIMul: - case SpvOpFMul: - case SpvOpDot: - case SpvOpIAddCarry: - case SpvOpUMulExtended: - case SpvOpSMulExtended: - case SpvOpBitwiseOr: - case SpvOpBitwiseXor: - case SpvOpBitwiseAnd: - case SpvOpOrdered: - case SpvOpUnordered: - case SpvOpLogicalEqual: - case SpvOpLogicalNotEqual: - case SpvOpLogicalOr: - case SpvOpLogicalAnd: - case SpvOpIEqual: - case SpvOpINotEqual: - case SpvOpFOrdEqual: - case SpvOpFUnordEqual: - case SpvOpFOrdNotEqual: - case SpvOpFUnordNotEqual: + case spv::Op::OpPtrEqual: + case spv::Op::OpPtrNotEqual: + case spv::Op::OpIAdd: + case spv::Op::OpFAdd: + case spv::Op::OpIMul: + case spv::Op::OpFMul: + case spv::Op::OpDot: + case spv::Op::OpIAddCarry: + case spv::Op::OpUMulExtended: + case spv::Op::OpSMulExtended: + case spv::Op::OpBitwiseOr: + case spv::Op::OpBitwiseXor: + case spv::Op::OpBitwiseAnd: + case spv::Op::OpOrdered: + case spv::Op::OpUnordered: + case spv::Op::OpLogicalEqual: + case spv::Op::OpLogicalNotEqual: + case spv::Op::OpLogicalOr: + case spv::Op::OpLogicalAnd: + case spv::Op::OpIEqual: + case spv::Op::OpINotEqual: + case spv::Op::OpFOrdEqual: + case spv::Op::OpFUnordEqual: + case spv::Op::OpFOrdNotEqual: + case spv::Op::OpFUnordNotEqual: return true; default: return false; } } -bool spvOpcodeIsLinearAlgebra(SpvOp opcode) { +bool spvOpcodeIsLinearAlgebra(spv::Op opcode) { switch (opcode) { - case SpvOpTranspose: - case SpvOpVectorTimesScalar: - case SpvOpMatrixTimesScalar: - case SpvOpVectorTimesMatrix: - case SpvOpMatrixTimesVector: - case SpvOpMatrixTimesMatrix: - case SpvOpOuterProduct: - case SpvOpDot: + case spv::Op::OpTranspose: + case spv::Op::OpVectorTimesScalar: + case spv::Op::OpMatrixTimesScalar: + case spv::Op::OpVectorTimesMatrix: + case spv::Op::OpMatrixTimesVector: + case spv::Op::OpMatrixTimesMatrix: + case spv::Op::OpOuterProduct: + case spv::Op::OpDot: return true; default: return false; } } -bool spvOpcodeIsImageSample(const SpvOp opcode) { +bool spvOpcodeIsImageSample(const spv::Op opcode) { switch (opcode) { - case SpvOpImageSampleImplicitLod: - case SpvOpImageSampleExplicitLod: - case SpvOpImageSampleDrefImplicitLod: - case SpvOpImageSampleDrefExplicitLod: - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjExplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSampleProjDrefExplicitLod: - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleExplicitLod: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: return true; default: return false; } } -std::vector spvOpcodeMemorySemanticsOperandIndices(SpvOp opcode) { +std::vector spvOpcodeMemorySemanticsOperandIndices(spv::Op opcode) { switch (opcode) { - case SpvOpMemoryBarrier: + case spv::Op::OpMemoryBarrier: return {1}; - case SpvOpAtomicStore: - case SpvOpControlBarrier: - case SpvOpAtomicFlagClear: - case SpvOpMemoryNamedBarrier: + case spv::Op::OpAtomicStore: + case spv::Op::OpControlBarrier: + case spv::Op::OpAtomicFlagClear: + case spv::Op::OpMemoryNamedBarrier: return {2}; - case SpvOpAtomicLoad: - case SpvOpAtomicExchange: - case SpvOpAtomicIIncrement: - case SpvOpAtomicIDecrement: - case SpvOpAtomicIAdd: - case SpvOpAtomicFAddEXT: - case SpvOpAtomicISub: - case SpvOpAtomicSMin: - case SpvOpAtomicUMin: - case SpvOpAtomicSMax: - case SpvOpAtomicUMax: - case SpvOpAtomicAnd: - case SpvOpAtomicOr: - case SpvOpAtomicXor: - case SpvOpAtomicFlagTestAndSet: + case spv::Op::OpAtomicLoad: + case spv::Op::OpAtomicExchange: + case spv::Op::OpAtomicIIncrement: + case spv::Op::OpAtomicIDecrement: + case spv::Op::OpAtomicIAdd: + case spv::Op::OpAtomicFAddEXT: + case spv::Op::OpAtomicISub: + case spv::Op::OpAtomicSMin: + case spv::Op::OpAtomicUMin: + case spv::Op::OpAtomicSMax: + case spv::Op::OpAtomicUMax: + case spv::Op::OpAtomicAnd: + case spv::Op::OpAtomicOr: + case spv::Op::OpAtomicXor: + case spv::Op::OpAtomicFlagTestAndSet: return {4}; - case SpvOpAtomicCompareExchange: - case SpvOpAtomicCompareExchangeWeak: + case spv::Op::OpAtomicCompareExchange: + case spv::Op::OpAtomicCompareExchangeWeak: return {4, 5}; default: return {}; } } -bool spvOpcodeIsAccessChain(SpvOp opcode) { +bool spvOpcodeIsAccessChain(spv::Op opcode) { switch (opcode) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: return true; default: return false; } } -bool spvOpcodeIsBit(SpvOp opcode) { +bool spvOpcodeIsBit(spv::Op opcode) { switch (opcode) { - case SpvOpShiftRightLogical: - case SpvOpShiftRightArithmetic: - case SpvOpShiftLeftLogical: - case SpvOpBitwiseOr: - case SpvOpBitwiseXor: - case SpvOpBitwiseAnd: - case SpvOpNot: - case SpvOpBitReverse: - case SpvOpBitCount: + case spv::Op::OpShiftRightLogical: + case spv::Op::OpShiftRightArithmetic: + case spv::Op::OpShiftLeftLogical: + case spv::Op::OpBitwiseOr: + case spv::Op::OpBitwiseXor: + case spv::Op::OpBitwiseAnd: + case spv::Op::OpNot: + case spv::Op::OpBitReverse: + case spv::Op::OpBitCount: return true; default: return false; diff --git a/3rdparty/spirv-tools/source/opcode.h b/3rdparty/spirv-tools/source/opcode.h index 77a0bed25..217aeb2b6 100644 --- a/3rdparty/spirv-tools/source/opcode.h +++ b/3rdparty/spirv-tools/source/opcode.h @@ -29,7 +29,7 @@ const char* spvGeneratorStr(uint32_t generator); // Combines word_count and opcode enumerant in single word. -uint32_t spvOpcodeMake(uint16_t word_count, SpvOp opcode); +uint32_t spvOpcodeMake(uint16_t word_count, spv::Op opcode); // Splits word into into two constituent parts: word_count and opcode. void spvOpcodeSplit(const uint32_t word, uint16_t* word_count, @@ -45,115 +45,118 @@ spv_result_t spvOpcodeTableNameLookup(spv_target_env, // SPV_SUCCESS and writes a handle of the table entry into *entry. spv_result_t spvOpcodeTableValueLookup(spv_target_env, const spv_opcode_table table, - const SpvOp opcode, + const spv::Op opcode, spv_opcode_desc* entry); // Copies an instruction's word and fixes the endianness to host native. The // source instruction's stream/opcode/endianness is in the words/opcode/endian // parameter. The word_count parameter specifies the number of words to copy. // Writes copied instruction into *inst. -void spvInstructionCopy(const uint32_t* words, const SpvOp opcode, +void spvInstructionCopy(const uint32_t* words, const spv::Op opcode, const uint16_t word_count, const spv_endianness_t endian, spv_instruction_t* inst); // Determine if the given opcode is a scalar type. Returns zero if false, // non-zero otherwise. -int32_t spvOpcodeIsScalarType(const SpvOp opcode); +int32_t spvOpcodeIsScalarType(const spv::Op opcode); // Determines if the given opcode is a specialization constant. Returns zero if // false, non-zero otherwise. -int32_t spvOpcodeIsSpecConstant(const SpvOp opcode); +int32_t spvOpcodeIsSpecConstant(const spv::Op opcode); // Determines if the given opcode is a constant. Returns zero if false, non-zero // otherwise. -int32_t spvOpcodeIsConstant(const SpvOp opcode); +int32_t spvOpcodeIsConstant(const spv::Op opcode); // Returns true if the given opcode is a constant or undef. -bool spvOpcodeIsConstantOrUndef(const SpvOp opcode); +bool spvOpcodeIsConstantOrUndef(const spv::Op opcode); // Returns true if the given opcode is a scalar specialization constant. -bool spvOpcodeIsScalarSpecConstant(const SpvOp opcode); +bool spvOpcodeIsScalarSpecConstant(const spv::Op opcode); // Determines if the given opcode is a composite type. Returns zero if false, // non-zero otherwise. -int32_t spvOpcodeIsComposite(const SpvOp opcode); +int32_t spvOpcodeIsComposite(const spv::Op opcode); // Determines if the given opcode results in a pointer when using the logical // addressing model. Returns zero if false, non-zero otherwise. -int32_t spvOpcodeReturnsLogicalPointer(const SpvOp opcode); +int32_t spvOpcodeReturnsLogicalPointer(const spv::Op opcode); // Returns whether the given opcode could result in a pointer or a variable // pointer when using the logical addressing model. -bool spvOpcodeReturnsLogicalVariablePointer(const SpvOp opcode); +bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode); // Determines if the given opcode generates a type. Returns zero if false, // non-zero otherwise. -int32_t spvOpcodeGeneratesType(SpvOp opcode); +int32_t spvOpcodeGeneratesType(spv::Op opcode); // Returns true if the opcode adds a decoration to an id. -bool spvOpcodeIsDecoration(const SpvOp opcode); +bool spvOpcodeIsDecoration(const spv::Op opcode); // Returns true if the opcode is a load from memory into a result id. This // function only considers core instructions. -bool spvOpcodeIsLoad(const SpvOp opcode); +bool spvOpcodeIsLoad(const spv::Op opcode); // Returns true if the opcode is an atomic operation that uses the original // value. -bool spvOpcodeIsAtomicWithLoad(const SpvOp opcode); +bool spvOpcodeIsAtomicWithLoad(const spv::Op opcode); // Returns true if the opcode is an atomic operation. -bool spvOpcodeIsAtomicOp(const SpvOp opcode); +bool spvOpcodeIsAtomicOp(const spv::Op opcode); // Returns true if the given opcode is a branch instruction. -bool spvOpcodeIsBranch(SpvOp opcode); +bool spvOpcodeIsBranch(spv::Op opcode); // Returns true if the given opcode is a return instruction. -bool spvOpcodeIsReturn(SpvOp opcode); +bool spvOpcodeIsReturn(spv::Op opcode); // Returns true if the given opcode aborts execution. To abort means that after // executing that instruction, no other instructions will be executed regardless // of the context in which the instruction appears. Note that `OpUnreachable` // is considered an abort even if its behaviour is undefined. -bool spvOpcodeIsAbort(SpvOp opcode); +bool spvOpcodeIsAbort(spv::Op opcode); // Returns true if the given opcode is a return instruction or it aborts // execution. -bool spvOpcodeIsReturnOrAbort(SpvOp opcode); +bool spvOpcodeIsReturnOrAbort(spv::Op opcode); // Returns true if the given opcode is a basic block terminator. -bool spvOpcodeIsBlockTerminator(SpvOp opcode); +bool spvOpcodeIsBlockTerminator(spv::Op opcode); // Returns true if the given opcode always defines an opaque type. -bool spvOpcodeIsBaseOpaqueType(SpvOp opcode); +bool spvOpcodeIsBaseOpaqueType(spv::Op opcode); // Returns true if the given opcode is a non-uniform group operation. -bool spvOpcodeIsNonUniformGroupOperation(SpvOp opcode); +bool spvOpcodeIsNonUniformGroupOperation(spv::Op opcode); // Returns true if the opcode with vector inputs could be divided into a series // of independent scalar operations that would give the same result. -bool spvOpcodeIsScalarizable(SpvOp opcode); +bool spvOpcodeIsScalarizable(spv::Op opcode); // Returns true if the given opcode is a debug instruction. -bool spvOpcodeIsDebug(SpvOp opcode); +bool spvOpcodeIsDebug(spv::Op opcode); // Returns true for opcodes that are binary operators, // where the order of the operands is irrelevant. -bool spvOpcodeIsCommutativeBinaryOperator(SpvOp opcode); +bool spvOpcodeIsCommutativeBinaryOperator(spv::Op opcode); // Returns true for opcodes that represent linear algebra instructions. -bool spvOpcodeIsLinearAlgebra(SpvOp opcode); +bool spvOpcodeIsLinearAlgebra(spv::Op opcode); // Returns true for opcodes that represent image sample instructions. -bool spvOpcodeIsImageSample(SpvOp opcode); +bool spvOpcodeIsImageSample(spv::Op opcode); // Returns a vector containing the indices of the memory semantics // operands for |opcode|. -std::vector spvOpcodeMemorySemanticsOperandIndices(SpvOp opcode); +std::vector spvOpcodeMemorySemanticsOperandIndices(spv::Op opcode); // Returns true for opcodes that represent access chain instructions. -bool spvOpcodeIsAccessChain(SpvOp opcode); +bool spvOpcodeIsAccessChain(spv::Op opcode); // Returns true for opcodes that represent bit instructions. -bool spvOpcodeIsBit(SpvOp opcode); +bool spvOpcodeIsBit(spv::Op opcode); + +// Gets the name of an instruction, without the "Op" prefix. +const char* spvOpcodeString(const spv::Op opcode); #endif // SOURCE_OPCODE_H_ diff --git a/3rdparty/spirv-tools/source/operand.cpp b/3rdparty/spirv-tools/source/operand.cpp index 0c255a352..31a6c5965 100644 --- a/3rdparty/spirv-tools/source/operand.cpp +++ b/3rdparty/spirv-tools/source/operand.cpp @@ -512,7 +512,7 @@ bool spvIsInIdType(spv_operand_type_t type) { } std::function spvOperandCanBeForwardDeclaredFunction( - SpvOp opcode) { + spv::Op opcode) { std::function out; if (spvOpcodeGeneratesType(opcode)) { // All types can use forward pointers. @@ -520,57 +520,57 @@ std::function spvOperandCanBeForwardDeclaredFunction( return out; } switch (opcode) { - case SpvOpExecutionMode: - case SpvOpExecutionModeId: - case SpvOpEntryPoint: - case SpvOpName: - case SpvOpMemberName: - case SpvOpSelectionMerge: - case SpvOpDecorate: - case SpvOpMemberDecorate: - case SpvOpDecorateId: - case SpvOpDecorateStringGOOGLE: - case SpvOpMemberDecorateStringGOOGLE: - case SpvOpBranch: - case SpvOpLoopMerge: + case spv::Op::OpExecutionMode: + case spv::Op::OpExecutionModeId: + case spv::Op::OpEntryPoint: + case spv::Op::OpName: + case spv::Op::OpMemberName: + case spv::Op::OpSelectionMerge: + case spv::Op::OpDecorate: + case spv::Op::OpMemberDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpDecorateStringGOOGLE: + case spv::Op::OpMemberDecorateStringGOOGLE: + case spv::Op::OpBranch: + case spv::Op::OpLoopMerge: out = [](unsigned) { return true; }; break; - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - case SpvOpBranchConditional: - case SpvOpSwitch: + case spv::Op::OpGroupDecorate: + case spv::Op::OpGroupMemberDecorate: + case spv::Op::OpBranchConditional: + case spv::Op::OpSwitch: out = [](unsigned index) { return index != 0; }; break; - case SpvOpFunctionCall: + case spv::Op::OpFunctionCall: // The Function parameter. out = [](unsigned index) { return index == 2; }; break; - case SpvOpPhi: + case spv::Op::OpPhi: out = [](unsigned index) { return index > 1; }; break; - case SpvOpEnqueueKernel: + case spv::Op::OpEnqueueKernel: // The Invoke parameter. out = [](unsigned index) { return index == 8; }; break; - case SpvOpGetKernelNDrangeSubGroupCount: - case SpvOpGetKernelNDrangeMaxSubGroupSize: + case spv::Op::OpGetKernelNDrangeSubGroupCount: + case spv::Op::OpGetKernelNDrangeMaxSubGroupSize: // The Invoke parameter. out = [](unsigned index) { return index == 3; }; break; - case SpvOpGetKernelWorkGroupSize: - case SpvOpGetKernelPreferredWorkGroupSizeMultiple: + case spv::Op::OpGetKernelWorkGroupSize: + case spv::Op::OpGetKernelPreferredWorkGroupSizeMultiple: // The Invoke parameter. out = [](unsigned index) { return index == 2; }; break; - case SpvOpTypeForwardPointer: + case spv::Op::OpTypeForwardPointer: out = [](unsigned index) { return index == 0; }; break; - case SpvOpTypeArray: + case spv::Op::OpTypeArray: out = [](unsigned index) { return index == 1; }; break; default: diff --git a/3rdparty/spirv-tools/source/operand.h b/3rdparty/spirv-tools/source/operand.h index 7c73c6f56..a3010d934 100644 --- a/3rdparty/spirv-tools/source/operand.h +++ b/3rdparty/spirv-tools/source/operand.h @@ -139,7 +139,7 @@ bool spvIsInIdType(spv_operand_type_t type); // of the operand can be forward declared. This function will // used in the SSA validation stage of the pipeline std::function spvOperandCanBeForwardDeclaredFunction( - SpvOp opcode); + spv::Op opcode); // Takes the instruction key of a debug info extension instruction // and returns a function object that will return true if the index diff --git a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp index 7fa5c8a95..53d13f18b 100644 --- a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp @@ -31,51 +31,50 @@ namespace spvtools { namespace opt { - namespace { -const uint32_t kTypePointerStorageClassInIdx = 0; -const uint32_t kEntryPointFunctionIdInIdx = 1; -const uint32_t kSelectionMergeMergeBlockIdInIdx = 0; -const uint32_t kLoopMergeContinueBlockIdInIdx = 1; -const uint32_t kCopyMemoryTargetAddrInIdx = 0; -const uint32_t kCopyMemorySourceAddrInIdx = 1; -const uint32_t kLoadSourceAddrInIdx = 0; -const uint32_t kDebugDeclareOperandVariableIndex = 5; -const uint32_t kGlobalVariableVariableIndex = 12; +constexpr uint32_t kTypePointerStorageClassInIdx = 0; +constexpr uint32_t kEntryPointFunctionIdInIdx = 1; +constexpr uint32_t kSelectionMergeMergeBlockIdInIdx = 0; +constexpr uint32_t kLoopMergeContinueBlockIdInIdx = 1; +constexpr uint32_t kCopyMemoryTargetAddrInIdx = 0; +constexpr uint32_t kCopyMemorySourceAddrInIdx = 1; +constexpr uint32_t kLoadSourceAddrInIdx = 0; +constexpr uint32_t kDebugDeclareOperandVariableIndex = 5; +constexpr uint32_t kGlobalVariableVariableIndex = 12; // Sorting functor to present annotation instructions in an easy-to-process // order. The functor orders by opcode first and falls back on unique id // ordering if both instructions have the same opcode. // // Desired priority: -// SpvOpGroupDecorate -// SpvOpGroupMemberDecorate -// SpvOpDecorate -// SpvOpMemberDecorate -// SpvOpDecorateId -// SpvOpDecorateStringGOOGLE -// SpvOpDecorationGroup +// spv::Op::OpGroupDecorate +// spv::Op::OpGroupMemberDecorate +// spv::Op::OpDecorate +// spv::Op::OpMemberDecorate +// spv::Op::OpDecorateId +// spv::Op::OpDecorateStringGOOGLE +// spv::Op::OpDecorationGroup struct DecorationLess { bool operator()(const Instruction* lhs, const Instruction* rhs) const { assert(lhs && rhs); - SpvOp lhsOp = lhs->opcode(); - SpvOp rhsOp = rhs->opcode(); + spv::Op lhsOp = lhs->opcode(); + spv::Op rhsOp = rhs->opcode(); if (lhsOp != rhsOp) { #define PRIORITY_CASE(opcode) \ if (lhsOp == opcode && rhsOp != opcode) return true; \ if (rhsOp == opcode && lhsOp != opcode) return false; // OpGroupDecorate and OpGroupMember decorate are highest priority to // eliminate dead targets early and simplify subsequent checks. - PRIORITY_CASE(SpvOpGroupDecorate) - PRIORITY_CASE(SpvOpGroupMemberDecorate) - PRIORITY_CASE(SpvOpDecorate) - PRIORITY_CASE(SpvOpMemberDecorate) - PRIORITY_CASE(SpvOpDecorateId) - PRIORITY_CASE(SpvOpDecorateStringGOOGLE) + PRIORITY_CASE(spv::Op::OpGroupDecorate) + PRIORITY_CASE(spv::Op::OpGroupMemberDecorate) + PRIORITY_CASE(spv::Op::OpDecorate) + PRIORITY_CASE(spv::Op::OpMemberDecorate) + PRIORITY_CASE(spv::Op::OpDecorateId) + PRIORITY_CASE(spv::Op::OpDecorateStringGOOGLE) // OpDecorationGroup is lowest priority to ensure use/def chains remain // usable for instructions that target this group. - PRIORITY_CASE(SpvOpDecorationGroup) + PRIORITY_CASE(spv::Op::OpDecorationGroup) #undef PRIORITY_CASE } @@ -86,25 +85,26 @@ struct DecorationLess { } // namespace -bool AggressiveDCEPass::IsVarOfStorage(uint32_t varId, uint32_t storageClass) { +bool AggressiveDCEPass::IsVarOfStorage(uint32_t varId, + spv::StorageClass storageClass) { if (varId == 0) return false; const Instruction* varInst = get_def_use_mgr()->GetDef(varId); - const SpvOp op = varInst->opcode(); - if (op != SpvOpVariable) return false; + const spv::Op op = varInst->opcode(); + if (op != spv::Op::OpVariable) return false; const uint32_t varTypeId = varInst->type_id(); const Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); - if (varTypeInst->opcode() != SpvOpTypePointer) return false; - return varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) == - storageClass; + if (varTypeInst->opcode() != spv::Op::OpTypePointer) return false; + return spv::StorageClass(varTypeInst->GetSingleWordInOperand( + kTypePointerStorageClassInIdx)) == storageClass; } bool AggressiveDCEPass::IsLocalVar(uint32_t varId, Function* func) { - if (IsVarOfStorage(varId, SpvStorageClassFunction)) { + if (IsVarOfStorage(varId, spv::StorageClass::Function)) { return true; } - if (!IsVarOfStorage(varId, SpvStorageClassPrivate) && - !IsVarOfStorage(varId, SpvStorageClassWorkgroup)) { + if (!IsVarOfStorage(varId, spv::StorageClass::Private) && + !IsVarOfStorage(varId, spv::StorageClass::Workgroup)) { return false; } @@ -122,21 +122,21 @@ void AggressiveDCEPass::AddStores(Function* func, uint32_t ptrId) { if (blk && blk->GetParent() != func) return; switch (user->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpCopyObject: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpCopyObject: this->AddStores(func, user->result_id()); break; - case SpvOpLoad: + case spv::Op::OpLoad: break; - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: if (user->GetSingleWordInOperand(kCopyMemoryTargetAddrInIdx) == ptrId) { AddToWorklist(user); } break; // If default, assume it stores e.g. frexp, modf, function call - case SpvOpStore: + case spv::Op::OpStore: default: AddToWorklist(user); break; @@ -154,7 +154,7 @@ bool AggressiveDCEPass::AllExtensionsSupported() const { // Only allow NonSemantic.Shader.DebugInfo.100, we cannot safely optimise // around unknown extended instruction sets even if they are non-semantic for (auto& inst : context()->module()->ext_inst_imports()) { - assert(inst.opcode() == SpvOpExtInstImport && + assert(inst.opcode() == spv::Op::OpExtInstImport && "Expecting an import of an extension's instruction set."); const std::string extension_name = inst.GetInOperand(0).AsString(); if (spvtools::utils::starts_with(extension_name, "NonSemantic.") && @@ -172,11 +172,11 @@ bool AggressiveDCEPass::IsTargetDead(Instruction* inst) { // This must be a decoration group. We go through annotations in a specific // order. So if this is not used by any group or group member decorates, it // is dead. - assert(tInst->opcode() == SpvOpDecorationGroup); + assert(tInst->opcode() == spv::Op::OpDecorationGroup); bool dead = true; get_def_use_mgr()->ForEachUser(tInst, [&dead](Instruction* user) { - if (user->opcode() == SpvOpGroupDecorate || - user->opcode() == SpvOpGroupMemberDecorate) + if (user->opcode() == spv::Op::OpGroupDecorate || + user->opcode() == spv::Op::OpGroupMemberDecorate) dead = false; }); return dead; @@ -197,7 +197,7 @@ void AggressiveDCEPass::ProcessLoad(Function* func, uint32_t varId) { void AggressiveDCEPass::AddBranch(uint32_t labelId, BasicBlock* bp) { std::unique_ptr newBranch( - new Instruction(context(), SpvOpBranch, 0, 0, + new Instruction(context(), spv::Op::OpBranch, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {labelId}}})); context()->AnalyzeDefUse(&*newBranch); context()->set_instr_block(&*newBranch, bp); @@ -206,8 +206,8 @@ void AggressiveDCEPass::AddBranch(uint32_t labelId, BasicBlock* bp) { void AggressiveDCEPass::AddBreaksAndContinuesToWorklist( Instruction* mergeInst) { - assert(mergeInst->opcode() == SpvOpSelectionMerge || - mergeInst->opcode() == SpvOpLoopMerge); + assert(mergeInst->opcode() == spv::Op::OpSelectionMerge || + mergeInst->opcode() == spv::Op::OpLoopMerge); BasicBlock* header = context()->get_instr_block(mergeInst); const uint32_t mergeId = mergeInst->GetSingleWordInOperand(0); @@ -223,7 +223,7 @@ void AggressiveDCEPass::AddBreaksAndContinuesToWorklist( } }); - if (mergeInst->opcode() != SpvOpLoopMerge) { + if (mergeInst->opcode() != spv::Op::OpLoopMerge) { return; } @@ -231,26 +231,27 @@ void AggressiveDCEPass::AddBreaksAndContinuesToWorklist( const uint32_t contId = mergeInst->GetSingleWordInOperand(kLoopMergeContinueBlockIdInIdx); get_def_use_mgr()->ForEachUser(contId, [&contId, this](Instruction* user) { - SpvOp op = user->opcode(); - if (op == SpvOpBranchConditional || op == SpvOpSwitch) { + spv::Op op = user->opcode(); + if (op == spv::Op::OpBranchConditional || op == spv::Op::OpSwitch) { // A conditional branch or switch can only be a continue if it does not // have a merge instruction or its merge block is not the continue block. Instruction* hdrMerge = GetMergeInstruction(user); - if (hdrMerge != nullptr && hdrMerge->opcode() == SpvOpSelectionMerge) { + if (hdrMerge != nullptr && + hdrMerge->opcode() == spv::Op::OpSelectionMerge) { uint32_t hdrMergeId = hdrMerge->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); if (hdrMergeId == contId) return; // Need to mark merge instruction too AddToWorklist(hdrMerge); } - } else if (op == SpvOpBranch) { + } else if (op == spv::Op::OpBranch) { // An unconditional branch can only be a continue if it is not // branching to its own merge block. BasicBlock* blk = context()->get_instr_block(user); Instruction* hdrBranch = GetHeaderBranch(blk); if (hdrBranch == nullptr) return; Instruction* hdrMerge = GetMergeInstruction(hdrBranch); - if (hdrMerge->opcode() == SpvOpLoopMerge) return; + if (hdrMerge->opcode() == spv::Op::OpLoopMerge) return; uint32_t hdrMergeId = hdrMerge->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); if (contId == hdrMergeId) return; @@ -277,11 +278,11 @@ bool AggressiveDCEPass::KillDeadInstructions( uint32_t merge_block_id = 0; (*bi)->ForEachInst([this, &modified, &merge_block_id](Instruction* inst) { if (IsLive(inst)) return; - if (inst->opcode() == SpvOpLabel) return; + if (inst->opcode() == spv::Op::OpLabel) return; // If dead instruction is selection merge, remember merge block // for new branch at end of block - if (inst->opcode() == SpvOpSelectionMerge || - inst->opcode() == SpvOpLoopMerge) + if (inst->opcode() == spv::Op::OpSelectionMerge || + inst->opcode() == spv::Op::OpLoopMerge) merge_block_id = inst->GetSingleWordInOperand(0); to_kill_.push_back(inst); modified = true; @@ -295,19 +296,19 @@ bool AggressiveDCEPass::KillDeadInstructions( } auto merge_terminator = (*bi)->terminator(); - if (merge_terminator->opcode() == SpvOpUnreachable) { + if (merge_terminator->opcode() == spv::Op::OpUnreachable) { // The merge was unreachable. This is undefined behaviour so just // return (or return an undef). Then mark the new return as live. auto func_ret_type_inst = get_def_use_mgr()->GetDef(func->type_id()); - if (func_ret_type_inst->opcode() == SpvOpTypeVoid) { - merge_terminator->SetOpcode(SpvOpReturn); + if (func_ret_type_inst->opcode() == spv::Op::OpTypeVoid) { + merge_terminator->SetOpcode(spv::Op::OpReturn); } else { // Find an undef for the return value and make sure it gets kept by // the pass. auto undef_id = Type2Undef(func->type_id()); auto undef = get_def_use_mgr()->GetDef(undef_id); live_insts_.Set(undef->unique_id()); - merge_terminator->SetOpcode(SpvOpReturnValue); + merge_terminator->SetOpcode(spv::Op::OpReturnValue); merge_terminator->SetInOperands({{SPV_OPERAND_TYPE_ID, {undef_id}}}); get_def_use_mgr()->AnalyzeInstUse(merge_terminator); } @@ -369,11 +370,11 @@ void AggressiveDCEPass::AddDecorationsToWorkList(const Instruction* inst) { // We only care about OpDecorateId instructions because the are the only // decorations that will reference an id that will have to be kept live // because of that use. - if (dec->opcode() != SpvOpDecorateId) { + if (dec->opcode() != spv::Op::OpDecorateId) { continue; } - if (dec->GetSingleWordInOperand(1) == - SpvDecorationHlslCounterBufferGOOGLE) { + if (spv::Decoration(dec->GetSingleWordInOperand(1)) == + spv::Decoration::HlslCounterBufferGOOGLE) { // These decorations should not force the use id to be live. It will be // removed if either the target or the in operand are dead. continue; @@ -391,7 +392,7 @@ void AggressiveDCEPass::MarkLoadedVariablesAsLive(Function* func, } std::vector AggressiveDCEPass::GetLoadedVariables(Instruction* inst) { - if (inst->opcode() == SpvOpFunctionCall) { + if (inst->opcode() == spv::Op::OpFunctionCall) { return GetLoadedVariablesFromFunctionCall(inst); } uint32_t var_id = GetLoadedVariableFromNonFunctionCalls(inst); @@ -409,11 +410,11 @@ uint32_t AggressiveDCEPass::GetLoadedVariableFromNonFunctionCalls( } switch (inst->opcode()) { - case SpvOpLoad: - case SpvOpImageTexelPointer: + case spv::Op::OpLoad: + case spv::Op::OpImageTexelPointer: return GetVariableId(inst->GetSingleWordInOperand(kLoadSourceAddrInIdx)); - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: return GetVariableId( inst->GetSingleWordInOperand(kCopyMemorySourceAddrInIdx)); default: @@ -436,7 +437,7 @@ uint32_t AggressiveDCEPass::GetLoadedVariableFromNonFunctionCalls( std::vector AggressiveDCEPass::GetLoadedVariablesFromFunctionCall( const Instruction* inst) { - assert(inst->opcode() == SpvOpFunctionCall); + assert(inst->opcode() == spv::Op::OpFunctionCall); std::vector live_variables; inst->ForEachInId([this, &live_variables](const uint32_t* operand_id) { if (!IsPtr(*operand_id)) return; @@ -481,7 +482,7 @@ void AggressiveDCEPass::MarkBlockAsLive(Instruction* inst) { // the loop, so the loop construct must be live. We exclude the label because // it does not matter how many times it is executed. This could be extended // to more instructions, but we will need it for now. - if (inst->opcode() != SpvOpLabel) + if (inst->opcode() != spv::Op::OpLabel) MarkLoopConstructAsLiveIfLoopHeader(basic_block); Instruction* next_branch_inst = GetBranchForNextHeader(basic_block); @@ -491,8 +492,8 @@ void AggressiveDCEPass::MarkBlockAsLive(Instruction* inst) { AddToWorklist(mergeInst); } - if (inst->opcode() == SpvOpLoopMerge || - inst->opcode() == SpvOpSelectionMerge) { + if (inst->opcode() == spv::Op::OpLoopMerge || + inst->opcode() == spv::Op::OpSelectionMerge) { AddBreaksAndContinuesToWorklist(inst); } } @@ -529,27 +530,27 @@ void AggressiveDCEPass::InitializeWorkList( // cleaned up. for (auto& bi : structured_order) { for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - SpvOp op = ii->opcode(); + spv::Op op = ii->opcode(); if (ii->IsBranch()) { continue; } switch (op) { - case SpvOpStore: { + case spv::Op::OpStore: { uint32_t var_id = 0; (void)GetPtr(&*ii, &var_id); if (!IsLocalVar(var_id, func)) AddToWorklist(&*ii); } break; - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: { + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: { uint32_t var_id = 0; uint32_t target_addr_id = ii->GetSingleWordInOperand(kCopyMemoryTargetAddrInIdx); (void)GetPtr(target_addr_id, &var_id); if (!IsLocalVar(var_id, func)) AddToWorklist(&*ii); } break; - case SpvOpLoopMerge: - case SpvOpSelectionMerge: - case SpvOpUnreachable: + case spv::Op::OpLoopMerge: + case spv::Op::OpSelectionMerge: + case spv::Op::OpUnreachable: break; default: { // Function calls, atomics, function params, function returns, etc. @@ -578,8 +579,10 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() { auto* var = get_def_use_mgr()->GetDef(entry.GetSingleWordInOperand(i)); auto storage_class = var->GetSingleWordInOperand(0u); // Vulkan support outputs without an associated input, but not inputs - // without an associated output. - if (storage_class == SpvStorageClassOutput) { + // without an associated output. Don't remove outputs unless explicitly + // allowed. + if (!remove_outputs_ && + spv::StorageClass(storage_class) == spv::StorageClass::Output) { AddToWorklist(var); } } @@ -588,24 +591,29 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() { } } for (auto& anno : get_module()->annotations()) { - if (anno.opcode() == SpvOpDecorate) { + if (anno.opcode() == spv::Op::OpDecorate) { // Keep workgroup size. - if (anno.GetSingleWordInOperand(1u) == SpvDecorationBuiltIn && - anno.GetSingleWordInOperand(2u) == SpvBuiltInWorkgroupSize) { + if (spv::Decoration(anno.GetSingleWordInOperand(1u)) == + spv::Decoration::BuiltIn && + spv::BuiltIn(anno.GetSingleWordInOperand(2u)) == + spv::BuiltIn::WorkgroupSize) { AddToWorklist(&anno); } if (context()->preserve_bindings()) { // Keep all bindings. - if ((anno.GetSingleWordInOperand(1u) == SpvDecorationDescriptorSet) || - (anno.GetSingleWordInOperand(1u) == SpvDecorationBinding)) { + if ((spv::Decoration(anno.GetSingleWordInOperand(1u)) == + spv::Decoration::DescriptorSet) || + (spv::Decoration(anno.GetSingleWordInOperand(1u)) == + spv::Decoration::Binding)) { AddToWorklist(&anno); } } if (context()->preserve_spec_constants()) { // Keep all specialization constant instructions - if (anno.GetSingleWordInOperand(1u) == SpvDecorationSpecId) { + if (spv::Decoration(anno.GetSingleWordInOperand(1u)) == + spv::Decoration::SpecId) { AddToWorklist(&anno); } } @@ -624,7 +632,7 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() { debug_global_seen = true; dbg.ForEachInId([this](const uint32_t* iid) { Instruction* in_inst = get_def_use_mgr()->GetDef(*iid); - if (in_inst->opcode() == SpvOpVariable) return; + if (in_inst->opcode() == spv::Op::OpVariable) return; AddToWorklist(in_inst); }); } @@ -647,19 +655,19 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() { Pass::Status AggressiveDCEPass::ProcessImpl() { // Current functionality assumes shader capability // TODO(greg-lunarg): Handle additional capabilities - if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + if (!context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) return Status::SuccessWithoutChange; // Current functionality assumes relaxed logical addressing (see // instruction.h) // TODO(greg-lunarg): Handle non-logical addressing - if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + if (context()->get_feature_mgr()->HasCapability(spv::Capability::Addresses)) return Status::SuccessWithoutChange; // The variable pointer extension is no longer needed to use the capability, // so we have to look for the capability. if (context()->get_feature_mgr()->HasCapability( - SpvCapabilityVariablePointersStorageBuffer)) + spv::Capability::VariablePointersStorageBuffer)) return Status::SuccessWithoutChange; // If any extensions in the module are not explicitly supported, @@ -743,7 +751,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() { bool modified = false; Instruction* instruction = &*get_module()->debug2_begin(); while (instruction) { - if (instruction->opcode() != SpvOpName) { + if (instruction->opcode() != spv::Op::OpName) { instruction = instruction->NextNode(); continue; } @@ -764,22 +772,22 @@ bool AggressiveDCEPass::ProcessGlobalValues() { std::sort(annotations.begin(), annotations.end(), DecorationLess()); for (auto annotation : annotations) { switch (annotation->opcode()) { - case SpvOpDecorate: - case SpvOpMemberDecorate: - case SpvOpDecorateStringGOOGLE: - case SpvOpMemberDecorateStringGOOGLE: + case spv::Op::OpDecorate: + case spv::Op::OpMemberDecorate: + case spv::Op::OpDecorateStringGOOGLE: + case spv::Op::OpMemberDecorateStringGOOGLE: if (IsTargetDead(annotation)) { context()->KillInst(annotation); modified = true; } break; - case SpvOpDecorateId: + case spv::Op::OpDecorateId: if (IsTargetDead(annotation)) { context()->KillInst(annotation); modified = true; } else { - if (annotation->GetSingleWordInOperand(1) == - SpvDecorationHlslCounterBufferGOOGLE) { + if (spv::Decoration(annotation->GetSingleWordInOperand(1)) == + spv::Decoration::HlslCounterBufferGOOGLE) { // HlslCounterBuffer will reference an id other than the target. // If that id is dead, then the decoration can be removed as well. uint32_t counter_buffer_id = annotation->GetSingleWordInOperand(2); @@ -792,7 +800,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() { } } break; - case SpvOpGroupDecorate: { + case spv::Op::OpGroupDecorate: { // Go through the targets of this group decorate. Remove each dead // target. If all targets are dead, remove this decoration. bool dead = true; @@ -818,7 +826,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() { } break; } - case SpvOpGroupMemberDecorate: { + case spv::Op::OpGroupMemberDecorate: { // Go through the targets of this group member decorate. Remove each // dead target (and member index). If all targets are dead, remove this // decoration. @@ -846,7 +854,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() { } break; } - case SpvOpDecorationGroup: + case spv::Op::OpDecorationGroup: // By the time we hit decoration groups we've checked everything that // can target them. So if they have no uses they must be dead. if (get_def_use_mgr()->NumUsers(annotation) == 0) { @@ -887,7 +895,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() { // this live as it does not have a result id. This is a little too // conservative since it is not known if the structure type that needed // it is still live. TODO(greg-lunarg): Only save if needed. - if (val.opcode() == SpvOpTypeForwardPointer) { + if (val.opcode() == spv::Op::OpTypeForwardPointer) { uint32_t ptr_ty_id = val.GetSingleWordInOperand(0); Instruction* ptr_ty_inst = get_def_use_mgr()->GetDef(ptr_ty_id); if (IsLive(ptr_ty_inst)) continue; @@ -1083,8 +1091,9 @@ bool AggressiveDCEPass::IsEntryPoint(Function* func) { } bool AggressiveDCEPass::HasCall(Function* func) { - return !func->WhileEachInst( - [](Instruction* inst) { return inst->opcode() != SpvOpFunctionCall; }); + return !func->WhileEachInst([](Instruction* inst) { + return inst->opcode() != spv::Op::OpFunctionCall; + }); } void AggressiveDCEPass::MarkFirstBlockAsLive(Function* func) { diff --git a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h index c1291dc47..fbe08ad03 100644 --- a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h +++ b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h @@ -44,8 +44,10 @@ class AggressiveDCEPass : public MemPass { using GetBlocksFunction = std::function*(const BasicBlock*)>; - AggressiveDCEPass(bool preserve_interface = false) - : preserve_interface_(preserve_interface) {} + AggressiveDCEPass(bool preserve_interface = false, + bool remove_outputs = false) + : preserve_interface_(preserve_interface), + remove_outputs_(remove_outputs) {} const char* name() const override { return "eliminate-dead-code-aggressive"; } Status Process() override; @@ -63,9 +65,14 @@ class AggressiveDCEPass : public MemPass { // is not allowed. bool preserve_interface_; + // Output variables can be removed from the interface if this is true. + // This is safe if the caller knows that the corresponding input variable + // in the following shader has been removed. It is false by default. + bool remove_outputs_; + // Return true if |varId| is a variable of |storageClass|. |varId| must either // be 0 or the result of an instruction. - bool IsVarOfStorage(uint32_t varId, uint32_t storageClass); + bool IsVarOfStorage(uint32_t varId, spv::StorageClass storageClass); // Return true if the instance of the variable |varId| can only be access in // |func|. For example, a function scope variable, or a private variable diff --git a/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp b/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp index dd9bafda3..a314567f8 100644 --- a/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp +++ b/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp @@ -24,7 +24,6 @@ namespace spvtools { namespace opt { - namespace { enum AmdShaderBallotExtOpcodes { @@ -136,19 +135,19 @@ bool ReplaceTrinaryMid(IRContext* ctx, Instruction* inst, // Returns a folding rule that will replace the opcode with |opcode| and add // the capabilities required. The folding rule assumes it is folding an // OpGroup*NonUniformAMD instruction from the SPV_AMD_shader_ballot extension. -template +template bool ReplaceGroupNonuniformOperationOpCode( IRContext* ctx, Instruction* inst, const std::vector&) { switch (new_opcode) { - case SpvOpGroupNonUniformIAdd: - case SpvOpGroupNonUniformFAdd: - case SpvOpGroupNonUniformUMin: - case SpvOpGroupNonUniformSMin: - case SpvOpGroupNonUniformFMin: - case SpvOpGroupNonUniformUMax: - case SpvOpGroupNonUniformSMax: - case SpvOpGroupNonUniformFMax: + case spv::Op::OpGroupNonUniformIAdd: + case spv::Op::OpGroupNonUniformFAdd: + case spv::Op::OpGroupNonUniformUMin: + case spv::Op::OpGroupNonUniformSMin: + case spv::Op::OpGroupNonUniformFMin: + case spv::Op::OpGroupNonUniformUMax: + case spv::Op::OpGroupNonUniformSMax: + case spv::Op::OpGroupNonUniformFMax: break; default: assert( @@ -157,21 +156,21 @@ bool ReplaceGroupNonuniformOperationOpCode( } switch (inst->opcode()) { - case SpvOpGroupIAddNonUniformAMD: - case SpvOpGroupFAddNonUniformAMD: - case SpvOpGroupUMinNonUniformAMD: - case SpvOpGroupSMinNonUniformAMD: - case SpvOpGroupFMinNonUniformAMD: - case SpvOpGroupUMaxNonUniformAMD: - case SpvOpGroupSMaxNonUniformAMD: - case SpvOpGroupFMaxNonUniformAMD: + case spv::Op::OpGroupIAddNonUniformAMD: + case spv::Op::OpGroupFAddNonUniformAMD: + case spv::Op::OpGroupUMinNonUniformAMD: + case spv::Op::OpGroupSMinNonUniformAMD: + case spv::Op::OpGroupFMinNonUniformAMD: + case spv::Op::OpGroupUMaxNonUniformAMD: + case spv::Op::OpGroupSMaxNonUniformAMD: + case spv::Op::OpGroupFMaxNonUniformAMD: break; default: assert(false && "Should be replacing a group non uniform arithmetic operation."); } - ctx->AddCapability(SpvCapabilityGroupNonUniformArithmetic); + ctx->AddCapability(spv::Capability::GroupNonUniformArithmetic); inst->SetOpcode(new_opcode); return true; } @@ -215,8 +214,8 @@ bool ReplaceSwizzleInvocations(IRContext* ctx, Instruction* inst, analysis::ConstantManager* const_mgr = ctx->get_constant_mgr(); ctx->AddExtension("SPV_KHR_shader_ballot"); - ctx->AddCapability(SpvCapabilityGroupNonUniformBallot); - ctx->AddCapability(SpvCapabilityGroupNonUniformShuffle); + ctx->AddCapability(spv::Capability::GroupNonUniformBallot); + ctx->AddCapability(spv::Capability::GroupNonUniformShuffle); InstructionBuilder ir_builder( ctx, inst, @@ -226,8 +225,8 @@ bool ReplaceSwizzleInvocations(IRContext* ctx, Instruction* inst, uint32_t offset_id = inst->GetSingleWordInOperand(3); // Get the subgroup invocation id. - uint32_t var_id = - ctx->GetBuiltinInputVarId(SpvBuiltInSubgroupLocalInvocationId); + uint32_t var_id = ctx->GetBuiltinInputVarId( + uint32_t(spv::BuiltIn::SubgroupLocalInvocationId)); assert(var_id != 0 && "Could not get SubgroupLocalInvocationId variable."); Instruction* var_inst = ctx->get_def_use_mgr()->GetDef(var_id); Instruction* var_ptr_type = @@ -239,35 +238,38 @@ bool ReplaceSwizzleInvocations(IRContext* ctx, Instruction* inst, uint32_t quad_mask = ir_builder.GetUintConstantId(3); // This gives the offset in the group of 4 of this invocation. - Instruction* quad_idx = ir_builder.AddBinaryOp(uint_type_id, SpvOpBitwiseAnd, - id->result_id(), quad_mask); + Instruction* quad_idx = ir_builder.AddBinaryOp( + uint_type_id, spv::Op::OpBitwiseAnd, id->result_id(), quad_mask); // Get the invocation id of the first invocation in the group of 4. - Instruction* quad_ldr = ir_builder.AddBinaryOp( - uint_type_id, SpvOpBitwiseXor, id->result_id(), quad_idx->result_id()); + Instruction* quad_ldr = + ir_builder.AddBinaryOp(uint_type_id, spv::Op::OpBitwiseXor, + id->result_id(), quad_idx->result_id()); // Get the offset of the target invocation from the offset vector. Instruction* my_offset = - ir_builder.AddBinaryOp(uint_type_id, SpvOpVectorExtractDynamic, offset_id, - quad_idx->result_id()); + ir_builder.AddBinaryOp(uint_type_id, spv::Op::OpVectorExtractDynamic, + offset_id, quad_idx->result_id()); // Determine the index of the invocation to read from. - Instruction* target_inv = ir_builder.AddBinaryOp( - uint_type_id, SpvOpIAdd, quad_ldr->result_id(), my_offset->result_id()); + Instruction* target_inv = + ir_builder.AddBinaryOp(uint_type_id, spv::Op::OpIAdd, + quad_ldr->result_id(), my_offset->result_id()); // Do the group operations uint32_t uint_max_id = ir_builder.GetUintConstantId(0xFFFFFFFF); - uint32_t subgroup_scope = ir_builder.GetUintConstantId(SpvScopeSubgroup); + uint32_t subgroup_scope = + ir_builder.GetUintConstantId(uint32_t(spv::Scope::Subgroup)); const auto* ballot_value_const = const_mgr->GetConstant( type_mgr->GetUIntVectorType(4), {uint_max_id, uint_max_id, uint_max_id, uint_max_id}); Instruction* ballot_value = const_mgr->GetDefiningInstruction(ballot_value_const); Instruction* is_active = ir_builder.AddNaryOp( - type_mgr->GetBoolTypeId(), SpvOpGroupNonUniformBallotBitExtract, + type_mgr->GetBoolTypeId(), spv::Op::OpGroupNonUniformBallotBitExtract, {subgroup_scope, ballot_value->result_id(), target_inv->result_id()}); Instruction* shuffle = - ir_builder.AddNaryOp(inst->type_id(), SpvOpGroupNonUniformShuffle, + ir_builder.AddNaryOp(inst->type_id(), spv::Op::OpGroupNonUniformShuffle, {subgroup_scope, data_id, target_inv->result_id()}); // Create the null constant to use in the select. @@ -276,7 +278,7 @@ bool ReplaceSwizzleInvocations(IRContext* ctx, Instruction* inst, Instruction* null_inst = const_mgr->GetDefiningInstruction(null); // Build the select. - inst->SetOpcode(SpvOpSelect); + inst->SetOpcode(spv::Op::OpSelect); Instruction::OperandList new_operands; new_operands.push_back({SPV_OPERAND_TYPE_ID, {is_active->result_id()}}); new_operands.push_back({SPV_OPERAND_TYPE_ID, {shuffle->result_id()}}); @@ -327,8 +329,8 @@ bool ReplaceSwizzleInvocationsMasked( analysis::DefUseManager* def_use_mgr = ctx->get_def_use_mgr(); analysis::ConstantManager* const_mgr = ctx->get_constant_mgr(); - ctx->AddCapability(SpvCapabilityGroupNonUniformBallot); - ctx->AddCapability(SpvCapabilityGroupNonUniformShuffle); + ctx->AddCapability(spv::Capability::GroupNonUniformBallot); + ctx->AddCapability(spv::Capability::GroupNonUniformShuffle); InstructionBuilder ir_builder( ctx, inst, @@ -338,7 +340,7 @@ bool ReplaceSwizzleInvocationsMasked( uint32_t data_id = inst->GetSingleWordInOperand(2); Instruction* mask_inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(3)); - assert(mask_inst->opcode() == SpvOpConstantComposite && + assert(mask_inst->opcode() == spv::Op::OpConstantComposite && "The mask is suppose to be a vector constant."); assert(mask_inst->NumInOperands() == 3 && "The mask is suppose to have 3 components."); @@ -348,8 +350,8 @@ bool ReplaceSwizzleInvocationsMasked( uint32_t uint_z = mask_inst->GetSingleWordInOperand(2); // Get the subgroup invocation id. - uint32_t var_id = - ctx->GetBuiltinInputVarId(SpvBuiltInSubgroupLocalInvocationId); + uint32_t var_id = ctx->GetBuiltinInputVarId( + uint32_t(spv::BuiltIn::SubgroupLocalInvocationId)); ctx->AddExtension("SPV_KHR_shader_ballot"); assert(var_id != 0 && "Could not get SubgroupLocalInvocationId variable."); Instruction* var_inst = ctx->get_def_use_mgr()->GetDef(var_id); @@ -361,28 +363,30 @@ bool ReplaceSwizzleInvocationsMasked( // Do the bitwise operations. uint32_t mask_extended = ir_builder.GetUintConstantId(0xFFFFFFE0); - Instruction* and_mask = ir_builder.AddBinaryOp(uint_type_id, SpvOpBitwiseOr, - uint_x, mask_extended); - Instruction* and_result = ir_builder.AddBinaryOp( - uint_type_id, SpvOpBitwiseAnd, id->result_id(), and_mask->result_id()); + Instruction* and_mask = ir_builder.AddBinaryOp( + uint_type_id, spv::Op::OpBitwiseOr, uint_x, mask_extended); + Instruction* and_result = + ir_builder.AddBinaryOp(uint_type_id, spv::Op::OpBitwiseAnd, + id->result_id(), and_mask->result_id()); Instruction* or_result = ir_builder.AddBinaryOp( - uint_type_id, SpvOpBitwiseOr, and_result->result_id(), uint_y); + uint_type_id, spv::Op::OpBitwiseOr, and_result->result_id(), uint_y); Instruction* target_inv = ir_builder.AddBinaryOp( - uint_type_id, SpvOpBitwiseXor, or_result->result_id(), uint_z); + uint_type_id, spv::Op::OpBitwiseXor, or_result->result_id(), uint_z); // Do the group operations uint32_t uint_max_id = ir_builder.GetUintConstantId(0xFFFFFFFF); - uint32_t subgroup_scope = ir_builder.GetUintConstantId(SpvScopeSubgroup); + uint32_t subgroup_scope = + ir_builder.GetUintConstantId(uint32_t(spv::Scope::Subgroup)); const auto* ballot_value_const = const_mgr->GetConstant( type_mgr->GetUIntVectorType(4), {uint_max_id, uint_max_id, uint_max_id, uint_max_id}); Instruction* ballot_value = const_mgr->GetDefiningInstruction(ballot_value_const); Instruction* is_active = ir_builder.AddNaryOp( - type_mgr->GetBoolTypeId(), SpvOpGroupNonUniformBallotBitExtract, + type_mgr->GetBoolTypeId(), spv::Op::OpGroupNonUniformBallotBitExtract, {subgroup_scope, ballot_value->result_id(), target_inv->result_id()}); Instruction* shuffle = - ir_builder.AddNaryOp(inst->type_id(), SpvOpGroupNonUniformShuffle, + ir_builder.AddNaryOp(inst->type_id(), spv::Op::OpGroupNonUniformShuffle, {subgroup_scope, data_id, target_inv->result_id()}); // Create the null constant to use in the select. @@ -391,7 +395,7 @@ bool ReplaceSwizzleInvocationsMasked( Instruction* null_inst = const_mgr->GetDefiningInstruction(null); // Build the select. - inst->SetOpcode(SpvOpSelect); + inst->SetOpcode(spv::Op::OpSelect); Instruction::OperandList new_operands; new_operands.push_back({SPV_OPERAND_TYPE_ID, {is_active->result_id()}}); new_operands.push_back({SPV_OPERAND_TYPE_ID, {shuffle->result_id()}}); @@ -420,9 +424,9 @@ bool ReplaceSwizzleInvocationsMasked( // Also adding the capabilities and builtins that are needed. bool ReplaceWriteInvocation(IRContext* ctx, Instruction* inst, const std::vector&) { - uint32_t var_id = - ctx->GetBuiltinInputVarId(SpvBuiltInSubgroupLocalInvocationId); - ctx->AddCapability(SpvCapabilitySubgroupBallotKHR); + uint32_t var_id = ctx->GetBuiltinInputVarId( + uint32_t(spv::BuiltIn::SubgroupLocalInvocationId)); + ctx->AddCapability(spv::Capability::SubgroupBallotKHR); ctx->AddExtension("SPV_KHR_shader_ballot"); assert(var_id != 0 && "Could not get SubgroupLocalInvocationId variable."); Instruction* var_inst = ctx->get_def_use_mgr()->GetDef(var_id); @@ -437,11 +441,11 @@ bool ReplaceWriteInvocation(IRContext* ctx, Instruction* inst, analysis::Bool bool_type; uint32_t bool_type_id = ctx->get_type_mgr()->GetTypeInstruction(&bool_type); Instruction* cmp = - ir_builder.AddBinaryOp(bool_type_id, SpvOpIEqual, t->result_id(), + ir_builder.AddBinaryOp(bool_type_id, spv::Op::OpIEqual, t->result_id(), inst->GetSingleWordInOperand(4)); // Build a select. - inst->SetOpcode(SpvOpSelect); + inst->SetOpcode(spv::Op::OpSelect); Instruction::OperandList new_operands; new_operands.push_back({SPV_OPERAND_TYPE_ID, {cmp->result_id()}}); new_operands.push_back(inst->GetInOperand(3)); @@ -479,14 +483,15 @@ bool ReplaceMbcnt(IRContext* context, Instruction* inst, analysis::TypeManager* type_mgr = context->get_type_mgr(); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); - uint32_t var_id = context->GetBuiltinInputVarId(SpvBuiltInSubgroupLtMask); + uint32_t var_id = + context->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::SubgroupLtMask)); assert(var_id != 0 && "Could not get SubgroupLtMask variable."); - context->AddCapability(SpvCapabilityGroupNonUniformBallot); + context->AddCapability(spv::Capability::GroupNonUniformBallot); Instruction* var_inst = def_use_mgr->GetDef(var_id); Instruction* var_ptr_type = def_use_mgr->GetDef(var_inst->type_id()); Instruction* var_type = def_use_mgr->GetDef(var_ptr_type->GetSingleWordInOperand(1)); - assert(var_type->opcode() == SpvOpTypeVector && + assert(var_type->opcode() == spv::Op::OpTypeVector && "Variable is suppose to be a vector of 4 ints"); // Get the type for the shuffle. @@ -509,11 +514,12 @@ bool ReplaceMbcnt(IRContext* context, Instruction* inst, Instruction* shuffle = ir_builder.AddVectorShuffle( shuffle_type_id, load->result_id(), load->result_id(), {0, 1}); Instruction* bitcast = ir_builder.AddUnaryOp( - mask_inst->type_id(), SpvOpBitcast, shuffle->result_id()); - Instruction* t = ir_builder.AddBinaryOp(mask_inst->type_id(), SpvOpBitwiseAnd, - bitcast->result_id(), mask_id); + mask_inst->type_id(), spv::Op::OpBitcast, shuffle->result_id()); + Instruction* t = + ir_builder.AddBinaryOp(mask_inst->type_id(), spv::Op::OpBitwiseAnd, + bitcast->result_id(), mask_id); - inst->SetOpcode(SpvOpBitCount); + inst->SetOpcode(spv::Op::OpBitCount); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {t->result_id()}}}); context->UpdateDefUse(inst); return true; @@ -599,11 +605,11 @@ bool ReplaceCubeFaceCoord(IRContext* ctx, Instruction* inst, // Negate the input values. Instruction* nx = - ir_builder.AddUnaryOp(float_type_id, SpvOpFNegate, x->result_id()); + ir_builder.AddUnaryOp(float_type_id, spv::Op::OpFNegate, x->result_id()); Instruction* ny = - ir_builder.AddUnaryOp(float_type_id, SpvOpFNegate, y->result_id()); + ir_builder.AddUnaryOp(float_type_id, spv::Op::OpFNegate, y->result_id()); Instruction* nz = - ir_builder.AddUnaryOp(float_type_id, SpvOpFNegate, z->result_id()); + ir_builder.AddUnaryOp(float_type_id, spv::Op::OpFNegate, z->result_id()); // Get the abolsute values of the inputs. Instruction* ax = ir_builder.AddNaryExtendedInstruction( @@ -614,12 +620,12 @@ bool ReplaceCubeFaceCoord(IRContext* ctx, Instruction* inst, float_type_id, glsl405_ext_inst_id, GLSLstd450FAbs, {z->result_id()}); // Find which values are negative. Used in later computations. - Instruction* is_z_neg = ir_builder.AddBinaryOp(bool_id, SpvOpFOrdLessThan, - z->result_id(), f0_const_id); - Instruction* is_y_neg = ir_builder.AddBinaryOp(bool_id, SpvOpFOrdLessThan, - y->result_id(), f0_const_id); - Instruction* is_x_neg = ir_builder.AddBinaryOp(bool_id, SpvOpFOrdLessThan, - x->result_id(), f0_const_id); + Instruction* is_z_neg = ir_builder.AddBinaryOp( + bool_id, spv::Op::OpFOrdLessThan, z->result_id(), f0_const_id); + Instruction* is_y_neg = ir_builder.AddBinaryOp( + bool_id, spv::Op::OpFOrdLessThan, y->result_id(), f0_const_id); + Instruction* is_x_neg = ir_builder.AddBinaryOp( + bool_id, spv::Op::OpFOrdLessThan, x->result_id(), f0_const_id); // Compute cubema Instruction* amax_x_y = ir_builder.AddNaryExtendedInstruction( @@ -628,19 +634,21 @@ bool ReplaceCubeFaceCoord(IRContext* ctx, Instruction* inst, Instruction* amax = ir_builder.AddNaryExtendedInstruction( float_type_id, glsl405_ext_inst_id, GLSLstd450FMax, {az->result_id(), amax_x_y->result_id()}); - Instruction* cubema = ir_builder.AddBinaryOp(float_type_id, SpvOpFMul, + Instruction* cubema = ir_builder.AddBinaryOp(float_type_id, spv::Op::OpFMul, f2_const_id, amax->result_id()); // Do the comparisons needed for computing cubesc and cubetc. Instruction* is_z_max = - ir_builder.AddBinaryOp(bool_id, SpvOpFOrdGreaterThanEqual, + ir_builder.AddBinaryOp(bool_id, spv::Op::OpFOrdGreaterThanEqual, az->result_id(), amax_x_y->result_id()); - Instruction* not_is_z_max = - ir_builder.AddUnaryOp(bool_id, SpvOpLogicalNot, is_z_max->result_id()); - Instruction* y_gr_x = ir_builder.AddBinaryOp( - bool_id, SpvOpFOrdGreaterThanEqual, ay->result_id(), ax->result_id()); - Instruction* is_y_max = ir_builder.AddBinaryOp( - bool_id, SpvOpLogicalAnd, not_is_z_max->result_id(), y_gr_x->result_id()); + Instruction* not_is_z_max = ir_builder.AddUnaryOp( + bool_id, spv::Op::OpLogicalNot, is_z_max->result_id()); + Instruction* y_gr_x = + ir_builder.AddBinaryOp(bool_id, spv::Op::OpFOrdGreaterThanEqual, + ay->result_id(), ax->result_id()); + Instruction* is_y_max = + ir_builder.AddBinaryOp(bool_id, spv::Op::OpLogicalAnd, + not_is_z_max->result_id(), y_gr_x->result_id()); // Select the correct value for cubesc. Instruction* cubesc_case_1 = ir_builder.AddSelect( @@ -667,10 +675,10 @@ bool ReplaceCubeFaceCoord(IRContext* ctx, Instruction* inst, Instruction* denom = ir_builder.AddCompositeConstruct( v2_float_type_id, {cubema->result_id(), cubema->result_id()}); Instruction* div = ir_builder.AddBinaryOp( - v2_float_type_id, SpvOpFDiv, cube->result_id(), denom->result_id()); + v2_float_type_id, spv::Op::OpFDiv, cube->result_id(), denom->result_id()); // Get the final result by adding 0.5 to |div|. - inst->SetOpcode(SpvOpFAdd); + inst->SetOpcode(spv::Op::OpFAdd); Instruction::OperandList new_operands; new_operands.push_back({SPV_OPERAND_TYPE_ID, {div->result_id()}}); new_operands.push_back({SPV_OPERAND_TYPE_ID, {vec_const_id}}); @@ -752,22 +760,23 @@ bool ReplaceCubeFaceIndex(IRContext* ctx, Instruction* inst, float_type_id, glsl405_ext_inst_id, GLSLstd450FAbs, {z->result_id()}); // Find which values are negative. Used in later computations. - Instruction* is_z_neg = ir_builder.AddBinaryOp(bool_id, SpvOpFOrdLessThan, - z->result_id(), f0_const_id); - Instruction* is_y_neg = ir_builder.AddBinaryOp(bool_id, SpvOpFOrdLessThan, - y->result_id(), f0_const_id); - Instruction* is_x_neg = ir_builder.AddBinaryOp(bool_id, SpvOpFOrdLessThan, - x->result_id(), f0_const_id); + Instruction* is_z_neg = ir_builder.AddBinaryOp( + bool_id, spv::Op::OpFOrdLessThan, z->result_id(), f0_const_id); + Instruction* is_y_neg = ir_builder.AddBinaryOp( + bool_id, spv::Op::OpFOrdLessThan, y->result_id(), f0_const_id); + Instruction* is_x_neg = ir_builder.AddBinaryOp( + bool_id, spv::Op::OpFOrdLessThan, x->result_id(), f0_const_id); // Find the max value. Instruction* amax_x_y = ir_builder.AddNaryExtendedInstruction( float_type_id, glsl405_ext_inst_id, GLSLstd450FMax, {ax->result_id(), ay->result_id()}); Instruction* is_z_max = - ir_builder.AddBinaryOp(bool_id, SpvOpFOrdGreaterThanEqual, + ir_builder.AddBinaryOp(bool_id, spv::Op::OpFOrdGreaterThanEqual, az->result_id(), amax_x_y->result_id()); - Instruction* y_gr_x = ir_builder.AddBinaryOp( - bool_id, SpvOpFOrdGreaterThanEqual, ay->result_id(), ax->result_id()); + Instruction* y_gr_x = + ir_builder.AddBinaryOp(bool_id, spv::Op::OpFOrdGreaterThanEqual, + ay->result_id(), ax->result_id()); // Get the value for each case. Instruction* case_z = ir_builder.AddSelect( @@ -783,7 +792,7 @@ bool ReplaceCubeFaceIndex(IRContext* ctx, Instruction* inst, case_y->result_id(), case_x->result_id()); // Get the final result by adding 0.5 to |div|. - inst->SetOpcode(SpvOpSelect); + inst->SetOpcode(spv::Op::OpSelect); Instruction::OperandList new_operands; new_operands.push_back({SPV_OPERAND_TYPE_ID, {is_z_max->result_id()}}); new_operands.push_back({SPV_OPERAND_TYPE_ID, {case_z->result_id()}}); @@ -813,11 +822,12 @@ bool ReplaceTimeAMD(IRContext* ctx, Instruction* inst, ctx, inst, IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); ctx->AddExtension("SPV_KHR_shader_clock"); - ctx->AddCapability(SpvCapabilityShaderClockKHR); + ctx->AddCapability(spv::Capability::ShaderClockKHR); - inst->SetOpcode(SpvOpReadClockKHR); + inst->SetOpcode(spv::Op::OpReadClockKHR); Instruction::OperandList args; - uint32_t subgroup_scope_id = ir_builder.GetUintConstantId(SpvScopeSubgroup); + uint32_t subgroup_scope_id = + ir_builder.GetUintConstantId(uint32_t(spv::Scope::Subgroup)); args.push_back({SPV_OPERAND_TYPE_ID, {subgroup_scope_id}}); inst->SetInOperands(std::move(args)); ctx->UpdateDefUse(inst); @@ -831,22 +841,22 @@ class AmdExtFoldingRules : public FoldingRules { protected: virtual void AddFoldingRules() override { - rules_[SpvOpGroupIAddNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); - rules_[SpvOpGroupFAddNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); - rules_[SpvOpGroupUMinNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); - rules_[SpvOpGroupSMinNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); - rules_[SpvOpGroupFMinNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); - rules_[SpvOpGroupUMaxNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); - rules_[SpvOpGroupSMaxNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); - rules_[SpvOpGroupFMaxNonUniformAMD].push_back( - ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupIAddNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupFAddNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupUMinNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupSMinNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupFMinNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupUMaxNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupSMaxNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); + rules_[spv::Op::OpGroupFMaxNonUniformAMD].push_back( + ReplaceGroupNonuniformOperationOpCode); uint32_t extension_id = context()->module()->GetExtInstImportId("SPV_AMD_shader_ballot"); @@ -934,7 +944,7 @@ Pass::Status AmdExtensionToKhrPass::Process() { std::vector to_be_killed; for (Instruction& inst : context()->module()->extensions()) { - if (inst.opcode() == SpvOpExtension) { + if (inst.opcode() == spv::Op::OpExtension) { if (ext_to_remove.count(inst.GetInOperand(0).AsString()) != 0) { to_be_killed.push_back(&inst); } @@ -942,7 +952,7 @@ Pass::Status AmdExtensionToKhrPass::Process() { } for (Instruction& inst : context()->ext_inst_imports()) { - if (inst.opcode() == SpvOpExtInstImport) { + if (inst.opcode() == spv::Op::OpExtInstImport) { if (ext_to_remove.count(inst.GetInOperand(0).AsString()) != 0) { to_be_killed.push_back(&inst); } diff --git a/3rdparty/spirv-tools/source/opt/analyze_live_input_pass.cpp b/3rdparty/spirv-tools/source/opt/analyze_live_input_pass.cpp new file mode 100644 index 000000000..529e68467 --- /dev/null +++ b/3rdparty/spirv-tools/source/opt/analyze_live_input_pass.cpp @@ -0,0 +1,45 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// Copyright (c) 2022 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/opt/analyze_live_input_pass.h" + +#include "source/opt/ir_context.h" + +namespace spvtools { +namespace opt { + +Pass::Status AnalyzeLiveInputPass::Process() { + // Current functionality assumes shader capability + if (!context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) + return Status::SuccessWithoutChange; + Pass::Status status = DoLiveInputAnalysis(); + return status; +} + +Pass::Status AnalyzeLiveInputPass::DoLiveInputAnalysis() { + // Current functionality only supports frag, tesc, tese or geom shaders. + // Report failure for any other stage. + auto stage = context()->GetStage(); + if (stage != spv::ExecutionModel::Fragment && + stage != spv::ExecutionModel::TessellationControl && + stage != spv::ExecutionModel::TessellationEvaluation && + stage != spv::ExecutionModel::Geometry) + return Status::Failure; + context()->get_liveness_mgr()->GetLiveness(live_locs_, live_builtins_); + return Status::SuccessWithoutChange; +} + +} // namespace opt +} // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/analyze_live_input_pass.h b/3rdparty/spirv-tools/source/opt/analyze_live_input_pass.h new file mode 100644 index 000000000..ab292effe --- /dev/null +++ b/3rdparty/spirv-tools/source/opt/analyze_live_input_pass.h @@ -0,0 +1,57 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// Copyright (c) 2022 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_ANALYZE_LIVE_INPUT_H_ +#define SOURCE_OPT_ANALYZE_LIVE_INPUT_H_ + +#include + +#include "source/opt/pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class AnalyzeLiveInputPass : public Pass { + public: + explicit AnalyzeLiveInputPass(std::unordered_set* live_locs, + std::unordered_set* live_builtins) + : live_locs_(live_locs), live_builtins_(live_builtins) {} + + const char* name() const override { return "analyze-live-input"; } + Status Process() override; + + // Return the mask of preserved Analyses. + IRContext::Analysis GetPreservedAnalyses() override { + return IRContext::kAnalysisDefUse | + IRContext::kAnalysisInstrToBlockMapping | + IRContext::kAnalysisCombinators | IRContext::kAnalysisCFG | + IRContext::kAnalysisDominatorAnalysis | + IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap | + IRContext::kAnalysisConstants | IRContext::kAnalysisTypes; + } + + private: + // Do live input analysis + Status DoLiveInputAnalysis(); + + std::unordered_set* live_locs_; + std::unordered_set* live_builtins_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_ANALYZE_LIVE_INPUT_H_ diff --git a/3rdparty/spirv-tools/source/opt/basic_block.cpp b/3rdparty/spirv-tools/source/opt/basic_block.cpp index e82a744af..d12178ebe 100644 --- a/3rdparty/spirv-tools/source/opt/basic_block.cpp +++ b/3rdparty/spirv-tools/source/opt/basic_block.cpp @@ -25,11 +25,9 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kLoopMergeContinueBlockIdInIdx = 1; -const uint32_t kLoopMergeMergeBlockIdInIdx = 0; -const uint32_t kSelectionMergeMergeBlockIdInIdx = 0; - +constexpr uint32_t kLoopMergeContinueBlockIdInIdx = 1; +constexpr uint32_t kLoopMergeMergeBlockIdInIdx = 0; +constexpr uint32_t kSelectionMergeMergeBlockIdInIdx = 0; } // namespace BasicBlock* BasicBlock::Clone(IRContext* context) const { @@ -58,7 +56,7 @@ const Instruction* BasicBlock::GetMergeInst() const { if (iter != cbegin()) { --iter; const auto opcode = iter->opcode(); - if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) { + if (opcode == spv::Op::OpLoopMerge || opcode == spv::Op::OpSelectionMerge) { result = &*iter; } } @@ -73,7 +71,7 @@ Instruction* BasicBlock::GetMergeInst() { if (iter != begin()) { --iter; const auto opcode = iter->opcode(); - if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) { + if (opcode == spv::Op::OpLoopMerge || opcode == spv::Op::OpSelectionMerge) { result = &*iter; } } @@ -82,7 +80,7 @@ Instruction* BasicBlock::GetMergeInst() { const Instruction* BasicBlock::GetLoopMergeInst() const { if (auto* merge = GetMergeInst()) { - if (merge->opcode() == SpvOpLoopMerge) { + if (merge->opcode() == spv::Op::OpLoopMerge) { return merge; } } @@ -91,7 +89,7 @@ const Instruction* BasicBlock::GetLoopMergeInst() const { Instruction* BasicBlock::GetLoopMergeInst() { if (auto* merge = GetMergeInst()) { - if (merge->opcode() == SpvOpLoopMerge) { + if (merge->opcode() == spv::Op::OpLoopMerge) { return merge; } } @@ -100,7 +98,7 @@ Instruction* BasicBlock::GetLoopMergeInst() { void BasicBlock::KillAllInsts(bool killLabel) { ForEachInst([killLabel](Instruction* ip) { - if (killLabel || ip->opcode() != SpvOpLabel) { + if (killLabel || ip->opcode() != spv::Op::OpLabel) { ip->context()->KillInst(ip); } }); @@ -118,10 +116,10 @@ bool BasicBlock::WhileEachSuccessorLabel( const std::function& f) const { const auto br = &insts_.back(); switch (br->opcode()) { - case SpvOpBranch: + case spv::Op::OpBranch: return f(br->GetOperand(0).words[0]); - case SpvOpBranchConditional: - case SpvOpSwitch: { + case spv::Op::OpBranchConditional: + case spv::Op::OpSwitch: { bool is_first = true; return br->WhileEachInId([&is_first, &f](const uint32_t* idp) { if (!is_first) return f(*idp); @@ -138,13 +136,13 @@ void BasicBlock::ForEachSuccessorLabel( const std::function& f) { auto br = &insts_.back(); switch (br->opcode()) { - case SpvOpBranch: { + case spv::Op::OpBranch: { uint32_t tmp_id = br->GetOperand(0).words[0]; f(&tmp_id); if (tmp_id != br->GetOperand(0).words[0]) br->SetOperand(0, {tmp_id}); } break; - case SpvOpBranchConditional: - case SpvOpSwitch: { + case spv::Op::OpBranchConditional: + case spv::Op::OpSwitch: { bool is_first = true; br->ForEachInId([&is_first, &f](uint32_t* idp) { if (!is_first) f(idp); @@ -171,7 +169,8 @@ void BasicBlock::ForMergeAndContinueLabel( --ii; if (ii == insts_.begin()) return; --ii; - if (ii->opcode() == SpvOpSelectionMerge || ii->opcode() == SpvOpLoopMerge) { + if (ii->opcode() == spv::Op::OpSelectionMerge || + ii->opcode() == spv::Op::OpLoopMerge) { ii->ForEachInId([&f](const uint32_t* idp) { f(*idp); }); } } @@ -182,9 +181,9 @@ uint32_t BasicBlock::MergeBlockIdIfAny() const { uint32_t mbid = 0; if (merge_ii != cbegin()) { --merge_ii; - if (merge_ii->opcode() == SpvOpLoopMerge) { + if (merge_ii->opcode() == spv::Op::OpLoopMerge) { mbid = merge_ii->GetSingleWordInOperand(kLoopMergeMergeBlockIdInIdx); - } else if (merge_ii->opcode() == SpvOpSelectionMerge) { + } else if (merge_ii->opcode() == spv::Op::OpSelectionMerge) { mbid = merge_ii->GetSingleWordInOperand(kSelectionMergeMergeBlockIdInIdx); } } @@ -204,7 +203,7 @@ uint32_t BasicBlock::ContinueBlockIdIfAny() const { uint32_t cbid = 0; if (merge_ii != cbegin()) { --merge_ii; - if (merge_ii->opcode() == SpvOpLoopMerge) { + if (merge_ii->opcode() == spv::Op::OpLoopMerge) { cbid = merge_ii->GetSingleWordInOperand(kLoopMergeContinueBlockIdInIdx); } } @@ -241,9 +240,9 @@ BasicBlock* BasicBlock::SplitBasicBlock(IRContext* context, uint32_t label_id, iterator iter) { assert(!insts_.empty()); - std::unique_ptr new_block_temp = - MakeUnique(MakeUnique( - context, SpvOpLabel, 0, label_id, std::initializer_list{})); + std::unique_ptr new_block_temp = MakeUnique( + MakeUnique(context, spv::Op::OpLabel, 0, label_id, + std::initializer_list{})); BasicBlock* new_block = new_block_temp.get(); function_->InsertBasicBlockAfter(std::move(new_block_temp), this); diff --git a/3rdparty/spirv-tools/source/opt/basic_block.h b/3rdparty/spirv-tools/source/opt/basic_block.h index dd3b2e287..24d5fceb3 100644 --- a/3rdparty/spirv-tools/source/opt/basic_block.h +++ b/3rdparty/spirv-tools/source/opt/basic_block.h @@ -319,7 +319,7 @@ inline bool BasicBlock::WhileEachPhiInst( Instruction* inst = &insts_.front(); while (inst != nullptr) { Instruction* next_instruction = inst->NextNode(); - if (inst->opcode() != SpvOpPhi) break; + if (inst->opcode() != spv::Op::OpPhi) break; if (!inst->WhileEachInst(f, run_on_debug_line_insts)) return false; inst = next_instruction; } diff --git a/3rdparty/spirv-tools/source/opt/block_merge_util.cpp b/3rdparty/spirv-tools/source/opt/block_merge_util.cpp index 83c702ca3..fe23e36f9 100644 --- a/3rdparty/spirv-tools/source/opt/block_merge_util.cpp +++ b/3rdparty/spirv-tools/source/opt/block_merge_util.cpp @@ -20,7 +20,6 @@ namespace spvtools { namespace opt { namespace blockmergeutil { - namespace { // Returns true if |block| contains a merge instruction. @@ -34,14 +33,15 @@ bool IsHeader(IRContext* context, uint32_t id) { // Returns true if |id| is the merge target of a merge instruction. bool IsMerge(IRContext* context, uint32_t id) { - return !context->get_def_use_mgr()->WhileEachUse(id, [](Instruction* user, - uint32_t index) { - SpvOp op = user->opcode(); - if ((op == SpvOpLoopMerge || op == SpvOpSelectionMerge) && index == 0u) { - return false; - } - return true; - }); + return !context->get_def_use_mgr()->WhileEachUse( + id, [](Instruction* user, uint32_t index) { + spv::Op op = user->opcode(); + if ((op == spv::Op::OpLoopMerge || op == spv::Op::OpSelectionMerge) && + index == 0u) { + return false; + } + return true; + }); } // Returns true if |block| is the merge target of a merge instruction. @@ -53,8 +53,8 @@ bool IsMerge(IRContext* context, BasicBlock* block) { bool IsContinue(IRContext* context, uint32_t id) { return !context->get_def_use_mgr()->WhileEachUse( id, [](Instruction* user, uint32_t index) { - SpvOp op = user->opcode(); - if (op == SpvOpLoopMerge && index == 1u) { + spv::Op op = user->opcode(); + if (op == spv::Op::OpLoopMerge && index == 1u) { return false; } return true; @@ -82,7 +82,7 @@ bool CanMergeWithSuccessor(IRContext* context, BasicBlock* block) { auto ii = block->end(); --ii; Instruction* br = &*ii; - if (br->opcode() != SpvOpBranch) { + if (br->opcode() != spv::Op::OpBranch) { return false; } @@ -119,9 +119,10 @@ bool CanMergeWithSuccessor(IRContext* context, BasicBlock* block) { // The merge must be a loop merge because a selection merge cannot be // followed by an unconditional branch. BasicBlock* succ_block = context->get_instr_block(lab_id); - SpvOp succ_term_op = succ_block->terminator()->opcode(); - assert(merge_inst->opcode() == SpvOpLoopMerge); - if (succ_term_op != SpvOpBranch && succ_term_op != SpvOpBranchConditional) { + spv::Op succ_term_op = succ_block->terminator()->opcode(); + assert(merge_inst->opcode() == spv::Op::OpLoopMerge); + if (succ_term_op != spv::Op::OpBranch && + succ_term_op != spv::Op::OpBranchConditional) { return false; } } @@ -170,6 +171,11 @@ void MergeWithSuccessor(IRContext* context, Function* func, // sbi must follow bi in func's ordering. assert(sbi != func->end()); + if (sbi->tail()->opcode() == spv::Op::OpSwitch && + sbi->MergeBlockIdIfAny() != 0) { + context->InvalidateAnalyses(IRContext::Analysis::kAnalysisStructuredCFG); + } + // Update the inst-to-block mapping for the instructions in sbi. for (auto& inst : *sbi) { context->set_instr_block(&inst, &*bi); diff --git a/3rdparty/spirv-tools/source/opt/ccp_pass.cpp b/3rdparty/spirv-tools/source/opt/ccp_pass.cpp index 5f8550276..63627a2f7 100644 --- a/3rdparty/spirv-tools/source/opt/ccp_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/ccp_pass.cpp @@ -29,14 +29,11 @@ namespace spvtools { namespace opt { - namespace { - // This SSA id is never defined nor referenced in the IR. It is a special ID // which represents varying values. When an ID is found to have a varying // value, its entry in the |values_| table maps to kVaryingSSAId. -const uint32_t kVaryingSSAId = std::numeric_limits::max(); - +constexpr uint32_t kVaryingSSAId = std::numeric_limits::max(); } // namespace bool CCPPass::IsVaryingValue(uint32_t id) const { return id == kVaryingSSAId; } @@ -136,7 +133,7 @@ SSAPropagator::PropStatus CCPPass::VisitAssignment(Instruction* instr) { // If this is a copy operation, and the RHS is a known constant, assign its // value to the LHS. - if (instr->opcode() == SpvOpCopyObject) { + if (instr->opcode() == spv::Op::OpCopyObject) { uint32_t rhs_id = instr->GetSingleWordInOperand(0); auto it = values_.find(rhs_id); if (it != values_.end()) { @@ -211,10 +208,10 @@ SSAPropagator::PropStatus CCPPass::VisitBranch(Instruction* instr, *dest_bb = nullptr; uint32_t dest_label = 0; - if (instr->opcode() == SpvOpBranch) { + if (instr->opcode() == spv::Op::OpBranch) { // An unconditional jump always goes to its unique destination. dest_label = instr->GetSingleWordInOperand(0); - } else if (instr->opcode() == SpvOpBranchConditional) { + } else if (instr->opcode() == spv::Op::OpBranchConditional) { // For a conditional branch, determine whether the predicate selector has a // known value in |values_|. If it does, set the destination block // according to the selector's boolean value. @@ -243,7 +240,7 @@ SSAPropagator::PropStatus CCPPass::VisitBranch(Instruction* instr, // For an OpSwitch, extract the value taken by the switch selector and check // which of the target literals it matches. The branch associated with that // literal is the taken branch. - assert(instr->opcode() == SpvOpSwitch); + assert(instr->opcode() == spv::Op::OpSwitch); if (instr->GetOperand(0).words.size() != 1) { // If the selector is wider than 32-bits, return varying. TODO(dnovillo): // Add support for wider constants. @@ -290,7 +287,7 @@ SSAPropagator::PropStatus CCPPass::VisitBranch(Instruction* instr, SSAPropagator::PropStatus CCPPass::VisitInstruction(Instruction* instr, BasicBlock** dest_bb) { *dest_bb = nullptr; - if (instr->opcode() == SpvOpPhi) { + if (instr->opcode() == spv::Op::OpPhi) { return VisitPhi(instr); } else if (instr->IsBranch()) { return VisitBranch(instr, dest_bb); diff --git a/3rdparty/spirv-tools/source/opt/cfg.cpp b/3rdparty/spirv-tools/source/opt/cfg.cpp index a0248d54c..4c4bb2568 100644 --- a/3rdparty/spirv-tools/source/opt/cfg.cpp +++ b/3rdparty/spirv-tools/source/opt/cfg.cpp @@ -29,16 +29,16 @@ namespace { using cbb_ptr = const opt::BasicBlock*; // Universal Limit of ResultID + 1 -const int kMaxResultId = 0x400000; +constexpr int kMaxResultId = 0x400000; } // namespace CFG::CFG(Module* module) : module_(module), pseudo_entry_block_(std::unique_ptr( - new Instruction(module->context(), SpvOpLabel, 0, 0, {}))), + new Instruction(module->context(), spv::Op::OpLabel, 0, 0, {}))), pseudo_exit_block_(std::unique_ptr(new Instruction( - module->context(), SpvOpLabel, 0, kMaxResultId, {}))) { + module->context(), spv::Op::OpLabel, 0, kMaxResultId, {}))) { for (auto& fn : *module) { for (auto& blk : fn) { RegisterBlock(&blk); @@ -81,7 +81,7 @@ void CFG::ComputeStructuredOrder(Function* func, BasicBlock* root, BasicBlock* end, std::list* order) { assert(module_->context()->get_feature_mgr()->HasCapability( - SpvCapabilityShader) && + spv::Capability::Shader) && "This only works on structured control flow"); // Compute structured successors and do DFS. @@ -228,7 +228,7 @@ BasicBlock* CFG::SplitLoopHeader(BasicBlock* bb) { // Create the new header bb basic bb. // Leave the phi instructions behind. auto iter = bb->begin(); - while (iter->opcode() == SpvOpPhi) { + while (iter->opcode() == spv::Op::OpPhi) { ++iter; } @@ -304,7 +304,7 @@ BasicBlock* CFG::SplitLoopHeader(BasicBlock* bb) { context, bb, IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); bb->AddInstruction( - MakeUnique(context, SpvOpBranch, 0, 0, + MakeUnique(context, spv::Op::OpBranch, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {new_header->id()}}})); context->AnalyzeUses(bb->terminator()); diff --git a/3rdparty/spirv-tools/source/opt/code_sink.cpp b/3rdparty/spirv-tools/source/opt/code_sink.cpp index cd7779747..35a8df23b 100644 --- a/3rdparty/spirv-tools/source/opt/code_sink.cpp +++ b/3rdparty/spirv-tools/source/opt/code_sink.cpp @@ -50,7 +50,8 @@ bool CodeSinkingPass::SinkInstructionsInBB(BasicBlock* bb) { } bool CodeSinkingPass::SinkInstruction(Instruction* inst) { - if (inst->opcode() != SpvOpLoad && inst->opcode() != SpvOpAccessChain) { + if (inst->opcode() != spv::Op::OpLoad && + inst->opcode() != spv::Op::OpAccessChain) { return false; } @@ -60,7 +61,7 @@ bool CodeSinkingPass::SinkInstruction(Instruction* inst) { if (BasicBlock* target_bb = FindNewBasicBlockFor(inst)) { Instruction* pos = &*target_bb->begin(); - while (pos->opcode() == SpvOpPhi) { + while (pos->opcode() == spv::Op::OpPhi) { pos = pos->NextNode(); } @@ -79,7 +80,7 @@ BasicBlock* CodeSinkingPass::FindNewBasicBlockFor(Instruction* inst) { std::unordered_set bbs_with_uses; get_def_use_mgr()->ForEachUse( inst, [&bbs_with_uses, this](Instruction* use, uint32_t idx) { - if (use->opcode() != SpvOpPhi) { + if (use->opcode() != spv::Op::OpPhi) { BasicBlock* use_bb = context()->get_instr_block(use); if (use_bb) { bbs_with_uses.insert(use_bb->id()); @@ -99,7 +100,7 @@ BasicBlock* CodeSinkingPass::FindNewBasicBlockFor(Instruction* inst) { // of succ_bb, then |inst| can be moved to succ_bb. If succ_bb, has move // then one predecessor, then moving |inst| into succ_bb could cause it to // be executed more often, so the search has to stop. - if (bb->terminator()->opcode() == SpvOpBranch) { + if (bb->terminator()->opcode() == spv::Op::OpBranch) { uint32_t succ_bb_id = bb->terminator()->GetSingleWordInOperand(0); if (cfg()->preds(succ_bb_id).size() == 1) { bb = context()->get_instr_block(succ_bb_id); @@ -113,7 +114,8 @@ BasicBlock* CodeSinkingPass::FindNewBasicBlockFor(Instruction* inst) { // instruction or an OpLoopMerge, then it is a break or continue. We could // figure it out, but not worth doing it now. Instruction* merge_inst = bb->GetMergeInst(); - if (merge_inst == nullptr || merge_inst->opcode() != SpvOpSelectionMerge) { + if (merge_inst == nullptr || + merge_inst->opcode() != spv::Op::OpSelectionMerge) { break; } @@ -173,7 +175,7 @@ bool CodeSinkingPass::ReferencesMutableMemory(Instruction* inst) { } Instruction* base_ptr = inst->GetBaseAddress(); - if (base_ptr->opcode() != SpvOpVariable) { + if (base_ptr->opcode() != spv::Op::OpVariable) { return true; } @@ -185,7 +187,8 @@ bool CodeSinkingPass::ReferencesMutableMemory(Instruction* inst) { return true; } - if (base_ptr->GetSingleWordInOperand(0) != SpvStorageClassUniform) { + if (spv::StorageClass(base_ptr->GetSingleWordInOperand(0)) != + spv::StorageClass::Uniform) { return true; } @@ -200,41 +203,41 @@ bool CodeSinkingPass::HasUniformMemorySync() { bool has_sync = false; get_module()->ForEachInst([this, &has_sync](Instruction* inst) { switch (inst->opcode()) { - case SpvOpMemoryBarrier: { + case spv::Op::OpMemoryBarrier: { uint32_t mem_semantics_id = inst->GetSingleWordInOperand(1); if (IsSyncOnUniform(mem_semantics_id)) { has_sync = true; } break; } - case SpvOpControlBarrier: - case SpvOpAtomicLoad: - case SpvOpAtomicStore: - case SpvOpAtomicExchange: - case SpvOpAtomicIIncrement: - case SpvOpAtomicIDecrement: - case SpvOpAtomicIAdd: - case SpvOpAtomicFAddEXT: - case SpvOpAtomicISub: - case SpvOpAtomicSMin: - case SpvOpAtomicUMin: - case SpvOpAtomicFMinEXT: - case SpvOpAtomicSMax: - case SpvOpAtomicUMax: - case SpvOpAtomicFMaxEXT: - case SpvOpAtomicAnd: - case SpvOpAtomicOr: - case SpvOpAtomicXor: - case SpvOpAtomicFlagTestAndSet: - case SpvOpAtomicFlagClear: { + case spv::Op::OpControlBarrier: + case spv::Op::OpAtomicLoad: + case spv::Op::OpAtomicStore: + case spv::Op::OpAtomicExchange: + case spv::Op::OpAtomicIIncrement: + case spv::Op::OpAtomicIDecrement: + case spv::Op::OpAtomicIAdd: + case spv::Op::OpAtomicFAddEXT: + case spv::Op::OpAtomicISub: + case spv::Op::OpAtomicSMin: + case spv::Op::OpAtomicUMin: + case spv::Op::OpAtomicFMinEXT: + case spv::Op::OpAtomicSMax: + case spv::Op::OpAtomicUMax: + case spv::Op::OpAtomicFMaxEXT: + case spv::Op::OpAtomicAnd: + case spv::Op::OpAtomicOr: + case spv::Op::OpAtomicXor: + case spv::Op::OpAtomicFlagTestAndSet: + case spv::Op::OpAtomicFlagClear: { uint32_t mem_semantics_id = inst->GetSingleWordInOperand(2); if (IsSyncOnUniform(mem_semantics_id)) { has_sync = true; } break; } - case SpvOpAtomicCompareExchange: - case SpvOpAtomicCompareExchangeWeak: + case spv::Op::OpAtomicCompareExchange: + case spv::Op::OpAtomicCompareExchangeWeak: if (IsSyncOnUniform(inst->GetSingleWordInOperand(2)) || IsSyncOnUniform(inst->GetSingleWordInOperand(3))) { has_sync = true; @@ -259,28 +262,30 @@ bool CodeSinkingPass::IsSyncOnUniform(uint32_t mem_semantics_id) const { // If it does not affect uniform memory, then it is does not apply to uniform // memory. - if ((mem_semantics_int & SpvMemorySemanticsUniformMemoryMask) == 0) { + if ((mem_semantics_int & uint32_t(spv::MemorySemanticsMask::UniformMemory)) == + 0) { return false; } // Check if there is an acquire or release. If so not, this it does not add // any memory constraints. - return (mem_semantics_int & (SpvMemorySemanticsAcquireMask | - SpvMemorySemanticsAcquireReleaseMask | - SpvMemorySemanticsReleaseMask)) != 0; + return (mem_semantics_int & + uint32_t(spv::MemorySemanticsMask::Acquire | + spv::MemorySemanticsMask::AcquireRelease | + spv::MemorySemanticsMask::Release)) != 0; } bool CodeSinkingPass::HasPossibleStore(Instruction* var_inst) { - assert(var_inst->opcode() == SpvOpVariable || - var_inst->opcode() == SpvOpAccessChain || - var_inst->opcode() == SpvOpPtrAccessChain); + assert(var_inst->opcode() == spv::Op::OpVariable || + var_inst->opcode() == spv::Op::OpAccessChain || + var_inst->opcode() == spv::Op::OpPtrAccessChain); return get_def_use_mgr()->WhileEachUser(var_inst, [this](Instruction* use) { switch (use->opcode()) { - case SpvOpStore: + case spv::Op::OpStore: return true; - case SpvOpAccessChain: - case SpvOpPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpPtrAccessChain: return HasPossibleStore(use); default: return false; diff --git a/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp b/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp index 142897a2e..99ec79625 100644 --- a/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp +++ b/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp @@ -44,10 +44,10 @@ bool CombineAccessChains::ProcessFunction(Function& function) { function.entry().get(), [&modified, this](BasicBlock* block) { block->ForEachInst([&modified, this](Instruction* inst) { switch (inst->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: modified |= CombineAccessChain(inst); break; default: @@ -76,10 +76,10 @@ uint32_t CombineAccessChains::GetConstantValue( uint32_t CombineAccessChains::GetArrayStride(const Instruction* inst) { uint32_t array_stride = 0; context()->get_decoration_mgr()->WhileEachDecoration( - inst->type_id(), SpvDecorationArrayStride, + inst->type_id(), uint32_t(spv::Decoration::ArrayStride), [&array_stride](const Instruction& decoration) { - assert(decoration.opcode() != SpvOpDecorateId); - if (decoration.opcode() == SpvOpDecorate) { + assert(decoration.opcode() != spv::Op::OpDecorateId); + if (decoration.opcode() == spv::Op::OpDecorate) { array_stride = decoration.GetSingleWordInOperand(1); } else { array_stride = decoration.GetSingleWordInOperand(2); @@ -200,18 +200,18 @@ bool CombineAccessChains::CreateNewInputOperands( } bool CombineAccessChains::CombineAccessChain(Instruction* inst) { - assert((inst->opcode() == SpvOpPtrAccessChain || - inst->opcode() == SpvOpAccessChain || - inst->opcode() == SpvOpInBoundsAccessChain || - inst->opcode() == SpvOpInBoundsPtrAccessChain) && + assert((inst->opcode() == spv::Op::OpPtrAccessChain || + inst->opcode() == spv::Op::OpAccessChain || + inst->opcode() == spv::Op::OpInBoundsAccessChain || + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) && "Wrong opcode. Expected an access chain."); Instruction* ptr_input = context()->get_def_use_mgr()->GetDef(inst->GetSingleWordInOperand(0)); - if (ptr_input->opcode() != SpvOpAccessChain && - ptr_input->opcode() != SpvOpInBoundsAccessChain && - ptr_input->opcode() != SpvOpPtrAccessChain && - ptr_input->opcode() != SpvOpInBoundsPtrAccessChain) { + if (ptr_input->opcode() != spv::Op::OpAccessChain && + ptr_input->opcode() != spv::Op::OpInBoundsAccessChain && + ptr_input->opcode() != spv::Op::OpPtrAccessChain && + ptr_input->opcode() != spv::Op::OpInBoundsPtrAccessChain) { return false; } @@ -246,7 +246,7 @@ bool CombineAccessChains::CombineAccessChain(Instruction* inst) { } else if (inst->NumInOperands() == 1) { // |inst| is a no-op, change it to a copy. Instruction simplification will // clean it up. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); } else { std::vector new_operands; if (!CreateNewInputOperands(ptr_input, inst, &new_operands)) return false; @@ -259,23 +259,25 @@ bool CombineAccessChains::CombineAccessChain(Instruction* inst) { return true; } -SpvOp CombineAccessChains::UpdateOpcode(SpvOp base_opcode, SpvOp input_opcode) { - auto IsInBounds = [](SpvOp opcode) { - return opcode == SpvOpInBoundsPtrAccessChain || - opcode == SpvOpInBoundsAccessChain; +spv::Op CombineAccessChains::UpdateOpcode(spv::Op base_opcode, + spv::Op input_opcode) { + auto IsInBounds = [](spv::Op opcode) { + return opcode == spv::Op::OpInBoundsPtrAccessChain || + opcode == spv::Op::OpInBoundsAccessChain; }; - if (input_opcode == SpvOpInBoundsPtrAccessChain) { - if (!IsInBounds(base_opcode)) return SpvOpPtrAccessChain; - } else if (input_opcode == SpvOpInBoundsAccessChain) { - if (!IsInBounds(base_opcode)) return SpvOpAccessChain; + if (input_opcode == spv::Op::OpInBoundsPtrAccessChain) { + if (!IsInBounds(base_opcode)) return spv::Op::OpPtrAccessChain; + } else if (input_opcode == spv::Op::OpInBoundsAccessChain) { + if (!IsInBounds(base_opcode)) return spv::Op::OpAccessChain; } return input_opcode; } -bool CombineAccessChains::IsPtrAccessChain(SpvOp opcode) { - return opcode == SpvOpPtrAccessChain || opcode == SpvOpInBoundsPtrAccessChain; +bool CombineAccessChains::IsPtrAccessChain(spv::Op opcode) { + return opcode == spv::Op::OpPtrAccessChain || + opcode == spv::Op::OpInBoundsPtrAccessChain; } bool CombineAccessChains::Has64BitIndices(Instruction* inst) { diff --git a/3rdparty/spirv-tools/source/opt/combine_access_chains.h b/3rdparty/spirv-tools/source/opt/combine_access_chains.h index 531209ec1..32ee50d30 100644 --- a/3rdparty/spirv-tools/source/opt/combine_access_chains.h +++ b/3rdparty/spirv-tools/source/opt/combine_access_chains.h @@ -68,10 +68,10 @@ class CombineAccessChains : public Pass { std::vector* new_operands); // Returns the opcode to use for the combined access chain. - SpvOp UpdateOpcode(SpvOp base_opcode, SpvOp input_opcode); + spv::Op UpdateOpcode(spv::Op base_opcode, spv::Op input_opcode); // Returns true if |opcode| is a pointer access chain. - bool IsPtrAccessChain(SpvOp opcode); + bool IsPtrAccessChain(spv::Op opcode); // Returns true if |inst| (an access chain) has 64-bit indices. bool Has64BitIndices(Instruction* inst); diff --git a/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp b/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp index 0ad755c94..14f22089b 100644 --- a/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp +++ b/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp @@ -19,8 +19,7 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kExtractCompositeIdInIdx = 0; +constexpr uint32_t kExtractCompositeIdInIdx = 0; // Returns a constants with the value NaN of the given type. Only works for // 32-bit and 64-bit float point types. Returns |nullptr| if an error occurs. @@ -120,11 +119,97 @@ ConstantFoldingRule FoldExtractWithConstants() { }; } +// Folds an OpcompositeInsert where input is a composite constant. +ConstantFoldingRule FoldInsertWithConstants() { + return [](IRContext* context, Instruction* inst, + const std::vector& constants) + -> const analysis::Constant* { + analysis::ConstantManager* const_mgr = context->get_constant_mgr(); + const analysis::Constant* object = constants[0]; + const analysis::Constant* composite = constants[1]; + if (object == nullptr || composite == nullptr) { + return nullptr; + } + + // If there is more than 1 index, then each additional constant used by the + // index will need to be recreated to use the inserted object. + std::vector chain; + std::vector components; + const analysis::Type* type = nullptr; + const uint32_t final_index = (inst->NumInOperands() - 1); + + // Work down hierarchy of all indexes + for (uint32_t i = 2; i < inst->NumInOperands(); ++i) { + type = composite->type(); + + if (composite->AsNullConstant()) { + // Make new composite so it can be inserted in the index with the + // non-null value + const auto new_composite = const_mgr->GetNullCompositeConstant(type); + // Keep track of any indexes along the way to last index + if (i != final_index) { + chain.push_back(new_composite); + } + components = new_composite->AsCompositeConstant()->GetComponents(); + } else { + // Keep track of any indexes along the way to last index + if (i != final_index) { + chain.push_back(composite); + } + components = composite->AsCompositeConstant()->GetComponents(); + } + const uint32_t index = inst->GetSingleWordInOperand(i); + composite = components[index]; + } + + // Final index in hierarchy is inserted with new object. + const uint32_t final_operand = inst->GetSingleWordInOperand(final_index); + std::vector ids; + for (size_t i = 0; i < components.size(); i++) { + const analysis::Constant* constant = + (i == final_operand) ? object : components[i]; + Instruction* member_inst = const_mgr->GetDefiningInstruction(constant); + ids.push_back(member_inst->result_id()); + } + const analysis::Constant* new_constant = const_mgr->GetConstant(type, ids); + + // Work backwards up the chain and replace each index with new constant. + for (size_t i = chain.size(); i > 0; i--) { + // Need to insert any previous instruction into the module first. + // Can't just insert in types_values_begin() because it will move above + // where the types are declared. + // Can't compare with location of inst because not all new added + // instructions are added to types_values_ + auto iter = context->types_values_end(); + Module::inst_iterator* pos = &iter; + const_mgr->BuildInstructionAndAddToModule(new_constant, pos); + + composite = chain[i - 1]; + components = composite->AsCompositeConstant()->GetComponents(); + type = composite->type(); + ids.clear(); + for (size_t k = 0; k < components.size(); k++) { + const uint32_t index = + inst->GetSingleWordInOperand(1 + static_cast(i)); + const analysis::Constant* constant = + (k == index) ? new_constant : components[k]; + const uint32_t constant_id = + const_mgr->FindDeclaredConstant(constant, 0); + ids.push_back(constant_id); + } + new_constant = const_mgr->GetConstant(type, ids); + } + + // If multiple constants were created, only need to return the top index. + return new_constant; + }; +} + ConstantFoldingRule FoldVectorShuffleWithConstants() { return [](IRContext* context, Instruction* inst, const std::vector& constants) -> const analysis::Constant* { - assert(inst->opcode() == SpvOpVectorShuffle); + assert(inst->opcode() == spv::Op::OpVectorShuffle); const analysis::Constant* c1 = constants[0]; const analysis::Constant* c2 = constants[1]; if (c1 == nullptr || c2 == nullptr) { @@ -180,7 +265,7 @@ ConstantFoldingRule FoldVectorTimesScalar() { return [](IRContext* context, Instruction* inst, const std::vector& constants) -> const analysis::Constant* { - assert(inst->opcode() == SpvOpVectorTimesScalar); + assert(inst->opcode() == spv::Op::OpVectorTimesScalar); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); analysis::TypeManager* type_mgr = context->get_type_mgr(); @@ -255,7 +340,7 @@ ConstantFoldingRule FoldVectorTimesMatrix() { return [](IRContext* context, Instruction* inst, const std::vector& constants) -> const analysis::Constant* { - assert(inst->opcode() == SpvOpVectorTimesMatrix); + assert(inst->opcode() == spv::Op::OpVectorTimesMatrix); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); analysis::TypeManager* type_mgr = context->get_type_mgr(); @@ -348,7 +433,7 @@ ConstantFoldingRule FoldMatrixTimesVector() { return [](IRContext* context, Instruction* inst, const std::vector& constants) -> const analysis::Constant* { - assert(inst->opcode() == SpvOpMatrixTimesVector); + assert(inst->opcode() == spv::Op::OpMatrixTimesVector); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); analysis::TypeManager* type_mgr = context->get_type_mgr(); @@ -458,9 +543,9 @@ ConstantFoldingRule FoldCompositeWithConstants() { } uint32_t component_type_id = 0; - if (type_inst->opcode() == SpvOpTypeStruct) { + if (type_inst->opcode() == spv::Op::OpTypeStruct) { component_type_id = type_inst->GetSingleWordInOperand(i); - } else if (type_inst->opcode() == SpvOpTypeArray) { + } else if (type_inst->opcode() == spv::Op::OpTypeArray) { component_type_id = type_inst->GetSingleWordInOperand(0); } @@ -509,7 +594,7 @@ ConstantFoldingRule FoldFPUnaryOp(UnaryScalarFoldingRule scalar_rule) { } const analysis::Constant* arg = - (inst->opcode() == SpvOpExtInst) ? constants[1] : constants[0]; + (inst->opcode() == spv::Op::OpExtInst) ? constants[1] : constants[0]; if (arg == nullptr) { return nullptr; @@ -599,7 +684,7 @@ ConstantFoldingRule FoldFPBinaryOp(BinaryScalarFoldingRule scalar_rule) { if (!inst->IsFloatingPointFoldingAllowed()) { return nullptr; } - if (inst->opcode() == SpvOpExtInst) { + if (inst->opcode() == spv::Op::OpExtInst) { return FoldFPBinaryOp(scalar_rule, inst->type_id(), {constants[1], constants[2]}, context); } @@ -957,7 +1042,7 @@ UnaryScalarFoldingRule FoldFNegateOp() { ConstantFoldingRule FoldFNegate() { return FoldFPUnaryOp(FoldFNegateOp()); } -ConstantFoldingRule FoldFClampFeedingCompare(uint32_t cmp_opcode) { +ConstantFoldingRule FoldFClampFeedingCompare(spv::Op cmp_opcode) { return [cmp_opcode](IRContext* context, Instruction* inst, const std::vector& constants) -> const analysis::Constant* { @@ -985,7 +1070,7 @@ ConstantFoldingRule FoldFClampFeedingCompare(uint32_t cmp_opcode) { return nullptr; } - if (operand_inst->opcode() != SpvOpExtInst) { + if (operand_inst->opcode() != spv::Op::OpExtInst) { return nullptr; } @@ -1009,25 +1094,25 @@ ConstantFoldingRule FoldFClampFeedingCompare(uint32_t cmp_opcode) { bool result = false; switch (cmp_opcode) { - case SpvOpFOrdLessThan: - case SpvOpFUnordLessThan: - case SpvOpFOrdGreaterThanEqual: - case SpvOpFUnordGreaterThanEqual: + case spv::Op::OpFOrdLessThan: + case spv::Op::OpFUnordLessThan: + case spv::Op::OpFOrdGreaterThanEqual: + case spv::Op::OpFUnordGreaterThanEqual: if (constants[0]) { if (min_const) { if (constants[0]->GetValueAsDouble() < min_const->GetValueAsDouble()) { found_result = true; - result = (cmp_opcode == SpvOpFOrdLessThan || - cmp_opcode == SpvOpFUnordLessThan); + result = (cmp_opcode == spv::Op::OpFOrdLessThan || + cmp_opcode == spv::Op::OpFUnordLessThan); } } if (max_const) { if (constants[0]->GetValueAsDouble() >= max_const->GetValueAsDouble()) { found_result = true; - result = !(cmp_opcode == SpvOpFOrdLessThan || - cmp_opcode == SpvOpFUnordLessThan); + result = !(cmp_opcode == spv::Op::OpFOrdLessThan || + cmp_opcode == spv::Op::OpFUnordLessThan); } } } @@ -1037,8 +1122,8 @@ ConstantFoldingRule FoldFClampFeedingCompare(uint32_t cmp_opcode) { if (max_const->GetValueAsDouble() < constants[1]->GetValueAsDouble()) { found_result = true; - result = (cmp_opcode == SpvOpFOrdLessThan || - cmp_opcode == SpvOpFUnordLessThan); + result = (cmp_opcode == spv::Op::OpFOrdLessThan || + cmp_opcode == spv::Op::OpFUnordLessThan); } } @@ -1046,31 +1131,31 @@ ConstantFoldingRule FoldFClampFeedingCompare(uint32_t cmp_opcode) { if (min_const->GetValueAsDouble() >= constants[1]->GetValueAsDouble()) { found_result = true; - result = !(cmp_opcode == SpvOpFOrdLessThan || - cmp_opcode == SpvOpFUnordLessThan); + result = !(cmp_opcode == spv::Op::OpFOrdLessThan || + cmp_opcode == spv::Op::OpFUnordLessThan); } } } break; - case SpvOpFOrdGreaterThan: - case SpvOpFUnordGreaterThan: - case SpvOpFOrdLessThanEqual: - case SpvOpFUnordLessThanEqual: + case spv::Op::OpFOrdGreaterThan: + case spv::Op::OpFUnordGreaterThan: + case spv::Op::OpFOrdLessThanEqual: + case spv::Op::OpFUnordLessThanEqual: if (constants[0]) { if (min_const) { if (constants[0]->GetValueAsDouble() <= min_const->GetValueAsDouble()) { found_result = true; - result = (cmp_opcode == SpvOpFOrdLessThanEqual || - cmp_opcode == SpvOpFUnordLessThanEqual); + result = (cmp_opcode == spv::Op::OpFOrdLessThanEqual || + cmp_opcode == spv::Op::OpFUnordLessThanEqual); } } if (max_const) { if (constants[0]->GetValueAsDouble() > max_const->GetValueAsDouble()) { found_result = true; - result = !(cmp_opcode == SpvOpFOrdLessThanEqual || - cmp_opcode == SpvOpFUnordLessThanEqual); + result = !(cmp_opcode == spv::Op::OpFOrdLessThanEqual || + cmp_opcode == spv::Op::OpFUnordLessThanEqual); } } } @@ -1080,8 +1165,8 @@ ConstantFoldingRule FoldFClampFeedingCompare(uint32_t cmp_opcode) { if (max_const->GetValueAsDouble() <= constants[1]->GetValueAsDouble()) { found_result = true; - result = (cmp_opcode == SpvOpFOrdLessThanEqual || - cmp_opcode == SpvOpFUnordLessThanEqual); + result = (cmp_opcode == spv::Op::OpFOrdLessThanEqual || + cmp_opcode == spv::Op::OpFUnordLessThanEqual); } } @@ -1089,8 +1174,8 @@ ConstantFoldingRule FoldFClampFeedingCompare(uint32_t cmp_opcode) { if (min_const->GetValueAsDouble() > constants[1]->GetValueAsDouble()) { found_result = true; - result = !(cmp_opcode == SpvOpFOrdLessThanEqual || - cmp_opcode == SpvOpFUnordLessThanEqual); + result = !(cmp_opcode == spv::Op::OpFOrdLessThanEqual || + cmp_opcode == spv::Op::OpFUnordLessThanEqual); } } } @@ -1117,7 +1202,7 @@ ConstantFoldingRule FoldFMix() { const std::vector& constants) -> const analysis::Constant* { analysis::ConstantManager* const_mgr = context->get_constant_mgr(); - assert(inst->opcode() == SpvOpExtInst && + assert(inst->opcode() == spv::Op::OpExtInst && "Expecting an extended instruction."); assert(inst->GetSingleWordInOperand(0) == context->get_feature_mgr()->GetExtInstImportId_GLSLstd450() && @@ -1267,7 +1352,7 @@ const analysis::Constant* FoldMax(const analysis::Type* result_type, const analysis::Constant* FoldClamp1( IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpExtInst && + assert(inst->opcode() == spv::Op::OpExtInst && "Expecting an extended instruction."); assert(inst->GetSingleWordInOperand(0) == context->get_feature_mgr()->GetExtInstImportId_GLSLstd450() && @@ -1293,7 +1378,7 @@ const analysis::Constant* FoldClamp1( const analysis::Constant* FoldClamp2( IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpExtInst && + assert(inst->opcode() == spv::Op::OpExtInst && "Expecting an extended instruction."); assert(inst->GetSingleWordInOperand(0) == context->get_feature_mgr()->GetExtInstImportId_GLSLstd450() && @@ -1321,7 +1406,7 @@ const analysis::Constant* FoldClamp2( const analysis::Constant* FoldClamp3( IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpExtInst && + assert(inst->opcode() == spv::Op::OpExtInst && "Expecting an extended instruction."); assert(inst->GetSingleWordInOperand(0) == context->get_feature_mgr()->GetExtInstImportId_GLSLstd450() && @@ -1407,68 +1492,70 @@ void ConstantFoldingRules::AddFoldingRules() { // applies to the instruction, the rest of the rules will not be attempted. // Take that into consideration. - rules_[SpvOpCompositeConstruct].push_back(FoldCompositeWithConstants()); + rules_[spv::Op::OpCompositeConstruct].push_back(FoldCompositeWithConstants()); - rules_[SpvOpCompositeExtract].push_back(FoldExtractWithConstants()); + rules_[spv::Op::OpCompositeExtract].push_back(FoldExtractWithConstants()); + rules_[spv::Op::OpCompositeInsert].push_back(FoldInsertWithConstants()); - rules_[SpvOpConvertFToS].push_back(FoldFToI()); - rules_[SpvOpConvertFToU].push_back(FoldFToI()); - rules_[SpvOpConvertSToF].push_back(FoldIToF()); - rules_[SpvOpConvertUToF].push_back(FoldIToF()); + rules_[spv::Op::OpConvertFToS].push_back(FoldFToI()); + rules_[spv::Op::OpConvertFToU].push_back(FoldFToI()); + rules_[spv::Op::OpConvertSToF].push_back(FoldIToF()); + rules_[spv::Op::OpConvertUToF].push_back(FoldIToF()); - rules_[SpvOpDot].push_back(FoldOpDotWithConstants()); - rules_[SpvOpFAdd].push_back(FoldFAdd()); - rules_[SpvOpFDiv].push_back(FoldFDiv()); - rules_[SpvOpFMul].push_back(FoldFMul()); - rules_[SpvOpFSub].push_back(FoldFSub()); + rules_[spv::Op::OpDot].push_back(FoldOpDotWithConstants()); + rules_[spv::Op::OpFAdd].push_back(FoldFAdd()); + rules_[spv::Op::OpFDiv].push_back(FoldFDiv()); + rules_[spv::Op::OpFMul].push_back(FoldFMul()); + rules_[spv::Op::OpFSub].push_back(FoldFSub()); - rules_[SpvOpFOrdEqual].push_back(FoldFOrdEqual()); + rules_[spv::Op::OpFOrdEqual].push_back(FoldFOrdEqual()); - rules_[SpvOpFUnordEqual].push_back(FoldFUnordEqual()); + rules_[spv::Op::OpFUnordEqual].push_back(FoldFUnordEqual()); - rules_[SpvOpFOrdNotEqual].push_back(FoldFOrdNotEqual()); + rules_[spv::Op::OpFOrdNotEqual].push_back(FoldFOrdNotEqual()); - rules_[SpvOpFUnordNotEqual].push_back(FoldFUnordNotEqual()); + rules_[spv::Op::OpFUnordNotEqual].push_back(FoldFUnordNotEqual()); - rules_[SpvOpFOrdLessThan].push_back(FoldFOrdLessThan()); - rules_[SpvOpFOrdLessThan].push_back( - FoldFClampFeedingCompare(SpvOpFOrdLessThan)); + rules_[spv::Op::OpFOrdLessThan].push_back(FoldFOrdLessThan()); + rules_[spv::Op::OpFOrdLessThan].push_back( + FoldFClampFeedingCompare(spv::Op::OpFOrdLessThan)); - rules_[SpvOpFUnordLessThan].push_back(FoldFUnordLessThan()); - rules_[SpvOpFUnordLessThan].push_back( - FoldFClampFeedingCompare(SpvOpFUnordLessThan)); + rules_[spv::Op::OpFUnordLessThan].push_back(FoldFUnordLessThan()); + rules_[spv::Op::OpFUnordLessThan].push_back( + FoldFClampFeedingCompare(spv::Op::OpFUnordLessThan)); - rules_[SpvOpFOrdGreaterThan].push_back(FoldFOrdGreaterThan()); - rules_[SpvOpFOrdGreaterThan].push_back( - FoldFClampFeedingCompare(SpvOpFOrdGreaterThan)); + rules_[spv::Op::OpFOrdGreaterThan].push_back(FoldFOrdGreaterThan()); + rules_[spv::Op::OpFOrdGreaterThan].push_back( + FoldFClampFeedingCompare(spv::Op::OpFOrdGreaterThan)); - rules_[SpvOpFUnordGreaterThan].push_back(FoldFUnordGreaterThan()); - rules_[SpvOpFUnordGreaterThan].push_back( - FoldFClampFeedingCompare(SpvOpFUnordGreaterThan)); + rules_[spv::Op::OpFUnordGreaterThan].push_back(FoldFUnordGreaterThan()); + rules_[spv::Op::OpFUnordGreaterThan].push_back( + FoldFClampFeedingCompare(spv::Op::OpFUnordGreaterThan)); - rules_[SpvOpFOrdLessThanEqual].push_back(FoldFOrdLessThanEqual()); - rules_[SpvOpFOrdLessThanEqual].push_back( - FoldFClampFeedingCompare(SpvOpFOrdLessThanEqual)); + rules_[spv::Op::OpFOrdLessThanEqual].push_back(FoldFOrdLessThanEqual()); + rules_[spv::Op::OpFOrdLessThanEqual].push_back( + FoldFClampFeedingCompare(spv::Op::OpFOrdLessThanEqual)); - rules_[SpvOpFUnordLessThanEqual].push_back(FoldFUnordLessThanEqual()); - rules_[SpvOpFUnordLessThanEqual].push_back( - FoldFClampFeedingCompare(SpvOpFUnordLessThanEqual)); + rules_[spv::Op::OpFUnordLessThanEqual].push_back(FoldFUnordLessThanEqual()); + rules_[spv::Op::OpFUnordLessThanEqual].push_back( + FoldFClampFeedingCompare(spv::Op::OpFUnordLessThanEqual)); - rules_[SpvOpFOrdGreaterThanEqual].push_back(FoldFOrdGreaterThanEqual()); - rules_[SpvOpFOrdGreaterThanEqual].push_back( - FoldFClampFeedingCompare(SpvOpFOrdGreaterThanEqual)); + rules_[spv::Op::OpFOrdGreaterThanEqual].push_back(FoldFOrdGreaterThanEqual()); + rules_[spv::Op::OpFOrdGreaterThanEqual].push_back( + FoldFClampFeedingCompare(spv::Op::OpFOrdGreaterThanEqual)); - rules_[SpvOpFUnordGreaterThanEqual].push_back(FoldFUnordGreaterThanEqual()); - rules_[SpvOpFUnordGreaterThanEqual].push_back( - FoldFClampFeedingCompare(SpvOpFUnordGreaterThanEqual)); + rules_[spv::Op::OpFUnordGreaterThanEqual].push_back( + FoldFUnordGreaterThanEqual()); + rules_[spv::Op::OpFUnordGreaterThanEqual].push_back( + FoldFClampFeedingCompare(spv::Op::OpFUnordGreaterThanEqual)); - rules_[SpvOpVectorShuffle].push_back(FoldVectorShuffleWithConstants()); - rules_[SpvOpVectorTimesScalar].push_back(FoldVectorTimesScalar()); - rules_[SpvOpVectorTimesMatrix].push_back(FoldVectorTimesMatrix()); - rules_[SpvOpMatrixTimesVector].push_back(FoldMatrixTimesVector()); + rules_[spv::Op::OpVectorShuffle].push_back(FoldVectorShuffleWithConstants()); + rules_[spv::Op::OpVectorTimesScalar].push_back(FoldVectorTimesScalar()); + rules_[spv::Op::OpVectorTimesMatrix].push_back(FoldVectorTimesMatrix()); + rules_[spv::Op::OpMatrixTimesVector].push_back(FoldMatrixTimesVector()); - rules_[SpvOpFNegate].push_back(FoldFNegate()); - rules_[SpvOpQuantizeToF16].push_back(FoldQuantizeToF16()); + rules_[spv::Op::OpFNegate].push_back(FoldFNegate()); + rules_[spv::Op::OpQuantizeToF16].push_back(FoldQuantizeToF16()); // Add rules for GLSLstd450 FeatureManager* feature_manager = context_->get_feature_mgr(); diff --git a/3rdparty/spirv-tools/source/opt/const_folding_rules.h b/3rdparty/spirv-tools/source/opt/const_folding_rules.h index 41ee2aa22..fa345321f 100644 --- a/3rdparty/spirv-tools/source/opt/const_folding_rules.h +++ b/3rdparty/spirv-tools/source/opt/const_folding_rules.h @@ -88,7 +88,7 @@ class ConstantFoldingRules { // Returns true if there is at least 1 folding rule for |inst|. const std::vector& GetRulesForInstruction( const Instruction* inst) const { - if (inst->opcode() != SpvOpExtInst) { + if (inst->opcode() != spv::Op::OpExtInst) { auto it = rules_.find(inst->opcode()); if (it != rules_.end()) { return it->second.value; @@ -108,9 +108,15 @@ class ConstantFoldingRules { virtual void AddFoldingRules(); protected: + struct hasher { + size_t operator()(const spv::Op& op) const noexcept { + return std::hash()(uint32_t(op)); + } + }; + // |rules[opcode]| is the set of rules that can be applied to instructions // with |opcode| as the opcode. - std::unordered_map rules_; + std::unordered_map rules_; // The folding rules for extended instructions. std::map ext_rules_; diff --git a/3rdparty/spirv-tools/source/opt/constants.cpp b/3rdparty/spirv-tools/source/opt/constants.cpp index bcff08c13..d70e27bb2 100644 --- a/3rdparty/spirv-tools/source/opt/constants.cpp +++ b/3rdparty/spirv-tools/source/opt/constants.cpp @@ -306,16 +306,16 @@ const Constant* ConstantManager::GetConstantFromInst(const Instruction* inst) { switch (inst->opcode()) { // OpConstant{True|False} have the value embedded in the opcode. So they // are not handled by the for-loop above. Here we add the value explicitly. - case SpvOp::SpvOpConstantTrue: + case spv::Op::OpConstantTrue: literal_words_or_ids.push_back(true); break; - case SpvOp::SpvOpConstantFalse: + case spv::Op::OpConstantFalse: literal_words_or_ids.push_back(false); break; - case SpvOp::SpvOpConstantNull: - case SpvOp::SpvOpConstant: - case SpvOp::SpvOpConstantComposite: - case SpvOp::SpvOpSpecConstantComposite: + case spv::Op::OpConstantNull: + case spv::Op::OpConstant: + case spv::Op::OpConstantComposite: + case spv::Op::OpSpecConstantComposite: break; default: return nullptr; @@ -329,22 +329,22 @@ std::unique_ptr ConstantManager::CreateInstruction( uint32_t type = (type_id == 0) ? context()->get_type_mgr()->GetId(c->type()) : type_id; if (c->AsNullConstant()) { - return MakeUnique(context(), SpvOp::SpvOpConstantNull, type, - id, std::initializer_list{}); + return MakeUnique(context(), spv::Op::OpConstantNull, type, id, + std::initializer_list{}); } else if (const BoolConstant* bc = c->AsBoolConstant()) { return MakeUnique( context(), - bc->value() ? SpvOp::SpvOpConstantTrue : SpvOp::SpvOpConstantFalse, - type, id, std::initializer_list{}); + bc->value() ? spv::Op::OpConstantTrue : spv::Op::OpConstantFalse, type, + id, std::initializer_list{}); } else if (const IntConstant* ic = c->AsIntConstant()) { return MakeUnique( - context(), SpvOp::SpvOpConstant, type, id, + context(), spv::Op::OpConstant, type, id, std::initializer_list{ Operand(spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, ic->words())}); } else if (const FloatConstant* fc = c->AsFloatConstant()) { return MakeUnique( - context(), SpvOp::SpvOpConstant, type, id, + context(), spv::Op::OpConstant, type, id, std::initializer_list{ Operand(spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, fc->words())}); @@ -362,9 +362,9 @@ std::unique_ptr ConstantManager::CreateCompositeInstruction( uint32_t component_index = 0; for (const Constant* component_const : cc->GetComponents()) { uint32_t component_type_id = 0; - if (type_inst && type_inst->opcode() == SpvOpTypeStruct) { + if (type_inst && type_inst->opcode() == spv::Op::OpTypeStruct) { component_type_id = type_inst->GetSingleWordInOperand(component_index); - } else if (type_inst && type_inst->opcode() == SpvOpTypeArray) { + } else if (type_inst && type_inst->opcode() == spv::Op::OpTypeArray) { component_type_id = type_inst->GetSingleWordInOperand(0); } uint32_t id = FindDeclaredConstant(component_const, component_type_id); @@ -381,7 +381,7 @@ std::unique_ptr ConstantManager::CreateCompositeInstruction( } uint32_t type = (type_id == 0) ? context()->get_type_mgr()->GetId(cc->type()) : type_id; - return MakeUnique(context(), SpvOp::SpvOpConstantComposite, type, + return MakeUnique(context(), spv::Op::OpConstantComposite, type, result_id, std::move(operands)); } @@ -391,6 +391,43 @@ const Constant* ConstantManager::GetConstant( return cst ? RegisterConstant(std::move(cst)) : nullptr; } +const Constant* ConstantManager::GetNullCompositeConstant(const Type* type) { + std::vector literal_words_or_id; + + if (type->AsVector()) { + const Type* element_type = type->AsVector()->element_type(); + const uint32_t null_id = GetNullConstId(element_type); + const uint32_t element_count = type->AsVector()->element_count(); + for (uint32_t i = 0; i < element_count; i++) { + literal_words_or_id.push_back(null_id); + } + } else if (type->AsMatrix()) { + const Type* element_type = type->AsMatrix()->element_type(); + const uint32_t null_id = GetNullConstId(element_type); + const uint32_t element_count = type->AsMatrix()->element_count(); + for (uint32_t i = 0; i < element_count; i++) { + literal_words_or_id.push_back(null_id); + } + } else if (type->AsStruct()) { + // TODO (sfricke-lunarg) add proper struct support + return nullptr; + } else if (type->AsArray()) { + const Type* element_type = type->AsArray()->element_type(); + const uint32_t null_id = GetNullConstId(element_type); + assert(type->AsArray()->length_info().words[0] == + analysis::Array::LengthInfo::kConstant && + "unexpected array length"); + const uint32_t element_count = type->AsArray()->length_info().words[0]; + for (uint32_t i = 0; i < element_count; i++) { + literal_words_or_id.push_back(null_id); + } + } else { + return nullptr; + } + + return GetConstant(type, literal_words_or_id); +} + const Constant* ConstantManager::GetNumericVectorConstantWithWords( const Vector* type, const std::vector& literal_words) { const auto* element_type = type->element_type(); @@ -445,18 +482,23 @@ const Constant* ConstantManager::GetDoubleConst(double val) { return c; } -uint32_t ConstantManager::GetSIntConst(int32_t val) { +uint32_t ConstantManager::GetSIntConstId(int32_t val) { Type* sint_type = context()->get_type_mgr()->GetSIntType(); const Constant* c = GetConstant(sint_type, {static_cast(val)}); return GetDefiningInstruction(c)->result_id(); } -uint32_t ConstantManager::GetUIntConst(uint32_t val) { +uint32_t ConstantManager::GetUIntConstId(uint32_t val) { Type* uint_type = context()->get_type_mgr()->GetUIntType(); const Constant* c = GetConstant(uint_type, {val}); return GetDefiningInstruction(c)->result_id(); } +uint32_t ConstantManager::GetNullConstId(const Type* type) { + const Constant* c = GetConstant(type, {}); + return GetDefiningInstruction(c)->result_id(); +} + std::vector Constant::GetVectorComponents( analysis::ConstantManager* const_mgr) const { std::vector components; diff --git a/3rdparty/spirv-tools/source/opt/constants.h b/3rdparty/spirv-tools/source/opt/constants.h index 620991efa..6b123bd92 100644 --- a/3rdparty/spirv-tools/source/opt/constants.h +++ b/3rdparty/spirv-tools/source/opt/constants.h @@ -520,6 +520,14 @@ class ConstantManager { literal_words_or_ids.end())); } + // Takes a type and creates a OpConstantComposite + // This allows a + // OpConstantNull %composite_type + // to become a + // OpConstantComposite %composite_type %null %null ... etc + // Assumes type is a Composite already, otherwise returns null + const Constant* GetNullCompositeConstant(const Type* type); + // Gets or creates a unique Constant instance of Vector type |type| with // numeric elements and a vector of constant defining words |literal_words|. // If a Constant instance existed already in the constant pool, it returns a @@ -649,10 +657,13 @@ class ConstantManager { const Constant* GetDoubleConst(double val); // Returns the id of a 32-bit signed integer constant with value |val|. - uint32_t GetSIntConst(int32_t val); + uint32_t GetSIntConstId(int32_t val); // Returns the id of a 32-bit unsigned integer constant with value |val|. - uint32_t GetUIntConst(uint32_t val); + uint32_t GetUIntConstId(uint32_t val); + + // Returns the id of a OpConstantNull with type of |type|. + uint32_t GetNullConstId(const Type* type); private: // Creates a Constant instance with the given type and a vector of constant diff --git a/3rdparty/spirv-tools/source/opt/control_dependence.cpp b/3rdparty/spirv-tools/source/opt/control_dependence.cpp index f4879e0f3..a153cabfc 100644 --- a/3rdparty/spirv-tools/source/opt/control_dependence.cpp +++ b/3rdparty/spirv-tools/source/opt/control_dependence.cpp @@ -24,7 +24,6 @@ #include "source/opt/dominator_analysis.h" #include "source/opt/function.h" #include "source/opt/instruction.h" -#include "spirv/unified1/spirv.h" // Computes the control dependence graph (CDG) using the algorithm in Cytron // 1991, "Efficiently Computing Static Single Assignment Form and the Control @@ -49,8 +48,8 @@ uint32_t ControlDependence::GetConditionID(const CFG& cfg) const { } const BasicBlock* source_bb = cfg.block(source_bb_id()); const Instruction* branch = source_bb->terminator(); - assert((branch->opcode() == SpvOpBranchConditional || - branch->opcode() == SpvOpSwitch) && + assert((branch->opcode() == spv::Op::OpBranchConditional || + branch->opcode() == spv::Op::OpSwitch) && "invalid control dependence; last instruction must be conditional " "branch or switch"); return branch->GetSingleWordInOperand(0); diff --git a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp index 4086e31ac..7a4c1f409 100644 --- a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp @@ -18,19 +18,16 @@ #include "source/opt/ir_builder.h" -namespace { - -// Indices of operands in SPIR-V instructions -static const int kImageSampleDrefIdInIdx = 2; - -} // anonymous namespace - namespace spvtools { namespace opt { +namespace { +// Indices of operands in SPIR-V instructions +constexpr int kImageSampleDrefIdInIdx = 2; +} // namespace bool ConvertToHalfPass::IsArithmetic(Instruction* inst) { return target_ops_core_.count(inst->opcode()) != 0 || - (inst->opcode() == SpvOpExtInst && + (inst->opcode() == spv::Op::OpExtInst && inst->GetSingleWordInOperand(0) == context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450() && target_ops_450_.count(inst->GetSingleWordInOperand(1)) != 0); @@ -45,9 +42,11 @@ bool ConvertToHalfPass::IsFloat(Instruction* inst, uint32_t width) { bool ConvertToHalfPass::IsDecoratedRelaxed(Instruction* inst) { uint32_t r_id = inst->result_id(); for (auto r_inst : get_decoration_mgr()->GetDecorationsFor(r_id, false)) - if (r_inst->opcode() == SpvOpDecorate && - r_inst->GetSingleWordInOperand(1) == SpvDecorationRelaxedPrecision) + if (r_inst->opcode() == spv::Op::OpDecorate && + spv::Decoration(r_inst->GetSingleWordInOperand(1)) == + spv::Decoration::RelaxedPrecision) { return true; + } return false; } @@ -82,12 +81,12 @@ analysis::Type* ConvertToHalfPass::FloatMatrixType(uint32_t v_cnt, uint32_t ConvertToHalfPass::EquivFloatTypeId(uint32_t ty_id, uint32_t width) { analysis::Type* reg_equiv_ty; Instruction* ty_inst = get_def_use_mgr()->GetDef(ty_id); - if (ty_inst->opcode() == SpvOpTypeMatrix) + if (ty_inst->opcode() == spv::Op::OpTypeMatrix) reg_equiv_ty = FloatMatrixType(ty_inst->GetSingleWordInOperand(1), ty_inst->GetSingleWordInOperand(0), width); - else if (ty_inst->opcode() == SpvOpTypeVector) + else if (ty_inst->opcode() == spv::Op::OpTypeVector) reg_equiv_ty = FloatVectorType(ty_inst->GetSingleWordInOperand(1), width); - else // SpvOpTypeFloat + else // spv::Op::OpTypeFloat reg_equiv_ty = FloatScalarType(width); return context()->get_type_mgr()->GetTypeInstruction(reg_equiv_ty); } @@ -102,18 +101,18 @@ void ConvertToHalfPass::GenConvert(uint32_t* val_idp, uint32_t width, InstructionBuilder builder( context(), inst, IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - if (val_inst->opcode() == SpvOpUndef) - cvt_inst = builder.AddNullaryOp(nty_id, SpvOpUndef); + if (val_inst->opcode() == spv::Op::OpUndef) + cvt_inst = builder.AddNullaryOp(nty_id, spv::Op::OpUndef); else - cvt_inst = builder.AddUnaryOp(nty_id, SpvOpFConvert, *val_idp); + cvt_inst = builder.AddUnaryOp(nty_id, spv::Op::OpFConvert, *val_idp); *val_idp = cvt_inst->result_id(); } bool ConvertToHalfPass::MatConvertCleanup(Instruction* inst) { - if (inst->opcode() != SpvOpFConvert) return false; + if (inst->opcode() != spv::Op::OpFConvert) return false; uint32_t mty_id = inst->type_id(); Instruction* mty_inst = get_def_use_mgr()->GetDef(mty_id); - if (mty_inst->opcode() != SpvOpTypeMatrix) return false; + if (mty_inst->opcode() != spv::Op::OpTypeMatrix) return false; uint32_t vty_id = mty_inst->GetSingleWordInOperand(0); uint32_t v_cnt = mty_inst->GetSingleWordInOperand(1); Instruction* vty_inst = get_def_use_mgr()->GetDef(vty_id); @@ -130,18 +129,18 @@ bool ConvertToHalfPass::MatConvertCleanup(Instruction* inst) { std::vector opnds = {}; for (uint32_t vidx = 0; vidx < v_cnt; ++vidx) { Instruction* ext_inst = builder.AddIdLiteralOp( - orig_vty_id, SpvOpCompositeExtract, orig_mat_id, vidx); + orig_vty_id, spv::Op::OpCompositeExtract, orig_mat_id, vidx); Instruction* cvt_inst = - builder.AddUnaryOp(vty_id, SpvOpFConvert, ext_inst->result_id()); + builder.AddUnaryOp(vty_id, spv::Op::OpFConvert, ext_inst->result_id()); opnds.push_back({SPV_OPERAND_TYPE_ID, {cvt_inst->result_id()}}); } uint32_t mat_id = TakeNextId(); std::unique_ptr mat_inst(new Instruction( - context(), SpvOpCompositeConstruct, mty_id, mat_id, opnds)); + context(), spv::Op::OpCompositeConstruct, mty_id, mat_id, opnds)); (void)builder.AddInstruction(std::move(mat_inst)); context()->ReplaceAllUsesWith(inst->result_id(), mat_id); // Turn original instruction into copy so it is valid. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetResultType(EquivFloatTypeId(mty_id, orig_width)); get_def_use_mgr()->AnalyzeInstUse(inst); return true; @@ -150,10 +149,11 @@ bool ConvertToHalfPass::MatConvertCleanup(Instruction* inst) { bool ConvertToHalfPass::RemoveRelaxedDecoration(uint32_t id) { return context()->get_decoration_mgr()->RemoveDecorationsFrom( id, [](const Instruction& dec) { - if (dec.opcode() == SpvOpDecorate && - dec.GetSingleWordInOperand(1u) == SpvDecorationRelaxedPrecision) + if (dec.opcode() == spv::Op::OpDecorate && + spv::Decoration(dec.GetSingleWordInOperand(1u)) == + spv::Decoration::RelaxedPrecision) { return true; - else + } else return false; }); } @@ -196,8 +196,8 @@ bool ConvertToHalfPass::ProcessPhi(Instruction* inst, uint32_t from_width, auto insert_before = bp->tail(); if (insert_before != bp->begin()) { --insert_before; - if (insert_before->opcode() != SpvOpSelectionMerge && - insert_before->opcode() != SpvOpLoopMerge) + if (insert_before->opcode() != spv::Op::OpSelectionMerge && + insert_before->opcode() != spv::Op::OpLoopMerge) ++insert_before; } GenConvert(prev_idp, to_width, &*insert_before); @@ -229,7 +229,8 @@ bool ConvertToHalfPass::ProcessConvert(Instruction* inst) { // changed to half. uint32_t val_id = inst->GetSingleWordInOperand(0); Instruction* val_inst = get_def_use_mgr()->GetDef(val_id); - if (inst->type_id() == val_inst->type_id()) inst->SetOpcode(SpvOpCopyObject); + if (inst->type_id() == val_inst->type_id()) + inst->SetOpcode(spv::Op::OpCopyObject); return true; // modified } @@ -251,7 +252,7 @@ bool ConvertToHalfPass::ProcessImageRef(Instruction* inst) { bool ConvertToHalfPass::ProcessDefault(Instruction* inst) { // If non-relaxed instruction has changed operands, need to convert // them back to float32 - if (inst->opcode() == SpvOpPhi) return ProcessPhi(inst, 16u, 32u); + if (inst->opcode() == spv::Op::OpPhi) return ProcessPhi(inst, 16u, 32u); bool modified = false; inst->ForEachInId([&inst, &modified, this](uint32_t* idp) { if (converted_ids_.count(*idp) == 0) return; @@ -269,9 +270,9 @@ bool ConvertToHalfPass::GenHalfInst(Instruction* inst) { bool inst_relaxed = IsRelaxed(inst->result_id()); if (IsArithmetic(inst) && inst_relaxed) modified = GenHalfArith(inst); - else if (inst->opcode() == SpvOpPhi && inst_relaxed) + else if (inst->opcode() == spv::Op::OpPhi && inst_relaxed) modified = ProcessPhi(inst, 32u, 16u); - else if (inst->opcode() == SpvOpFConvert) + else if (inst->opcode() == spv::Op::OpFConvert) modified = ProcessConvert(inst); else if (image_ops_.count(inst->opcode()) != 0) modified = ProcessImageRef(inst); @@ -350,7 +351,7 @@ Pass::Status ConvertToHalfPass::ProcessImpl() { }; bool modified = context()->ProcessReachableCallTree(pfn); // If modified, make sure module has Float16 capability - if (modified) context()->AddCapability(SpvCapabilityFloat16); + if (modified) context()->AddCapability(spv::Capability::Float16); // Remove all RelaxedPrecision decorations from instructions and globals for (auto c_id : relaxed_ids_set_) { modified |= RemoveRelaxedDecoration(c_id); @@ -371,44 +372,44 @@ Pass::Status ConvertToHalfPass::Process() { void ConvertToHalfPass::Initialize() { target_ops_core_ = { - SpvOpVectorExtractDynamic, - SpvOpVectorInsertDynamic, - SpvOpVectorShuffle, - SpvOpCompositeConstruct, - SpvOpCompositeInsert, - SpvOpCompositeExtract, - SpvOpCopyObject, - SpvOpTranspose, - SpvOpConvertSToF, - SpvOpConvertUToF, - // SpvOpFConvert, - // SpvOpQuantizeToF16, - SpvOpFNegate, - SpvOpFAdd, - SpvOpFSub, - SpvOpFMul, - SpvOpFDiv, - SpvOpFMod, - SpvOpVectorTimesScalar, - SpvOpMatrixTimesScalar, - SpvOpVectorTimesMatrix, - SpvOpMatrixTimesVector, - SpvOpMatrixTimesMatrix, - SpvOpOuterProduct, - SpvOpDot, - SpvOpSelect, - SpvOpFOrdEqual, - SpvOpFUnordEqual, - SpvOpFOrdNotEqual, - SpvOpFUnordNotEqual, - SpvOpFOrdLessThan, - SpvOpFUnordLessThan, - SpvOpFOrdGreaterThan, - SpvOpFUnordGreaterThan, - SpvOpFOrdLessThanEqual, - SpvOpFUnordLessThanEqual, - SpvOpFOrdGreaterThanEqual, - SpvOpFUnordGreaterThanEqual, + spv::Op::OpVectorExtractDynamic, + spv::Op::OpVectorInsertDynamic, + spv::Op::OpVectorShuffle, + spv::Op::OpCompositeConstruct, + spv::Op::OpCompositeInsert, + spv::Op::OpCompositeExtract, + spv::Op::OpCopyObject, + spv::Op::OpTranspose, + spv::Op::OpConvertSToF, + spv::Op::OpConvertUToF, + // spv::Op::OpFConvert, + // spv::Op::OpQuantizeToF16, + spv::Op::OpFNegate, + spv::Op::OpFAdd, + spv::Op::OpFSub, + spv::Op::OpFMul, + spv::Op::OpFDiv, + spv::Op::OpFMod, + spv::Op::OpVectorTimesScalar, + spv::Op::OpMatrixTimesScalar, + spv::Op::OpVectorTimesMatrix, + spv::Op::OpMatrixTimesVector, + spv::Op::OpMatrixTimesMatrix, + spv::Op::OpOuterProduct, + spv::Op::OpDot, + spv::Op::OpSelect, + spv::Op::OpFOrdEqual, + spv::Op::OpFUnordEqual, + spv::Op::OpFOrdNotEqual, + spv::Op::OpFUnordNotEqual, + spv::Op::OpFOrdLessThan, + spv::Op::OpFUnordLessThan, + spv::Op::OpFOrdGreaterThan, + spv::Op::OpFUnordGreaterThan, + spv::Op::OpFOrdLessThanEqual, + spv::Op::OpFUnordLessThanEqual, + spv::Op::OpFOrdGreaterThanEqual, + spv::Op::OpFUnordGreaterThanEqual, }; target_ops_450_ = { GLSLstd450Round, GLSLstd450RoundEven, GLSLstd450Trunc, GLSLstd450FAbs, @@ -427,53 +428,53 @@ void ConvertToHalfPass::Initialize() { GLSLstd450Ldexp, GLSLstd450Length, GLSLstd450Distance, GLSLstd450Cross, GLSLstd450Normalize, GLSLstd450FaceForward, GLSLstd450Reflect, GLSLstd450Refract, GLSLstd450NMin, GLSLstd450NMax, GLSLstd450NClamp}; - image_ops_ = {SpvOpImageSampleImplicitLod, - SpvOpImageSampleExplicitLod, - SpvOpImageSampleDrefImplicitLod, - SpvOpImageSampleDrefExplicitLod, - SpvOpImageSampleProjImplicitLod, - SpvOpImageSampleProjExplicitLod, - SpvOpImageSampleProjDrefImplicitLod, - SpvOpImageSampleProjDrefExplicitLod, - SpvOpImageFetch, - SpvOpImageGather, - SpvOpImageDrefGather, - SpvOpImageRead, - SpvOpImageSparseSampleImplicitLod, - SpvOpImageSparseSampleExplicitLod, - SpvOpImageSparseSampleDrefImplicitLod, - SpvOpImageSparseSampleDrefExplicitLod, - SpvOpImageSparseSampleProjImplicitLod, - SpvOpImageSparseSampleProjExplicitLod, - SpvOpImageSparseSampleProjDrefImplicitLod, - SpvOpImageSparseSampleProjDrefExplicitLod, - SpvOpImageSparseFetch, - SpvOpImageSparseGather, - SpvOpImageSparseDrefGather, - SpvOpImageSparseTexelsResident, - SpvOpImageSparseRead}; + image_ops_ = {spv::Op::OpImageSampleImplicitLod, + spv::Op::OpImageSampleExplicitLod, + spv::Op::OpImageSampleDrefImplicitLod, + spv::Op::OpImageSampleDrefExplicitLod, + spv::Op::OpImageSampleProjImplicitLod, + spv::Op::OpImageSampleProjExplicitLod, + spv::Op::OpImageSampleProjDrefImplicitLod, + spv::Op::OpImageSampleProjDrefExplicitLod, + spv::Op::OpImageFetch, + spv::Op::OpImageGather, + spv::Op::OpImageDrefGather, + spv::Op::OpImageRead, + spv::Op::OpImageSparseSampleImplicitLod, + spv::Op::OpImageSparseSampleExplicitLod, + spv::Op::OpImageSparseSampleDrefImplicitLod, + spv::Op::OpImageSparseSampleDrefExplicitLod, + spv::Op::OpImageSparseSampleProjImplicitLod, + spv::Op::OpImageSparseSampleProjExplicitLod, + spv::Op::OpImageSparseSampleProjDrefImplicitLod, + spv::Op::OpImageSparseSampleProjDrefExplicitLod, + spv::Op::OpImageSparseFetch, + spv::Op::OpImageSparseGather, + spv::Op::OpImageSparseDrefGather, + spv::Op::OpImageSparseTexelsResident, + spv::Op::OpImageSparseRead}; dref_image_ops_ = { - SpvOpImageSampleDrefImplicitLod, - SpvOpImageSampleDrefExplicitLod, - SpvOpImageSampleProjDrefImplicitLod, - SpvOpImageSampleProjDrefExplicitLod, - SpvOpImageDrefGather, - SpvOpImageSparseSampleDrefImplicitLod, - SpvOpImageSparseSampleDrefExplicitLod, - SpvOpImageSparseSampleProjDrefImplicitLod, - SpvOpImageSparseSampleProjDrefExplicitLod, - SpvOpImageSparseDrefGather, + spv::Op::OpImageSampleDrefImplicitLod, + spv::Op::OpImageSampleDrefExplicitLod, + spv::Op::OpImageSampleProjDrefImplicitLod, + spv::Op::OpImageSampleProjDrefExplicitLod, + spv::Op::OpImageDrefGather, + spv::Op::OpImageSparseSampleDrefImplicitLod, + spv::Op::OpImageSparseSampleDrefExplicitLod, + spv::Op::OpImageSparseSampleProjDrefImplicitLod, + spv::Op::OpImageSparseSampleProjDrefExplicitLod, + spv::Op::OpImageSparseDrefGather, }; closure_ops_ = { - SpvOpVectorExtractDynamic, - SpvOpVectorInsertDynamic, - SpvOpVectorShuffle, - SpvOpCompositeConstruct, - SpvOpCompositeInsert, - SpvOpCompositeExtract, - SpvOpCopyObject, - SpvOpTranspose, - SpvOpPhi, + spv::Op::OpVectorExtractDynamic, + spv::Op::OpVectorInsertDynamic, + spv::Op::OpVectorShuffle, + spv::Op::OpCompositeConstruct, + spv::Op::OpCompositeInsert, + spv::Op::OpCompositeExtract, + spv::Op::OpCopyObject, + spv::Op::OpTranspose, + spv::Op::OpPhi, }; relaxed_ids_set_.clear(); converted_ids_.clear(); diff --git a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h index c6e84d1b7..feabfba3e 100644 --- a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h +++ b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h @@ -120,20 +120,26 @@ class ConvertToHalfPass : public Pass { // Initialize state for converting to half void Initialize(); + struct hasher { + size_t operator()(const spv::Op& op) const noexcept { + return std::hash()(uint32_t(op)); + } + }; + // Set of core operations to be processed - std::unordered_set target_ops_core_; + std::unordered_set target_ops_core_; // Set of 450 extension operations to be processed std::unordered_set target_ops_450_; // Set of sample operations - std::unordered_set image_ops_; + std::unordered_set image_ops_; // Set of dref sample operations - std::unordered_set dref_image_ops_; + std::unordered_set dref_image_ops_; // Set of dref sample operations - std::unordered_set closure_ops_; + std::unordered_set closure_ops_; // Set of ids of all relaxed instructions std::unordered_set relaxed_ids_set_; diff --git a/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp b/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp index e84d3578a..2effc3e4c 100644 --- a/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp @@ -70,7 +70,7 @@ uint32_t GetImageTypeOfSampledImage(analysis::TypeManager* type_mgr, Instruction* GetNonCopyObjectDef(analysis::DefUseManager* def_use_mgr, uint32_t inst_id) { Instruction* inst = def_use_mgr->GetDef(inst_id); - while (inst->opcode() == SpvOpCopyObject) { + while (inst->opcode() == spv::Op::OpCopyObject) { inst_id = inst->GetSingleWordInOperand(0u); inst = def_use_mgr->GetDef(inst_id); } @@ -87,8 +87,9 @@ bool ConvertToSampledImagePass::GetDescriptorSetBinding( bool found_binding_to_convert = false; for (auto decorate : decoration_manager->GetDecorationsFor(inst.result_id(), false)) { - uint32_t decoration = decorate->GetSingleWordInOperand(1u); - if (decoration == SpvDecorationDescriptorSet) { + spv::Decoration decoration = + spv::Decoration(decorate->GetSingleWordInOperand(1u)); + if (decoration == spv::Decoration::DescriptorSet) { if (found_descriptor_set_to_convert) { assert(false && "A resource has two OpDecorate for the descriptor set"); return false; @@ -96,7 +97,7 @@ bool ConvertToSampledImagePass::GetDescriptorSetBinding( descriptor_set_binding->descriptor_set = decorate->GetSingleWordInOperand(2u); found_descriptor_set_to_convert = true; - } else if (decoration == SpvDecorationBinding) { + } else if (decoration == spv::Decoration::Binding) { if (found_binding_to_convert) { assert(false && "A resource has two OpDecorate for the binding"); return false; @@ -116,7 +117,7 @@ bool ConvertToSampledImagePass::ShouldResourceBeConverted( const analysis::Type* ConvertToSampledImagePass::GetVariableType( const Instruction& variable) const { - if (variable.opcode() != SpvOpVariable) return nullptr; + if (variable.opcode() != spv::Op::OpVariable) return nullptr; auto* type = context()->get_type_mgr()->GetType(variable.type_id()); auto* pointer_type = type->AsPointer(); if (!pointer_type) return nullptr; @@ -124,12 +125,12 @@ const analysis::Type* ConvertToSampledImagePass::GetVariableType( return pointer_type->pointee_type(); } -SpvStorageClass ConvertToSampledImagePass::GetStorageClass( +spv::StorageClass ConvertToSampledImagePass::GetStorageClass( const Instruction& variable) const { - assert(variable.opcode() == SpvOpVariable); + assert(variable.opcode() == spv::Op::OpVariable); auto* type = context()->get_type_mgr()->GetType(variable.type_id()); auto* pointer_type = type->AsPointer(); - if (!pointer_type) return SpvStorageClassMax; + if (!pointer_type) return spv::StorageClass::Max; return pointer_type->storage_class(); } @@ -205,12 +206,12 @@ Pass::Status ConvertToSampledImagePass::Process() { void ConvertToSampledImagePass::FindUses(const Instruction* inst, std::vector* uses, - uint32_t user_opcode) const { + spv::Op user_opcode) const { auto* def_use_mgr = context()->get_def_use_mgr(); def_use_mgr->ForEachUser(inst, [uses, user_opcode, this](Instruction* user) { if (user->opcode() == user_opcode) { uses->push_back(user); - } else if (user->opcode() == SpvOpCopyObject) { + } else if (user->opcode() == spv::Op::OpCopyObject) { FindUses(user, uses, user_opcode); } }); @@ -221,21 +222,21 @@ void ConvertToSampledImagePass::FindUsesOfImage( auto* def_use_mgr = context()->get_def_use_mgr(); def_use_mgr->ForEachUser(image, [uses, this](Instruction* user) { switch (user->opcode()) { - case SpvOpImageFetch: - case SpvOpImageRead: - case SpvOpImageWrite: - case SpvOpImageQueryFormat: - case SpvOpImageQueryOrder: - case SpvOpImageQuerySizeLod: - case SpvOpImageQuerySize: - case SpvOpImageQueryLevels: - case SpvOpImageQuerySamples: - case SpvOpImageSparseFetch: + case spv::Op::OpImageFetch: + case spv::Op::OpImageRead: + case spv::Op::OpImageWrite: + case spv::Op::OpImageQueryFormat: + case spv::Op::OpImageQueryOrder: + case spv::Op::OpImageQuerySizeLod: + case spv::Op::OpImageQuerySize: + case spv::Op::OpImageQueryLevels: + case spv::Op::OpImageQuerySamples: + case spv::Op::OpImageSparseFetch: uses->push_back(user); default: break; } - if (user->opcode() == SpvOpCopyObject) { + if (user->opcode() == spv::Op::OpCopyObject) { FindUsesOfImage(user, uses); } }); @@ -248,7 +249,7 @@ Instruction* ConvertToSampledImagePass::CreateImageExtraction( IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); return builder.AddUnaryOp( GetImageTypeOfSampledImage(context()->get_type_mgr(), sampled_image), - SpvOpImage, sampled_image->result_id()); + spv::Op::OpImage, sampled_image->result_id()); } uint32_t ConvertToSampledImagePass::GetSampledImageTypeForImage( @@ -284,7 +285,7 @@ bool ConvertToSampledImagePass:: auto* def_use_mgr = context()->get_def_use_mgr(); uint32_t sampler_id = sampled_image_inst->GetSingleWordInOperand(1u); auto* sampler_load = def_use_mgr->GetDef(sampler_id); - if (sampler_load->opcode() != SpvOpLoad) return false; + if (sampler_load->opcode() != spv::Op::OpLoad) return false; auto* sampler = def_use_mgr->GetDef(sampler_load->GetSingleWordInOperand(0u)); DescriptorSetAndBinding sampler_descriptor_set_binding; return GetDescriptorSetBinding(*sampler, &sampler_descriptor_set_binding) && @@ -295,7 +296,7 @@ void ConvertToSampledImagePass::UpdateSampledImageUses( Instruction* image_load, Instruction* image_extraction, const DescriptorSetAndBinding& image_descriptor_set_binding) { std::vector sampled_image_users; - FindUses(image_load, &sampled_image_users, SpvOpSampledImage); + FindUses(image_load, &sampled_image_users, spv::Op::OpSampledImage); auto* def_use_mgr = context()->get_def_use_mgr(); for (auto* sampled_image_inst : sampled_image_users) { @@ -328,7 +329,7 @@ bool ConvertToSampledImagePass::ConvertImageVariableToSampledImage( context()->get_type_mgr()->GetType(sampled_image_type_id); if (sampled_image_type == nullptr) return false; auto storage_class = GetStorageClass(*image_variable); - if (storage_class == SpvStorageClassMax) return false; + if (storage_class == spv::StorageClass::Max) return false; analysis::Pointer sampled_image_pointer(sampled_image_type, storage_class); // Make sure |image_variable| is behind its type i.e., avoid the forward @@ -343,7 +344,7 @@ Pass::Status ConvertToSampledImagePass::UpdateImageVariableToSampledImage( Instruction* image_variable, const DescriptorSetAndBinding& descriptor_set_binding) { std::vector image_variable_loads; - FindUses(image_variable, &image_variable_loads, SpvOpLoad); + FindUses(image_variable, &image_variable_loads, spv::Op::OpLoad); if (image_variable_loads.empty()) return Status::SuccessWithoutChange; const uint32_t sampled_image_type_id = @@ -364,14 +365,14 @@ Pass::Status ConvertToSampledImagePass::UpdateImageVariableToSampledImage( bool ConvertToSampledImagePass::DoesSampledImageReferenceImage( Instruction* sampled_image_inst, Instruction* image_variable) { - if (sampled_image_inst->opcode() != SpvOpSampledImage) return false; + if (sampled_image_inst->opcode() != spv::Op::OpSampledImage) return false; auto* def_use_mgr = context()->get_def_use_mgr(); auto* image_load = GetNonCopyObjectDef( def_use_mgr, sampled_image_inst->GetSingleWordInOperand(0u)); - if (image_load->opcode() != SpvOpLoad) return false; + if (image_load->opcode() != spv::Op::OpLoad) return false; auto* image = GetNonCopyObjectDef(def_use_mgr, image_load->GetSingleWordInOperand(0u)); - return image->opcode() == SpvOpVariable && + return image->opcode() == spv::Op::OpVariable && image->result_id() == image_variable->result_id(); } @@ -381,10 +382,10 @@ Pass::Status ConvertToSampledImagePass::CheckUsesOfSamplerVariable( if (image_to_be_combined_with == nullptr) return Status::Failure; std::vector sampler_variable_loads; - FindUses(sampler_variable, &sampler_variable_loads, SpvOpLoad); + FindUses(sampler_variable, &sampler_variable_loads, spv::Op::OpLoad); for (auto* load : sampler_variable_loads) { std::vector sampled_image_users; - FindUses(load, &sampled_image_users, SpvOpSampledImage); + FindUses(load, &sampled_image_users, spv::Op::OpSampledImage); for (auto* sampled_image_inst : sampled_image_users) { if (!DoesSampledImageReferenceImage(sampled_image_inst, image_to_be_combined_with)) { diff --git a/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.h b/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.h index d3938af7d..a8b1501e6 100644 --- a/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.h +++ b/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.h @@ -120,13 +120,13 @@ class ConvertToSampledImagePass : public Pass { const analysis::Type* GetVariableType(const Instruction& variable) const; // Returns the storage class of |variable|. - SpvStorageClass GetStorageClass(const Instruction& variable) const; + spv::StorageClass GetStorageClass(const Instruction& variable) const; // Finds |inst|'s users whose opcode is |user_opcode| or users of OpCopyObject // instructions of |inst| whose opcode is |user_opcode| and puts them in // |uses|. void FindUses(const Instruction* inst, std::vector* uses, - uint32_t user_opcode) const; + spv::Op user_opcode) const; // Finds OpImage* instructions using |image| or OpCopyObject instructions that // copy |image| and puts them in |uses|. diff --git a/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp b/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp index 0b235629b..66a268fba 100644 --- a/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp +++ b/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp @@ -22,12 +22,12 @@ namespace spvtools { namespace opt { namespace { -const uint32_t kLoadPointerInOperand = 0; -const uint32_t kStorePointerInOperand = 0; -const uint32_t kStoreObjectInOperand = 1; -const uint32_t kCompositeExtractObjectInOperand = 0; -const uint32_t kTypePointerStorageClassInIdx = 0; -const uint32_t kTypePointerPointeeInIdx = 1; +constexpr uint32_t kLoadPointerInOperand = 0; +constexpr uint32_t kStorePointerInOperand = 0; +constexpr uint32_t kStoreObjectInOperand = 1; +constexpr uint32_t kCompositeExtractObjectInOperand = 0; +constexpr uint32_t kTypePointerStorageClassInIdx = 0; +constexpr uint32_t kTypePointerPointeeInIdx = 1; bool IsDebugDeclareOrValue(Instruction* di) { auto dbg_opcode = di->GetCommonDebugOpcode(); @@ -46,8 +46,8 @@ Pass::Status CopyPropagateArrays::Process() { BasicBlock* entry_bb = &*function.begin(); - for (auto var_inst = entry_bb->begin(); var_inst->opcode() == SpvOpVariable; - ++var_inst) { + for (auto var_inst = entry_bb->begin(); + var_inst->opcode() == spv::Op::OpVariable; ++var_inst) { if (!IsPointerToArrayType(var_inst->type_id())) { continue; } @@ -76,7 +76,7 @@ Pass::Status CopyPropagateArrays::Process() { std::unique_ptr CopyPropagateArrays::FindSourceObjectIfPossible(Instruction* var_inst, Instruction* store_inst) { - assert(var_inst->opcode() == SpvOpVariable && "Expecting a variable."); + assert(var_inst->opcode() == spv::Op::OpVariable && "Expecting a variable."); // Check that the variable is a composite object where |store_inst| // dominates all of its loads. @@ -114,7 +114,7 @@ Instruction* CopyPropagateArrays::FindStoreInstruction( Instruction* store_inst = nullptr; get_def_use_mgr()->WhileEachUser( var_inst, [&store_inst, var_inst](Instruction* use) { - if (use->opcode() == SpvOpStore && + if (use->opcode() == spv::Op::OpStore && use->GetSingleWordInOperand(kStorePointerInOperand) == var_inst->result_id()) { if (store_inst == nullptr) { @@ -132,7 +132,7 @@ Instruction* CopyPropagateArrays::FindStoreInstruction( void CopyPropagateArrays::PropagateObject(Instruction* var_inst, MemoryObject* source, Instruction* insertion_point) { - assert(var_inst->opcode() == SpvOpVariable && + assert(var_inst->opcode() == spv::Op::OpVariable && "This function propagates variables."); Instruction* new_access_chain = BuildNewAccessChain(insertion_point, source); @@ -166,17 +166,17 @@ Instruction* CopyPropagateArrays::BuildNewAccessChain( bool CopyPropagateArrays::HasNoStores(Instruction* ptr_inst) { return get_def_use_mgr()->WhileEachUser(ptr_inst, [this](Instruction* use) { - if (use->opcode() == SpvOpLoad) { + if (use->opcode() == spv::Op::OpLoad) { return true; - } else if (use->opcode() == SpvOpAccessChain) { + } else if (use->opcode() == spv::Op::OpAccessChain) { return HasNoStores(use); - } else if (use->IsDecoration() || use->opcode() == SpvOpName) { + } else if (use->IsDecoration() || use->opcode() == spv::Op::OpName) { return true; - } else if (use->opcode() == SpvOpStore) { + } else if (use->opcode() == spv::Op::OpStore) { return false; - } else if (use->opcode() == SpvOpImageTexelPointer) { + } else if (use->opcode() == spv::Op::OpImageTexelPointer) { return true; - } else if (use->opcode() == SpvOpEntryPoint) { + } else if (use->opcode() == spv::Op::OpEntryPoint) { return true; } // Some other instruction. Be conservative. @@ -193,19 +193,19 @@ bool CopyPropagateArrays::HasValidReferencesOnly(Instruction* ptr_inst, return get_def_use_mgr()->WhileEachUser( ptr_inst, [this, store_inst, dominator_analysis, ptr_inst](Instruction* use) { - if (use->opcode() == SpvOpLoad || - use->opcode() == SpvOpImageTexelPointer) { + if (use->opcode() == spv::Op::OpLoad || + use->opcode() == spv::Op::OpImageTexelPointer) { // TODO: If there are many load in the same BB as |store_inst| the // time to do the multiple traverses can add up. Consider collecting // those loads and doing a single traversal. return dominator_analysis->Dominates(store_inst, use); - } else if (use->opcode() == SpvOpAccessChain) { + } else if (use->opcode() == spv::Op::OpAccessChain) { return HasValidReferencesOnly(use, store_inst); - } else if (use->IsDecoration() || use->opcode() == SpvOpName) { + } else if (use->IsDecoration() || use->opcode() == spv::Op::OpName) { return true; - } else if (use->opcode() == SpvOpStore) { + } else if (use->opcode() == spv::Op::OpStore) { // If we are storing to part of the object it is not an candidate. - return ptr_inst->opcode() == SpvOpVariable && + return ptr_inst->opcode() == spv::Op::OpVariable && store_inst->GetSingleWordInOperand(kStorePointerInOperand) == ptr_inst->result_id(); } else if (IsDebugDeclareOrValue(use)) { @@ -221,15 +221,15 @@ CopyPropagateArrays::GetSourceObjectIfAny(uint32_t result) { Instruction* result_inst = context()->get_def_use_mgr()->GetDef(result); switch (result_inst->opcode()) { - case SpvOpLoad: + case spv::Op::OpLoad: return BuildMemoryObjectFromLoad(result_inst); - case SpvOpCompositeExtract: + case spv::Op::OpCompositeExtract: return BuildMemoryObjectFromExtract(result_inst); - case SpvOpCompositeConstruct: + case spv::Op::OpCompositeConstruct: return BuildMemoryObjectFromCompositeConstruct(result_inst); - case SpvOpCopyObject: + case spv::Op::OpCopyObject: return GetSourceObjectIfAny(result_inst->GetSingleWordInOperand(0)); - case SpvOpCompositeInsert: + case spv::Op::OpCompositeInsert: return BuildMemoryObjectFromInsert(result_inst); default: return nullptr; @@ -251,7 +251,7 @@ CopyPropagateArrays::BuildMemoryObjectFromLoad(Instruction* load_inst) { // // It is built in reverse order because the different |OpAccessChain| // instructions are visited in reverse order from which they are applied. - while (current_inst->opcode() == SpvOpAccessChain) { + while (current_inst->opcode() == spv::Op::OpAccessChain) { for (uint32_t i = current_inst->NumInOperands() - 1; i >= 1; --i) { uint32_t element_index_id = current_inst->GetSingleWordInOperand(i); components_in_reverse.push_back(element_index_id); @@ -263,7 +263,7 @@ CopyPropagateArrays::BuildMemoryObjectFromLoad(Instruction* load_inst) { // instruction followed by a series of |OpAccessChain| instructions, then // return |nullptr| because we cannot identify the owner or access chain // exactly. - if (current_inst->opcode() != SpvOpVariable) { + if (current_inst->opcode() != spv::Op::OpVariable) { return nullptr; } @@ -276,7 +276,7 @@ CopyPropagateArrays::BuildMemoryObjectFromLoad(Instruction* load_inst) { std::unique_ptr CopyPropagateArrays::BuildMemoryObjectFromExtract(Instruction* extract_inst) { - assert(extract_inst->opcode() == SpvOpCompositeExtract && + assert(extract_inst->opcode() == spv::Op::OpCompositeExtract && "Expecting an OpCompositeExtract instruction."); std::unique_ptr result = GetSourceObjectIfAny( extract_inst->GetSingleWordInOperand(kCompositeExtractObjectInOperand)); @@ -297,7 +297,7 @@ CopyPropagateArrays::BuildMemoryObjectFromExtract(Instruction* extract_inst) { std::unique_ptr CopyPropagateArrays::BuildMemoryObjectFromCompositeConstruct( Instruction* conststruct_inst) { - assert(conststruct_inst->opcode() == SpvOpCompositeConstruct && + assert(conststruct_inst->opcode() == spv::Op::OpCompositeConstruct && "Expecting an OpCompositeConstruct instruction."); // If every operand in the instruction are part of the same memory object, and @@ -352,7 +352,7 @@ CopyPropagateArrays::BuildMemoryObjectFromCompositeConstruct( std::unique_ptr CopyPropagateArrays::BuildMemoryObjectFromInsert(Instruction* insert_inst) { - assert(insert_inst->opcode() == SpvOpCompositeInsert && + assert(insert_inst->opcode() == spv::Op::OpCompositeInsert && "Expecting an OpCompositeInsert instruction."); analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); @@ -407,7 +407,7 @@ CopyPropagateArrays::BuildMemoryObjectFromInsert(Instruction* insert_inst) { Instruction* current_insert = def_use_mgr->GetDef(insert_inst->GetSingleWordInOperand(1)); for (uint32_t i = number_of_elements - 1; i > 0; --i) { - if (current_insert->opcode() != SpvOpCompositeInsert) { + if (current_insert->opcode() != spv::Op::OpCompositeInsert) { return nullptr; } @@ -500,7 +500,7 @@ bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst, if (IsDebugDeclareOrValue(use)) return true; switch (use->opcode()) { - case SpvOpLoad: { + case spv::Op::OpLoad: { analysis::Pointer* pointer_type = type->AsPointer(); uint32_t new_type_id = type_mgr->GetId(pointer_type->pointee_type()); @@ -509,7 +509,7 @@ bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst, } return true; } - case SpvOpAccessChain: { + case spv::Op::OpAccessChain: { analysis::Pointer* pointer_type = type->AsPointer(); const analysis::Type* pointee_type = pointer_type->pointee_type(); @@ -547,7 +547,7 @@ bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst, } return true; } - case SpvOpCompositeExtract: { + case spv::Op::OpCompositeExtract: { std::vector access_chain; for (uint32_t i = 1; i < use->NumInOperands(); ++i) { access_chain.push_back(use->GetSingleWordInOperand(i)); @@ -565,13 +565,13 @@ bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst, } return true; } - case SpvOpStore: + case spv::Op::OpStore: // If needed, we can create an element-by-element copy to change the // type of the value being stored. This way we can always handled // stores. return true; - case SpvOpImageTexelPointer: - case SpvOpName: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpName: return true; default: return use->IsDecoration(); @@ -598,8 +598,8 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, if (use->IsCommonDebugInstr()) { switch (use->GetCommonDebugOpcode()) { case CommonDebugInfoDebugDeclare: { - if (new_ptr_inst->opcode() == SpvOpVariable || - new_ptr_inst->opcode() == SpvOpFunctionParameter) { + if (new_ptr_inst->opcode() == spv::Op::OpVariable || + new_ptr_inst->opcode() == spv::Op::OpFunctionParameter) { context()->ForgetUses(use); use->SetOperand(index, {new_ptr_inst->result_id()}); context()->AnalyzeUses(use); @@ -640,7 +640,7 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, } switch (use->opcode()) { - case SpvOpLoad: { + case spv::Op::OpLoad: { // Replace the actual use. context()->ForgetUses(use); use->SetOperand(index, {new_ptr_inst->result_id()}); @@ -658,7 +658,7 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, context()->AnalyzeUses(use); } } break; - case SpvOpAccessChain: { + case spv::Op::OpAccessChain: { // Update the actual use. context()->ForgetUses(use); use->SetOperand(index, {new_ptr_inst->result_id()}); @@ -685,7 +685,7 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, pointer_type_inst->GetSingleWordInOperand(kTypePointerPointeeInIdx), access_chain); - SpvStorageClass storage_class = static_cast( + spv::StorageClass storage_class = static_cast( pointer_type_inst->GetSingleWordInOperand( kTypePointerStorageClassInIdx)); @@ -700,7 +700,7 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, context()->AnalyzeUses(use); } } break; - case SpvOpCompositeExtract: { + case spv::Op::OpCompositeExtract: { // Update the actual use. context()->ForgetUses(use); use->SetOperand(index, {new_ptr_inst->result_id()}); @@ -721,7 +721,7 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, context()->AnalyzeUses(use); } } break; - case SpvOpStore: + case spv::Op::OpStore: // If the use is the pointer, then it is the single store to that // variable. We do not want to replace it. Instead, it will become // dead after all of the loads are removed, and ADCE will get rid of it. @@ -744,11 +744,11 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst, context()->AnalyzeUses(use); } break; - case SpvOpDecorate: + case spv::Op::OpDecorate: // We treat an OpImageTexelPointer as a load. The result type should // always have the Image storage class, and should not need to be // updated. - case SpvOpImageTexelPointer: + case spv::Op::OpImageTexelPointer: // Replace the actual use. context()->ForgetUses(use); use->SetOperand(index, {new_ptr_inst->result_id()}); @@ -766,13 +766,13 @@ uint32_t CopyPropagateArrays::GetMemberTypeId( for (uint32_t element_index : access_chain) { Instruction* type_inst = get_def_use_mgr()->GetDef(id); switch (type_inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeMatrix: - case SpvOpTypeVector: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeVector: id = type_inst->GetSingleWordInOperand(0); break; - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: id = type_inst->GetSingleWordInOperand(element_index); break; default: diff --git a/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h b/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h index 9e7641f61..7486f8086 100644 --- a/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h +++ b/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h @@ -134,13 +134,13 @@ class CopyPropagateArrays : public MemPass { var_pointer_inst->GetSingleWordInOperand(1), GetAccessIds()); uint32_t member_pointer_type_id = type_mgr->FindPointerToType( - member_type_id, static_cast( + member_type_id, static_cast( var_pointer_inst->GetSingleWordInOperand(0))); return member_pointer_type_id; } // Returns the storage class of the memory object. - SpvStorageClass GetStorageClass() const { + spv::StorageClass GetStorageClass() const { analysis::TypeManager* type_mgr = GetVariable()->context()->get_type_mgr(); const analysis::Pointer* pointer_type = diff --git a/3rdparty/spirv-tools/source/opt/dataflow.cpp b/3rdparty/spirv-tools/source/opt/dataflow.cpp index c91fad08e..8d74e4137 100644 --- a/3rdparty/spirv-tools/source/opt/dataflow.cpp +++ b/3rdparty/spirv-tools/source/opt/dataflow.cpp @@ -78,7 +78,7 @@ void ForwardDataFlowAnalysis::EnqueueUsers(Instruction* inst) { } void ForwardDataFlowAnalysis::EnqueueBlockSuccessors(Instruction* inst) { - if (inst->opcode() != SpvOpLabel) return; + if (inst->opcode() != spv::Op::OpLabel) return; context() .cfg() ->block(inst->result_id()) diff --git a/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp index d99b7f78a..319b8d161 100644 --- a/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp @@ -29,28 +29,25 @@ namespace spvtools { namespace opt { - namespace { - -const uint32_t kBranchCondTrueLabIdInIdx = 1; -const uint32_t kBranchCondFalseLabIdInIdx = 2; - -} // anonymous namespace +constexpr uint32_t kBranchCondTrueLabIdInIdx = 1; +constexpr uint32_t kBranchCondFalseLabIdInIdx = 2; +} // namespace bool DeadBranchElimPass::GetConstCondition(uint32_t condId, bool* condVal) { bool condIsConst; Instruction* cInst = get_def_use_mgr()->GetDef(condId); switch (cInst->opcode()) { - case SpvOpConstantNull: - case SpvOpConstantFalse: { + case spv::Op::OpConstantNull: + case spv::Op::OpConstantFalse: { *condVal = false; condIsConst = true; } break; - case SpvOpConstantTrue: { + case spv::Op::OpConstantTrue: { *condVal = true; condIsConst = true; } break; - case SpvOpLogicalNot: { + case spv::Op::OpLogicalNot: { bool negVal; condIsConst = GetConstCondition(cInst->GetSingleWordInOperand(0), &negVal); @@ -65,13 +62,13 @@ bool DeadBranchElimPass::GetConstInteger(uint32_t selId, uint32_t* selVal) { Instruction* sInst = get_def_use_mgr()->GetDef(selId); uint32_t typeId = sInst->type_id(); Instruction* typeInst = get_def_use_mgr()->GetDef(typeId); - if (!typeInst || (typeInst->opcode() != SpvOpTypeInt)) return false; + if (!typeInst || (typeInst->opcode() != spv::Op::OpTypeInt)) return false; // TODO(greg-lunarg): Support non-32 bit ints if (typeInst->GetSingleWordInOperand(0) != 32) return false; - if (sInst->opcode() == SpvOpConstant) { + if (sInst->opcode() == spv::Op::OpConstant) { *selVal = sInst->GetSingleWordInOperand(0); return true; - } else if (sInst->opcode() == SpvOpConstantNull) { + } else if (sInst->opcode() == spv::Op::OpConstantNull) { *selVal = 0; return true; } @@ -81,7 +78,7 @@ bool DeadBranchElimPass::GetConstInteger(uint32_t selId, uint32_t* selVal) { void DeadBranchElimPass::AddBranch(uint32_t labelId, BasicBlock* bp) { assert(get_def_use_mgr()->GetDef(labelId) != nullptr); std::unique_ptr newBranch( - new Instruction(context(), SpvOpBranch, 0, 0, + new Instruction(context(), spv::Op::OpBranch, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {labelId}}})); context()->AnalyzeDefUse(&*newBranch); context()->set_instr_block(&*newBranch, bp); @@ -115,13 +112,13 @@ bool DeadBranchElimPass::MarkLiveBlocks( Instruction* terminator = block->terminator(); uint32_t live_lab_id = 0; // Check if the terminator has a single valid successor. - if (terminator->opcode() == SpvOpBranchConditional) { + if (terminator->opcode() == spv::Op::OpBranchConditional) { bool condVal; if (GetConstCondition(terminator->GetSingleWordInOperand(0u), &condVal)) { live_lab_id = terminator->GetSingleWordInOperand( condVal ? kBranchCondTrueLabIdInIdx : kBranchCondFalseLabIdInIdx); } - } else if (terminator->opcode() == SpvOpSwitch) { + } else if (terminator->opcode() == spv::Op::OpSwitch) { uint32_t sel_val; if (GetConstInteger(terminator->GetSingleWordInOperand(0u), &sel_val)) { // Search switch operands for selector value, set live_lab_id to @@ -194,8 +191,8 @@ bool DeadBranchElimPass::SimplifyBranch(BasicBlock* block, uint32_t live_lab_id) { Instruction* merge_inst = block->GetMergeInst(); Instruction* terminator = block->terminator(); - if (merge_inst && merge_inst->opcode() == SpvOpSelectionMerge) { - if (merge_inst->NextNode()->opcode() == SpvOpSwitch && + if (merge_inst && merge_inst->opcode() == spv::Op::OpSelectionMerge) { + if (merge_inst->NextNode()->opcode() == spv::Op::OpSwitch && SwitchHasNestedBreak(block->id())) { if (terminator->NumInOperands() == 2) { // We cannot remove the branch, and it already has a single case, so no @@ -266,7 +263,7 @@ bool DeadBranchElimPass::FixPhiNodesInLiveBlocks( for (auto& block : *func) { if (live_blocks.count(&block)) { for (auto iter = block.begin(); iter != block.end();) { - if (iter->opcode() != SpvOpPhi) { + if (iter->opcode() != spv::Op::OpPhi) { break; } @@ -292,7 +289,7 @@ bool DeadBranchElimPass::FixPhiNodesInLiveBlocks( cont_iter->second == &block && inst->NumInOperands() > 4) { if (get_def_use_mgr() ->GetDef(inst->GetSingleWordInOperand(i - 1)) - ->opcode() == SpvOpUndef) { + ->opcode() == spv::Op::OpUndef) { // Already undef incoming value, no change necessary. operands.push_back(inst->GetInOperand(i - 1)); operands.push_back(inst->GetInOperand(i)); @@ -378,14 +375,14 @@ bool DeadBranchElimPass::EraseDeadBlocks( if (unreachable_continues.count(&*ebi)) { uint32_t cont_id = unreachable_continues.find(&*ebi)->second->id(); if (ebi->begin() != ebi->tail() || - ebi->terminator()->opcode() != SpvOpBranch || + ebi->terminator()->opcode() != spv::Op::OpBranch || ebi->terminator()->GetSingleWordInOperand(0u) != cont_id) { // Make unreachable, but leave the label. KillAllInsts(&*ebi, false); // Add unconditional branch to header. assert(unreachable_continues.count(&*ebi)); ebi->AddInstruction(MakeUnique( - context(), SpvOpBranch, 0, 0, + context(), spv::Op::OpBranch, 0, 0, std::initializer_list{{SPV_OPERAND_TYPE_ID, {cont_id}}})); get_def_use_mgr()->AnalyzeInstUse(&*ebi->tail()); context()->set_instr_block(&*ebi->tail(), &*ebi); @@ -394,12 +391,12 @@ bool DeadBranchElimPass::EraseDeadBlocks( ++ebi; } else if (unreachable_merges.count(&*ebi)) { if (ebi->begin() != ebi->tail() || - ebi->terminator()->opcode() != SpvOpUnreachable) { + ebi->terminator()->opcode() != spv::Op::OpUnreachable) { // Make unreachable, but leave the label. KillAllInsts(&*ebi, false); // Add unreachable terminator. ebi->AddInstruction( - MakeUnique(context(), SpvOpUnreachable, 0, 0, + MakeUnique(context(), spv::Op::OpUnreachable, 0, 0, std::initializer_list{})); context()->AnalyzeUses(ebi->terminator()); context()->set_instr_block(ebi->terminator(), &*ebi); @@ -465,7 +462,7 @@ void DeadBranchElimPass::FixBlockOrder() { }; // Structured order is more intuitive so use it where possible. - if (context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) { + if (context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) { context()->ProcessReachableCallTree(reorder_structured); } else { context()->ProcessReachableCallTree(reorder_dominators); @@ -477,7 +474,8 @@ Pass::Status DeadBranchElimPass::Process() { // support required in KillNamesAndDecorates(). // TODO(greg-lunarg): Add support for OpGroupDecorate for (auto& ai : get_module()->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + if (ai.opcode() == spv::Op::OpGroupDecorate) + return Status::SuccessWithoutChange; // Process all entry point functions ProcessFunction pfn = [this](Function* fp) { return EliminateDeadBranches(fp); @@ -501,7 +499,7 @@ Instruction* DeadBranchElimPass::FindFirstExitFromSelectionMerge( Instruction* branch = start_block->terminator(); uint32_t next_block_id = 0; switch (branch->opcode()) { - case SpvOpBranchConditional: + case spv::Op::OpBranchConditional: next_block_id = start_block->MergeBlockIdIfAny(); if (next_block_id == 0) { // If a possible target is the |loop_merge_id| or |loop_continue_id|, @@ -530,7 +528,7 @@ Instruction* DeadBranchElimPass::FindFirstExitFromSelectionMerge( } } break; - case SpvOpSwitch: + case spv::Op::OpSwitch: next_block_id = start_block->MergeBlockIdIfAny(); if (next_block_id == 0) { // A switch with no merge instructions can have at most 5 targets: @@ -578,7 +576,7 @@ Instruction* DeadBranchElimPass::FindFirstExitFromSelectionMerge( // The fall through is case 3. } break; - case SpvOpBranch: + case spv::Op::OpBranch: // Need to check if this is the header of a loop nested in the // selection construct. next_block_id = start_block->MergeBlockIdIfAny(); diff --git a/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp index d877f0f96..a48690374 100644 --- a/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp @@ -23,32 +23,29 @@ namespace spvtools { namespace opt { - namespace { - -const uint32_t kTypeVectorCountInIdx = 1; -const uint32_t kTypeMatrixCountInIdx = 1; -const uint32_t kTypeArrayLengthIdInIdx = 1; -const uint32_t kTypeIntWidthInIdx = 0; -const uint32_t kConstantValueInIdx = 0; -const uint32_t kInsertObjectIdInIdx = 0; -const uint32_t kInsertCompositeIdInIdx = 1; - -} // anonymous namespace +constexpr uint32_t kTypeVectorCountInIdx = 1; +constexpr uint32_t kTypeMatrixCountInIdx = 1; +constexpr uint32_t kTypeArrayLengthIdInIdx = 1; +constexpr uint32_t kTypeIntWidthInIdx = 0; +constexpr uint32_t kConstantValueInIdx = 0; +constexpr uint32_t kInsertObjectIdInIdx = 0; +constexpr uint32_t kInsertCompositeIdInIdx = 1; +} // namespace uint32_t DeadInsertElimPass::NumComponents(Instruction* typeInst) { switch (typeInst->opcode()) { - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { return typeInst->GetSingleWordInOperand(kTypeVectorCountInIdx); } break; - case SpvOpTypeMatrix: { + case spv::Op::OpTypeMatrix: { return typeInst->GetSingleWordInOperand(kTypeMatrixCountInIdx); } break; - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { uint32_t lenId = typeInst->GetSingleWordInOperand(kTypeArrayLengthIdInIdx); Instruction* lenInst = get_def_use_mgr()->GetDef(lenId); - if (lenInst->opcode() != SpvOpConstant) return 0; + if (lenInst->opcode() != spv::Op::OpConstant) return 0; uint32_t lenTypeId = lenInst->type_id(); Instruction* lenTypeInst = get_def_use_mgr()->GetDef(lenTypeId); // TODO(greg-lunarg): Support non-32-bit array length @@ -56,7 +53,7 @@ uint32_t DeadInsertElimPass::NumComponents(Instruction* typeInst) { return 0; return lenInst->GetSingleWordInOperand(kConstantValueInIdx); } break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { return typeInst->NumInOperands(); } break; default: { return 0; } break; @@ -68,10 +65,10 @@ void DeadInsertElimPass::MarkInsertChain( uint32_t extOffset, std::unordered_set* visited_phis) { // Not currently optimizing array inserts. Instruction* typeInst = get_def_use_mgr()->GetDef(insertChain->type_id()); - if (typeInst->opcode() == SpvOpTypeArray) return; + if (typeInst->opcode() == spv::Op::OpTypeArray) return; // Insert chains are only composed of inserts and phis - if (insertChain->opcode() != SpvOpCompositeInsert && - insertChain->opcode() != SpvOpPhi) + if (insertChain->opcode() != spv::Op::OpCompositeInsert && + insertChain->opcode() != spv::Op::OpPhi) return; // If extract indices are empty, mark all subcomponents if type // is constant length. @@ -89,7 +86,7 @@ void DeadInsertElimPass::MarkInsertChain( } } Instruction* insInst = insertChain; - while (insInst->opcode() == SpvOpCompositeInsert) { + while (insInst->opcode() == spv::Op::OpCompositeInsert) { // If no extract indices, mark insert and inserted object (which might // also be an insert chain) and continue up the chain though the input // composite. @@ -139,7 +136,7 @@ void DeadInsertElimPass::MarkInsertChain( insInst = get_def_use_mgr()->GetDef(compId); } // If insert chain ended with phi, do recursive call on each operand - if (insInst->opcode() != SpvOpPhi) return; + if (insInst->opcode() != spv::Op::OpPhi) return; // Mark phi visited to prevent potential infinite loop. If phi is already // visited, return to avoid infinite loop. if (visited_phis->count(insInst->result_id()) != 0) return; @@ -179,17 +176,17 @@ bool DeadInsertElimPass::EliminateDeadInsertsOnePass(Function* func) { for (auto bi = func->begin(); bi != func->end(); ++bi) { for (auto ii = bi->begin(); ii != bi->end(); ++ii) { // Only process Inserts and composite Phis - SpvOp op = ii->opcode(); + spv::Op op = ii->opcode(); Instruction* typeInst = get_def_use_mgr()->GetDef(ii->type_id()); - if (op != SpvOpCompositeInsert && - (op != SpvOpPhi || !spvOpcodeIsComposite(typeInst->opcode()))) + if (op != spv::Op::OpCompositeInsert && + (op != spv::Op::OpPhi || !spvOpcodeIsComposite(typeInst->opcode()))) continue; // The marking algorithm can be expensive for large arrays and the // efficacy of eliminating dead inserts into arrays is questionable. // Skip optimizing array inserts for now. Just mark them live. // TODO(greg-lunarg): Eliminate dead array inserts - if (op == SpvOpCompositeInsert) { - if (typeInst->opcode() == SpvOpTypeArray) { + if (op == spv::Op::OpCompositeInsert) { + if (typeInst->opcode() == spv::Op::OpTypeArray) { liveInserts_.insert(ii->result_id()); continue; } @@ -198,11 +195,11 @@ bool DeadInsertElimPass::EliminateDeadInsertsOnePass(Function* func) { get_def_use_mgr()->ForEachUser(id, [&ii, this](Instruction* user) { if (user->IsCommonDebugInstr()) return; switch (user->opcode()) { - case SpvOpCompositeInsert: - case SpvOpPhi: + case spv::Op::OpCompositeInsert: + case spv::Op::OpPhi: // Use by insert or phi does not initiate marking break; - case SpvOpCompositeExtract: { + case spv::Op::OpCompositeExtract: { // Capture extract indices std::vector extIndices; uint32_t icnt = 0; @@ -226,7 +223,7 @@ bool DeadInsertElimPass::EliminateDeadInsertsOnePass(Function* func) { std::vector dead_instructions; for (auto bi = func->begin(); bi != func->end(); ++bi) { for (auto ii = bi->begin(); ii != bi->end(); ++ii) { - if (ii->opcode() != SpvOpCompositeInsert) continue; + if (ii->opcode() != spv::Op::OpCompositeInsert) continue; const uint32_t id = ii->result_id(); if (liveInserts_.find(id) != liveInserts_.end()) continue; const uint32_t replId = diff --git a/3rdparty/spirv-tools/source/opt/dead_variable_elimination.cpp b/3rdparty/spirv-tools/source/opt/dead_variable_elimination.cpp index 283710684..e39132c22 100644 --- a/3rdparty/spirv-tools/source/opt/dead_variable_elimination.cpp +++ b/3rdparty/spirv-tools/source/opt/dead_variable_elimination.cpp @@ -33,7 +33,7 @@ Pass::Status DeadVariableElimination::Process() { // Get the reference count for all of the global OpVariable instructions. for (auto& inst : context()->types_values()) { - if (inst.opcode() != SpvOp::SpvOpVariable) { + if (inst.opcode() != spv::Op::OpVariable) { continue; } @@ -43,11 +43,11 @@ Pass::Status DeadVariableElimination::Process() { // Check the linkage. If it is exported, it could be reference somewhere // else, so we must keep the variable around. get_decoration_mgr()->ForEachDecoration( - result_id, SpvDecorationLinkageAttributes, + result_id, uint32_t(spv::Decoration::LinkageAttributes), [&count](const Instruction& linkage_instruction) { uint32_t last_operand = linkage_instruction.NumOperands() - 1; - if (linkage_instruction.GetSingleWordOperand(last_operand) == - SpvLinkageTypeExport) { + if (spv::LinkageType(linkage_instruction.GetSingleWordOperand( + last_operand)) == spv::LinkageType::Export) { count = kMustKeep; } }); @@ -57,7 +57,8 @@ Pass::Status DeadVariableElimination::Process() { // at the uses and count the number of real references. count = 0; get_def_use_mgr()->ForEachUser(result_id, [&count](Instruction* user) { - if (!IsAnnotationInst(user->opcode()) && user->opcode() != SpvOpName) { + if (!IsAnnotationInst(user->opcode()) && + user->opcode() != spv::Op::OpName) { ++count; } }); @@ -81,7 +82,7 @@ Pass::Status DeadVariableElimination::Process() { void DeadVariableElimination::DeleteVariable(uint32_t result_id) { Instruction* inst = get_def_use_mgr()->GetDef(result_id); - assert(inst->opcode() == SpvOpVariable && + assert(inst->opcode() == spv::Op::OpVariable && "Should not be trying to delete anything other than an OpVariable."); // Look for an initializer that references another variable. We need to know @@ -93,7 +94,7 @@ void DeadVariableElimination::DeleteVariable(uint32_t result_id) { // TODO: Handle OpSpecConstantOP which might be defined in terms of other // variables. Will probably require a unified dead code pass that does all // instruction types. (Issue 906) - if (initializer->opcode() == SpvOpVariable) { + if (initializer->opcode() == spv::Op::OpVariable) { uint32_t initializer_id = initializer->result_id(); size_t& count = reference_count_[initializer_id]; if (count != kMustKeep) { diff --git a/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp b/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp index 3585186f4..1e614c6ff 100644 --- a/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp +++ b/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp @@ -22,32 +22,31 @@ // Constants for OpenCL.DebugInfo.100 & NonSemantic.Shader.DebugInfo.100 // extension instructions. -static const uint32_t kOpLineOperandLineIndex = 1; -static const uint32_t kLineOperandIndexDebugFunction = 7; -static const uint32_t kLineOperandIndexDebugLexicalBlock = 5; -static const uint32_t kLineOperandIndexDebugLine = 5; -static const uint32_t kDebugFunctionOperandFunctionIndex = 13; -static const uint32_t kDebugFunctionDefinitionOperandDebugFunctionIndex = 4; -static const uint32_t kDebugFunctionDefinitionOperandOpFunctionIndex = 5; -static const uint32_t kDebugFunctionOperandParentIndex = 9; -static const uint32_t kDebugTypeCompositeOperandParentIndex = 9; -static const uint32_t kDebugLexicalBlockOperandParentIndex = 7; -static const uint32_t kDebugInlinedAtOperandInlinedIndex = 6; -static const uint32_t kDebugExpressOperandOperationIndex = 4; -static const uint32_t kDebugDeclareOperandLocalVariableIndex = 4; -static const uint32_t kDebugDeclareOperandVariableIndex = 5; -static const uint32_t kDebugValueOperandExpressionIndex = 6; -static const uint32_t kDebugOperationOperandOperationIndex = 4; -static const uint32_t kOpVariableOperandStorageClassIndex = 2; -static const uint32_t kDebugLocalVariableOperandParentIndex = 9; -static const uint32_t kExtInstInstructionInIdx = 1; -static const uint32_t kDebugGlobalVariableOperandFlagsIndex = 12; -static const uint32_t kDebugLocalVariableOperandFlagsIndex = 10; - namespace spvtools { namespace opt { namespace analysis { namespace { +constexpr uint32_t kOpLineOperandLineIndex = 1; +constexpr uint32_t kLineOperandIndexDebugFunction = 7; +constexpr uint32_t kLineOperandIndexDebugLexicalBlock = 5; +constexpr uint32_t kLineOperandIndexDebugLine = 5; +constexpr uint32_t kDebugFunctionOperandFunctionIndex = 13; +constexpr uint32_t kDebugFunctionDefinitionOperandDebugFunctionIndex = 4; +constexpr uint32_t kDebugFunctionDefinitionOperandOpFunctionIndex = 5; +constexpr uint32_t kDebugFunctionOperandParentIndex = 9; +constexpr uint32_t kDebugTypeCompositeOperandParentIndex = 9; +constexpr uint32_t kDebugLexicalBlockOperandParentIndex = 7; +constexpr uint32_t kDebugInlinedAtOperandInlinedIndex = 6; +constexpr uint32_t kDebugExpressOperandOperationIndex = 4; +constexpr uint32_t kDebugDeclareOperandLocalVariableIndex = 4; +constexpr uint32_t kDebugDeclareOperandVariableIndex = 5; +constexpr uint32_t kDebugValueOperandExpressionIndex = 6; +constexpr uint32_t kDebugOperationOperandOperationIndex = 4; +constexpr uint32_t kOpVariableOperandStorageClassIndex = 2; +constexpr uint32_t kDebugLocalVariableOperandParentIndex = 9; +constexpr uint32_t kExtInstInstructionInIdx = 1; +constexpr uint32_t kDebugGlobalVariableOperandFlagsIndex = 12; +constexpr uint32_t kDebugLocalVariableOperandFlagsIndex = 10; void SetInlinedOperand(Instruction* dbg_inlined_at, uint32_t inlined_operand) { assert(dbg_inlined_at); @@ -156,7 +155,8 @@ void DebugInfoManager::RegisterDbgDeclare(uint32_t var_id, uint32_t AddNewConstInGlobals(IRContext* context, uint32_t const_value) { uint32_t id = context->TakeNextId(); std::unique_ptr new_const(new Instruction( - context, SpvOpConstant, context->get_type_mgr()->GetUIntTypeId(), id, + context, spv::Op::OpConstant, context->get_type_mgr()->GetUIntTypeId(), + id, { {spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, {const_value}}, @@ -212,7 +212,7 @@ uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line, break; } } else { - if (line->opcode() == SpvOpLine) { + if (line->opcode() == spv::Op::OpLine) { line_number = line->GetSingleWordOperand(kOpLineOperandLineIndex); } else if (line->GetShader100DebugOpcode() == NonSemanticShaderDebugInfo100DebugLine) { @@ -230,18 +230,19 @@ uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line, // constants that may be generated here is likely not significant // and will likely be cleaned up in later passes. if (line_number_type == spv_operand_type_t::SPV_OPERAND_TYPE_ID && - line->opcode() == SpvOpLine) { + line->opcode() == spv::Op::OpLine) { if (!context()->AreAnalysesValid(IRContext::Analysis::kAnalysisDefUse) || !context()->AreAnalysesValid(IRContext::Analysis::kAnalysisConstants)) line_number = AddNewConstInGlobals(context(), line_number); else - line_number = context()->get_constant_mgr()->GetUIntConst(line_number); + line_number = + context()->get_constant_mgr()->GetUIntConstId(line_number); } } uint32_t result_id = context()->TakeNextId(); std::unique_ptr inlined_at(new Instruction( - context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), + context(), spv::Op::OpExtInst, context()->get_type_mgr()->GetVoidTypeId(), result_id, { {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {setId}}, @@ -334,8 +335,8 @@ Instruction* DebugInfoManager::GetDebugOperationWithDeref() { if (context()->get_feature_mgr()->GetExtInstImportId_OpenCL100DebugInfo()) { deref_operation = std::unique_ptr(new Instruction( - context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), - result_id, + context(), spv::Op::OpExtInst, + context()->get_type_mgr()->GetVoidTypeId(), result_id, { {SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, {SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, @@ -344,11 +345,11 @@ Instruction* DebugInfoManager::GetDebugOperationWithDeref() { {static_cast(OpenCLDebugInfo100Deref)}}, })); } else { - uint32_t deref_id = context()->get_constant_mgr()->GetUIntConst( + uint32_t deref_id = context()->get_constant_mgr()->GetUIntConstId( NonSemanticShaderDebugInfo100Deref); deref_operation = std::unique_ptr( - new Instruction(context(), SpvOpExtInst, + new Instruction(context(), spv::Op::OpExtInst, context()->get_type_mgr()->GetVoidTypeId(), result_id, { {SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, @@ -390,7 +391,7 @@ Instruction* DebugInfoManager::GetDebugInfoNone() { uint32_t result_id = context()->TakeNextId(); std::unique_ptr dbg_info_none_inst(new Instruction( - context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), + context(), spv::Op::OpExtInst, context()->get_type_mgr()->GetVoidTypeId(), result_id, { {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, @@ -414,7 +415,7 @@ Instruction* DebugInfoManager::GetEmptyDebugExpression() { uint32_t result_id = context()->TakeNextId(); std::unique_ptr empty_debug_expr(new Instruction( - context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), + context(), spv::Op::OpExtInst, context()->get_type_mgr()->GetVoidTypeId(), result_id, { {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, @@ -527,7 +528,7 @@ bool DebugInfoManager::IsDeclareVisibleToInstr(Instruction* dbg_declare, assert(scope != nullptr); std::vector scope_ids; - if (scope->opcode() == SpvOpPhi) { + if (scope->opcode() == spv::Op::OpPhi) { scope_ids.push_back(scope->GetDebugScope().GetLexicalScope()); for (uint32_t i = 0; i < scope->NumInOperands(); i += 2) { auto* value = context()->get_def_use_mgr()->GetDef( @@ -571,8 +572,8 @@ bool DebugInfoManager::AddDebugValueForVariable(Instruction* scope_and_line, // Avoid inserting the new DebugValue between OpPhi or OpVariable // instructions. Instruction* insert_before = insert_pos->NextNode(); - while (insert_before->opcode() == SpvOpPhi || - insert_before->opcode() == SpvOpVariable) { + while (insert_before->opcode() == spv::Op::OpPhi || + insert_before->opcode() == spv::Op::OpVariable) { insert_before = insert_before->NextNode(); } modified |= AddDebugValueForDecl(dbg_decl_or_val, value_id, insert_before, @@ -653,9 +654,10 @@ uint32_t DebugInfoManager::GetVariableIdOfDebugValueUsedForDeclare( } auto* var = context()->get_def_use_mgr()->GetDef(var_id); - if (var->opcode() == SpvOpVariable && - SpvStorageClass(var->GetSingleWordOperand( - kOpVariableOperandStorageClassIndex)) == SpvStorageClassFunction) { + if (var->opcode() == spv::Op::OpVariable && + spv::StorageClass( + var->GetSingleWordOperand(kOpVariableOperandStorageClassIndex)) == + spv::StorageClass::Function) { return var_id; } return 0; @@ -762,8 +764,8 @@ void DebugInfoManager::ConvertDebugGlobalToLocalVariable( CommonDebugInfoDebugGlobalVariable) { return; } - assert(local_var->opcode() == SpvOpVariable || - local_var->opcode() == SpvOpFunctionParameter); + assert(local_var->opcode() == spv::Op::OpVariable || + local_var->opcode() == spv::Op::OpFunctionParameter); // Convert |dbg_global_var| to DebugLocalVariable dbg_global_var->SetInOperand(kExtInstInstructionInIdx, @@ -780,7 +782,7 @@ void DebugInfoManager::ConvertDebugGlobalToLocalVariable( // Create a DebugDeclare std::unique_ptr new_dbg_decl(new Instruction( - context(), SpvOpExtInst, context()->get_type_mgr()->GetVoidTypeId(), + context(), spv::Op::OpExtInst, context()->get_type_mgr()->GetVoidTypeId(), context()->TakeNextId(), { {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {GetDbgSetImportId()}}, @@ -794,7 +796,7 @@ void DebugInfoManager::ConvertDebugGlobalToLocalVariable( })); // Must insert after all OpVariables in block Instruction* insert_before = local_var; - while (insert_before->opcode() == SpvOpVariable) + while (insert_before->opcode() == spv::Op::OpVariable) insert_before = insert_before->NextNode(); auto* added_dbg_decl = insert_before->InsertBefore(std::move(new_dbg_decl)); if (context()->AreAnalysesValid(IRContext::Analysis::kAnalysisDefUse)) diff --git a/3rdparty/spirv-tools/source/opt/decoration_manager.cpp b/3rdparty/spirv-tools/source/opt/decoration_manager.cpp index 2146c359d..1393d480e 100644 --- a/3rdparty/spirv-tools/source/opt/decoration_manager.cpp +++ b/3rdparty/spirv-tools/source/opt/decoration_manager.cpp @@ -22,6 +22,9 @@ #include "source/opt/ir_context.h" +namespace spvtools { +namespace opt { +namespace analysis { namespace { using InstructionVector = std::vector; using DecorationSet = std::set; @@ -49,10 +52,6 @@ bool IsSubset(const DecorationSet& a, const DecorationSet& b) { } } // namespace -namespace spvtools { -namespace opt { -namespace analysis { - bool DecorationManager::RemoveDecorationsFrom( uint32_t id, std::function pred) { bool was_modified = false; @@ -76,8 +75,8 @@ bool DecorationManager::RemoveDecorationsFrom( // applying the group. std::unordered_set indirect_decorations_to_remove; for (Instruction* inst : decorations_info.indirect_decorations) { - assert(inst->opcode() == SpvOpGroupDecorate || - inst->opcode() == SpvOpGroupMemberDecorate); + assert(inst->opcode() == spv::Op::OpGroupDecorate || + inst->opcode() == spv::Op::OpGroupMemberDecorate); std::vector group_decorations_to_keep; const uint32_t group_id = inst->GetSingleWordInOperand(0u); @@ -99,7 +98,8 @@ bool DecorationManager::RemoveDecorationsFrom( } // Otherwise, remove |id| from the targets of |group_id| - const uint32_t stride = inst->opcode() == SpvOpGroupDecorate ? 1u : 2u; + const uint32_t stride = + inst->opcode() == spv::Op::OpGroupDecorate ? 1u : 2u; for (uint32_t i = 1u; i < inst->NumInOperands();) { if (inst->GetSingleWordInOperand(i) != id) { i += stride; @@ -212,16 +212,16 @@ bool DecorationManager::HaveTheSameDecorations(uint32_t id1, } switch (inst->opcode()) { - case SpvOpDecorate: + case spv::Op::OpDecorate: decorate_set->emplace(std::move(decoration_payload)); break; - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: member_decorate_set->emplace(std::move(decoration_payload)); break; - case SpvOpDecorateId: + case spv::Op::OpDecorateId: decorate_id_set->emplace(std::move(decoration_payload)); break; - case SpvOpDecorateStringGOOGLE: + case spv::Op::OpDecorateStringGOOGLE: decorate_string_set->emplace(std::move(decoration_payload)); break; default: @@ -278,16 +278,16 @@ bool DecorationManager::HaveSubsetOfDecorations(uint32_t id1, } switch (inst->opcode()) { - case SpvOpDecorate: + case spv::Op::OpDecorate: decorate_set->emplace(std::move(decoration_payload)); break; - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: member_decorate_set->emplace(std::move(decoration_payload)); break; - case SpvOpDecorateId: + case spv::Op::OpDecorateId: decorate_id_set->emplace(std::move(decoration_payload)); break; - case SpvOpDecorateStringGOOGLE: + case spv::Op::OpDecorateStringGOOGLE: decorate_string_set->emplace(std::move(decoration_payload)); break; default: @@ -328,10 +328,10 @@ bool DecorationManager::AreDecorationsTheSame(const Instruction* inst1, const Instruction* inst2, bool ignore_target) const { switch (inst1->opcode()) { - case SpvOpDecorate: - case SpvOpMemberDecorate: - case SpvOpDecorateId: - case SpvOpDecorateStringGOOGLE: + case spv::Op::OpDecorate: + case spv::Op::OpMemberDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpDecorateStringGOOGLE: break; default: return false; @@ -358,17 +358,18 @@ void DecorationManager::AnalyzeDecorations() { void DecorationManager::AddDecoration(Instruction* inst) { switch (inst->opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpDecorateStringGOOGLE: - case SpvOpMemberDecorate: { + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpDecorateStringGOOGLE: + case spv::Op::OpMemberDecorate: { const auto target_id = inst->GetSingleWordInOperand(0u); id_to_decoration_insts_[target_id].direct_decorations.push_back(inst); break; } - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: { - const uint32_t start = inst->opcode() == SpvOpGroupDecorate ? 1u : 2u; + case spv::Op::OpGroupDecorate: + case spv::Op::OpGroupMemberDecorate: { + const uint32_t start = + inst->opcode() == spv::Op::OpGroupDecorate ? 1u : 2u; const uint32_t stride = start; for (uint32_t i = start; i < inst->NumInOperands(); i += stride) { const auto target_id = inst->GetSingleWordInOperand(i); @@ -384,7 +385,7 @@ void DecorationManager::AddDecoration(Instruction* inst) { } } -void DecorationManager::AddDecoration(SpvOp opcode, +void DecorationManager::AddDecoration(spv::Op opcode, std::vector opnds) { IRContext* ctx = module_->context(); std::unique_ptr newDecoOp( @@ -394,7 +395,7 @@ void DecorationManager::AddDecoration(SpvOp opcode, void DecorationManager::AddDecoration(uint32_t inst_id, uint32_t decoration) { AddDecoration( - SpvOpDecorate, + spv::Op::OpDecorate, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {inst_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {decoration}}}); } @@ -402,7 +403,7 @@ void DecorationManager::AddDecoration(uint32_t inst_id, uint32_t decoration) { void DecorationManager::AddDecorationVal(uint32_t inst_id, uint32_t decoration, uint32_t decoration_value) { AddDecoration( - SpvOpDecorate, + spv::Op::OpDecorate, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {inst_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {decoration}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, @@ -413,7 +414,7 @@ void DecorationManager::AddMemberDecoration(uint32_t inst_id, uint32_t member, uint32_t decoration, uint32_t decoration_value) { AddDecoration( - SpvOpMemberDecorate, + spv::Op::OpMemberDecorate, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {inst_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {member}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {decoration}}, @@ -436,9 +437,10 @@ std::vector DecorationManager::InternalGetDecorationsFor( [include_linkage, &decorations](const std::vector& direct_decorations) { for (Instruction* inst : direct_decorations) { - const bool is_linkage = inst->opcode() == SpvOpDecorate && - inst->GetSingleWordInOperand(1u) == - SpvDecorationLinkageAttributes; + const bool is_linkage = + inst->opcode() == spv::Op::OpDecorate && + spv::Decoration(inst->GetSingleWordInOperand(1u)) == + spv::Decoration::LinkageAttributes; if (include_linkage || !is_linkage) decorations.push_back(inst); } }; @@ -462,14 +464,14 @@ bool DecorationManager::WhileEachDecoration( std::function f) { for (const Instruction* inst : GetDecorationsFor(id, true)) { switch (inst->opcode()) { - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: if (inst->GetSingleWordInOperand(2) == decoration) { if (!f(*inst)) return false; } break; - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpDecorateStringGOOGLE: + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpDecorateStringGOOGLE: if (inst->GetSingleWordInOperand(1) == decoration) { if (!f(*inst)) return false; } @@ -523,14 +525,14 @@ void DecorationManager::CloneDecorations(uint32_t from, uint32_t to) { decoration_list->second.indirect_decorations; for (Instruction* inst : indirect_decorations) { switch (inst->opcode()) { - case SpvOpGroupDecorate: + case spv::Op::OpGroupDecorate: context->ForgetUses(inst); // add |to| to list of decorated id's inst->AddOperand( Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID, {to})); context->AnalyzeUses(inst); break; - case SpvOpGroupMemberDecorate: { + case spv::Op::OpGroupMemberDecorate: { context->ForgetUses(inst); // for each (id == from), add (to, literal) as operands const uint32_t num_operands = inst->NumOperands(); @@ -554,13 +556,13 @@ void DecorationManager::CloneDecorations(uint32_t from, uint32_t to) { void DecorationManager::CloneDecorations( uint32_t from, uint32_t to, - const std::vector& decorations_to_copy) { + const std::vector& decorations_to_copy) { const auto decoration_list = id_to_decoration_insts_.find(from); if (decoration_list == id_to_decoration_insts_.end()) return; auto context = module_->context(); for (Instruction* inst : decoration_list->second.direct_decorations) { if (std::find(decorations_to_copy.begin(), decorations_to_copy.end(), - inst->GetSingleWordInOperand(1)) == + spv::Decoration(inst->GetSingleWordInOperand(1))) == decorations_to_copy.end()) { continue; } @@ -579,11 +581,11 @@ void DecorationManager::CloneDecorations( decoration_list->second.indirect_decorations; for (Instruction* inst : indirect_decorations) { switch (inst->opcode()) { - case SpvOpGroupDecorate: + case spv::Op::OpGroupDecorate: CloneDecorations(inst->GetSingleWordInOperand(0), to, decorations_to_copy); break; - case SpvOpGroupMemberDecorate: { + case spv::Op::OpGroupMemberDecorate: { assert(false && "The source id is not suppose to be a type."); break; } @@ -599,18 +601,19 @@ void DecorationManager::RemoveDecoration(Instruction* inst) { }; switch (inst->opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpDecorateStringGOOGLE: - case SpvOpMemberDecorate: { + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpDecorateStringGOOGLE: + case spv::Op::OpMemberDecorate: { const auto target_id = inst->GetSingleWordInOperand(0u); auto const iter = id_to_decoration_insts_.find(target_id); if (iter == id_to_decoration_insts_.end()) return; remove_from_container(iter->second.direct_decorations); } break; - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: { - const uint32_t stride = inst->opcode() == SpvOpGroupDecorate ? 1u : 2u; + case spv::Op::OpGroupDecorate: + case spv::Op::OpGroupMemberDecorate: { + const uint32_t stride = + inst->opcode() == spv::Op::OpGroupDecorate ? 1u : 2u; for (uint32_t i = 1u; i < inst->NumInOperands(); i += stride) { const auto target_id = inst->GetSingleWordInOperand(i); auto const iter = id_to_decoration_insts_.find(target_id); diff --git a/3rdparty/spirv-tools/source/opt/decoration_manager.h b/3rdparty/spirv-tools/source/opt/decoration_manager.h index fe78f2ce6..1a0d1b183 100644 --- a/3rdparty/spirv-tools/source/opt/decoration_manager.h +++ b/3rdparty/spirv-tools/source/opt/decoration_manager.h @@ -71,14 +71,14 @@ class DecorationManager { bool include_linkage); std::vector GetDecorationsFor(uint32_t id, bool include_linkage) const; - // Returns whether two IDs have the same decorations. Two SpvOpGroupDecorate - // instructions that apply the same decorations but to different IDs, still - // count as being the same. + // Returns whether two IDs have the same decorations. Two + // spv::Op::OpGroupDecorate instructions that apply the same decorations but + // to different IDs, still count as being the same. bool HaveTheSameDecorations(uint32_t id1, uint32_t id2) const; - // Returns whether two IDs have the same decorations. Two SpvOpGroupDecorate - // instructions that apply the same decorations but to different IDs, still - // count as being the same. + // Returns whether two IDs have the same decorations. Two + // spv::Op::OpGroupDecorate instructions that apply the same decorations but + // to different IDs, still count as being the same. bool HaveSubsetOfDecorations(uint32_t id1, uint32_t id2) const; // Returns whether the two decorations instructions are the same and are @@ -123,14 +123,15 @@ class DecorationManager { // Same as above, but only clone the decoration if the decoration operand is // in |decorations_to_copy|. This function has the extra restriction that // |from| and |to| must not be an object, not a type. - void CloneDecorations(uint32_t from, uint32_t to, - const std::vector& decorations_to_copy); + void CloneDecorations( + uint32_t from, uint32_t to, + const std::vector& decorations_to_copy); // Informs the decoration manager of a new decoration that it needs to track. void AddDecoration(Instruction* inst); // Add decoration with |opcode| and operands |opnds|. - void AddDecoration(SpvOp opcode, const std::vector opnds); + void AddDecoration(spv::Op opcode, const std::vector opnds); // Add |decoration| of |inst_id| to module. void AddDecoration(uint32_t inst_id, uint32_t decoration); @@ -195,9 +196,9 @@ class DecorationManager { // Mapping from ids to the instructions applying a decoration to those ids. // In other words, for each id you get all decoration instructions - // referencing that id, be it directly (SpvOpDecorate, SpvOpMemberDecorate - // and SpvOpDecorateId), or indirectly (SpvOpGroupDecorate, - // SpvOpMemberGroupDecorate). + // referencing that id, be it directly (spv::Op::OpDecorate, + // spv::Op::OpMemberDecorate and spv::Op::OpDecorateId), or indirectly + // (spv::Op::OpGroupDecorate, spv::Op::OpMemberGroupDecorate). std::unordered_map id_to_decoration_insts_; // The enclosing module. Module* module_; diff --git a/3rdparty/spirv-tools/source/opt/desc_sroa.cpp b/3rdparty/spirv-tools/source/opt/desc_sroa.cpp index b130ca806..8da0c864f 100644 --- a/3rdparty/spirv-tools/source/opt/desc_sroa.cpp +++ b/3rdparty/spirv-tools/source/opt/desc_sroa.cpp @@ -22,8 +22,9 @@ namespace opt { namespace { bool IsDecorationBinding(Instruction* inst) { - if (inst->opcode() != SpvOpDecorate) return false; - return inst->GetSingleWordInOperand(1u) == SpvDecorationBinding; + if (inst->opcode() != spv::Op::OpDecorate) return false; + return spv::Decoration(inst->GetSingleWordInOperand(1u)) == + spv::Decoration::Binding; } } // namespace @@ -56,7 +57,7 @@ bool DescriptorScalarReplacement::ReplaceCandidate(Instruction* var) { bool failed = !get_def_use_mgr()->WhileEachUser( var->result_id(), [this, &access_chain_work_list, &load_work_list](Instruction* use) { - if (use->opcode() == SpvOpName) { + if (use->opcode() == spv::Op::OpName) { return true; } @@ -65,11 +66,11 @@ bool DescriptorScalarReplacement::ReplaceCandidate(Instruction* var) { } switch (use->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: access_chain_work_list.push_back(use); return true; - case SpvOpLoad: + case spv::Op::OpLoad: load_work_list.push_back(use); return true; default: @@ -184,7 +185,7 @@ void DescriptorScalarReplacement::CopyDecorationsForNewVariable( // Handle OpMemberDecorate instructions. for (auto old_decoration : get_decoration_mgr()->GetDecorationsFor( old_var_type->result_id(), true)) { - assert(old_decoration->opcode() == SpvOpMemberDecorate); + assert(old_decoration->opcode() == spv::Op::OpMemberDecorate); if (old_decoration->GetSingleWordInOperand(1u) != index) continue; CreateNewDecorationForMemberDecorate(old_decoration, new_var_id); } @@ -212,8 +213,8 @@ uint32_t DescriptorScalarReplacement::GetNewBindingForElement( void DescriptorScalarReplacement::CreateNewDecorationForNewVariable( Instruction* old_decoration, uint32_t new_var_id, uint32_t new_binding) { - assert(old_decoration->opcode() == SpvOpDecorate || - old_decoration->opcode() == SpvOpDecorateString); + assert(old_decoration->opcode() == spv::Op::OpDecorate || + old_decoration->opcode() == spv::Op::OpDecorateString); std::unique_ptr new_decoration(old_decoration->Clone(context())); new_decoration->SetInOperand(0, {new_var_id}); @@ -231,25 +232,25 @@ void DescriptorScalarReplacement::CreateNewDecorationForMemberDecorate( auto new_decorate_operand_end = old_member_decoration->end(); operands.insert(operands.end(), new_decorate_operand_begin, new_decorate_operand_end); - get_decoration_mgr()->AddDecoration(SpvOpDecorate, std::move(operands)); + get_decoration_mgr()->AddDecoration(spv::Op::OpDecorate, std::move(operands)); } uint32_t DescriptorScalarReplacement::CreateReplacementVariable( Instruction* var, uint32_t idx) { // The storage class for the new variable is the same as the original. - SpvStorageClass storage_class = - static_cast(var->GetSingleWordInOperand(0)); + spv::StorageClass storage_class = + static_cast(var->GetSingleWordInOperand(0)); // The type for the new variable will be a pointer to type of the elements of // the array. uint32_t ptr_type_id = var->type_id(); Instruction* ptr_type_inst = get_def_use_mgr()->GetDef(ptr_type_id); - assert(ptr_type_inst->opcode() == SpvOpTypePointer && + assert(ptr_type_inst->opcode() == spv::Op::OpTypePointer && "Variable should be a pointer to an array or structure."); uint32_t pointee_type_id = ptr_type_inst->GetSingleWordInOperand(1); Instruction* pointee_type_inst = get_def_use_mgr()->GetDef(pointee_type_id); - const bool is_array = pointee_type_inst->opcode() == SpvOpTypeArray; - const bool is_struct = pointee_type_inst->opcode() == SpvOpTypeStruct; + const bool is_array = pointee_type_inst->opcode() == spv::Op::OpTypeArray; + const bool is_struct = pointee_type_inst->opcode() == spv::Op::OpTypeStruct; assert((is_array || is_struct) && "Variable should be a pointer to an array or structure."); @@ -263,7 +264,7 @@ uint32_t DescriptorScalarReplacement::CreateReplacementVariable( // Create the variable. uint32_t id = TakeNextId(); std::unique_ptr variable( - new Instruction(context(), SpvOpVariable, ptr_element_type_id, id, + new Instruction(context(), spv::Op::OpVariable, ptr_element_type_id, id, std::initializer_list{ {SPV_OPERAND_TYPE_STORAGE_CLASS, {static_cast(storage_class)}}})); @@ -293,7 +294,7 @@ uint32_t DescriptorScalarReplacement::CreateReplacementVariable( } std::unique_ptr new_name(new Instruction( - context(), SpvOpName, 0, 0, + context(), spv::Op::OpName, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {id}}, {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}})); @@ -315,14 +316,14 @@ uint32_t DescriptorScalarReplacement::GetNumBindingsUsedByType( Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); // If it's a pointer, look at the underlying type. - if (type_inst->opcode() == SpvOpTypePointer) { + if (type_inst->opcode() == spv::Op::OpTypePointer) { type_id = type_inst->GetSingleWordInOperand(1); type_inst = get_def_use_mgr()->GetDef(type_id); } // Arrays consume N*M binding numbers where N is the array length, and M is // the number of bindings used by each array element. - if (type_inst->opcode() == SpvOpTypeArray) { + if (type_inst->opcode() == spv::Op::OpTypeArray) { uint32_t element_type_id = type_inst->GetSingleWordInOperand(0); uint32_t length_id = type_inst->GetSingleWordInOperand(1); const analysis::Constant* length_const = @@ -335,7 +336,7 @@ uint32_t DescriptorScalarReplacement::GetNumBindingsUsedByType( // The number of bindings consumed by a structure is the sum of the bindings // used by its members. - if (type_inst->opcode() == SpvOpTypeStruct && + if (type_inst->opcode() == spv::Op::OpTypeStruct && !descsroautil::IsTypeOfStructuredBuffer(context(), type_inst)) { uint32_t sum = 0; for (uint32_t i = 0; i < type_inst->NumInOperands(); i++) @@ -353,12 +354,12 @@ bool DescriptorScalarReplacement::ReplaceLoadedValue(Instruction* var, // |value| is the OpLoad instruction that has loaded |var|. // The function expects all users of |value| to be OpCompositeExtract // instructions. Otherwise the function returns false with an error message. - assert(value->opcode() == SpvOpLoad); + assert(value->opcode() == spv::Op::OpLoad); assert(value->GetSingleWordInOperand(0) == var->result_id()); std::vector work_list; bool failed = !get_def_use_mgr()->WhileEachUser( value->result_id(), [this, &work_list](Instruction* use) { - if (use->opcode() != SpvOpCompositeExtract) { + if (use->opcode() != spv::Op::OpCompositeExtract) { context()->EmitErrorMessage( "Variable cannot be replaced: invalid instruction", use); return false; @@ -384,7 +385,7 @@ bool DescriptorScalarReplacement::ReplaceLoadedValue(Instruction* var, bool DescriptorScalarReplacement::ReplaceCompositeExtract( Instruction* var, Instruction* extract) { - assert(extract->opcode() == SpvOpCompositeExtract); + assert(extract->opcode() == spv::Op::OpCompositeExtract); // We're currently only supporting extractions of one index at a time. If we // need to, we can handle cases with multiple indexes in the future. if (extract->NumInOperands() != 2) { @@ -400,7 +401,7 @@ bool DescriptorScalarReplacement::ReplaceCompositeExtract( // OpCompositeExtract. uint32_t load_id = TakeNextId(); std::unique_ptr load( - new Instruction(context(), SpvOpLoad, extract->type_id(), load_id, + new Instruction(context(), spv::Op::OpLoad, extract->type_id(), load_id, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {replacement_var}}})); Instruction* load_instr = load.get(); diff --git a/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp b/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp index 1954e2cc3..dba3de9c0 100644 --- a/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp +++ b/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp @@ -17,12 +17,11 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kOpAccessChainInOperandIndexes = 1; +constexpr uint32_t kOpAccessChainInOperandIndexes = 1; // Returns the length of array type |type|. uint32_t GetLengthOfArrayType(IRContext* context, Instruction* type) { - assert(type->opcode() == SpvOpTypeArray && "type must be array"); + assert(type->opcode() == spv::Op::OpTypeArray && "type must be array"); uint32_t length_id = type->GetSingleWordInOperand(1); const analysis::Constant* length_const = context->get_constant_mgr()->FindDeclaredConstant(length_id); @@ -35,20 +34,20 @@ uint32_t GetLengthOfArrayType(IRContext* context, Instruction* type) { namespace descsroautil { bool IsDescriptorArray(IRContext* context, Instruction* var) { - if (var->opcode() != SpvOpVariable) { + if (var->opcode() != spv::Op::OpVariable) { return false; } uint32_t ptr_type_id = var->type_id(); Instruction* ptr_type_inst = context->get_def_use_mgr()->GetDef(ptr_type_id); - if (ptr_type_inst->opcode() != SpvOpTypePointer) { + if (ptr_type_inst->opcode() != spv::Op::OpTypePointer) { return false; } uint32_t var_type_id = ptr_type_inst->GetSingleWordInOperand(1); Instruction* var_type_inst = context->get_def_use_mgr()->GetDef(var_type_id); - if (var_type_inst->opcode() != SpvOpTypeArray && - var_type_inst->opcode() != SpvOpTypeStruct) { + if (var_type_inst->opcode() != spv::Op::OpTypeArray && + var_type_inst->opcode() != spv::Op::OpTypeStruct) { return false; } @@ -59,23 +58,23 @@ bool IsDescriptorArray(IRContext* context, Instruction* var) { } if (!context->get_decoration_mgr()->HasDecoration( - var->result_id(), SpvDecorationDescriptorSet)) { + var->result_id(), uint32_t(spv::Decoration::DescriptorSet))) { return false; } - return context->get_decoration_mgr()->HasDecoration(var->result_id(), - SpvDecorationBinding); + return context->get_decoration_mgr()->HasDecoration( + var->result_id(), uint32_t(spv::Decoration::Binding)); } bool IsTypeOfStructuredBuffer(IRContext* context, const Instruction* type) { - if (type->opcode() != SpvOpTypeStruct) { + if (type->opcode() != spv::Op::OpTypeStruct) { return false; } // All buffers have offset decorations for members of their structure types. // This is how we distinguish it from a structure of descriptors. - return context->get_decoration_mgr()->HasDecoration(type->result_id(), - SpvDecorationOffset); + return context->get_decoration_mgr()->HasDecoration( + type->result_id(), uint32_t(spv::Decoration::Offset)); } const analysis::Constant* GetAccessChainIndexAsConst( @@ -99,15 +98,15 @@ uint32_t GetNumberOfElementsForArrayOrStruct(IRContext* context, Instruction* var) { uint32_t ptr_type_id = var->type_id(); Instruction* ptr_type_inst = context->get_def_use_mgr()->GetDef(ptr_type_id); - assert(ptr_type_inst->opcode() == SpvOpTypePointer && + assert(ptr_type_inst->opcode() == spv::Op::OpTypePointer && "Variable should be a pointer to an array or structure."); uint32_t pointee_type_id = ptr_type_inst->GetSingleWordInOperand(1); Instruction* pointee_type_inst = context->get_def_use_mgr()->GetDef(pointee_type_id); - if (pointee_type_inst->opcode() == SpvOpTypeArray) { + if (pointee_type_inst->opcode() == spv::Op::OpTypeArray) { return GetLengthOfArrayType(context, pointee_type_inst); } - assert(pointee_type_inst->opcode() == SpvOpTypeStruct && + assert(pointee_type_inst->opcode() == spv::Op::OpTypeStruct && "Variable should be a pointer to an array or structure."); return pointee_type_inst->NumInOperands(); } diff --git a/3rdparty/spirv-tools/source/opt/dominator_analysis.cpp b/3rdparty/spirv-tools/source/opt/dominator_analysis.cpp index b692d26a2..eb6dfc9e0 100644 --- a/3rdparty/spirv-tools/source/opt/dominator_analysis.cpp +++ b/3rdparty/spirv-tools/source/opt/dominator_analysis.cpp @@ -64,7 +64,7 @@ bool DominatorAnalysisBase::Dominates(Instruction* a, Instruction* b) const { // We handle OpLabel instructions explicitly since they are not stored in the // instruction list. - if (current->opcode() == SpvOpLabel) { + if (current->opcode() == spv::Op::OpLabel) { return true; } diff --git a/3rdparty/spirv-tools/source/opt/dominator_tree.cpp b/3rdparty/spirv-tools/source/opt/dominator_tree.cpp index 2680be2af..3c161a9b2 100644 --- a/3rdparty/spirv-tools/source/opt/dominator_tree.cpp +++ b/3rdparty/spirv-tools/source/opt/dominator_tree.cpp @@ -55,8 +55,8 @@ namespace { // called on each node traversed BEFORE their children. template -static void DepthFirstSearch(const BBType* bb, SuccessorLambda successors, - PreLambda pre, PostLambda post) { +void DepthFirstSearch(const BBType* bb, SuccessorLambda successors, + PreLambda pre, PostLambda post) { auto no_terminal_blocks = [](const BBType*) { return false; }; CFA::DepthFirstTraversal(bb, successors, pre, post, no_terminal_blocks); @@ -73,9 +73,8 @@ static void DepthFirstSearch(const BBType* bb, SuccessorLambda successors, // PostLambda - Lamdba matching the signature of 'void (const BBType*)' will be // called on each node traversed after their children. template -static void DepthFirstSearchPostOrder(const BBType* bb, - SuccessorLambda successors, - PostLambda post) { +void DepthFirstSearchPostOrder(const BBType* bb, SuccessorLambda successors, + PostLambda post) { // Ignore preorder operation. auto nop_preorder = [](const BBType*) {}; DepthFirstSearch(bb, successors, nop_preorder, post); diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp index d368bd145..d02151560 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp @@ -40,7 +40,7 @@ Pass::Status EliminateDeadConstantPass::Process() { context()->get_def_use_mgr()->ForEachUse( const_id, [&count](Instruction* user, uint32_t index) { (void)index; - SpvOp op = user->opcode(); + spv::Op op = user->opcode(); if (!(IsAnnotationInst(op) || IsDebug1Inst(op) || IsDebug2Inst(op) || IsDebug3Inst(op))) { ++count; @@ -59,9 +59,9 @@ Pass::Status EliminateDeadConstantPass::Process() { Instruction* inst = *working_list.begin(); // Back propagate if the instruction contains IDs in its operands. switch (inst->opcode()) { - case SpvOp::SpvOpConstantComposite: - case SpvOp::SpvOpSpecConstantComposite: - case SpvOp::SpvOpSpecConstantOp: + case spv::Op::OpConstantComposite: + case spv::Op::OpSpecConstantComposite: + case spv::Op::OpSpecConstantOp: for (uint32_t i = 0; i < inst->NumInOperands(); i++) { // SpecConstantOp instruction contains 'opcode' as its operand. Need // to exclude such operands when decreasing uses. diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp index 1379120ff..cf7f92f55 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp @@ -28,12 +28,12 @@ Module::iterator EliminateFunction(IRContext* context, ->ForEachInst( [context, first_func, func_iter, &seen_func_end, &to_kill](Instruction* inst) { - if (inst->opcode() == SpvOpFunctionEnd) { + if (inst->opcode() == spv::Op::OpFunctionEnd) { seen_func_end = true; } // Move non-semantic instructions to the previous function or // global values if this is the first function. - if (seen_func_end && inst->opcode() == SpvOpExtInst) { + if (seen_func_end && inst->opcode() == spv::Op::OpExtInst) { assert(inst->IsNonSemanticInstruction()); if (to_kill.find(inst) != to_kill.end()) return; std::unique_ptr clone(inst->Clone(context)); diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp deleted file mode 100644 index aa2776bbd..000000000 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) 2022 The Khronos Group Inc. -// Copyright (c) 2022 LunarG Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "source/opt/eliminate_dead_input_components_pass.h" - -#include -#include - -#include "source/opt/instruction.h" -#include "source/opt/ir_builder.h" -#include "source/opt/ir_context.h" -#include "source/util/bit_vector.h" - -namespace { - -const uint32_t kAccessChainBaseInIdx = 0; -const uint32_t kAccessChainIndex0InIdx = 1; -const uint32_t kConstantValueInIdx = 0; -const uint32_t kVariableStorageClassInIdx = 0; - -} // namespace - -namespace spvtools { -namespace opt { - -Pass::Status EliminateDeadInputComponentsPass::Process() { - // Current functionality assumes shader capability - if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) - return Status::SuccessWithoutChange; - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - bool modified = false; - std::vector> arrays_to_change; - for (auto& var : context()->types_values()) { - if (var.opcode() != SpvOpVariable) { - continue; - } - analysis::Type* var_type = type_mgr->GetType(var.type_id()); - analysis::Pointer* ptr_type = var_type->AsPointer(); - if (ptr_type == nullptr) { - continue; - } - if (ptr_type->storage_class() != SpvStorageClassInput) { - continue; - } - const analysis::Array* arr_type = ptr_type->pointee_type()->AsArray(); - if (arr_type != nullptr) { - unsigned arr_len_id = arr_type->LengthId(); - Instruction* arr_len_inst = def_use_mgr->GetDef(arr_len_id); - if (arr_len_inst->opcode() != SpvOpConstant) { - continue; - } - // SPIR-V requires array size is >= 1, so this works for signed or - // unsigned size - unsigned original_max = - arr_len_inst->GetSingleWordInOperand(kConstantValueInIdx) - 1; - unsigned max_idx = FindMaxIndex(var, original_max); - if (max_idx != original_max) { - ChangeArrayLength(var, max_idx + 1); - modified = true; - } - continue; - } - const analysis::Struct* struct_type = ptr_type->pointee_type()->AsStruct(); - if (struct_type == nullptr) continue; - const auto elt_types = struct_type->element_types(); - unsigned original_max = static_cast(elt_types.size()) - 1; - unsigned max_idx = FindMaxIndex(var, original_max); - if (max_idx != original_max) { - ChangeStructLength(var, max_idx + 1); - modified = true; - } - } - - return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; -} - -unsigned EliminateDeadInputComponentsPass::FindMaxIndex(Instruction& var, - unsigned original_max) { - unsigned max = 0; - bool seen_non_const_ac = false; - assert(var.opcode() == SpvOpVariable && "must be variable"); - context()->get_def_use_mgr()->WhileEachUser( - var.result_id(), [&max, &seen_non_const_ac, var, this](Instruction* use) { - auto use_opcode = use->opcode(); - if (use_opcode == SpvOpLoad || use_opcode == SpvOpCopyMemory || - use_opcode == SpvOpCopyMemorySized || - use_opcode == SpvOpCopyObject) { - seen_non_const_ac = true; - return false; - } - if (use->opcode() != SpvOpAccessChain && - use->opcode() != SpvOpInBoundsAccessChain) { - return true; - } - // OpAccessChain with no indices currently not optimized - if (use->NumInOperands() == 1) { - seen_non_const_ac = true; - return false; - } - unsigned base_id = use->GetSingleWordInOperand(kAccessChainBaseInIdx); - USE_ASSERT(base_id == var.result_id() && "unexpected base"); - unsigned idx_id = use->GetSingleWordInOperand(kAccessChainIndex0InIdx); - Instruction* idx_inst = context()->get_def_use_mgr()->GetDef(idx_id); - if (idx_inst->opcode() != SpvOpConstant) { - seen_non_const_ac = true; - return false; - } - unsigned value = idx_inst->GetSingleWordInOperand(kConstantValueInIdx); - if (value > max) max = value; - return true; - }); - return seen_non_const_ac ? original_max : max; -} - -void EliminateDeadInputComponentsPass::ChangeArrayLength(Instruction& arr_var, - unsigned length) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - analysis::Pointer* ptr_type = - type_mgr->GetType(arr_var.type_id())->AsPointer(); - const analysis::Array* arr_ty = ptr_type->pointee_type()->AsArray(); - assert(arr_ty && "expecting array type"); - uint32_t length_id = const_mgr->GetUIntConst(length); - analysis::Array new_arr_ty(arr_ty->element_type(), - arr_ty->GetConstantLengthInfo(length_id, length)); - analysis::Type* reg_new_arr_ty = type_mgr->GetRegisteredType(&new_arr_ty); - analysis::Pointer new_ptr_ty(reg_new_arr_ty, SpvStorageClassInput); - analysis::Type* reg_new_ptr_ty = type_mgr->GetRegisteredType(&new_ptr_ty); - uint32_t new_ptr_ty_id = type_mgr->GetTypeInstruction(reg_new_ptr_ty); - arr_var.SetResultType(new_ptr_ty_id); - def_use_mgr->AnalyzeInstUse(&arr_var); - // Move arr_var after its new type to preserve order - USE_ASSERT(arr_var.GetSingleWordInOperand(kVariableStorageClassInIdx) != - SpvStorageClassFunction && - "cannot move Function variable"); - Instruction* new_ptr_ty_inst = def_use_mgr->GetDef(new_ptr_ty_id); - arr_var.RemoveFromList(); - arr_var.InsertAfter(new_ptr_ty_inst); -} - -void EliminateDeadInputComponentsPass::ChangeStructLength( - Instruction& struct_var, unsigned length) { - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Pointer* ptr_type = - type_mgr->GetType(struct_var.type_id())->AsPointer(); - const analysis::Struct* struct_ty = ptr_type->pointee_type()->AsStruct(); - assert(struct_ty && "expecting struct type"); - const auto orig_elt_types = struct_ty->element_types(); - std::vector new_elt_types; - for (unsigned u = 0; u < length; ++u) - new_elt_types.push_back(orig_elt_types[u]); - analysis::Struct new_struct_ty(new_elt_types); - analysis::Type* reg_new_struct_ty = - type_mgr->GetRegisteredType(&new_struct_ty); - uint32_t new_struct_ty_id = type_mgr->GetTypeInstruction(reg_new_struct_ty); - uint32_t old_struct_ty_id = type_mgr->GetTypeInstruction(struct_ty); - analysis::DecorationManager* deco_mgr = context()->get_decoration_mgr(); - deco_mgr->CloneDecorations(old_struct_ty_id, new_struct_ty_id); - analysis::Pointer new_ptr_ty(reg_new_struct_ty, SpvStorageClassInput); - analysis::Type* reg_new_ptr_ty = type_mgr->GetRegisteredType(&new_ptr_ty); - uint32_t new_ptr_ty_id = type_mgr->GetTypeInstruction(reg_new_ptr_ty); - struct_var.SetResultType(new_ptr_ty_id); - analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); - def_use_mgr->AnalyzeInstUse(&struct_var); - // Move struct_var after its new type to preserve order - USE_ASSERT(struct_var.GetSingleWordInOperand(kVariableStorageClassInIdx) != - SpvStorageClassFunction && - "cannot move Function variable"); - Instruction* new_ptr_ty_inst = def_use_mgr->GetDef(new_ptr_ty_id); - struct_var.RemoveFromList(); - struct_var.InsertAfter(new_ptr_ty_inst); -} - -} // namespace opt -} // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp new file mode 100644 index 000000000..916fc27a3 --- /dev/null +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp @@ -0,0 +1,258 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// Copyright (c) 2022 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/opt/eliminate_dead_io_components_pass.h" + +#include +#include + +#include "source/opt/instruction.h" +#include "source/opt/ir_builder.h" +#include "source/opt/ir_context.h" +#include "source/util/bit_vector.h" + +namespace spvtools { +namespace opt { +namespace { +constexpr uint32_t kAccessChainBaseInIdx = 0; +constexpr uint32_t kAccessChainIndex0InIdx = 1; +constexpr uint32_t kAccessChainIndex1InIdx = 2; +constexpr uint32_t kConstantValueInIdx = 0; +} // namespace + +Pass::Status EliminateDeadIOComponentsPass::Process() { + // Only process input and output variables + if (elim_sclass_ != spv::StorageClass::Input && + elim_sclass_ != spv::StorageClass::Output) { + if (consumer()) { + std::string message = + "EliminateDeadIOComponentsPass only valid for input and output " + "variables."; + consumer()(SPV_MSG_ERROR, 0, {0, 0, 0}, message.c_str()); + } + return Status::Failure; + } + // If safe mode, only process Input variables in vertex shader + const auto stage = context()->GetStage(); + if (safe_mode_ && !(stage == spv::ExecutionModel::Vertex && + elim_sclass_ == spv::StorageClass::Input)) + return Status::SuccessWithoutChange; + // Current functionality assumes shader capability. + if (!context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) + return Status::SuccessWithoutChange; + // Current functionality assumes vert, frag, tesc, tese or geom shader. + // TODO(issue #4988): Add GLCompute. + if (stage != spv::ExecutionModel::Vertex && + stage != spv::ExecutionModel::Fragment && + stage != spv::ExecutionModel::TessellationControl && + stage != spv::ExecutionModel::TessellationEvaluation && + stage != spv::ExecutionModel::Geometry) + return Status::SuccessWithoutChange; + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + bool modified = false; + std::vector vars_to_move; + for (auto& var : context()->types_values()) { + if (var.opcode() != spv::Op::OpVariable) { + continue; + } + analysis::Type* var_type = type_mgr->GetType(var.type_id()); + analysis::Pointer* ptr_type = var_type->AsPointer(); + if (ptr_type == nullptr) { + continue; + } + const auto sclass = ptr_type->storage_class(); + if (sclass != elim_sclass_) { + continue; + } + // For tesc, or input variables in tese or geom shaders, + // there is a outer per-vertex-array that must be ignored + // for the purposes of this analysis/optimization. Do the + // analysis on the inner type in these cases. + bool skip_first_index = false; + auto core_type = ptr_type->pointee_type(); + if (stage == spv::ExecutionModel::TessellationControl || + (sclass == spv::StorageClass::Input && + (stage == spv::ExecutionModel::TessellationEvaluation || + stage == spv::ExecutionModel::Geometry))) { + auto arr_type = core_type->AsArray(); + if (!arr_type) continue; + core_type = arr_type->element_type(); + skip_first_index = true; + } + const analysis::Array* arr_type = core_type->AsArray(); + if (arr_type != nullptr) { + // Only process array if input of vertex shader, or output of + // fragment shader. Otherwise, if one shader has a runtime index and the + // other does not, interface incompatibility can occur. + if (!((sclass == spv::StorageClass::Input && + stage == spv::ExecutionModel::Vertex) || + (sclass == spv::StorageClass::Output && + stage == spv::ExecutionModel::Fragment))) + continue; + unsigned arr_len_id = arr_type->LengthId(); + Instruction* arr_len_inst = def_use_mgr->GetDef(arr_len_id); + if (arr_len_inst->opcode() != spv::Op::OpConstant) { + continue; + } + // SPIR-V requires array size is >= 1, so this works for signed or + // unsigned size. + unsigned original_max = + arr_len_inst->GetSingleWordInOperand(kConstantValueInIdx) - 1; + unsigned max_idx = FindMaxIndex(var, original_max); + if (max_idx != original_max) { + ChangeArrayLength(var, max_idx + 1); + vars_to_move.push_back(&var); + modified = true; + } + continue; + } + const analysis::Struct* struct_type = core_type->AsStruct(); + if (struct_type == nullptr) continue; + const auto elt_types = struct_type->element_types(); + unsigned original_max = static_cast(elt_types.size()) - 1; + unsigned max_idx = FindMaxIndex(var, original_max, skip_first_index); + if (max_idx != original_max) { + ChangeIOVarStructLength(var, max_idx + 1); + vars_to_move.push_back(&var); + modified = true; + } + } + + // Move changed vars after their new type instruction to preserve backward + // referencing. + for (auto var : vars_to_move) { + auto type_id = var->type_id(); + auto type_inst = def_use_mgr->GetDef(type_id); + var->RemoveFromList(); + var->InsertAfter(type_inst); + } + + return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; +} + +unsigned EliminateDeadIOComponentsPass::FindMaxIndex( + const Instruction& var, const unsigned original_max, + const bool skip_first_index) { + unsigned max = 0; + bool seen_non_const_ac = false; + assert(var.opcode() == spv::Op::OpVariable && "must be variable"); + context()->get_def_use_mgr()->WhileEachUser( + var.result_id(), [&max, &seen_non_const_ac, var, skip_first_index, + this](Instruction* use) { + auto use_opcode = use->opcode(); + if (use_opcode == spv::Op::OpLoad || use_opcode == spv::Op::OpStore || + use_opcode == spv::Op::OpCopyMemory || + use_opcode == spv::Op::OpCopyMemorySized || + use_opcode == spv::Op::OpCopyObject) { + seen_non_const_ac = true; + return false; + } + if (use->opcode() != spv::Op::OpAccessChain && + use->opcode() != spv::Op::OpInBoundsAccessChain) { + return true; + } + // OpAccessChain with no indices currently not optimized + if (use->NumInOperands() == 1 || + (skip_first_index && use->NumInOperands() == 2)) { + seen_non_const_ac = true; + return false; + } + const unsigned base_id = + use->GetSingleWordInOperand(kAccessChainBaseInIdx); + USE_ASSERT(base_id == var.result_id() && "unexpected base"); + const unsigned in_idx = skip_first_index ? kAccessChainIndex1InIdx + : kAccessChainIndex0InIdx; + const unsigned idx_id = use->GetSingleWordInOperand(in_idx); + Instruction* idx_inst = context()->get_def_use_mgr()->GetDef(idx_id); + if (idx_inst->opcode() != spv::Op::OpConstant) { + seen_non_const_ac = true; + return false; + } + unsigned value = idx_inst->GetSingleWordInOperand(kConstantValueInIdx); + if (value > max) max = value; + return true; + }); + return seen_non_const_ac ? original_max : max; +} + +void EliminateDeadIOComponentsPass::ChangeArrayLength(Instruction& arr_var, + unsigned length) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + analysis::Pointer* ptr_type = + type_mgr->GetType(arr_var.type_id())->AsPointer(); + const analysis::Array* arr_ty = ptr_type->pointee_type()->AsArray(); + assert(arr_ty && "expecting array type"); + uint32_t length_id = const_mgr->GetUIntConstId(length); + analysis::Array new_arr_ty(arr_ty->element_type(), + arr_ty->GetConstantLengthInfo(length_id, length)); + analysis::Type* reg_new_arr_ty = type_mgr->GetRegisteredType(&new_arr_ty); + analysis::Pointer new_ptr_ty(reg_new_arr_ty, ptr_type->storage_class()); + analysis::Type* reg_new_ptr_ty = type_mgr->GetRegisteredType(&new_ptr_ty); + uint32_t new_ptr_ty_id = type_mgr->GetTypeInstruction(reg_new_ptr_ty); + arr_var.SetResultType(new_ptr_ty_id); + def_use_mgr->AnalyzeInstUse(&arr_var); +} + +void EliminateDeadIOComponentsPass::ChangeIOVarStructLength(Instruction& io_var, + unsigned length) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::Pointer* ptr_type = + type_mgr->GetType(io_var.type_id())->AsPointer(); + auto core_type = ptr_type->pointee_type(); + // Check for per-vertex-array of struct from tesc, tese and geom and grab + // embedded struct type. + const auto arr_type = core_type->AsArray(); + if (arr_type) core_type = arr_type->element_type(); + const analysis::Struct* struct_ty = core_type->AsStruct(); + assert(struct_ty && "expecting struct type"); + const auto orig_elt_types = struct_ty->element_types(); + std::vector new_elt_types; + for (unsigned u = 0; u < length; ++u) + new_elt_types.push_back(orig_elt_types[u]); + analysis::Struct new_struct_ty(new_elt_types); + uint32_t old_struct_ty_id = type_mgr->GetTypeInstruction(struct_ty); + std::vector decorations = + context()->get_decoration_mgr()->GetDecorationsFor(old_struct_ty_id, + true); + for (auto dec : decorations) { + if (dec->opcode() == spv::Op::OpMemberDecorate) { + uint32_t midx = dec->GetSingleWordInOperand(1); + if (midx >= length) continue; + } + type_mgr->AttachDecoration(*dec, &new_struct_ty); + } + // Clone name instructions for new struct type + analysis::Type* reg_new_str_ty = type_mgr->GetRegisteredType(&new_struct_ty); + uint32_t new_struct_ty_id = type_mgr->GetTypeInstruction(reg_new_str_ty); + context()->CloneNames(old_struct_ty_id, new_struct_ty_id, length); + // Attach new type to var + analysis::Type* reg_new_var_ty = reg_new_str_ty; + if (arr_type) { + analysis::Array new_arr_ty(reg_new_var_ty, arr_type->length_info()); + reg_new_var_ty = type_mgr->GetRegisteredType(&new_arr_ty); + } + analysis::Pointer new_ptr_ty(reg_new_var_ty, elim_sclass_); + analysis::Type* reg_new_ptr_ty = type_mgr->GetRegisteredType(&new_ptr_ty); + uint32_t new_ptr_ty_id = type_mgr->GetTypeInstruction(reg_new_ptr_ty); + io_var.SetResultType(new_ptr_ty_id); + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + def_use_mgr->AnalyzeInstUse(&io_var); +} + +} // namespace opt +} // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h b/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.h similarity index 69% rename from 3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h rename to 3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.h index a3a133c2b..ef4dfb717 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.h @@ -26,14 +26,15 @@ namespace spvtools { namespace opt { // See optimizer.hpp for documentation. -class EliminateDeadInputComponentsPass : public Pass { +class EliminateDeadIOComponentsPass : public Pass { public: - explicit EliminateDeadInputComponentsPass() {} + explicit EliminateDeadIOComponentsPass(spv::StorageClass elim_sclass, + bool safe_mode = true) + : elim_sclass_(elim_sclass), safe_mode_(safe_mode) {} const char* name() const override { return "eliminate-dead-input-components"; } - Status Process() override; // Return the mask of preserved Analyses. @@ -50,13 +51,22 @@ class EliminateDeadInputComponentsPass : public Pass { // Find the max constant used to index the variable declared by |var| // through OpAccessChain or OpInBoundsAccessChain. If any non-constant // indices or non-Op*AccessChain use of |var|, return |original_max|. - unsigned FindMaxIndex(Instruction& var, unsigned original_max); + unsigned FindMaxIndex(const Instruction& var, const unsigned original_max, + const bool skip_first_index = false); // Change the length of the array |inst| to |length| void ChangeArrayLength(Instruction& inst, unsigned length); - // Change the length of the struct |struct_var| to |length| - void ChangeStructLength(Instruction& struct_var, unsigned length); + // Change the length of the struct in |io_var| to |length|. |io_var| + // is either the struct or a per-vertex-array of the struct. + void ChangeIOVarStructLength(Instruction& io_var, unsigned length); + + // Storage class to be optimized. Must be Input or Output. + spv::StorageClass elim_sclass_; + + // Only make changes that will not cause interface incompatibility if done + // standalone. Currently this is only Input variables in vertex shaders. + bool safe_mode_; }; } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp index 52aca5254..1c98502e2 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp @@ -17,17 +17,16 @@ #include "ir_builder.h" #include "source/opt/ir_context.h" +namespace spvtools { +namespace opt { namespace { -const uint32_t kRemovedMember = 0xFFFFFFFF; -const uint32_t kSpecConstOpOpcodeIdx = 0; +constexpr uint32_t kRemovedMember = 0xFFFFFFFF; +constexpr uint32_t kSpecConstOpOpcodeIdx = 0; constexpr uint32_t kArrayElementTypeIdx = 0; } // namespace -namespace spvtools { -namespace opt { - Pass::Status EliminateDeadMembersPass::Process() { - if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + if (!context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) return Status::SuccessWithoutChange; FindLiveMembers(); @@ -41,27 +40,27 @@ void EliminateDeadMembersPass::FindLiveMembers() { // Until we have implemented the rewriting of OpSpecConsantOp instructions, // we have to mark them as fully used just to be safe. for (auto& inst : get_module()->types_values()) { - if (inst.opcode() == SpvOpSpecConstantOp) { - switch (inst.GetSingleWordInOperand(kSpecConstOpOpcodeIdx)) { - case SpvOpCompositeExtract: + if (inst.opcode() == spv::Op::OpSpecConstantOp) { + switch (spv::Op(inst.GetSingleWordInOperand(kSpecConstOpOpcodeIdx))) { + case spv::Op::OpCompositeExtract: MarkMembersAsLiveForExtract(&inst); break; - case SpvOpCompositeInsert: + case spv::Op::OpCompositeInsert: // Nothing specific to do. break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: assert(false && "Not implemented yet."); break; default: break; } - } else if (inst.opcode() == SpvOpVariable) { - switch (inst.GetSingleWordInOperand(0)) { - case SpvStorageClassInput: - case SpvStorageClassOutput: + } else if (inst.opcode() == spv::Op::OpVariable) { + switch (spv::StorageClass(inst.GetSingleWordInOperand(0))) { + case spv::StorageClass::Input: + case spv::StorageClass::Output: MarkPointeeTypeAsFullUsed(inst.type_id()); break; default: @@ -86,34 +85,34 @@ void EliminateDeadMembersPass::FindLiveMembers(const Function& function) { void EliminateDeadMembersPass::FindLiveMembers(const Instruction* inst) { switch (inst->opcode()) { - case SpvOpStore: + case spv::Op::OpStore: MarkMembersAsLiveForStore(inst); break; - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: MarkMembersAsLiveForCopyMemory(inst); break; - case SpvOpCompositeExtract: + case spv::Op::OpCompositeExtract: MarkMembersAsLiveForExtract(inst); break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: MarkMembersAsLiveForAccessChain(inst); break; - case SpvOpReturnValue: + case spv::Op::OpReturnValue: // This should be an issue only if we are returning from the entry point. // However, for now I will keep it more conservative because functions are // often inlined leaving only the entry points. MarkOperandTypeAsFullyUsed(inst, 0); break; - case SpvOpArrayLength: + case spv::Op::OpArrayLength: MarkMembersAsLiveForArrayLength(inst); break; - case SpvOpLoad: - case SpvOpCompositeInsert: - case SpvOpCompositeConstruct: + case spv::Op::OpLoad: + case spv::Op::OpCompositeInsert: + case spv::Op::OpCompositeConstruct: break; default: // This path is here for safety. All instructions that can reference @@ -131,7 +130,7 @@ void EliminateDeadMembersPass::MarkMembersAsLiveForStore( // memory that is read outside of the shader. Other passes can remove all // store to memory that is not visible outside of the shader, so we do not // complicate the code for now. - assert(inst->opcode() == SpvOpStore); + assert(inst->opcode() == spv::Op::OpStore); uint32_t object_id = inst->GetSingleWordInOperand(1); Instruction* object_inst = context()->get_def_use_mgr()->GetDef(object_id); uint32_t object_type_id = object_inst->type_id(); @@ -143,15 +142,15 @@ void EliminateDeadMembersPass::MarkTypeAsFullyUsed(uint32_t type_id) { assert(type_inst != nullptr); switch (type_inst->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: // Mark every member and its type as fully used. for (uint32_t i = 0; i < type_inst->NumInOperands(); ++i) { used_members_[type_id].insert(i); MarkTypeAsFullyUsed(type_inst->GetSingleWordInOperand(i)); } break; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: MarkTypeAsFullyUsed( type_inst->GetSingleWordInOperand(kArrayElementTypeIdx)); break; @@ -162,7 +161,7 @@ void EliminateDeadMembersPass::MarkTypeAsFullyUsed(uint32_t type_id) { void EliminateDeadMembersPass::MarkPointeeTypeAsFullUsed(uint32_t ptr_type_id) { Instruction* ptr_type_inst = get_def_use_mgr()->GetDef(ptr_type_id); - assert(ptr_type_inst->opcode() == SpvOpTypePointer); + assert(ptr_type_inst->opcode() == spv::Op::OpTypePointer); MarkTypeAsFullyUsed(ptr_type_inst->GetSingleWordInOperand(1)); } @@ -178,12 +177,13 @@ void EliminateDeadMembersPass::MarkMembersAsLiveForCopyMemory( void EliminateDeadMembersPass::MarkMembersAsLiveForExtract( const Instruction* inst) { - assert(inst->opcode() == SpvOpCompositeExtract || - (inst->opcode() == SpvOpSpecConstantOp && - inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx) == - SpvOpCompositeExtract)); + assert(inst->opcode() == spv::Op::OpCompositeExtract || + (inst->opcode() == spv::Op::OpSpecConstantOp && + spv::Op(inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx)) == + spv::Op::OpCompositeExtract)); - uint32_t first_operand = (inst->opcode() == SpvOpSpecConstantOp ? 1 : 0); + uint32_t first_operand = + (inst->opcode() == spv::Op::OpSpecConstantOp ? 1 : 0); uint32_t composite_id = inst->GetSingleWordInOperand(first_operand); Instruction* composite_inst = get_def_use_mgr()->GetDef(composite_id); uint32_t type_id = composite_inst->type_id(); @@ -192,14 +192,14 @@ void EliminateDeadMembersPass::MarkMembersAsLiveForExtract( Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); uint32_t member_idx = inst->GetSingleWordInOperand(i); switch (type_inst->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: used_members_[type_id].insert(member_idx); type_id = type_inst->GetSingleWordInOperand(member_idx); break; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: - case SpvOpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: type_id = type_inst->GetSingleWordInOperand(0); break; default: @@ -210,10 +210,10 @@ void EliminateDeadMembersPass::MarkMembersAsLiveForExtract( void EliminateDeadMembersPass::MarkMembersAsLiveForAccessChain( const Instruction* inst) { - assert(inst->opcode() == SpvOpAccessChain || - inst->opcode() == SpvOpInBoundsAccessChain || - inst->opcode() == SpvOpPtrAccessChain || - inst->opcode() == SpvOpInBoundsPtrAccessChain); + assert(inst->opcode() == spv::Op::OpAccessChain || + inst->opcode() == spv::Op::OpInBoundsAccessChain || + inst->opcode() == spv::Op::OpPtrAccessChain || + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain); uint32_t pointer_id = inst->GetSingleWordInOperand(0); Instruction* pointer_inst = get_def_use_mgr()->GetDef(pointer_id); @@ -225,14 +225,14 @@ void EliminateDeadMembersPass::MarkMembersAsLiveForAccessChain( // For a pointer access chain, we need to skip the |element| index. It is not // a reference to the member of a struct, and it does not change the type. - uint32_t i = (inst->opcode() == SpvOpAccessChain || - inst->opcode() == SpvOpInBoundsAccessChain + uint32_t i = (inst->opcode() == spv::Op::OpAccessChain || + inst->opcode() == spv::Op::OpInBoundsAccessChain ? 1 : 2); for (; i < inst->NumInOperands(); ++i) { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); switch (type_inst->opcode()) { - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const analysis::IntConstant* member_idx = const_mgr->FindDeclaredConstant(inst->GetSingleWordInOperand(i)) ->AsIntConstant(); @@ -242,10 +242,10 @@ void EliminateDeadMembersPass::MarkMembersAsLiveForAccessChain( used_members_[type_id].insert(index); type_id = type_inst->GetSingleWordInOperand(index); } break; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: - case SpvOpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: type_id = type_inst->GetSingleWordInOperand(0); break; default: @@ -263,7 +263,7 @@ void EliminateDeadMembersPass::MarkOperandTypeAsFullyUsed( void EliminateDeadMembersPass::MarkMembersAsLiveForArrayLength( const Instruction* inst) { - assert(inst->opcode() == SpvOpArrayLength); + assert(inst->opcode() == spv::Op::OpArrayLength); uint32_t object_id = inst->GetSingleWordInOperand(0); Instruction* object_inst = get_def_use_mgr()->GetDef(object_id); uint32_t pointer_type_id = object_inst->type_id(); @@ -278,7 +278,7 @@ bool EliminateDeadMembersPass::RemoveDeadMembers() { // First update all of the OpTypeStruct instructions. get_module()->ForEachInst([&modified, this](Instruction* inst) { switch (inst->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: modified |= UpdateOpTypeStruct(inst); break; default: @@ -289,47 +289,47 @@ bool EliminateDeadMembersPass::RemoveDeadMembers() { // Now update all of the instructions that reference the OpTypeStructs. get_module()->ForEachInst([&modified, this](Instruction* inst) { switch (inst->opcode()) { - case SpvOpMemberName: + case spv::Op::OpMemberName: modified |= UpdateOpMemberNameOrDecorate(inst); break; - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: modified |= UpdateOpMemberNameOrDecorate(inst); break; - case SpvOpGroupMemberDecorate: + case spv::Op::OpGroupMemberDecorate: modified |= UpdateOpGroupMemberDecorate(inst); break; - case SpvOpSpecConstantComposite: - case SpvOpConstantComposite: - case SpvOpCompositeConstruct: + case spv::Op::OpSpecConstantComposite: + case spv::Op::OpConstantComposite: + case spv::Op::OpCompositeConstruct: modified |= UpdateConstantComposite(inst); break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: modified |= UpdateAccessChain(inst); break; - case SpvOpCompositeExtract: + case spv::Op::OpCompositeExtract: modified |= UpdateCompsiteExtract(inst); break; - case SpvOpCompositeInsert: + case spv::Op::OpCompositeInsert: modified |= UpdateCompositeInsert(inst); break; - case SpvOpArrayLength: + case spv::Op::OpArrayLength: modified |= UpdateOpArrayLength(inst); break; - case SpvOpSpecConstantOp: - switch (inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx)) { - case SpvOpCompositeExtract: + case spv::Op::OpSpecConstantOp: + switch (spv::Op(inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx))) { + case spv::Op::OpCompositeExtract: modified |= UpdateCompsiteExtract(inst); break; - case SpvOpCompositeInsert: + case spv::Op::OpCompositeInsert: modified |= UpdateCompositeInsert(inst); break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: assert(false && "Not implemented yet."); break; default: @@ -344,7 +344,7 @@ bool EliminateDeadMembersPass::RemoveDeadMembers() { } bool EliminateDeadMembersPass::UpdateOpTypeStruct(Instruction* inst) { - assert(inst->opcode() == SpvOpTypeStruct); + assert(inst->opcode() == spv::Op::OpTypeStruct); const auto& live_members = used_members_[inst->result_id()]; if (live_members.size() == inst->NumInOperands()) { @@ -362,8 +362,8 @@ bool EliminateDeadMembersPass::UpdateOpTypeStruct(Instruction* inst) { } bool EliminateDeadMembersPass::UpdateOpMemberNameOrDecorate(Instruction* inst) { - assert(inst->opcode() == SpvOpMemberName || - inst->opcode() == SpvOpMemberDecorate); + assert(inst->opcode() == spv::Op::OpMemberName || + inst->opcode() == spv::Op::OpMemberDecorate); uint32_t type_id = inst->GetSingleWordInOperand(0); auto live_members = used_members_.find(type_id); @@ -388,7 +388,7 @@ bool EliminateDeadMembersPass::UpdateOpMemberNameOrDecorate(Instruction* inst) { } bool EliminateDeadMembersPass::UpdateOpGroupMemberDecorate(Instruction* inst) { - assert(inst->opcode() == SpvOpGroupMemberDecorate); + assert(inst->opcode() == spv::Op::OpGroupMemberDecorate); bool modified = false; @@ -429,9 +429,9 @@ bool EliminateDeadMembersPass::UpdateOpGroupMemberDecorate(Instruction* inst) { } bool EliminateDeadMembersPass::UpdateConstantComposite(Instruction* inst) { - assert(inst->opcode() == SpvOpSpecConstantComposite || - inst->opcode() == SpvOpConstantComposite || - inst->opcode() == SpvOpCompositeConstruct); + assert(inst->opcode() == spv::Op::OpSpecConstantComposite || + inst->opcode() == spv::Op::OpConstantComposite || + inst->opcode() == spv::Op::OpCompositeConstruct); uint32_t type_id = inst->type_id(); bool modified = false; @@ -450,10 +450,10 @@ bool EliminateDeadMembersPass::UpdateConstantComposite(Instruction* inst) { } bool EliminateDeadMembersPass::UpdateAccessChain(Instruction* inst) { - assert(inst->opcode() == SpvOpAccessChain || - inst->opcode() == SpvOpInBoundsAccessChain || - inst->opcode() == SpvOpPtrAccessChain || - inst->opcode() == SpvOpInBoundsPtrAccessChain); + assert(inst->opcode() == spv::Op::OpAccessChain || + inst->opcode() == spv::Op::OpInBoundsAccessChain || + inst->opcode() == spv::Op::OpPtrAccessChain || + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain); uint32_t pointer_id = inst->GetSingleWordInOperand(0); Instruction* pointer_inst = get_def_use_mgr()->GetDef(pointer_id); @@ -467,8 +467,8 @@ bool EliminateDeadMembersPass::UpdateAccessChain(Instruction* inst) { new_operands.emplace_back(inst->GetInOperand(0)); // For pointer access chains we want to copy the element operand. - if (inst->opcode() == SpvOpPtrAccessChain || - inst->opcode() == SpvOpInBoundsPtrAccessChain) { + if (inst->opcode() == spv::Op::OpPtrAccessChain || + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) { new_operands.emplace_back(inst->GetInOperand(1)); } @@ -476,7 +476,7 @@ bool EliminateDeadMembersPass::UpdateAccessChain(Instruction* inst) { i < inst->NumInOperands(); ++i) { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); switch (type_inst->opcode()) { - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const analysis::IntConstant* member_idx = const_mgr->FindDeclaredConstant(inst->GetSingleWordInOperand(i)) ->AsIntConstant(); @@ -501,10 +501,10 @@ bool EliminateDeadMembersPass::UpdateAccessChain(Instruction* inst) { // index. type_id = type_inst->GetSingleWordInOperand(new_member_idx); } break; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: - case SpvOpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: new_operands.emplace_back(inst->GetInOperand(i)); type_id = type_inst->GetSingleWordInOperand(0); break; @@ -539,13 +539,13 @@ uint32_t EliminateDeadMembersPass::GetNewMemberIndex(uint32_t type_id, } bool EliminateDeadMembersPass::UpdateCompsiteExtract(Instruction* inst) { - assert(inst->opcode() == SpvOpCompositeExtract || - (inst->opcode() == SpvOpSpecConstantOp && - inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx) == - SpvOpCompositeExtract)); + assert(inst->opcode() == spv::Op::OpCompositeExtract || + (inst->opcode() == spv::Op::OpSpecConstantOp && + spv::Op(inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx)) == + spv::Op::OpCompositeExtract)); uint32_t first_operand = 0; - if (inst->opcode() == SpvOpSpecConstantOp) { + if (inst->opcode() == spv::Op::OpSpecConstantOp) { first_operand = 1; } uint32_t object_id = inst->GetSingleWordInOperand(first_operand); @@ -569,15 +569,15 @@ bool EliminateDeadMembersPass::UpdateCompsiteExtract(Instruction* inst) { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); switch (type_inst->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: // The type will have already been rewritten, so use the new member // index. type_id = type_inst->GetSingleWordInOperand(new_member_idx); break; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: - case SpvOpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: type_id = type_inst->GetSingleWordInOperand(0); break; default: @@ -594,13 +594,13 @@ bool EliminateDeadMembersPass::UpdateCompsiteExtract(Instruction* inst) { } bool EliminateDeadMembersPass::UpdateCompositeInsert(Instruction* inst) { - assert(inst->opcode() == SpvOpCompositeInsert || - (inst->opcode() == SpvOpSpecConstantOp && - inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx) == - SpvOpCompositeInsert)); + assert(inst->opcode() == spv::Op::OpCompositeInsert || + (inst->opcode() == spv::Op::OpSpecConstantOp && + spv::Op(inst->GetSingleWordInOperand(kSpecConstOpOpcodeIdx)) == + spv::Op::OpCompositeInsert)); uint32_t first_operand = 0; - if (inst->opcode() == SpvOpSpecConstantOp) { + if (inst->opcode() == spv::Op::OpSpecConstantOp) { first_operand = 1; } @@ -630,15 +630,15 @@ bool EliminateDeadMembersPass::UpdateCompositeInsert(Instruction* inst) { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); switch (type_inst->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: // The type will have already been rewritten, so use the new member // index. type_id = type_inst->GetSingleWordInOperand(new_member_idx); break; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: - case SpvOpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: type_id = type_inst->GetSingleWordInOperand(0); break; default: diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp new file mode 100644 index 000000000..f2f64f812 --- /dev/null +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp @@ -0,0 +1,237 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// Copyright (c) 2022 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/opt/eliminate_dead_output_stores_pass.h" + +#include "source/opt/instruction.h" +#include "source/opt/ir_context.h" + +namespace spvtools { +namespace opt { +namespace { +constexpr uint32_t kDecorationLocationInIdx = 2; +constexpr uint32_t kOpDecorateMemberMemberInIdx = 1; +constexpr uint32_t kOpDecorateBuiltInLiteralInIdx = 2; +constexpr uint32_t kOpDecorateMemberBuiltInLiteralInIdx = 3; +constexpr uint32_t kOpAccessChainIdx0InIdx = 1; +constexpr uint32_t kOpConstantValueInIdx = 0; +} // namespace + +Pass::Status EliminateDeadOutputStoresPass::Process() { + // Current functionality assumes shader capability + if (!context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) + return Status::SuccessWithoutChange; + Pass::Status status = DoDeadOutputStoreElimination(); + return status; +} + +void EliminateDeadOutputStoresPass::InitializeElimination() { + kill_list_.clear(); +} + +bool EliminateDeadOutputStoresPass::IsLiveBuiltin(uint32_t bi) { + return live_builtins_->find(bi) != live_builtins_->end(); +} + +bool EliminateDeadOutputStoresPass::AnyLocsAreLive(uint32_t start, + uint32_t count) { + auto finish = start + count; + for (uint32_t u = start; u < finish; ++u) { + if (live_locs_->find(u) != live_locs_->end()) return true; + } + return false; +} + +void EliminateDeadOutputStoresPass::KillAllStoresOfRef(Instruction* ref) { + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + if (ref->opcode() == spv::Op::OpStore) { + kill_list_.push_back(ref); + return; + } + assert((ref->opcode() == spv::Op::OpAccessChain || + ref->opcode() == spv::Op::OpInBoundsAccessChain) && + "unexpected use of output variable"); + def_use_mgr->ForEachUser(ref, [this](Instruction* user) { + if (user->opcode() == spv::Op::OpStore) kill_list_.push_back(user); + }); +} + +void EliminateDeadOutputStoresPass::KillAllDeadStoresOfLocRef( + Instruction* ref, Instruction* var) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::DecorationManager* deco_mgr = context()->get_decoration_mgr(); + analysis::LivenessManager* live_mgr = context()->get_liveness_mgr(); + // Find variable location if present. + uint32_t start_loc = 0; + auto var_id = var->result_id(); + bool no_loc = deco_mgr->WhileEachDecoration( + var_id, uint32_t(spv::Decoration::Location), + [&start_loc](const Instruction& deco) { + assert(deco.opcode() == spv::Op::OpDecorate && "unexpected decoration"); + start_loc = deco.GetSingleWordInOperand(kDecorationLocationInIdx); + return false; + }); + // Find patch decoration if present + bool is_patch = !deco_mgr->WhileEachDecoration( + var_id, uint32_t(spv::Decoration::Patch), [](const Instruction& deco) { + if (deco.opcode() != spv::Op::OpDecorate) + assert(false && "unexpected decoration"); + return false; + }); + // Compute offset and final type of reference. If no location found + // or any stored locations are live, return without removing stores. + auto ptr_type = type_mgr->GetType(var->type_id())->AsPointer(); + assert(ptr_type && "unexpected var type"); + auto var_type = ptr_type->pointee_type(); + uint32_t ref_loc = start_loc; + auto curr_type = var_type; + if (ref->opcode() == spv::Op::OpAccessChain || + ref->opcode() == spv::Op::OpInBoundsAccessChain) { + live_mgr->AnalyzeAccessChainLoc(ref, &curr_type, &ref_loc, &no_loc, + is_patch, /* input */ false); + } + if (no_loc || AnyLocsAreLive(ref_loc, live_mgr->GetLocSize(curr_type))) + return; + // Kill all stores based on this reference + KillAllStoresOfRef(ref); +} + +void EliminateDeadOutputStoresPass::KillAllDeadStoresOfBuiltinRef( + Instruction* ref, Instruction* var) { + auto deco_mgr = context()->get_decoration_mgr(); + auto def_use_mgr = context()->get_def_use_mgr(); + auto type_mgr = context()->get_type_mgr(); + auto live_mgr = context()->get_liveness_mgr(); + // Search for builtin decoration of base variable + uint32_t builtin = uint32_t(spv::BuiltIn::Max); + auto var_id = var->result_id(); + (void)deco_mgr->WhileEachDecoration( + var_id, uint32_t(spv::Decoration::BuiltIn), + [&builtin](const Instruction& deco) { + assert(deco.opcode() == spv::Op::OpDecorate && "unexpected decoration"); + builtin = deco.GetSingleWordInOperand(kOpDecorateBuiltInLiteralInIdx); + return false; + }); + // If analyzed builtin and not live, kill stores. + if (builtin != uint32_t(spv::BuiltIn::Max)) { + if (live_mgr->IsAnalyzedBuiltin(builtin) && !IsLiveBuiltin(builtin)) + KillAllStoresOfRef(ref); + return; + } + // Search for builtin decoration on indexed member + auto ref_op = ref->opcode(); + if (ref_op != spv::Op::OpAccessChain && + ref_op != spv::Op::OpInBoundsAccessChain) { + return; + } + uint32_t in_idx = kOpAccessChainIdx0InIdx; + analysis::Type* var_type = type_mgr->GetType(var->type_id()); + analysis::Pointer* ptr_type = var_type->AsPointer(); + auto curr_type = ptr_type->pointee_type(); + auto arr_type = curr_type->AsArray(); + if (arr_type) { + curr_type = arr_type->element_type(); + ++in_idx; + } + auto str_type = curr_type->AsStruct(); + auto str_type_id = type_mgr->GetId(str_type); + auto member_idx_id = ref->GetSingleWordInOperand(in_idx); + auto member_idx_inst = def_use_mgr->GetDef(member_idx_id); + assert(member_idx_inst->opcode() == spv::Op::OpConstant && + "unexpected non-constant index"); + auto ac_idx = member_idx_inst->GetSingleWordInOperand(kOpConstantValueInIdx); + (void)deco_mgr->WhileEachDecoration( + str_type_id, uint32_t(spv::Decoration::BuiltIn), + [ac_idx, &builtin](const Instruction& deco) { + assert(deco.opcode() == spv::Op::OpMemberDecorate && + "unexpected decoration"); + auto deco_idx = + deco.GetSingleWordInOperand(kOpDecorateMemberMemberInIdx); + if (deco_idx == ac_idx) { + builtin = + deco.GetSingleWordInOperand(kOpDecorateMemberBuiltInLiteralInIdx); + return false; + } + return true; + }); + assert(builtin != uint32_t(spv::BuiltIn::Max) && "builtin not found"); + // If analyzed builtin and not live, kill stores. + if (live_mgr->IsAnalyzedBuiltin(builtin) && !IsLiveBuiltin(builtin)) + KillAllStoresOfRef(ref); +} + +Pass::Status EliminateDeadOutputStoresPass::DoDeadOutputStoreElimination() { + // Current implementation only supports vert, tesc, tese, geom shaders + auto stage = context()->GetStage(); + if (stage != spv::ExecutionModel::Vertex && + stage != spv::ExecutionModel::TessellationControl && + stage != spv::ExecutionModel::TessellationEvaluation && + stage != spv::ExecutionModel::Geometry) + return Status::Failure; + InitializeElimination(); + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::DecorationManager* deco_mgr = context()->get_decoration_mgr(); + // Process all output variables + for (auto& var : context()->types_values()) { + if (var.opcode() != spv::Op::OpVariable) { + continue; + } + analysis::Type* var_type = type_mgr->GetType(var.type_id()); + analysis::Pointer* ptr_type = var_type->AsPointer(); + if (ptr_type->storage_class() != spv::StorageClass::Output) { + continue; + } + // If builtin decoration on variable, process as builtin. + auto var_id = var.result_id(); + bool is_builtin = false; + if (deco_mgr->HasDecoration(var_id, uint32_t(spv::Decoration::BuiltIn))) { + is_builtin = true; + } else { + // If interface block with builtin members, process as builtin. + // Strip off outer array type if present. + auto curr_type = ptr_type->pointee_type(); + auto arr_type = curr_type->AsArray(); + if (arr_type) curr_type = arr_type->element_type(); + auto str_type = curr_type->AsStruct(); + if (str_type) { + auto str_type_id = type_mgr->GetId(str_type); + if (deco_mgr->HasDecoration(str_type_id, + uint32_t(spv::Decoration::BuiltIn))) + is_builtin = true; + } + } + // For each store or access chain using var, if dead builtin or all its + // locations are dead, kill store or all access chain's stores + def_use_mgr->ForEachUser( + var_id, [this, &var, is_builtin](Instruction* user) { + auto op = user->opcode(); + if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || + op == spv::Op::OpDecorate) + return; + if (is_builtin) + KillAllDeadStoresOfBuiltinRef(user, &var); + else + KillAllDeadStoresOfLocRef(user, &var); + }); + } + for (auto& kinst : kill_list_) context()->KillInst(kinst); + + return kill_list_.empty() ? Status::SuccessWithoutChange + : Status::SuccessWithChange; +} + +} // namespace opt +} // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h new file mode 100644 index 000000000..13785f349 --- /dev/null +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h @@ -0,0 +1,87 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// Copyright (c) 2022 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_ELIMINATE_DEAD_OUTPUT_STORES_H_ +#define SOURCE_OPT_ELIMINATE_DEAD_OUTPUT_STORES_H_ + +#include + +#include "source/opt/ir_context.h" +#include "source/opt/module.h" +#include "source/opt/pass.h" + +namespace spvtools { +namespace opt { + +// See optimizer.hpp for documentation. +class EliminateDeadOutputStoresPass : public Pass { + public: + explicit EliminateDeadOutputStoresPass( + std::unordered_set* live_locs, + std::unordered_set* live_builtins) + : live_locs_(live_locs), live_builtins_(live_builtins) {} + + const char* name() const override { return "eliminate-dead-output-stores"; } + Status Process() override; + + // Return the mask of preserved Analyses. + IRContext::Analysis GetPreservedAnalyses() override { + return IRContext::kAnalysisDefUse | + IRContext::kAnalysisInstrToBlockMapping | + IRContext::kAnalysisCombinators | IRContext::kAnalysisCFG | + IRContext::kAnalysisDominatorAnalysis | + IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap | + IRContext::kAnalysisConstants | IRContext::kAnalysisTypes; + } + + private: + // Initialize elimination + void InitializeElimination(); + + // Do dead output store analysis + Status DoDeadOutputStoreAnalysis(); + + // Do dead output store analysis + Status DoDeadOutputStoreElimination(); + + // Mark all locations live + void MarkAllLocsLive(); + + // Kill all stores resulting from |ref|. + void KillAllStoresOfRef(Instruction* ref); + + // Kill all dead stores resulting from |user| of loc-based |var|. + void KillAllDeadStoresOfLocRef(Instruction* user, Instruction* var); + + // Kill all dead stores resulting from |user| of builtin |var|. + void KillAllDeadStoresOfBuiltinRef(Instruction* user, Instruction* var); + + // Return true if any of |count| locations starting at location |start| are + // live. + bool AnyLocsAreLive(uint32_t start, uint32_t count); + + // Return true if builtin |bi| is live. + bool IsLiveBuiltin(uint32_t bi); + + std::unordered_set* live_locs_; + std::unordered_set* live_builtins_; + + std::vector kill_list_; +}; + +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_ELIMINATE_DEAD_OUTPUT_STORES_H_ diff --git a/3rdparty/spirv-tools/source/opt/feature_manager.cpp b/3rdparty/spirv-tools/source/opt/feature_manager.cpp index a59027167..2a1c00664 100644 --- a/3rdparty/spirv-tools/source/opt/feature_manager.cpp +++ b/3rdparty/spirv-tools/source/opt/feature_manager.cpp @@ -36,7 +36,7 @@ void FeatureManager::AddExtensions(Module* module) { } void FeatureManager::AddExtension(Instruction* ext) { - assert(ext->opcode() == SpvOpExtension && + assert(ext->opcode() == spv::Op::OpExtension && "Expecting an extension instruction."); const std::string name = ext->GetInOperand(0u).AsString(); @@ -51,27 +51,27 @@ void FeatureManager::RemoveExtension(Extension ext) { extensions_.Remove(ext); } -void FeatureManager::AddCapability(SpvCapability cap) { +void FeatureManager::AddCapability(spv::Capability cap) { if (capabilities_.Contains(cap)) return; capabilities_.Add(cap); spv_operand_desc desc = {}; - if (SPV_SUCCESS == - grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) { + if (SPV_SUCCESS == grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, + uint32_t(cap), &desc)) { CapabilitySet(desc->numCapabilities, desc->capabilities) - .ForEach([this](SpvCapability c) { AddCapability(c); }); + .ForEach([this](spv::Capability c) { AddCapability(c); }); } } -void FeatureManager::RemoveCapability(SpvCapability cap) { +void FeatureManager::RemoveCapability(spv::Capability cap) { if (!capabilities_.Contains(cap)) return; capabilities_.Remove(cap); } void FeatureManager::AddCapabilities(Module* module) { for (Instruction& inst : module->capabilities()) { - AddCapability(static_cast(inst.GetSingleWordInOperand(0))); + AddCapability(static_cast(inst.GetSingleWordInOperand(0))); } } diff --git a/3rdparty/spirv-tools/source/opt/feature_manager.h b/3rdparty/spirv-tools/source/opt/feature_manager.h index 68c8e9a23..b96988de4 100644 --- a/3rdparty/spirv-tools/source/opt/feature_manager.h +++ b/3rdparty/spirv-tools/source/opt/feature_manager.h @@ -34,12 +34,12 @@ class FeatureManager { void RemoveExtension(Extension extension); // Returns true if |cap| is an enabled capability in the module. - bool HasCapability(SpvCapability cap) const { + bool HasCapability(spv::Capability cap) const { return capabilities_.Contains(cap); } // Removes the given |capability| from the current FeatureManager. - void RemoveCapability(SpvCapability capability); + void RemoveCapability(spv::Capability capability); // Analyzes |module| and records enabled extensions and capabilities. void Analyze(Module* module); @@ -66,7 +66,7 @@ class FeatureManager { // Adds the given |capability| and all implied capabilities into the current // FeatureManager. - void AddCapability(SpvCapability capability); + void AddCapability(spv::Capability capability); // Add the extension |ext| to the feature manager. void AddExtension(Instruction* ext); diff --git a/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp b/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp index d140fb4b0..f3486bed3 100644 --- a/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp +++ b/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp @@ -29,7 +29,7 @@ Pass::Status FixFuncCallArgumentsPass::Process() { if (ModuleHasASingleFunction()) return Status::SuccessWithoutChange; for (auto& func : *get_module()) { func.ForEachInst([this, &modified](Instruction* inst) { - if (inst->opcode() == SpvOpFunctionCall) { + if (inst->opcode() == spv::Op::OpFunctionCall) { modified |= FixFuncCallArguments(inst); } }); @@ -44,7 +44,7 @@ bool FixFuncCallArgumentsPass::FixFuncCallArguments( Operand& op = func_call_inst->GetInOperand(i); if (op.type != SPV_OPERAND_TYPE_ID) continue; Instruction* operand_inst = get_def_use_mgr()->GetDef(op.AsId()); - if (operand_inst->opcode() == SpvOpAccessChain) { + if (operand_inst->opcode() == spv::Op::OpAccessChain) { uint32_t var_id = ReplaceAccessChainFuncCallArguments(func_call_inst, operand_inst); func_call_inst->SetInOperand(i, {var_id}); @@ -71,10 +71,11 @@ uint32_t FixFuncCallArgumentsPass::ReplaceAccessChainFuncCallArguments( Instruction* op_type = get_def_use_mgr()->GetDef(op_ptr_type->GetSingleWordInOperand(1)); uint32_t varType = context()->get_type_mgr()->FindPointerToType( - op_type->result_id(), SpvStorageClassFunction); + op_type->result_id(), spv::StorageClass::Function); // Create new variable builder.SetInsertPoint(variable_insertion_point); - Instruction* var = builder.AddVariable(varType, SpvStorageClassFunction); + Instruction* var = + builder.AddVariable(varType, uint32_t(spv::StorageClass::Function)); // Load access chain to the new variable before function call builder.SetInsertPoint(func_call_inst); diff --git a/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp b/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp index 04eb1326c..5597e825b 100644 --- a/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp +++ b/3rdparty/spirv-tools/source/opt/fix_storage_class.cpp @@ -26,7 +26,7 @@ Pass::Status FixStorageClass::Process() { bool modified = false; get_module()->ForEachInst([this, &modified](Instruction* inst) { - if (inst->opcode() == SpvOpVariable) { + if (inst->opcode() == spv::Op::OpVariable) { std::set seen; std::vector> uses; get_def_use_mgr()->ForEachUse(inst, @@ -37,7 +37,7 @@ Pass::Status FixStorageClass::Process() { for (auto& use : uses) { modified |= PropagateStorageClass( use.first, - static_cast(inst->GetSingleWordInOperand(0)), + static_cast(inst->GetSingleWordInOperand(0)), &seen); assert(seen.empty() && "Seen was not properly reset."); modified |= @@ -50,14 +50,14 @@ Pass::Status FixStorageClass::Process() { } bool FixStorageClass::PropagateStorageClass(Instruction* inst, - SpvStorageClass storage_class, + spv::StorageClass storage_class, std::set* seen) { if (!IsPointerResultType(inst)) { return false; } if (IsPointerToStorageClass(inst, storage_class)) { - if (inst->opcode() == SpvOpPhi) { + if (inst->opcode() == spv::Op::OpPhi) { if (!seen->insert(inst->result_id()).second) { return false; } @@ -71,34 +71,34 @@ bool FixStorageClass::PropagateStorageClass(Instruction* inst, modified |= PropagateStorageClass(use, storage_class, seen); } - if (inst->opcode() == SpvOpPhi) { + if (inst->opcode() == spv::Op::OpPhi) { seen->erase(inst->result_id()); } return modified; } switch (inst->opcode()) { - case SpvOpAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpCopyObject: - case SpvOpPhi: - case SpvOpSelect: + case spv::Op::OpAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpCopyObject: + case spv::Op::OpPhi: + case spv::Op::OpSelect: FixInstructionStorageClass(inst, storage_class, seen); return true; - case SpvOpFunctionCall: + case spv::Op::OpFunctionCall: // We cannot be sure of the actual connection between the storage class // of the parameter and the storage class of the result, so we should not // do anything. If the result type needs to be fixed, the function call // should be inlined. return false; - case SpvOpImageTexelPointer: - case SpvOpLoad: - case SpvOpStore: - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: - case SpvOpVariable: - case SpvOpBitcast: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpLoad: + case spv::Op::OpStore: + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: + case spv::Op::OpVariable: + case spv::Op::OpBitcast: // Nothing to change for these opcode. The result type is the same // regardless of the storage class of the operand. return false; @@ -109,9 +109,9 @@ bool FixStorageClass::PropagateStorageClass(Instruction* inst, } } -void FixStorageClass::FixInstructionStorageClass(Instruction* inst, - SpvStorageClass storage_class, - std::set* seen) { +void FixStorageClass::FixInstructionStorageClass( + Instruction* inst, spv::StorageClass storage_class, + std::set* seen) { assert(IsPointerResultType(inst) && "The result type of the instruction must be a pointer."); @@ -126,10 +126,10 @@ void FixStorageClass::FixInstructionStorageClass(Instruction* inst, } void FixStorageClass::ChangeResultStorageClass( - Instruction* inst, SpvStorageClass storage_class) const { + Instruction* inst, spv::StorageClass storage_class) const { analysis::TypeManager* type_mgr = context()->get_type_mgr(); Instruction* result_type_inst = get_def_use_mgr()->GetDef(inst->type_id()); - assert(result_type_inst->opcode() == SpvOpTypePointer); + assert(result_type_inst->opcode() == spv::Op::OpTypePointer); uint32_t pointee_type_id = result_type_inst->GetSingleWordInOperand(1); uint32_t new_result_type_id = type_mgr->FindPointerToType(pointee_type_id, storage_class); @@ -147,7 +147,7 @@ bool FixStorageClass::IsPointerResultType(Instruction* inst) { } bool FixStorageClass::IsPointerToStorageClass(Instruction* inst, - SpvStorageClass storage_class) { + spv::StorageClass storage_class) { analysis::TypeManager* type_mgr = context()->get_type_mgr(); analysis::Type* pType = type_mgr->GetType(inst->type_id()); const analysis::Pointer* result_type = pType->AsPointer(); @@ -180,39 +180,39 @@ bool FixStorageClass::PropagateType(Instruction* inst, uint32_t type_id, // particular type, then we want find that type. uint32_t new_type_id = 0; switch (inst->opcode()) { - case SpvOpAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: if (op_idx == 2) { new_type_id = WalkAccessChainType(inst, type_id); } break; - case SpvOpCopyObject: + case spv::Op::OpCopyObject: new_type_id = type_id; break; - case SpvOpPhi: + case spv::Op::OpPhi: if (seen->insert(inst->result_id()).second) { new_type_id = type_id; } break; - case SpvOpSelect: + case spv::Op::OpSelect: if (op_idx > 2) { new_type_id = type_id; } break; - case SpvOpFunctionCall: + case spv::Op::OpFunctionCall: // We cannot be sure of the actual connection between the type // of the parameter and the type of the result, so we should not // do anything. If the result type needs to be fixed, the function call // should be inlined. return false; - case SpvOpLoad: { + case spv::Op::OpLoad: { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); new_type_id = type_inst->GetSingleWordInOperand(1); break; } - case SpvOpStore: { + case spv::Op::OpStore: { uint32_t obj_id = inst->GetSingleWordInOperand(1); Instruction* obj_inst = get_def_use_mgr()->GetDef(obj_id); uint32_t obj_type_id = obj_inst->type_id(); @@ -237,18 +237,18 @@ bool FixStorageClass::PropagateType(Instruction* inst, uint32_t type_id, context()->UpdateDefUse(inst); } } break; - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: // TODO: May need to expand the copy as we do with the stores. break; - case SpvOpCompositeConstruct: - case SpvOpCompositeExtract: - case SpvOpCompositeInsert: + case spv::Op::OpCompositeConstruct: + case spv::Op::OpCompositeExtract: + case spv::Op::OpCompositeInsert: // TODO: DXC does not seem to generate code that will require changes to // these opcode. The can be implemented when they come up. break; - case SpvOpImageTexelPointer: - case SpvOpBitcast: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpBitcast: // Nothing to change for these opcode. The result type is the same // regardless of the type of the operand. return false; @@ -278,7 +278,7 @@ bool FixStorageClass::PropagateType(Instruction* inst, uint32_t type_id, PropagateType(use.first, new_type_id, use.second, seen); } - if (inst->opcode() == SpvOpPhi) { + if (inst->opcode() == spv::Op::OpPhi) { seen->erase(inst->result_id()); } } @@ -288,12 +288,12 @@ bool FixStorageClass::PropagateType(Instruction* inst, uint32_t type_id, uint32_t FixStorageClass::WalkAccessChainType(Instruction* inst, uint32_t id) { uint32_t start_idx = 0; switch (inst->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: start_idx = 1; break; - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: start_idx = 2; break; default: @@ -302,19 +302,19 @@ uint32_t FixStorageClass::WalkAccessChainType(Instruction* inst, uint32_t id) { } Instruction* orig_type_inst = get_def_use_mgr()->GetDef(id); - assert(orig_type_inst->opcode() == SpvOpTypePointer); + assert(orig_type_inst->opcode() == spv::Op::OpTypePointer); id = orig_type_inst->GetSingleWordInOperand(1); for (uint32_t i = start_idx; i < inst->NumInOperands(); ++i) { Instruction* type_inst = get_def_use_mgr()->GetDef(id); switch (type_inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeMatrix: - case SpvOpTypeVector: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeVector: id = type_inst->GetSingleWordInOperand(0); break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const analysis::Constant* index_const = context()->get_constant_mgr()->FindDeclaredConstant( inst->GetSingleWordInOperand(i)); @@ -330,8 +330,8 @@ uint32_t FixStorageClass::WalkAccessChainType(Instruction* inst, uint32_t id) { } return context()->get_type_mgr()->FindPointerToType( - id, - static_cast(orig_type_inst->GetSingleWordInOperand(0))); + id, static_cast( + orig_type_inst->GetSingleWordInOperand(0))); } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/fix_storage_class.h b/3rdparty/spirv-tools/source/opt/fix_storage_class.h index e72e864a6..6c67acd37 100644 --- a/3rdparty/spirv-tools/source/opt/fix_storage_class.h +++ b/3rdparty/spirv-tools/source/opt/fix_storage_class.h @@ -48,7 +48,7 @@ class FixStorageClass : public Pass { // appropriate, and propagates the change to the users of |inst| as well. // Returns true of any changes were made. // |seen| is used to track OpPhi instructions that should not be processed. - bool PropagateStorageClass(Instruction* inst, SpvStorageClass storage_class, + bool PropagateStorageClass(Instruction* inst, spv::StorageClass storage_class, std::set* seen); // Changes the storage class of the result of |inst| to |storage_class|. @@ -58,13 +58,13 @@ class FixStorageClass : public Pass { // |seen| is used to track OpPhi instructions that should not be processed by // |PropagateStorageClass| void FixInstructionStorageClass(Instruction* inst, - SpvStorageClass storage_class, + spv::StorageClass storage_class, std::set* seen); // Changes the storage class of the result of |inst| to |storage_class|. The // result type of |inst| must be a pointer. void ChangeResultStorageClass(Instruction* inst, - SpvStorageClass storage_class) const; + spv::StorageClass storage_class) const; // Returns true if the result type of |inst| is a pointer. bool IsPointerResultType(Instruction* inst); @@ -72,7 +72,7 @@ class FixStorageClass : public Pass { // Returns true if the result of |inst| is a pointer to storage class // |storage_class|. bool IsPointerToStorageClass(Instruction* inst, - SpvStorageClass storage_class); + spv::StorageClass storage_class); // Change |inst| to match that operand |op_idx| now has type |type_id|, and // adjust any uses of |inst| accordingly. Returns true if the code changed. diff --git a/3rdparty/spirv-tools/source/opt/flatten_decoration_pass.cpp b/3rdparty/spirv-tools/source/opt/flatten_decoration_pass.cpp index f4de9116f..c878c097e 100644 --- a/3rdparty/spirv-tools/source/opt/flatten_decoration_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/flatten_decoration_pass.cpp @@ -49,16 +49,16 @@ Pass::Status FlattenDecorationPass::Process() { // Rely on unordered_map::operator[] to create its entries on first access. for (const auto& inst : annotations) { switch (inst.opcode()) { - case SpvOp::SpvOpDecorationGroup: + case spv::Op::OpDecorationGroup: group_ids.insert(inst.result_id()); break; - case SpvOp::SpvOpGroupDecorate: { + case spv::Op::OpGroupDecorate: { Words& words = normal_uses[inst.GetSingleWordInOperand(0)]; for (uint32_t i = 1; i < inst.NumInOperandWords(); i++) { words.push_back(inst.GetSingleWordInOperand(i)); } } break; - case SpvOp::SpvOpGroupMemberDecorate: { + case spv::Op::OpGroupMemberDecorate: { Words& words = member_uses[inst.GetSingleWordInOperand(0)]; for (uint32_t i = 1; i < inst.NumInOperandWords(); i++) { words.push_back(inst.GetSingleWordInOperand(i)); @@ -77,12 +77,12 @@ Pass::Status FlattenDecorationPass::Process() { // Should we replace this instruction? bool replace = false; switch (inst_iter->opcode()) { - case SpvOp::SpvOpDecorationGroup: - case SpvOp::SpvOpGroupDecorate: - case SpvOp::SpvOpGroupMemberDecorate: + case spv::Op::OpDecorationGroup: + case spv::Op::OpGroupDecorate: + case spv::Op::OpGroupMemberDecorate: replace = true; break; - case SpvOp::SpvOpDecorate: { + case spv::Op::OpDecorate: { // If this decoration targets a group, then replace it // by sets of normal and member decorations. const uint32_t group = inst_iter->GetSingleWordOperand(0); @@ -115,7 +115,7 @@ Pass::Status FlattenDecorationPass::Process() { operands.insert(operands.end(), decoration_operands_iter, inst_iter->end()); std::unique_ptr new_inst(new Instruction( - context(), SpvOp::SpvOpMemberDecorate, 0, 0, operands)); + context(), spv::Op::OpMemberDecorate, 0, 0, operands)); inst_iter = inst_iter.InsertBefore(std::move(new_inst)); ++inst_iter; replace = true; @@ -146,7 +146,7 @@ Pass::Status FlattenDecorationPass::Process() { if (!group_ids.empty()) { for (auto debug_inst_iter = context()->debug2_begin(); debug_inst_iter != context()->debug2_end();) { - if (debug_inst_iter->opcode() == SpvOp::SpvOpName) { + if (debug_inst_iter->opcode() == spv::Op::OpName) { const uint32_t target = debug_inst_iter->GetSingleWordOperand(0); if (group_ids.count(target)) { debug_inst_iter = debug_inst_iter.Erase(); diff --git a/3rdparty/spirv-tools/source/opt/fold.cpp b/3rdparty/spirv-tools/source/opt/fold.cpp index 315741ad7..3c234c4e3 100644 --- a/3rdparty/spirv-tools/source/opt/fold.cpp +++ b/3rdparty/spirv-tools/source/opt/fold.cpp @@ -42,23 +42,24 @@ namespace { } // namespace -uint32_t InstructionFolder::UnaryOperate(SpvOp opcode, uint32_t operand) const { +uint32_t InstructionFolder::UnaryOperate(spv::Op opcode, + uint32_t operand) const { switch (opcode) { // Arthimetics - case SpvOp::SpvOpSNegate: { + case spv::Op::OpSNegate: { int32_t s_operand = static_cast(operand); if (s_operand == std::numeric_limits::min()) { return s_operand; } return -s_operand; } - case SpvOp::SpvOpNot: + case spv::Op::OpNot: return ~operand; - case SpvOp::SpvOpLogicalNot: + case spv::Op::OpLogicalNot: return !static_cast(operand); - case SpvOp::SpvOpUConvert: + case spv::Op::OpUConvert: return operand; - case SpvOp::SpvOpSConvert: + case spv::Op::OpSConvert: return operand; default: assert(false && @@ -67,31 +68,31 @@ uint32_t InstructionFolder::UnaryOperate(SpvOp opcode, uint32_t operand) const { } } -uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, +uint32_t InstructionFolder::BinaryOperate(spv::Op opcode, uint32_t a, uint32_t b) const { switch (opcode) { // Arthimetics - case SpvOp::SpvOpIAdd: + case spv::Op::OpIAdd: return a + b; - case SpvOp::SpvOpISub: + case spv::Op::OpISub: return a - b; - case SpvOp::SpvOpIMul: + case spv::Op::OpIMul: return a * b; - case SpvOp::SpvOpUDiv: + case spv::Op::OpUDiv: if (b != 0) { return a / b; } else { // Dividing by 0 is undefined, so we will just pick 0. return 0; } - case SpvOp::SpvOpSDiv: + case spv::Op::OpSDiv: if (b != 0u) { return (static_cast(a)) / (static_cast(b)); } else { // Dividing by 0 is undefined, so we will just pick 0. return 0; } - case SpvOp::SpvOpSRem: { + case spv::Op::OpSRem: { // The sign of non-zero result comes from the first operand: a. This is // guaranteed by C++11 rules for integer division operator. The division // result is rounded toward zero, so the result of '%' has the sign of @@ -103,10 +104,10 @@ uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, return 0; } } - case SpvOp::SpvOpSMod: { + case spv::Op::OpSMod: { // The sign of non-zero result comes from the second operand: b if (b != 0u) { - int32_t rem = BinaryOperate(SpvOp::SpvOpSRem, a, b); + int32_t rem = BinaryOperate(spv::Op::OpSRem, a, b); int32_t b_prim = static_cast(b); return (rem + b_prim) % b_prim; } else { @@ -114,7 +115,7 @@ uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, return 0; } } - case SpvOp::SpvOpUMod: + case spv::Op::OpUMod: if (b != 0u) { return (a % b); } else { @@ -123,7 +124,7 @@ uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, } // Shifting - case SpvOp::SpvOpShiftRightLogical: + case spv::Op::OpShiftRightLogical: if (b >= 32) { // This is undefined behaviour when |b| > 32. Choose 0 for consistency. // When |b| == 32, doing the shift in C++ in undefined, but the result @@ -131,7 +132,7 @@ uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, return 0; } return a >> b; - case SpvOp::SpvOpShiftRightArithmetic: + case spv::Op::OpShiftRightArithmetic: if (b > 32) { // This is undefined behaviour. Choose 0 for consistency. return 0; @@ -146,7 +147,7 @@ uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, } } return (static_cast(a)) >> b; - case SpvOp::SpvOpShiftLeftLogical: + case spv::Op::OpShiftLeftLogical: if (b >= 32) { // This is undefined behaviour when |b| > 32. Choose 0 for consistency. // When |b| == 32, doing the shift in C++ in undefined, but the result @@ -156,43 +157,43 @@ uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, return a << b; // Bitwise operations - case SpvOp::SpvOpBitwiseOr: + case spv::Op::OpBitwiseOr: return a | b; - case SpvOp::SpvOpBitwiseAnd: + case spv::Op::OpBitwiseAnd: return a & b; - case SpvOp::SpvOpBitwiseXor: + case spv::Op::OpBitwiseXor: return a ^ b; // Logical - case SpvOp::SpvOpLogicalEqual: + case spv::Op::OpLogicalEqual: return (static_cast(a)) == (static_cast(b)); - case SpvOp::SpvOpLogicalNotEqual: + case spv::Op::OpLogicalNotEqual: return (static_cast(a)) != (static_cast(b)); - case SpvOp::SpvOpLogicalOr: + case spv::Op::OpLogicalOr: return (static_cast(a)) || (static_cast(b)); - case SpvOp::SpvOpLogicalAnd: + case spv::Op::OpLogicalAnd: return (static_cast(a)) && (static_cast(b)); // Comparison - case SpvOp::SpvOpIEqual: + case spv::Op::OpIEqual: return a == b; - case SpvOp::SpvOpINotEqual: + case spv::Op::OpINotEqual: return a != b; - case SpvOp::SpvOpULessThan: + case spv::Op::OpULessThan: return a < b; - case SpvOp::SpvOpSLessThan: + case spv::Op::OpSLessThan: return (static_cast(a)) < (static_cast(b)); - case SpvOp::SpvOpUGreaterThan: + case spv::Op::OpUGreaterThan: return a > b; - case SpvOp::SpvOpSGreaterThan: + case spv::Op::OpSGreaterThan: return (static_cast(a)) > (static_cast(b)); - case SpvOp::SpvOpULessThanEqual: + case spv::Op::OpULessThanEqual: return a <= b; - case SpvOp::SpvOpSLessThanEqual: + case spv::Op::OpSLessThanEqual: return (static_cast(a)) <= (static_cast(b)); - case SpvOp::SpvOpUGreaterThanEqual: + case spv::Op::OpUGreaterThanEqual: return a >= b; - case SpvOp::SpvOpSGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: return (static_cast(a)) >= (static_cast(b)); default: assert(false && @@ -201,10 +202,10 @@ uint32_t InstructionFolder::BinaryOperate(SpvOp opcode, uint32_t a, } } -uint32_t InstructionFolder::TernaryOperate(SpvOp opcode, uint32_t a, uint32_t b, - uint32_t c) const { +uint32_t InstructionFolder::TernaryOperate(spv::Op opcode, uint32_t a, + uint32_t b, uint32_t c) const { switch (opcode) { - case SpvOp::SpvOpSelect: + case spv::Op::OpSelect: return (static_cast(a)) ? b : c; default: assert(false && @@ -214,7 +215,7 @@ uint32_t InstructionFolder::TernaryOperate(SpvOp opcode, uint32_t a, uint32_t b, } uint32_t InstructionFolder::OperateWords( - SpvOp opcode, const std::vector& operand_words) const { + spv::Op opcode, const std::vector& operand_words) const { switch (operand_words.size()) { case 1: return UnaryOperate(opcode, operand_words.front()); @@ -233,7 +234,7 @@ bool InstructionFolder::FoldInstructionInternal(Instruction* inst) const { auto identity_map = [](uint32_t id) { return id; }; Instruction* folded_inst = FoldInstructionToConstant(inst, identity_map); if (folded_inst != nullptr) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {folded_inst->result_id()}}}); return true; } @@ -256,7 +257,7 @@ bool InstructionFolder::FoldInstructionInternal(Instruction* inst) const { // result in 32 bit word. Scalar constants with longer than 32-bit width are // not accepted in this function. uint32_t InstructionFolder::FoldScalars( - SpvOp opcode, + spv::Op opcode, const std::vector& operands) const { assert(IsFoldableOpcode(opcode) && "Unhandled instruction opcode in FoldScalars"); @@ -282,7 +283,7 @@ uint32_t InstructionFolder::FoldScalars( bool InstructionFolder::FoldBinaryIntegerOpToConstant( Instruction* inst, const std::function& id_map, uint32_t* result) const { - SpvOp opcode = inst->opcode(); + spv::Op opcode = inst->opcode(); analysis::ConstantManager* const_manger = context_->get_constant_mgr(); uint32_t ids[2]; @@ -300,7 +301,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( switch (opcode) { // Arthimetics - case SpvOp::SpvOpIMul: + case spv::Op::OpIMul: for (uint32_t i = 0; i < 2; i++) { if (constants[i] != nullptr && constants[i]->IsZero()) { *result = 0; @@ -308,11 +309,11 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( } } break; - case SpvOp::SpvOpUDiv: - case SpvOp::SpvOpSDiv: - case SpvOp::SpvOpSRem: - case SpvOp::SpvOpSMod: - case SpvOp::SpvOpUMod: + case spv::Op::OpUDiv: + case spv::Op::OpSDiv: + case spv::Op::OpSRem: + case spv::Op::OpSMod: + case spv::Op::OpUMod: // This changes undefined behaviour (ie divide by 0) into a 0. for (uint32_t i = 0; i < 2; i++) { if (constants[i] != nullptr && constants[i]->IsZero()) { @@ -323,8 +324,8 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( break; // Shifting - case SpvOp::SpvOpShiftRightLogical: - case SpvOp::SpvOpShiftLeftLogical: + case spv::Op::OpShiftRightLogical: + case spv::Op::OpShiftLeftLogical: if (constants[1] != nullptr) { // When shifting by a value larger than the size of the result, the // result is undefined. We are setting the undefined behaviour to a @@ -339,7 +340,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( break; // Bitwise operations - case SpvOp::SpvOpBitwiseOr: + case spv::Op::OpBitwiseOr: for (uint32_t i = 0; i < 2; i++) { if (constants[i] != nullptr) { // TODO: Change the mask against a value based on the bit width of the @@ -353,7 +354,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( } } break; - case SpvOp::SpvOpBitwiseAnd: + case spv::Op::OpBitwiseAnd: for (uint32_t i = 0; i < 2; i++) { if (constants[i] != nullptr) { if (constants[i]->IsZero()) { @@ -365,7 +366,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( break; // Comparison - case SpvOp::SpvOpULessThan: + case spv::Op::OpULessThan: if (constants[0] != nullptr && constants[0]->GetU32BitValue() == UINT32_MAX) { *result = false; @@ -376,7 +377,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( return true; } break; - case SpvOp::SpvOpSLessThan: + case spv::Op::OpSLessThan: if (constants[0] != nullptr && constants[0]->GetS32BitValue() == INT32_MAX) { *result = false; @@ -388,7 +389,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( return true; } break; - case SpvOp::SpvOpUGreaterThan: + case spv::Op::OpUGreaterThan: if (constants[0] != nullptr && constants[0]->IsZero()) { *result = false; return true; @@ -399,7 +400,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( return true; } break; - case SpvOp::SpvOpSGreaterThan: + case spv::Op::OpSGreaterThan: if (constants[0] != nullptr && constants[0]->GetS32BitValue() == INT32_MIN) { *result = false; @@ -411,7 +412,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( return true; } break; - case SpvOp::SpvOpULessThanEqual: + case spv::Op::OpULessThanEqual: if (constants[0] != nullptr && constants[0]->IsZero()) { *result = true; return true; @@ -422,7 +423,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( return true; } break; - case SpvOp::SpvOpSLessThanEqual: + case spv::Op::OpSLessThanEqual: if (constants[0] != nullptr && constants[0]->GetS32BitValue() == INT32_MIN) { *result = true; @@ -434,7 +435,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( return true; } break; - case SpvOp::SpvOpUGreaterThanEqual: + case spv::Op::OpUGreaterThanEqual: if (constants[0] != nullptr && constants[0]->GetU32BitValue() == UINT32_MAX) { *result = true; @@ -445,7 +446,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( return true; } break; - case SpvOp::SpvOpSGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: if (constants[0] != nullptr && constants[0]->GetS32BitValue() == INT32_MAX) { *result = true; @@ -466,7 +467,7 @@ bool InstructionFolder::FoldBinaryIntegerOpToConstant( bool InstructionFolder::FoldBinaryBooleanOpToConstant( Instruction* inst, const std::function& id_map, uint32_t* result) const { - SpvOp opcode = inst->opcode(); + spv::Op opcode = inst->opcode(); analysis::ConstantManager* const_manger = context_->get_constant_mgr(); uint32_t ids[2]; @@ -484,7 +485,7 @@ bool InstructionFolder::FoldBinaryBooleanOpToConstant( switch (opcode) { // Logical - case SpvOp::SpvOpLogicalOr: + case spv::Op::OpLogicalOr: for (uint32_t i = 0; i < 2; i++) { if (constants[i] != nullptr) { if (constants[i]->value()) { @@ -494,7 +495,7 @@ bool InstructionFolder::FoldBinaryBooleanOpToConstant( } } break; - case SpvOp::SpvOpLogicalAnd: + case spv::Op::OpLogicalAnd: for (uint32_t i = 0; i < 2; i++) { if (constants[i] != nullptr) { if (!constants[i]->value()) { @@ -526,7 +527,7 @@ bool InstructionFolder::FoldIntegerOpToConstant( } std::vector InstructionFolder::FoldVectors( - SpvOp opcode, uint32_t num_dims, + spv::Op opcode, uint32_t num_dims, const std::vector& operands) const { assert(IsFoldableOpcode(opcode) && "Unhandled instruction opcode in FoldVectors"); @@ -570,44 +571,44 @@ std::vector InstructionFolder::FoldVectors( return result; } -bool InstructionFolder::IsFoldableOpcode(SpvOp opcode) const { +bool InstructionFolder::IsFoldableOpcode(spv::Op opcode) const { // NOTE: Extend to more opcodes as new cases are handled in the folder // functions. switch (opcode) { - case SpvOp::SpvOpBitwiseAnd: - case SpvOp::SpvOpBitwiseOr: - case SpvOp::SpvOpBitwiseXor: - case SpvOp::SpvOpIAdd: - case SpvOp::SpvOpIEqual: - case SpvOp::SpvOpIMul: - case SpvOp::SpvOpINotEqual: - case SpvOp::SpvOpISub: - case SpvOp::SpvOpLogicalAnd: - case SpvOp::SpvOpLogicalEqual: - case SpvOp::SpvOpLogicalNot: - case SpvOp::SpvOpLogicalNotEqual: - case SpvOp::SpvOpLogicalOr: - case SpvOp::SpvOpNot: - case SpvOp::SpvOpSDiv: - case SpvOp::SpvOpSelect: - case SpvOp::SpvOpSGreaterThan: - case SpvOp::SpvOpSGreaterThanEqual: - case SpvOp::SpvOpShiftLeftLogical: - case SpvOp::SpvOpShiftRightArithmetic: - case SpvOp::SpvOpShiftRightLogical: - case SpvOp::SpvOpSLessThan: - case SpvOp::SpvOpSLessThanEqual: - case SpvOp::SpvOpSMod: - case SpvOp::SpvOpSNegate: - case SpvOp::SpvOpSRem: - case SpvOp::SpvOpSConvert: - case SpvOp::SpvOpUConvert: - case SpvOp::SpvOpUDiv: - case SpvOp::SpvOpUGreaterThan: - case SpvOp::SpvOpUGreaterThanEqual: - case SpvOp::SpvOpULessThan: - case SpvOp::SpvOpULessThanEqual: - case SpvOp::SpvOpUMod: + case spv::Op::OpBitwiseAnd: + case spv::Op::OpBitwiseOr: + case spv::Op::OpBitwiseXor: + case spv::Op::OpIAdd: + case spv::Op::OpIEqual: + case spv::Op::OpIMul: + case spv::Op::OpINotEqual: + case spv::Op::OpISub: + case spv::Op::OpLogicalAnd: + case spv::Op::OpLogicalEqual: + case spv::Op::OpLogicalNot: + case spv::Op::OpLogicalNotEqual: + case spv::Op::OpLogicalOr: + case spv::Op::OpNot: + case spv::Op::OpSDiv: + case spv::Op::OpSelect: + case spv::Op::OpSGreaterThan: + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpShiftLeftLogical: + case spv::Op::OpShiftRightArithmetic: + case spv::Op::OpShiftRightLogical: + case spv::Op::OpSLessThan: + case spv::Op::OpSLessThanEqual: + case spv::Op::OpSMod: + case spv::Op::OpSNegate: + case spv::Op::OpSRem: + case spv::Op::OpSConvert: + case spv::Op::OpUConvert: + case spv::Op::OpUDiv: + case spv::Op::OpUGreaterThan: + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpULessThan: + case spv::Op::OpULessThanEqual: + case spv::Op::OpUMod: return true; default: return false; @@ -685,11 +686,11 @@ Instruction* InstructionFolder::FoldInstructionToConstant( bool InstructionFolder::IsFoldableType(Instruction* type_inst) const { // Support 32-bit integers. - if (type_inst->opcode() == SpvOpTypeInt) { + if (type_inst->opcode() == spv::Op::OpTypeInt) { return type_inst->GetSingleWordInOperand(0) == 32; } // Support booleans. - if (type_inst->opcode() == SpvOpTypeBool) { + if (type_inst->opcode() == spv::Op::OpTypeBool) { return true; } // Nothing else yet. @@ -699,7 +700,7 @@ bool InstructionFolder::IsFoldableType(Instruction* type_inst) const { bool InstructionFolder::FoldInstruction(Instruction* inst) const { bool modified = false; Instruction* folded_inst(inst); - while (folded_inst->opcode() != SpvOpCopyObject && + while (folded_inst->opcode() != spv::Op::OpCopyObject && FoldInstructionInternal(&*folded_inst)) { modified = true; } diff --git a/3rdparty/spirv-tools/source/opt/fold.h b/3rdparty/spirv-tools/source/opt/fold.h index 9e7c4705e..9a131d0df 100644 --- a/3rdparty/spirv-tools/source/opt/fold.h +++ b/3rdparty/spirv-tools/source/opt/fold.h @@ -55,7 +55,7 @@ class InstructionFolder { // IsFoldableOpcode test. If any error occurs during folding, the folder will // fail with a call to assert. uint32_t FoldScalars( - SpvOp opcode, + spv::Op opcode, const std::vector& operands) const; // Returns the result of performing an operation with the given |opcode| over @@ -72,12 +72,12 @@ class InstructionFolder { // IsFoldableOpcode test. If any error occurs during folding, the folder will // fail with a call to assert. std::vector FoldVectors( - SpvOp opcode, uint32_t num_dims, + spv::Op opcode, uint32_t num_dims, const std::vector& operands) const; // Returns true if |opcode| represents an operation handled by FoldScalars or // FoldVectors. - bool IsFoldableOpcode(SpvOp opcode) const; + bool IsFoldableOpcode(spv::Op opcode) const; // Returns true if |cst| is supported by FoldScalars and FoldVectors. bool IsFoldableConstant(const analysis::Constant* cst) const; @@ -126,22 +126,22 @@ class InstructionFolder { // Returns the single-word result from performing the given unary operation on // the operand value which is passed in as a 32-bit word. - uint32_t UnaryOperate(SpvOp opcode, uint32_t operand) const; + uint32_t UnaryOperate(spv::Op opcode, uint32_t operand) const; // Returns the single-word result from performing the given binary operation // on the operand values which are passed in as two 32-bit word. - uint32_t BinaryOperate(SpvOp opcode, uint32_t a, uint32_t b) const; + uint32_t BinaryOperate(spv::Op opcode, uint32_t a, uint32_t b) const; // Returns the single-word result from performing the given ternary operation // on the operand values which are passed in as three 32-bit word. - uint32_t TernaryOperate(SpvOp opcode, uint32_t a, uint32_t b, + uint32_t TernaryOperate(spv::Op opcode, uint32_t a, uint32_t b, uint32_t c) const; // Returns the single-word result from performing the given operation on the // operand words. This only works with 32-bit operations and uses boolean // convention that 0u is false, and anything else is boolean true. // TODO(qining): Support operands other than 32-bit wide. - uint32_t OperateWords(SpvOp opcode, + uint32_t OperateWords(spv::Op opcode, const std::vector& operand_words) const; bool FoldInstructionInternal(Instruction* inst) const; diff --git a/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp b/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp index 7a5187010..132be0c4b 100644 --- a/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp @@ -66,14 +66,14 @@ Pass::Status FoldSpecConstantOpAndCompositePass::Process() { if (const_mgr->GetType(inst) && !const_mgr->GetType(inst)->decoration_empty()) continue; - switch (SpvOp opcode = inst->opcode()) { + switch (spv::Op opcode = inst->opcode()) { // Records the values of Normal Constants. - case SpvOp::SpvOpConstantTrue: - case SpvOp::SpvOpConstantFalse: - case SpvOp::SpvOpConstant: - case SpvOp::SpvOpConstantNull: - case SpvOp::SpvOpConstantComposite: - case SpvOp::SpvOpSpecConstantComposite: { + case spv::Op::OpConstantTrue: + case spv::Op::OpConstantFalse: + case spv::Op::OpConstant: + case spv::Op::OpConstantNull: + case spv::Op::OpConstantComposite: + case spv::Op::OpSpecConstantComposite: { // A Constant instance will be created if the given instruction is a // Normal Constant whose value(s) are fixed. Note that for a composite // Spec Constant defined with OpSpecConstantComposite instruction, if @@ -84,8 +84,8 @@ Pass::Status FoldSpecConstantOpAndCompositePass::Process() { if (auto const_value = const_mgr->GetConstantFromInst(inst)) { // Need to replace the OpSpecConstantComposite instruction with a // corresponding OpConstantComposite instruction. - if (opcode == SpvOp::SpvOpSpecConstantComposite) { - inst->SetOpcode(SpvOp::SpvOpConstantComposite); + if (opcode == spv::Op::OpSpecConstantComposite) { + inst->SetOpcode(spv::Op::OpConstantComposite); modified = true; } const_mgr->MapConstantToInst(const_value, inst); @@ -99,7 +99,7 @@ Pass::Status FoldSpecConstantOpAndCompositePass::Process() { // Constants will be added to id_to_const_val_ and const_val_to_id_ so // that we can use the new Normal Constants when folding following Spec // Constants. - case SpvOp::SpvOpSpecConstantOp: + case spv::Op::OpSpecConstantOp: modified |= ProcessOpSpecConstantOp(&inst_iter); break; default: @@ -118,11 +118,11 @@ bool FoldSpecConstantOpAndCompositePass::ProcessOpSpecConstantOp( "The first in-operand of OpSpecConstantOp instruction must be of " "SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER type"); - switch (static_cast(inst->GetSingleWordInOperand(0))) { - case SpvOp::SpvOpCompositeExtract: - case SpvOp::SpvOpVectorShuffle: - case SpvOp::SpvOpCompositeInsert: - case SpvOp::SpvOpQuantizeToF16: + switch (static_cast(inst->GetSingleWordInOperand(0))) { + case spv::Op::OpCompositeExtract: + case spv::Op::OpVectorShuffle: + case spv::Op::OpCompositeInsert: + case spv::Op::OpQuantizeToF16: folded_inst = FoldWithInstructionFolder(pos); break; default: @@ -165,7 +165,7 @@ Instruction* FoldSpecConstantOpAndCompositePass::FoldWithInstructionFolder( // instruction and pass it to the instruction folder. std::unique_ptr inst((*inst_iter_ptr)->Clone(context())); inst->SetOpcode( - static_cast((*inst_iter_ptr)->GetSingleWordInOperand(0))); + static_cast((*inst_iter_ptr)->GetSingleWordInOperand(0))); inst->RemoveOperand(2); // We want the current instruction to be replaced by an |OpConstant*| @@ -289,7 +289,7 @@ Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation( const Instruction* inst = &**pos; analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); const analysis::Type* result_type = const_mgr->GetType(inst); - SpvOp spec_opcode = static_cast(inst->GetSingleWordInOperand(0)); + spv::Op spec_opcode = static_cast(inst->GetSingleWordInOperand(0)); // Check and collect operands. std::vector operands; diff --git a/3rdparty/spirv-tools/source/opt/folding_rules.cpp b/3rdparty/spirv-tools/source/opt/folding_rules.cpp index 3d803addc..1a4c03d7e 100644 --- a/3rdparty/spirv-tools/source/opt/folding_rules.cpp +++ b/3rdparty/spirv-tools/source/opt/folding_rules.cpp @@ -27,15 +27,15 @@ namespace spvtools { namespace opt { namespace { -const uint32_t kExtractCompositeIdInIdx = 0; -const uint32_t kInsertObjectIdInIdx = 0; -const uint32_t kInsertCompositeIdInIdx = 1; -const uint32_t kExtInstSetIdInIdx = 0; -const uint32_t kExtInstInstructionInIdx = 1; -const uint32_t kFMixXIdInIdx = 2; -const uint32_t kFMixYIdInIdx = 3; -const uint32_t kFMixAIdInIdx = 4; -const uint32_t kStoreObjectInIdx = 1; +constexpr uint32_t kExtractCompositeIdInIdx = 0; +constexpr uint32_t kInsertObjectIdInIdx = 0; +constexpr uint32_t kInsertCompositeIdInIdx = 1; +constexpr uint32_t kExtInstSetIdInIdx = 0; +constexpr uint32_t kExtInstInstructionInIdx = 1; +constexpr uint32_t kFMixXIdInIdx = 2; +constexpr uint32_t kFMixYIdInIdx = 3; +constexpr uint32_t kFMixAIdInIdx = 4; +constexpr uint32_t kStoreObjectInIdx = 1; // Some image instructions may contain an "image operands" argument. // Returns the operand index for the "image operands". @@ -43,33 +43,33 @@ const uint32_t kStoreObjectInIdx = 1; int32_t ImageOperandsMaskInOperandIndex(Instruction* inst) { const auto opcode = inst->opcode(); switch (opcode) { - case SpvOpImageSampleImplicitLod: - case SpvOpImageSampleExplicitLod: - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjExplicitLod: - case SpvOpImageFetch: - case SpvOpImageRead: - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleExplicitLod: - case SpvOpImageSparseSampleProjImplicitLod: - case SpvOpImageSparseSampleProjExplicitLod: - case SpvOpImageSparseFetch: - case SpvOpImageSparseRead: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageFetch: + case spv::Op::OpImageRead: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: + case spv::Op::OpImageSparseSampleProjImplicitLod: + case spv::Op::OpImageSparseSampleProjExplicitLod: + case spv::Op::OpImageSparseFetch: + case spv::Op::OpImageSparseRead: return inst->NumOperands() > 4 ? 2 : -1; - case SpvOpImageSampleDrefImplicitLod: - case SpvOpImageSampleDrefExplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSampleProjDrefExplicitLod: - case SpvOpImageGather: - case SpvOpImageDrefGather: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageSparseSampleDrefExplicitLod: - case SpvOpImageSparseSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleProjDrefExplicitLod: - case SpvOpImageSparseGather: - case SpvOpImageSparseDrefGather: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageGather: + case spv::Op::OpImageDrefGather: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSparseSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseGather: + case spv::Op::OpImageSparseDrefGather: return inst->NumOperands() > 5 ? 3 : -1; - case SpvOpImageWrite: + case spv::Op::OpImageWrite: return inst->NumOperands() > 3 ? 3 : -1; default: return -1; @@ -304,7 +304,7 @@ uint32_t Reciprocal(analysis::ConstantManager* const_mgr, FoldingRule ReciprocalFDiv() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFDiv); + assert(inst->opcode() == spv::Op::OpFDiv); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); @@ -333,7 +333,7 @@ FoldingRule ReciprocalFDiv() { // Don't fold a null constant. return false; } - inst->SetOpcode(SpvOpFMul); + inst->SetOpcode(spv::Op::OpFMul); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0u)}}, {SPV_OPERAND_TYPE_ID, {id}}}); @@ -348,7 +348,8 @@ FoldingRule ReciprocalFDiv() { FoldingRule MergeNegateArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFNegate || inst->opcode() == SpvOpSNegate); + assert(inst->opcode() == spv::Op::OpFNegate || + inst->opcode() == spv::Op::OpSNegate); (void)constants; const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); @@ -362,7 +363,7 @@ FoldingRule MergeNegateArithmetic() { if (op_inst->opcode() == inst->opcode()) { // Elide negates. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {op_inst->GetSingleWordInOperand(0u)}}}); return true; @@ -382,7 +383,8 @@ FoldingRule MergeNegateArithmetic() { FoldingRule MergeNegateMulDivArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFNegate || inst->opcode() == SpvOpSNegate); + assert(inst->opcode() == spv::Op::OpFNegate || + inst->opcode() == spv::Op::OpSNegate); (void)constants; analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = @@ -398,9 +400,10 @@ FoldingRule MergeNegateMulDivArithmetic() { uint32_t width = ElementWidth(type); if (width != 32 && width != 64) return false; - SpvOp opcode = op_inst->opcode(); - if (opcode == SpvOpFMul || opcode == SpvOpFDiv || opcode == SpvOpIMul || - opcode == SpvOpSDiv || opcode == SpvOpUDiv) { + spv::Op opcode = op_inst->opcode(); + if (opcode == spv::Op::OpFMul || opcode == spv::Op::OpFDiv || + opcode == spv::Op::OpIMul || opcode == spv::Op::OpSDiv || + opcode == spv::Op::OpUDiv) { std::vector op_constants = const_mgr->GetOperandConstants(op_inst); // Merge negate into mul or div if one operand is constant. @@ -413,7 +416,8 @@ FoldingRule MergeNegateMulDivArithmetic() { : op_inst->GetSingleWordInOperand(1u); // Change this instruction to a mul/div. inst->SetOpcode(op_inst->opcode()); - if (opcode == SpvOpFDiv || opcode == SpvOpUDiv || opcode == SpvOpSDiv) { + if (opcode == spv::Op::OpFDiv || opcode == spv::Op::OpUDiv || + opcode == spv::Op::OpSDiv) { uint32_t op0 = zero_is_variable ? non_const_id : neg_id; uint32_t op1 = zero_is_variable ? neg_id : non_const_id; inst->SetInOperands( @@ -440,7 +444,8 @@ FoldingRule MergeNegateMulDivArithmetic() { FoldingRule MergeNegateAddSubArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFNegate || inst->opcode() == SpvOpSNegate); + assert(inst->opcode() == spv::Op::OpFNegate || + inst->opcode() == spv::Op::OpSNegate); (void)constants; analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = @@ -456,14 +461,16 @@ FoldingRule MergeNegateAddSubArithmetic() { uint32_t width = ElementWidth(type); if (width != 32 && width != 64) return false; - if (op_inst->opcode() == SpvOpFAdd || op_inst->opcode() == SpvOpFSub || - op_inst->opcode() == SpvOpIAdd || op_inst->opcode() == SpvOpISub) { + if (op_inst->opcode() == spv::Op::OpFAdd || + op_inst->opcode() == spv::Op::OpFSub || + op_inst->opcode() == spv::Op::OpIAdd || + op_inst->opcode() == spv::Op::OpISub) { std::vector op_constants = const_mgr->GetOperandConstants(op_inst); if (op_constants[0] || op_constants[1]) { bool zero_is_variable = op_constants[0] == nullptr; - bool is_add = (op_inst->opcode() == SpvOpFAdd) || - (op_inst->opcode() == SpvOpIAdd); + bool is_add = (op_inst->opcode() == spv::Op::OpFAdd) || + (op_inst->opcode() == spv::Op::OpIAdd); bool swap_operands = !is_add || zero_is_variable; bool negate_const = is_add; const analysis::Constant* c = ConstInput(op_constants); @@ -481,7 +488,8 @@ FoldingRule MergeNegateAddSubArithmetic() { uint32_t op1 = zero_is_variable ? const_id : op_inst->GetSingleWordInOperand(1u); if (swap_operands) std::swap(op0, op1); - inst->SetOpcode(HasFloatingPoint(type) ? SpvOpFSub : SpvOpISub); + inst->SetOpcode(HasFloatingPoint(type) ? spv::Op::OpFSub + : spv::Op::OpISub); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {op0}}, {SPV_OPERAND_TYPE_ID, {op1}}}); return true; @@ -512,7 +520,7 @@ bool HasZero(const analysis::Constant* c) { // id. Returns 0 if the result is not a valid value. The input types must be // Float. uint32_t PerformFloatingPointOperation(analysis::ConstantManager* const_mgr, - SpvOp opcode, + spv::Op opcode, const analysis::Constant* input1, const analysis::Constant* input2) { const analysis::Type* type = input1->type(); @@ -535,17 +543,17 @@ uint32_t PerformFloatingPointOperation(analysis::ConstantManager* const_mgr, } \ static_assert(true, "require extra semicolon") switch (opcode) { - case SpvOpFMul: + case spv::Op::OpFMul: FOLD_OP(*); break; - case SpvOpFDiv: + case spv::Op::OpFDiv: if (HasZero(input2)) return 0; FOLD_OP(/); break; - case SpvOpFAdd: + case spv::Op::OpFAdd: FOLD_OP(+); break; - case SpvOpFSub: + case spv::Op::OpFSub: FOLD_OP(-); break; default: @@ -561,7 +569,8 @@ uint32_t PerformFloatingPointOperation(analysis::ConstantManager* const_mgr, // id. Returns 0 if the result is not a valid value. The input types must be // Integers. uint32_t PerformIntegerOperation(analysis::ConstantManager* const_mgr, - SpvOp opcode, const analysis::Constant* input1, + spv::Op opcode, + const analysis::Constant* input1, const analysis::Constant* input2) { assert(input1->type()->AsInteger()); const analysis::Integer* type = input1->type()->AsInteger(); @@ -582,17 +591,17 @@ uint32_t PerformIntegerOperation(analysis::ConstantManager* const_mgr, } \ static_assert(true, "require extra semicolon") switch (opcode) { - case SpvOpIMul: + case spv::Op::OpIMul: FOLD_OP(*); break; - case SpvOpSDiv: - case SpvOpUDiv: + case spv::Op::OpSDiv: + case spv::Op::OpUDiv: assert(false && "Should not merge integer division"); break; - case SpvOpIAdd: + case spv::Op::OpIAdd: FOLD_OP(+); break; - case SpvOpISub: + case spv::Op::OpISub: FOLD_OP(-); break; default: @@ -607,7 +616,7 @@ uint32_t PerformIntegerOperation(analysis::ConstantManager* const_mgr, // Performs |input1| |opcode| |input2| and returns the merged constant result // id. Returns 0 if the result is not a valid value. The input types must be // Integers, Floats or Vectors of such. -uint32_t PerformOperation(analysis::ConstantManager* const_mgr, SpvOp opcode, +uint32_t PerformOperation(analysis::ConstantManager* const_mgr, spv::Op opcode, const analysis::Constant* input1, const analysis::Constant* input2) { assert(input1 && input2); @@ -667,7 +676,8 @@ uint32_t PerformOperation(analysis::ConstantManager* const_mgr, SpvOp opcode, FoldingRule MergeMulMulArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFMul || inst->opcode() == SpvOpIMul); + assert(inst->opcode() == spv::Op::OpFMul || + inst->opcode() == spv::Op::OpIMul); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); @@ -719,7 +729,7 @@ FoldingRule MergeMulMulArithmetic() { FoldingRule MergeMulDivArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFMul); + assert(inst->opcode() == spv::Op::OpFMul); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); @@ -733,10 +743,10 @@ FoldingRule MergeMulDivArithmetic() { for (uint32_t i = 0; i < 2; i++) { uint32_t op_id = inst->GetSingleWordInOperand(i); Instruction* op_inst = def_use_mgr->GetDef(op_id); - if (op_inst->opcode() == SpvOpFDiv) { + if (op_inst->opcode() == spv::Op::OpFDiv) { if (op_inst->GetSingleWordInOperand(1) == inst->GetSingleWordInOperand(1 - i)) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {op_inst->GetSingleWordInOperand(0)}}}); return true; @@ -749,7 +759,7 @@ FoldingRule MergeMulDivArithmetic() { Instruction* other_inst = NonConstInput(context, constants[0], inst); if (!other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpFDiv) { + if (other_inst->opcode() == spv::Op::OpFDiv) { std::vector other_constants = const_mgr->GetOperandConstants(other_inst); const analysis::Constant* const_input2 = ConstInput(other_constants); @@ -793,7 +803,8 @@ FoldingRule MergeMulDivArithmetic() { FoldingRule MergeMulNegateArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFMul || inst->opcode() == SpvOpIMul); + assert(inst->opcode() == spv::Op::OpFMul || + inst->opcode() == spv::Op::OpIMul); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); @@ -809,8 +820,8 @@ FoldingRule MergeMulNegateArithmetic() { if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpFNegate || - other_inst->opcode() == SpvOpSNegate) { + if (other_inst->opcode() == spv::Op::OpFNegate || + other_inst->opcode() == spv::Op::OpSNegate) { uint32_t neg_id = NegateConstant(const_mgr, const_input1); inst->SetInOperands( @@ -833,7 +844,7 @@ FoldingRule MergeMulNegateArithmetic() { FoldingRule MergeDivDivArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFDiv); + assert(inst->opcode() == spv::Op::OpFDiv); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); @@ -856,10 +867,10 @@ FoldingRule MergeDivDivArithmetic() { bool other_first_is_variable = other_constants[0] == nullptr; - SpvOp merge_op = inst->opcode(); + spv::Op merge_op = inst->opcode(); if (other_first_is_variable) { // Constants magnify. - merge_op = SpvOpFMul; + merge_op = spv::Op::OpFMul; } // This is an x / (*) case. Swap the inputs. Doesn't harm multiply @@ -873,10 +884,10 @@ FoldingRule MergeDivDivArithmetic() { ? other_inst->GetSingleWordInOperand(0u) : other_inst->GetSingleWordInOperand(1u); - SpvOp op = inst->opcode(); + spv::Op op = inst->opcode(); if (!first_is_variable && !other_first_is_variable) { // Effectively div of 1/x, so change to multiply. - op = SpvOpFMul; + op = spv::Op::OpFMul; } uint32_t op1 = merged_id; @@ -904,7 +915,7 @@ FoldingRule MergeDivDivArithmetic() { FoldingRule MergeDivMulArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFDiv); + assert(inst->opcode() == spv::Op::OpFDiv); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); @@ -918,11 +929,11 @@ FoldingRule MergeDivMulArithmetic() { uint32_t op_id = inst->GetSingleWordInOperand(0); Instruction* op_inst = def_use_mgr->GetDef(op_id); - if (op_inst->opcode() == SpvOpFMul) { + if (op_inst->opcode() == spv::Op::OpFMul) { for (uint32_t i = 0; i < 2; i++) { if (op_inst->GetSingleWordInOperand(i) == inst->GetSingleWordInOperand(1)) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {op_inst->GetSingleWordInOperand(1 - i)}}}); return true; @@ -936,7 +947,7 @@ FoldingRule MergeDivMulArithmetic() { if (!other_inst->IsFloatingPointFoldingAllowed()) return false; bool first_is_variable = constants[0] == nullptr; - if (other_inst->opcode() == SpvOpFMul) { + if (other_inst->opcode() == spv::Op::OpFMul) { std::vector other_constants = const_mgr->GetOperandConstants(other_inst); const analysis::Constant* const_input2 = ConstInput(other_constants); @@ -976,7 +987,7 @@ FoldingRule MergeDivMulArithmetic() { FoldingRule MergeDivNegateArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFDiv); + assert(inst->opcode() == spv::Op::OpFDiv); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); if (!inst->IsFloatingPointFoldingAllowed()) return false; @@ -986,7 +997,7 @@ FoldingRule MergeDivNegateArithmetic() { if (!other_inst->IsFloatingPointFoldingAllowed()) return false; bool first_is_variable = constants[0] == nullptr; - if (other_inst->opcode() == SpvOpFNegate) { + if (other_inst->opcode() == spv::Op::OpFNegate) { uint32_t neg_id = NegateConstant(const_mgr, const_input1); if (first_is_variable) { @@ -1012,7 +1023,8 @@ FoldingRule MergeDivNegateArithmetic() { FoldingRule MergeAddNegateArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + assert(inst->opcode() == spv::Op::OpFAdd || + inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); bool uses_float = HasFloatingPoint(type); @@ -1024,9 +1036,10 @@ FoldingRule MergeAddNegateArithmetic() { if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpSNegate || - other_inst->opcode() == SpvOpFNegate) { - inst->SetOpcode(HasFloatingPoint(type) ? SpvOpFSub : SpvOpISub); + if (other_inst->opcode() == spv::Op::OpSNegate || + other_inst->opcode() == spv::Op::OpFNegate) { + inst->SetOpcode(HasFloatingPoint(type) ? spv::Op::OpFSub + : spv::Op::OpISub); uint32_t const_id = constants[0] ? inst->GetSingleWordInOperand(0u) : inst->GetSingleWordInOperand(1u); inst->SetInOperands( @@ -1045,7 +1058,8 @@ FoldingRule MergeAddNegateArithmetic() { FoldingRule MergeSubNegateArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFSub || inst->opcode() == SpvOpISub); + assert(inst->opcode() == spv::Op::OpFSub || + inst->opcode() == spv::Op::OpISub); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); @@ -1061,15 +1075,15 @@ FoldingRule MergeSubNegateArithmetic() { if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpSNegate || - other_inst->opcode() == SpvOpFNegate) { + if (other_inst->opcode() == spv::Op::OpSNegate || + other_inst->opcode() == spv::Op::OpFNegate) { uint32_t op1 = 0; uint32_t op2 = 0; - SpvOp opcode = inst->opcode(); + spv::Op opcode = inst->opcode(); if (constants[0] != nullptr) { op1 = other_inst->GetSingleWordInOperand(0u); op2 = inst->GetSingleWordInOperand(0u); - opcode = HasFloatingPoint(type) ? SpvOpFAdd : SpvOpIAdd; + opcode = HasFloatingPoint(type) ? spv::Op::OpFAdd : spv::Op::OpIAdd; } else { op1 = NegateConstant(const_mgr, const_input1); op2 = other_inst->GetSingleWordInOperand(0u); @@ -1093,7 +1107,8 @@ FoldingRule MergeSubNegateArithmetic() { FoldingRule MergeAddAddArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + assert(inst->opcode() == spv::Op::OpFAdd || + inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); @@ -1109,8 +1124,8 @@ FoldingRule MergeAddAddArithmetic() { if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpFAdd || - other_inst->opcode() == SpvOpIAdd) { + if (other_inst->opcode() == spv::Op::OpFAdd || + other_inst->opcode() == spv::Op::OpIAdd) { std::vector other_constants = const_mgr->GetOperandConstants(other_inst); const analysis::Constant* const_input2 = ConstInput(other_constants); @@ -1140,7 +1155,8 @@ FoldingRule MergeAddAddArithmetic() { FoldingRule MergeAddSubArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + assert(inst->opcode() == spv::Op::OpFAdd || + inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); @@ -1156,15 +1172,15 @@ FoldingRule MergeAddSubArithmetic() { if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpFSub || - other_inst->opcode() == SpvOpISub) { + if (other_inst->opcode() == spv::Op::OpFSub || + other_inst->opcode() == spv::Op::OpISub) { std::vector other_constants = const_mgr->GetOperandConstants(other_inst); const analysis::Constant* const_input2 = ConstInput(other_constants); if (!const_input2) return false; bool first_is_variable = other_constants[0] == nullptr; - SpvOp op = inst->opcode(); + spv::Op op = inst->opcode(); uint32_t op1 = 0; uint32_t op2 = 0; if (first_is_variable) { @@ -1199,7 +1215,8 @@ FoldingRule MergeAddSubArithmetic() { FoldingRule MergeSubAddArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFSub || inst->opcode() == SpvOpISub); + assert(inst->opcode() == spv::Op::OpFSub || + inst->opcode() == spv::Op::OpISub); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); @@ -1215,8 +1232,8 @@ FoldingRule MergeSubAddArithmetic() { if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpFAdd || - other_inst->opcode() == SpvOpIAdd) { + if (other_inst->opcode() == spv::Op::OpFAdd || + other_inst->opcode() == spv::Op::OpIAdd) { std::vector other_constants = const_mgr->GetOperandConstants(other_inst); const analysis::Constant* const_input2 = ConstInput(other_constants); @@ -1231,7 +1248,7 @@ FoldingRule MergeSubAddArithmetic() { // Subtract the constants. uint32_t merged_id = PerformOperation(const_mgr, inst->opcode(), const_input1, const_input2); - SpvOp op = inst->opcode(); + spv::Op op = inst->opcode(); uint32_t op1 = 0; uint32_t op2 = 0; if (constants[0] == nullptr) { @@ -1264,7 +1281,8 @@ FoldingRule MergeSubAddArithmetic() { FoldingRule MergeSubSubArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFSub || inst->opcode() == SpvOpISub); + assert(inst->opcode() == spv::Op::OpFSub || + inst->opcode() == spv::Op::OpISub); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); @@ -1280,8 +1298,8 @@ FoldingRule MergeSubSubArithmetic() { if (uses_float && !other_inst->IsFloatingPointFoldingAllowed()) return false; - if (other_inst->opcode() == SpvOpFSub || - other_inst->opcode() == SpvOpISub) { + if (other_inst->opcode() == spv::Op::OpFSub || + other_inst->opcode() == spv::Op::OpISub) { std::vector other_constants = const_mgr->GetOperandConstants(other_inst); const analysis::Constant* const_input2 = ConstInput(other_constants); @@ -1292,9 +1310,9 @@ FoldingRule MergeSubSubArithmetic() { // Merge the constants. uint32_t merged_id = 0; - SpvOp merge_op = inst->opcode(); + spv::Op merge_op = inst->opcode(); if (other_constants[0] == nullptr) { - merge_op = uses_float ? SpvOpFAdd : SpvOpIAdd; + merge_op = uses_float ? spv::Op::OpFAdd : spv::Op::OpIAdd; } else if (constants[0] == nullptr) { std::swap(const_input1, const_input2); } @@ -1302,10 +1320,10 @@ FoldingRule MergeSubSubArithmetic() { PerformOperation(const_mgr, merge_op, const_input1, const_input2); if (merged_id == 0) return false; - SpvOp op = inst->opcode(); + spv::Op op = inst->opcode(); if (constants[0] != nullptr && other_constants[0] != nullptr) { // Change the operation. - op = uses_float ? SpvOpFAdd : SpvOpIAdd; + op = uses_float ? spv::Op::OpFAdd : spv::Op::OpIAdd; } uint32_t op1 = 0; @@ -1333,13 +1351,14 @@ bool MergeGenericAddendSub(uint32_t addend, uint32_t sub, Instruction* inst) { IRContext* context = inst->context(); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); Instruction* sub_inst = def_use_mgr->GetDef(sub); - if (sub_inst->opcode() != SpvOpFSub && sub_inst->opcode() != SpvOpISub) + if (sub_inst->opcode() != spv::Op::OpFSub && + sub_inst->opcode() != spv::Op::OpISub) return false; - if (sub_inst->opcode() == SpvOpFSub && + if (sub_inst->opcode() == spv::Op::OpFSub && !sub_inst->IsFloatingPointFoldingAllowed()) return false; if (addend != sub_inst->GetSingleWordInOperand(1)) return false; - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {sub_inst->GetSingleWordInOperand(0)}}}); context->UpdateDefUse(inst); @@ -1355,7 +1374,8 @@ bool MergeGenericAddendSub(uint32_t addend, uint32_t sub, Instruction* inst) { FoldingRule MergeGenericAddSubArithmetic() { return [](IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + assert(inst->opcode() == spv::Op::OpFAdd || + inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); bool uses_float = HasFloatingPoint(type); @@ -1383,7 +1403,8 @@ bool FactorAddMulsOpnds(uint32_t factor0_0, uint32_t factor0_1, IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); Instruction* new_add_inst = ir_builder.AddBinaryOp( inst->type_id(), inst->opcode(), factor0_1, factor1_1); - inst->SetOpcode(inst->opcode() == SpvOpFAdd ? SpvOpFMul : SpvOpIMul); + inst->SetOpcode(inst->opcode() == spv::Op::OpFAdd ? spv::Op::OpFMul + : spv::Op::OpIMul); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {factor0_0}}, {SPV_OPERAND_TYPE_ID, {new_add_inst->result_id()}}}); context->UpdateDefUse(inst); @@ -1395,7 +1416,8 @@ bool FactorAddMulsOpnds(uint32_t factor0_0, uint32_t factor0_1, FoldingRule FactorAddMuls() { return [](IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd); + assert(inst->opcode() == spv::Op::OpFAdd || + inst->opcode() == spv::Op::OpIAdd); const analysis::Type* type = context->get_type_mgr()->GetType(inst->type_id()); bool uses_float = HasFloatingPoint(type); @@ -1404,13 +1426,13 @@ FoldingRule FactorAddMuls() { analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); uint32_t add_op0 = inst->GetSingleWordInOperand(0); Instruction* add_op0_inst = def_use_mgr->GetDef(add_op0); - if (add_op0_inst->opcode() != SpvOpFMul && - add_op0_inst->opcode() != SpvOpIMul) + if (add_op0_inst->opcode() != spv::Op::OpFMul && + add_op0_inst->opcode() != spv::Op::OpIMul) return false; uint32_t add_op1 = inst->GetSingleWordInOperand(1); Instruction* add_op1_inst = def_use_mgr->GetDef(add_op1); - if (add_op1_inst->opcode() != SpvOpFMul && - add_op1_inst->opcode() != SpvOpIMul) + if (add_op1_inst->opcode() != spv::Op::OpFMul && + add_op1_inst->opcode() != spv::Op::OpIMul) return false; // Only perform this optimization if both of the muls only have one use. @@ -1418,7 +1440,7 @@ FoldingRule FactorAddMuls() { if (def_use_mgr->NumUses(add_op0_inst) > 1) return false; if (def_use_mgr->NumUses(add_op1_inst) > 1) return false; - if (add_op0_inst->opcode() == SpvOpFMul && + if (add_op0_inst->opcode() == spv::Op::OpFMul && (!add_op0_inst->IsFloatingPointFoldingAllowed() || !add_op1_inst->IsFloatingPointFoldingAllowed())) return false; @@ -1457,7 +1479,7 @@ void ReplaceWithFma(Instruction* inst, uint32_t x, uint32_t y, uint32_t a) { operands.push_back({SPV_OPERAND_TYPE_ID, {y}}); operands.push_back({SPV_OPERAND_TYPE_ID, {a}}); - inst->SetOpcode(SpvOpExtInst); + inst->SetOpcode(spv::Op::OpExtInst); inst->SetInOperands(std::move(operands)); } @@ -1468,7 +1490,7 @@ void ReplaceWithFma(Instruction* inst, uint32_t x, uint32_t y, uint32_t a) { // a + (x * y) = Fma x y a bool MergeMulAddArithmetic(IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpFAdd); + assert(inst->opcode() == spv::Op::OpFAdd); if (!inst->IsFloatingPointFoldingAllowed()) { return false; @@ -1479,7 +1501,7 @@ bool MergeMulAddArithmetic(IRContext* context, Instruction* inst, uint32_t op_id = inst->GetSingleWordInOperand(i); Instruction* op_inst = def_use_mgr->GetDef(op_id); - if (op_inst->opcode() != SpvOpFMul) { + if (op_inst->opcode() != spv::Op::OpFMul) { continue; } @@ -1514,7 +1536,7 @@ void ReplaceWithFmaAndNegate(Instruction* sub, uint32_t x, uint32_t y, sub->context(), sub, IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); - Instruction* neg = ir_builder.AddUnaryOp(sub->type_id(), SpvOpFNegate, + Instruction* neg = ir_builder.AddUnaryOp(sub->type_id(), spv::Op::OpFNegate, negate_addition ? a : x); uint32_t neg_op = neg->result_id(); // -a : -x @@ -1525,7 +1547,7 @@ void ReplaceWithFmaAndNegate(Instruction* sub, uint32_t x, uint32_t y, operands.push_back({SPV_OPERAND_TYPE_ID, {y}}); operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? neg_op : a}}); - sub->SetOpcode(SpvOpExtInst); + sub->SetOpcode(spv::Op::OpExtInst); sub->SetInOperands(std::move(operands)); } @@ -1536,7 +1558,7 @@ void ReplaceWithFmaAndNegate(Instruction* sub, uint32_t x, uint32_t y, // a - (x * y) = Fma -x y a bool MergeMulSubArithmetic(IRContext* context, Instruction* sub, const std::vector&) { - assert(sub->opcode() == SpvOpFSub); + assert(sub->opcode() == spv::Op::OpFSub); if (!sub->IsFloatingPointFoldingAllowed()) { return false; @@ -1547,7 +1569,7 @@ bool MergeMulSubArithmetic(IRContext* context, Instruction* sub, uint32_t op_id = sub->GetSingleWordInOperand(i); Instruction* mul = def_use_mgr->GetDef(op_id); - if (mul->opcode() != SpvOpFMul) { + if (mul->opcode() != spv::Op::OpFMul) { continue; } @@ -1567,7 +1589,8 @@ bool MergeMulSubArithmetic(IRContext* context, Instruction* sub, FoldingRule IntMultipleBy1() { return [](IRContext*, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpIMul && "Wrong opcode. Should be OpIMul."); + assert(inst->opcode() == spv::Op::OpIMul && + "Wrong opcode. Should be OpIMul."); for (uint32_t i = 0; i < 2; i++) { if (constants[i] == nullptr) { continue; @@ -1579,7 +1602,7 @@ FoldingRule IntMultipleBy1() { bool is_one = (width == 32) ? int_constant->GetU32BitValue() == 1u : int_constant->GetU64BitValue() == 1ull; if (is_one) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(1 - i)}}}); return true; @@ -1596,7 +1619,7 @@ FoldingRule IntMultipleBy1() { uint32_t GetNumOfElementsContributedByOperand(IRContext* context, const Instruction* inst, uint32_t index) { - assert(inst->opcode() == SpvOpCompositeConstruct); + assert(inst->opcode() == spv::Op::OpCompositeConstruct); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); analysis::TypeManager* type_mgr = context->get_type_mgr(); @@ -1627,7 +1650,7 @@ uint32_t GetNumOfElementsContributedByOperand(IRContext* context, // out-of-bounds. |inst| must be an |OpCompositeConstruct| instruction. std::vector GetExtractOperandsForElementOfCompositeConstruct( IRContext* context, const Instruction* inst, uint32_t result_index) { - assert(inst->opcode() == SpvOpCompositeConstruct); + assert(inst->opcode() == spv::Op::OpCompositeConstruct); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); analysis::TypeManager* type_mgr = context->get_type_mgr(); @@ -1666,7 +1689,7 @@ bool CompositeConstructFeedingExtract( const std::vector&) { // If the input to an OpCompositeExtract is an OpCompositeConstruct, // then we can simply use the appropriate element in the construction. - assert(inst->opcode() == SpvOpCompositeExtract && + assert(inst->opcode() == spv::Op::OpCompositeExtract && "Wrong opcode. Should be OpCompositeExtract."); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); @@ -1678,7 +1701,7 @@ bool CompositeConstructFeedingExtract( uint32_t cid = inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); Instruction* cinst = def_use_mgr->GetDef(cid); - if (cinst->opcode() != SpvOpCompositeConstruct) { + if (cinst->opcode() != spv::Op::OpCompositeConstruct) { return false; } @@ -1700,7 +1723,7 @@ bool CompositeConstructFeedingExtract( if (operands.size() == 1) { // If there were no extra indices, then we have the final object. No need // to extract any more. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); } inst->SetInOperands(std::move(operands)); @@ -1738,8 +1761,8 @@ const analysis::Type* GetElementType(uint32_t type_id, bool HaveSameIndexesExceptForLast(Instruction* inst_1, Instruction* inst_2) { assert(inst_1->opcode() == inst_2->opcode() && "Expecting the opcodes to be the same."); - assert((inst_1->opcode() == SpvOpCompositeInsert || - inst_1->opcode() == SpvOpCompositeExtract) && + assert((inst_1->opcode() == spv::Op::OpCompositeInsert || + inst_1->opcode() == spv::Op::OpCompositeExtract) && "Instructions must be OpCompositeInsert or OpCompositeExtract."); if (inst_1->NumInOperands() != inst_2->NumInOperands()) { @@ -1747,7 +1770,7 @@ bool HaveSameIndexesExceptForLast(Instruction* inst_1, Instruction* inst_2) { } uint32_t first_index_position = - (inst_1->opcode() == SpvOpCompositeInsert ? 2 : 1); + (inst_1->opcode() == spv::Op::OpCompositeInsert ? 2 : 1); for (uint32_t i = first_index_position; i < inst_1->NumInOperands() - 1; i++) { if (inst_1->GetSingleWordInOperand(i) != @@ -1766,7 +1789,7 @@ bool HaveSameIndexesExceptForLast(Instruction* inst_1, Instruction* inst_2) { bool CompositeExtractFeedingConstruct( IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpCompositeConstruct && + assert(inst->opcode() == spv::Op::OpCompositeConstruct && "Wrong opcode. Should be OpCompositeConstruct."); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); uint32_t original_id = 0; @@ -1788,7 +1811,7 @@ bool CompositeExtractFeedingConstruct( first_element_inst = element_inst; } - if (element_inst->opcode() != SpvOpCompositeExtract) { + if (element_inst->opcode() != spv::Op::OpCompositeExtract) { return false; } @@ -1828,14 +1851,14 @@ bool CompositeExtractFeedingConstruct( if (first_element_inst->NumInOperands() == 2) { // Simplify by using the original object. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {original_id}}}); return true; } // Copies the original id and all indexes except for the last to the new // extract instruction. - inst->SetOpcode(SpvOpCompositeExtract); + inst->SetOpcode(spv::Op::OpCompositeExtract); inst->SetInOperands(std::vector(first_element_inst->begin() + 2, first_element_inst->end() - 1)); return true; @@ -1844,13 +1867,13 @@ bool CompositeExtractFeedingConstruct( FoldingRule InsertFeedingExtract() { return [](IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpCompositeExtract && + assert(inst->opcode() == spv::Op::OpCompositeExtract && "Wrong opcode. Should be OpCompositeExtract."); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); uint32_t cid = inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); Instruction* cinst = def_use_mgr->GetDef(cid); - if (cinst->opcode() != SpvOpCompositeInsert) { + if (cinst->opcode() != spv::Op::OpCompositeInsert) { return false; } @@ -1870,7 +1893,7 @@ FoldingRule InsertFeedingExtract() { // We are extracting the element that was inserted. if (i == inst->NumInOperands() && i + 1 == cinst->NumInOperands()) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {cinst->GetSingleWordInOperand(kInsertObjectIdInIdx)}}}); @@ -1919,14 +1942,14 @@ FoldingRule InsertFeedingExtract() { FoldingRule VectorShuffleFeedingExtract() { return [](IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpCompositeExtract && + assert(inst->opcode() == spv::Op::OpCompositeExtract && "Wrong opcode. Should be OpCompositeExtract."); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); analysis::TypeManager* type_mgr = context->get_type_mgr(); uint32_t cid = inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); Instruction* cinst = def_use_mgr->GetDef(cid); - if (cinst->opcode() != SpvOpVectorShuffle) { + if (cinst->opcode() != spv::Op::OpVectorShuffle) { return false; } @@ -1947,7 +1970,7 @@ FoldingRule VectorShuffleFeedingExtract() { // Extracting an undefined value so fold this extract into an undef. const uint32_t undef_literal_value = 0xffffffff; if (new_index == undef_literal_value) { - inst->SetOpcode(SpvOpUndef); + inst->SetOpcode(spv::Op::OpUndef); inst->SetInOperands({}); return true; } @@ -1975,7 +1998,7 @@ FoldingRule VectorShuffleFeedingExtract() { FoldingRule FMixFeedingExtract() { return [](IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpCompositeExtract && + assert(inst->opcode() == spv::Op::OpCompositeExtract && "Wrong opcode. Should be OpCompositeExtract."); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); @@ -1984,7 +2007,7 @@ FoldingRule FMixFeedingExtract() { inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); Instruction* composite_inst = def_use_mgr->GetDef(composite_id); - if (composite_inst->opcode() != SpvOpExtInst) { + if (composite_inst->opcode() != spv::Op::OpExtInst) { return false; } @@ -2004,7 +2027,7 @@ FoldingRule FMixFeedingExtract() { a->SetInOperand(kExtractCompositeIdInIdx, {a_id}); context->get_instruction_folder().FoldInstruction(a.get()); - if (a->opcode() != SpvOpCopyObject) { + if (a->opcode() != spv::Op::OpCopyObject) { return false; } @@ -2066,7 +2089,7 @@ std::map GetInsertedValues(Instruction* inst) { analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr(); std::map values_inserted; Instruction* current_inst = inst; - while (current_inst->opcode() == SpvOpCompositeInsert) { + while (current_inst->opcode() == spv::Op::OpCompositeInsert) { if (current_inst->NumInOperands() > inst->NumInOperands()) { // This is the catch the case // %2 = OpCompositeInsert %m2x2int %v2int_1_0 %m2x2int_undef 0 @@ -2108,7 +2131,7 @@ bool DoInsertedValuesCoverEntireObject( // Returns the type of the element that immediately contains the element being // inserted by the OpCompositeInsert instruction |inst|. const analysis::Type* GetContainerType(Instruction* inst) { - assert(inst->opcode() == SpvOpCompositeInsert); + assert(inst->opcode() == spv::Op::OpCompositeInsert); analysis::TypeManager* type_mgr = inst->context()->get_type_mgr(); return GetElementType(inst->type_id(), inst->begin() + 4, inst->end() - 1, type_mgr); @@ -2140,7 +2163,7 @@ Instruction* BuildCompositeConstruct( // instruction is replaced with an OpCopyObject instead. void InsertConstructedObject(Instruction* inst, const Instruction* construct) { if (inst->NumInOperands() == 3) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {construct->result_id()}}}); } else { inst->SetInOperand(kInsertObjectIdInIdx, {construct->result_id()}); @@ -2153,7 +2176,7 @@ void InsertConstructedObject(Instruction* inst, const Instruction* construct) { bool CompositeInsertToCompositeConstruct( IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpCompositeInsert && + assert(inst->opcode() == spv::Op::OpCompositeInsert && "Wrong opcode. Should be OpCompositeInsert."); if (inst->NumInOperands() < 3) return false; @@ -2179,7 +2202,8 @@ FoldingRule RedundantPhi() { // itself, can be replaced by the value itself. return [](IRContext*, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpPhi && "Wrong opcode. Should be OpPhi."); + assert(inst->opcode() == spv::Op::OpPhi && + "Wrong opcode. Should be OpPhi."); uint32_t incoming_value = 0; @@ -2203,7 +2227,7 @@ FoldingRule RedundantPhi() { } // We have a single incoming value. Simplify using that value. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {incoming_value}}}); return true; }; @@ -2212,7 +2236,7 @@ FoldingRule RedundantPhi() { FoldingRule BitCastScalarOrVector() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpBitcast && constants.size() == 1); + assert(inst->opcode() == spv::Op::OpBitcast && constants.size() == 1); if (constants[0] == nullptr) return false; const analysis::Type* type = @@ -2232,7 +2256,7 @@ FoldingRule BitCastScalarOrVector() { auto new_feeder_id = const_mgr->GetDefiningInstruction(bitcasted_constant, inst->type_id()) ->result_id(); - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {new_feeder_id}}}); return true; }; @@ -2243,7 +2267,7 @@ FoldingRule RedundantSelect() { // constant can be replaced by one of the values return [](IRContext*, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpSelect && + assert(inst->opcode() == spv::Op::OpSelect && "Wrong opcode. Should be OpSelect."); assert(inst->NumInOperands() == 3); assert(constants.size() == 3); @@ -2253,14 +2277,14 @@ FoldingRule RedundantSelect() { if (true_id == false_id) { // Both results are the same, condition doesn't matter - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {true_id}}}); return true; } else if (constants[0]) { const analysis::Type* type = constants[0]->type(); if (type->AsBool()) { // Scalar constant value, select the corresponding value. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); if (constants[0]->AsNullConstant() || !constants[0]->AsBoolConstant()->value()) { inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {false_id}}}); @@ -2272,7 +2296,7 @@ FoldingRule RedundantSelect() { assert(type->AsVector()); if (constants[0]->AsNullConstant()) { // All values come from false id. - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {false_id}}}); return true; } else { @@ -2299,7 +2323,7 @@ FoldingRule RedundantSelect() { } } - inst->SetOpcode(SpvOpVectorShuffle); + inst->SetOpcode(spv::Op::OpVectorShuffle); inst->SetInOperands(std::move(ops)); return true; } @@ -2359,7 +2383,8 @@ FloatConstantKind getFloatConstantKind(const analysis::Constant* constant) { FoldingRule RedundantFAdd() { return [](IRContext*, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFAdd && "Wrong opcode. Should be OpFAdd."); + assert(inst->opcode() == spv::Op::OpFAdd && + "Wrong opcode. Should be OpFAdd."); assert(constants.size() == 2); if (!inst->IsFloatingPointFoldingAllowed()) { @@ -2370,7 +2395,7 @@ FoldingRule RedundantFAdd() { FloatConstantKind kind1 = getFloatConstantKind(constants[1]); if (kind0 == FloatConstantKind::Zero || kind1 == FloatConstantKind::Zero) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand( kind0 == FloatConstantKind::Zero ? 1 : 0)}}}); @@ -2384,7 +2409,8 @@ FoldingRule RedundantFAdd() { FoldingRule RedundantFSub() { return [](IRContext*, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFSub && "Wrong opcode. Should be OpFSub."); + assert(inst->opcode() == spv::Op::OpFSub && + "Wrong opcode. Should be OpFSub."); assert(constants.size() == 2); if (!inst->IsFloatingPointFoldingAllowed()) { @@ -2395,14 +2421,14 @@ FoldingRule RedundantFSub() { FloatConstantKind kind1 = getFloatConstantKind(constants[1]); if (kind0 == FloatConstantKind::Zero) { - inst->SetOpcode(SpvOpFNegate); + inst->SetOpcode(spv::Op::OpFNegate); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(1)}}}); return true; } if (kind1 == FloatConstantKind::Zero) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}}); return true; @@ -2415,7 +2441,8 @@ FoldingRule RedundantFSub() { FoldingRule RedundantFMul() { return [](IRContext*, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFMul && "Wrong opcode. Should be OpFMul."); + assert(inst->opcode() == spv::Op::OpFMul && + "Wrong opcode. Should be OpFMul."); assert(constants.size() == 2); if (!inst->IsFloatingPointFoldingAllowed()) { @@ -2426,7 +2453,7 @@ FoldingRule RedundantFMul() { FloatConstantKind kind1 = getFloatConstantKind(constants[1]); if (kind0 == FloatConstantKind::Zero || kind1 == FloatConstantKind::Zero) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand( kind0 == FloatConstantKind::Zero ? 0 : 1)}}}); @@ -2434,7 +2461,7 @@ FoldingRule RedundantFMul() { } if (kind0 == FloatConstantKind::One || kind1 == FloatConstantKind::One) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand( kind0 == FloatConstantKind::One ? 1 : 0)}}}); @@ -2448,7 +2475,8 @@ FoldingRule RedundantFMul() { FoldingRule RedundantFDiv() { return [](IRContext*, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpFDiv && "Wrong opcode. Should be OpFDiv."); + assert(inst->opcode() == spv::Op::OpFDiv && + "Wrong opcode. Should be OpFDiv."); assert(constants.size() == 2); if (!inst->IsFloatingPointFoldingAllowed()) { @@ -2459,14 +2487,14 @@ FoldingRule RedundantFDiv() { FloatConstantKind kind1 = getFloatConstantKind(constants[1]); if (kind0 == FloatConstantKind::Zero) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}}); return true; } if (kind1 == FloatConstantKind::One) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}}); return true; @@ -2479,7 +2507,7 @@ FoldingRule RedundantFDiv() { FoldingRule RedundantFMix() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpExtInst && + assert(inst->opcode() == spv::Op::OpExtInst && "Wrong opcode. Should be OpExtInst."); if (!inst->IsFloatingPointFoldingAllowed()) { @@ -2497,7 +2525,7 @@ FoldingRule RedundantFMix() { FloatConstantKind kind4 = getFloatConstantKind(constants[4]); if (kind4 == FloatConstantKind::Zero || kind4 == FloatConstantKind::One) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); inst->SetInOperands( {{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(kind4 == FloatConstantKind::Zero @@ -2515,7 +2543,8 @@ FoldingRule RedundantFMix() { FoldingRule RedundantIAdd() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpIAdd && "Wrong opcode. Should be OpIAdd."); + assert(inst->opcode() == spv::Op::OpIAdd && + "Wrong opcode. Should be OpIAdd."); uint32_t operand = std::numeric_limits::max(); const analysis::Type* operand_type = nullptr; @@ -2531,9 +2560,9 @@ FoldingRule RedundantIAdd() { const analysis::Type* inst_type = context->get_type_mgr()->GetType(inst->type_id()); if (inst_type->IsSame(operand_type)) { - inst->SetOpcode(SpvOpCopyObject); + inst->SetOpcode(spv::Op::OpCopyObject); } else { - inst->SetOpcode(SpvOpBitcast); + inst->SetOpcode(spv::Op::OpBitcast); } inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {operand}}}); return true; @@ -2547,7 +2576,8 @@ FoldingRule RedundantIAdd() { FoldingRule DotProductDoingExtract() { return [](IRContext* context, Instruction* inst, const std::vector& constants) { - assert(inst->opcode() == SpvOpDot && "Wrong opcode. Should be OpDot."); + assert(inst->opcode() == spv::Op::OpDot && + "Wrong opcode. Should be OpDot."); analysis::ConstantManager* const_mgr = context->get_constant_mgr(); @@ -2573,7 +2603,7 @@ FoldingRule DotProductDoingExtract() { std::vector components; components = constants[i]->GetVectorComponents(const_mgr); - const uint32_t kNotFound = std::numeric_limits::max(); + constexpr uint32_t kNotFound = std::numeric_limits::max(); uint32_t component_with_one = kNotFound; bool all_others_zero = true; @@ -2606,7 +2636,7 @@ FoldingRule DotProductDoingExtract() { operands.push_back( {SPV_OPERAND_TYPE_LITERAL_INTEGER, {component_with_one}}); - inst->SetOpcode(SpvOpCompositeExtract); + inst->SetOpcode(spv::Op::OpCompositeExtract); inst->SetInOperands(std::move(operands)); return true; } @@ -2621,20 +2651,22 @@ FoldingRule DotProductDoingExtract() { FoldingRule StoringUndef() { return [](IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpStore && "Wrong opcode. Should be OpStore."); + assert(inst->opcode() == spv::Op::OpStore && + "Wrong opcode. Should be OpStore."); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); // If this is a volatile store, the store cannot be removed. if (inst->NumInOperands() == 3) { - if (inst->GetSingleWordInOperand(2) & SpvMemoryAccessVolatileMask) { + if (inst->GetSingleWordInOperand(2) & + uint32_t(spv::MemoryAccessMask::Volatile)) { return false; } } uint32_t object_id = inst->GetSingleWordInOperand(kStoreObjectInIdx); Instruction* object_inst = def_use_mgr->GetDef(object_id); - if (object_inst->opcode() == SpvOpUndef) { + if (object_inst->opcode() == spv::Op::OpUndef) { inst->ToNop(); return true; } @@ -2645,7 +2677,7 @@ FoldingRule StoringUndef() { FoldingRule VectorShuffleFeedingShuffle() { return [](IRContext* context, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpVectorShuffle && + assert(inst->opcode() == spv::Op::OpVectorShuffle && "Wrong opcode. Should be OpVectorShuffle."); analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); @@ -2658,13 +2690,13 @@ FoldingRule VectorShuffleFeedingShuffle() { uint32_t op0_length = op0_type->element_count(); bool feeder_is_op0 = true; - if (feeding_shuffle_inst->opcode() != SpvOpVectorShuffle) { + if (feeding_shuffle_inst->opcode() != spv::Op::OpVectorShuffle) { feeding_shuffle_inst = def_use_mgr->GetDef(inst->GetSingleWordInOperand(1)); feeder_is_op0 = false; } - if (feeding_shuffle_inst->opcode() != SpvOpVectorShuffle) { + if (feeding_shuffle_inst->opcode() != spv::Op::OpVectorShuffle) { return false; } @@ -2775,7 +2807,7 @@ FoldingRule VectorShuffleFeedingShuffle() { FoldingRule RemoveRedundantOperands() { return [](IRContext*, Instruction* inst, const std::vector&) { - assert(inst->opcode() == SpvOpEntryPoint && + assert(inst->opcode() == spv::Op::OpEntryPoint && "Wrong opcode. Should be OpEntryPoint."); bool has_redundant_operand = false; std::unordered_set seen_operands; @@ -2808,46 +2840,52 @@ FoldingRule UpdateImageOperands() { const std::vector& constants) { const auto opcode = inst->opcode(); (void)opcode; - assert((opcode == SpvOpImageSampleImplicitLod || - opcode == SpvOpImageSampleExplicitLod || - opcode == SpvOpImageSampleDrefImplicitLod || - opcode == SpvOpImageSampleDrefExplicitLod || - opcode == SpvOpImageSampleProjImplicitLod || - opcode == SpvOpImageSampleProjExplicitLod || - opcode == SpvOpImageSampleProjDrefImplicitLod || - opcode == SpvOpImageSampleProjDrefExplicitLod || - opcode == SpvOpImageFetch || opcode == SpvOpImageGather || - opcode == SpvOpImageDrefGather || opcode == SpvOpImageRead || - opcode == SpvOpImageWrite || - opcode == SpvOpImageSparseSampleImplicitLod || - opcode == SpvOpImageSparseSampleExplicitLod || - opcode == SpvOpImageSparseSampleDrefImplicitLod || - opcode == SpvOpImageSparseSampleDrefExplicitLod || - opcode == SpvOpImageSparseSampleProjImplicitLod || - opcode == SpvOpImageSparseSampleProjExplicitLod || - opcode == SpvOpImageSparseSampleProjDrefImplicitLod || - opcode == SpvOpImageSparseSampleProjDrefExplicitLod || - opcode == SpvOpImageSparseFetch || - opcode == SpvOpImageSparseGather || - opcode == SpvOpImageSparseDrefGather || - opcode == SpvOpImageSparseRead) && + assert((opcode == spv::Op::OpImageSampleImplicitLod || + opcode == spv::Op::OpImageSampleExplicitLod || + opcode == spv::Op::OpImageSampleDrefImplicitLod || + opcode == spv::Op::OpImageSampleDrefExplicitLod || + opcode == spv::Op::OpImageSampleProjImplicitLod || + opcode == spv::Op::OpImageSampleProjExplicitLod || + opcode == spv::Op::OpImageSampleProjDrefImplicitLod || + opcode == spv::Op::OpImageSampleProjDrefExplicitLod || + opcode == spv::Op::OpImageFetch || + opcode == spv::Op::OpImageGather || + opcode == spv::Op::OpImageDrefGather || + opcode == spv::Op::OpImageRead || opcode == spv::Op::OpImageWrite || + opcode == spv::Op::OpImageSparseSampleImplicitLod || + opcode == spv::Op::OpImageSparseSampleExplicitLod || + opcode == spv::Op::OpImageSparseSampleDrefImplicitLod || + opcode == spv::Op::OpImageSparseSampleDrefExplicitLod || + opcode == spv::Op::OpImageSparseSampleProjImplicitLod || + opcode == spv::Op::OpImageSparseSampleProjExplicitLod || + opcode == spv::Op::OpImageSparseSampleProjDrefImplicitLod || + opcode == spv::Op::OpImageSparseSampleProjDrefExplicitLod || + opcode == spv::Op::OpImageSparseFetch || + opcode == spv::Op::OpImageSparseGather || + opcode == spv::Op::OpImageSparseDrefGather || + opcode == spv::Op::OpImageSparseRead) && "Wrong opcode. Should be an image instruction."); int32_t operand_index = ImageOperandsMaskInOperandIndex(inst); if (operand_index >= 0) { auto image_operands = inst->GetSingleWordInOperand(operand_index); - if (image_operands & SpvImageOperandsOffsetMask) { + if (image_operands & uint32_t(spv::ImageOperandsMask::Offset)) { uint32_t offset_operand_index = operand_index + 1; - if (image_operands & SpvImageOperandsBiasMask) offset_operand_index++; - if (image_operands & SpvImageOperandsLodMask) offset_operand_index++; - if (image_operands & SpvImageOperandsGradMask) + if (image_operands & uint32_t(spv::ImageOperandsMask::Bias)) + offset_operand_index++; + if (image_operands & uint32_t(spv::ImageOperandsMask::Lod)) + offset_operand_index++; + if (image_operands & uint32_t(spv::ImageOperandsMask::Grad)) offset_operand_index += 2; - assert(((image_operands & SpvImageOperandsConstOffsetMask) == 0) && + assert(((image_operands & + uint32_t(spv::ImageOperandsMask::ConstOffset)) == 0) && "Offset and ConstOffset may not be used together"); if (offset_operand_index < inst->NumOperands()) { if (constants[offset_operand_index]) { - image_operands = image_operands | SpvImageOperandsConstOffsetMask; - image_operands = image_operands & ~SpvImageOperandsOffsetMask; + image_operands = + image_operands | uint32_t(spv::ImageOperandsMask::ConstOffset); + image_operands = + image_operands & ~uint32_t(spv::ImageOperandsMask::Offset); inst->SetInOperand(operand_index, {image_operands}); return true; } @@ -2866,108 +2904,119 @@ void FoldingRules::AddFoldingRules() { // Note that the order in which rules are added to the list matters. If a rule // applies to the instruction, the rest of the rules will not be attempted. // Take that into consideration. - rules_[SpvOpBitcast].push_back(BitCastScalarOrVector()); + rules_[spv::Op::OpBitcast].push_back(BitCastScalarOrVector()); - rules_[SpvOpCompositeConstruct].push_back(CompositeExtractFeedingConstruct); + rules_[spv::Op::OpCompositeConstruct].push_back( + CompositeExtractFeedingConstruct); - rules_[SpvOpCompositeExtract].push_back(InsertFeedingExtract()); - rules_[SpvOpCompositeExtract].push_back(CompositeConstructFeedingExtract); - rules_[SpvOpCompositeExtract].push_back(VectorShuffleFeedingExtract()); - rules_[SpvOpCompositeExtract].push_back(FMixFeedingExtract()); + rules_[spv::Op::OpCompositeExtract].push_back(InsertFeedingExtract()); + rules_[spv::Op::OpCompositeExtract].push_back( + CompositeConstructFeedingExtract); + rules_[spv::Op::OpCompositeExtract].push_back(VectorShuffleFeedingExtract()); + rules_[spv::Op::OpCompositeExtract].push_back(FMixFeedingExtract()); - rules_[SpvOpCompositeInsert].push_back(CompositeInsertToCompositeConstruct); + rules_[spv::Op::OpCompositeInsert].push_back( + CompositeInsertToCompositeConstruct); - rules_[SpvOpDot].push_back(DotProductDoingExtract()); + rules_[spv::Op::OpDot].push_back(DotProductDoingExtract()); - rules_[SpvOpEntryPoint].push_back(RemoveRedundantOperands()); + rules_[spv::Op::OpEntryPoint].push_back(RemoveRedundantOperands()); - rules_[SpvOpFAdd].push_back(RedundantFAdd()); - rules_[SpvOpFAdd].push_back(MergeAddNegateArithmetic()); - rules_[SpvOpFAdd].push_back(MergeAddAddArithmetic()); - rules_[SpvOpFAdd].push_back(MergeAddSubArithmetic()); - rules_[SpvOpFAdd].push_back(MergeGenericAddSubArithmetic()); - rules_[SpvOpFAdd].push_back(FactorAddMuls()); - rules_[SpvOpFAdd].push_back(MergeMulAddArithmetic); + rules_[spv::Op::OpFAdd].push_back(RedundantFAdd()); + rules_[spv::Op::OpFAdd].push_back(MergeAddNegateArithmetic()); + rules_[spv::Op::OpFAdd].push_back(MergeAddAddArithmetic()); + rules_[spv::Op::OpFAdd].push_back(MergeAddSubArithmetic()); + rules_[spv::Op::OpFAdd].push_back(MergeGenericAddSubArithmetic()); + rules_[spv::Op::OpFAdd].push_back(FactorAddMuls()); + rules_[spv::Op::OpFAdd].push_back(MergeMulAddArithmetic); - rules_[SpvOpFDiv].push_back(RedundantFDiv()); - rules_[SpvOpFDiv].push_back(ReciprocalFDiv()); - rules_[SpvOpFDiv].push_back(MergeDivDivArithmetic()); - rules_[SpvOpFDiv].push_back(MergeDivMulArithmetic()); - rules_[SpvOpFDiv].push_back(MergeDivNegateArithmetic()); + rules_[spv::Op::OpFDiv].push_back(RedundantFDiv()); + rules_[spv::Op::OpFDiv].push_back(ReciprocalFDiv()); + rules_[spv::Op::OpFDiv].push_back(MergeDivDivArithmetic()); + rules_[spv::Op::OpFDiv].push_back(MergeDivMulArithmetic()); + rules_[spv::Op::OpFDiv].push_back(MergeDivNegateArithmetic()); - rules_[SpvOpFMul].push_back(RedundantFMul()); - rules_[SpvOpFMul].push_back(MergeMulMulArithmetic()); - rules_[SpvOpFMul].push_back(MergeMulDivArithmetic()); - rules_[SpvOpFMul].push_back(MergeMulNegateArithmetic()); + rules_[spv::Op::OpFMul].push_back(RedundantFMul()); + rules_[spv::Op::OpFMul].push_back(MergeMulMulArithmetic()); + rules_[spv::Op::OpFMul].push_back(MergeMulDivArithmetic()); + rules_[spv::Op::OpFMul].push_back(MergeMulNegateArithmetic()); - rules_[SpvOpFNegate].push_back(MergeNegateArithmetic()); - rules_[SpvOpFNegate].push_back(MergeNegateAddSubArithmetic()); - rules_[SpvOpFNegate].push_back(MergeNegateMulDivArithmetic()); + rules_[spv::Op::OpFNegate].push_back(MergeNegateArithmetic()); + rules_[spv::Op::OpFNegate].push_back(MergeNegateAddSubArithmetic()); + rules_[spv::Op::OpFNegate].push_back(MergeNegateMulDivArithmetic()); - rules_[SpvOpFSub].push_back(RedundantFSub()); - rules_[SpvOpFSub].push_back(MergeSubNegateArithmetic()); - rules_[SpvOpFSub].push_back(MergeSubAddArithmetic()); - rules_[SpvOpFSub].push_back(MergeSubSubArithmetic()); - rules_[SpvOpFSub].push_back(MergeMulSubArithmetic); + rules_[spv::Op::OpFSub].push_back(RedundantFSub()); + rules_[spv::Op::OpFSub].push_back(MergeSubNegateArithmetic()); + rules_[spv::Op::OpFSub].push_back(MergeSubAddArithmetic()); + rules_[spv::Op::OpFSub].push_back(MergeSubSubArithmetic()); + rules_[spv::Op::OpFSub].push_back(MergeMulSubArithmetic); - rules_[SpvOpIAdd].push_back(RedundantIAdd()); - rules_[SpvOpIAdd].push_back(MergeAddNegateArithmetic()); - rules_[SpvOpIAdd].push_back(MergeAddAddArithmetic()); - rules_[SpvOpIAdd].push_back(MergeAddSubArithmetic()); - rules_[SpvOpIAdd].push_back(MergeGenericAddSubArithmetic()); - rules_[SpvOpIAdd].push_back(FactorAddMuls()); + rules_[spv::Op::OpIAdd].push_back(RedundantIAdd()); + rules_[spv::Op::OpIAdd].push_back(MergeAddNegateArithmetic()); + rules_[spv::Op::OpIAdd].push_back(MergeAddAddArithmetic()); + rules_[spv::Op::OpIAdd].push_back(MergeAddSubArithmetic()); + rules_[spv::Op::OpIAdd].push_back(MergeGenericAddSubArithmetic()); + rules_[spv::Op::OpIAdd].push_back(FactorAddMuls()); - rules_[SpvOpIMul].push_back(IntMultipleBy1()); - rules_[SpvOpIMul].push_back(MergeMulMulArithmetic()); - rules_[SpvOpIMul].push_back(MergeMulNegateArithmetic()); + rules_[spv::Op::OpIMul].push_back(IntMultipleBy1()); + rules_[spv::Op::OpIMul].push_back(MergeMulMulArithmetic()); + rules_[spv::Op::OpIMul].push_back(MergeMulNegateArithmetic()); - rules_[SpvOpISub].push_back(MergeSubNegateArithmetic()); - rules_[SpvOpISub].push_back(MergeSubAddArithmetic()); - rules_[SpvOpISub].push_back(MergeSubSubArithmetic()); + rules_[spv::Op::OpISub].push_back(MergeSubNegateArithmetic()); + rules_[spv::Op::OpISub].push_back(MergeSubAddArithmetic()); + rules_[spv::Op::OpISub].push_back(MergeSubSubArithmetic()); - rules_[SpvOpPhi].push_back(RedundantPhi()); + rules_[spv::Op::OpPhi].push_back(RedundantPhi()); - rules_[SpvOpSNegate].push_back(MergeNegateArithmetic()); - rules_[SpvOpSNegate].push_back(MergeNegateMulDivArithmetic()); - rules_[SpvOpSNegate].push_back(MergeNegateAddSubArithmetic()); + rules_[spv::Op::OpSNegate].push_back(MergeNegateArithmetic()); + rules_[spv::Op::OpSNegate].push_back(MergeNegateMulDivArithmetic()); + rules_[spv::Op::OpSNegate].push_back(MergeNegateAddSubArithmetic()); - rules_[SpvOpSelect].push_back(RedundantSelect()); + rules_[spv::Op::OpSelect].push_back(RedundantSelect()); - rules_[SpvOpStore].push_back(StoringUndef()); + rules_[spv::Op::OpStore].push_back(StoringUndef()); - rules_[SpvOpVectorShuffle].push_back(VectorShuffleFeedingShuffle()); + rules_[spv::Op::OpVectorShuffle].push_back(VectorShuffleFeedingShuffle()); - rules_[SpvOpImageSampleImplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSampleExplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSampleDrefImplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSampleDrefExplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSampleProjImplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSampleProjExplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSampleProjDrefImplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSampleProjDrefExplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageFetch].push_back(UpdateImageOperands()); - rules_[SpvOpImageGather].push_back(UpdateImageOperands()); - rules_[SpvOpImageDrefGather].push_back(UpdateImageOperands()); - rules_[SpvOpImageRead].push_back(UpdateImageOperands()); - rules_[SpvOpImageWrite].push_back(UpdateImageOperands()); - rules_[SpvOpImageSparseSampleImplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSparseSampleExplicitLod].push_back(UpdateImageOperands()); - rules_[SpvOpImageSparseSampleDrefImplicitLod].push_back( + rules_[spv::Op::OpImageSampleImplicitLod].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageSampleExplicitLod].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageSampleDrefImplicitLod].push_back( UpdateImageOperands()); - rules_[SpvOpImageSparseSampleDrefExplicitLod].push_back( + rules_[spv::Op::OpImageSampleDrefExplicitLod].push_back( UpdateImageOperands()); - rules_[SpvOpImageSparseSampleProjImplicitLod].push_back( + rules_[spv::Op::OpImageSampleProjImplicitLod].push_back( UpdateImageOperands()); - rules_[SpvOpImageSparseSampleProjExplicitLod].push_back( + rules_[spv::Op::OpImageSampleProjExplicitLod].push_back( UpdateImageOperands()); - rules_[SpvOpImageSparseSampleProjDrefImplicitLod].push_back( + rules_[spv::Op::OpImageSampleProjDrefImplicitLod].push_back( UpdateImageOperands()); - rules_[SpvOpImageSparseSampleProjDrefExplicitLod].push_back( + rules_[spv::Op::OpImageSampleProjDrefExplicitLod].push_back( UpdateImageOperands()); - rules_[SpvOpImageSparseFetch].push_back(UpdateImageOperands()); - rules_[SpvOpImageSparseGather].push_back(UpdateImageOperands()); - rules_[SpvOpImageSparseDrefGather].push_back(UpdateImageOperands()); - rules_[SpvOpImageSparseRead].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageFetch].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageGather].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageDrefGather].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageRead].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageWrite].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleImplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleExplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleDrefImplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleDrefExplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleProjImplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleProjExplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleProjDrefImplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseSampleProjDrefExplicitLod].push_back( + UpdateImageOperands()); + rules_[spv::Op::OpImageSparseFetch].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageSparseGather].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageSparseDrefGather].push_back(UpdateImageOperands()); + rules_[spv::Op::OpImageSparseRead].push_back(UpdateImageOperands()); FeatureManager* feature_manager = context_->get_feature_mgr(); // Add rules for GLSLstd450 diff --git a/3rdparty/spirv-tools/source/opt/folding_rules.h b/3rdparty/spirv-tools/source/opt/folding_rules.h index f1a86395c..b51e0ce4a 100644 --- a/3rdparty/spirv-tools/source/opt/folding_rules.h +++ b/3rdparty/spirv-tools/source/opt/folding_rules.h @@ -64,7 +64,7 @@ class FoldingRules { virtual ~FoldingRules() = default; const FoldingRuleSet& GetRulesForInstruction(Instruction* inst) const { - if (inst->opcode() != SpvOpExtInst) { + if (inst->opcode() != spv::Op::OpExtInst) { auto it = rules_.find(inst->opcode()); if (it != rules_.end()) { return it->second; @@ -86,8 +86,14 @@ class FoldingRules { virtual void AddFoldingRules(); protected: + struct hasher { + size_t operator()(const spv::Op& op) const noexcept { + return std::hash()(uint32_t(op)); + } + }; + // The folding rules for core instructions. - std::unordered_map rules_; + std::unordered_map rules_; // The folding rules for extended instructions. struct Key { diff --git a/3rdparty/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp b/3rdparty/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp index 10e98fd8b..3f89e56c0 100644 --- a/3rdparty/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/freeze_spec_constant_value_pass.cpp @@ -23,21 +23,21 @@ Pass::Status FreezeSpecConstantValuePass::Process() { auto ctx = context(); ctx->module()->ForEachInst([&modified, ctx](Instruction* inst) { switch (inst->opcode()) { - case SpvOp::SpvOpSpecConstant: - inst->SetOpcode(SpvOp::SpvOpConstant); + case spv::Op::OpSpecConstant: + inst->SetOpcode(spv::Op::OpConstant); modified = true; break; - case SpvOp::SpvOpSpecConstantTrue: - inst->SetOpcode(SpvOp::SpvOpConstantTrue); + case spv::Op::OpSpecConstantTrue: + inst->SetOpcode(spv::Op::OpConstantTrue); modified = true; break; - case SpvOp::SpvOpSpecConstantFalse: - inst->SetOpcode(SpvOp::SpvOpConstantFalse); + case spv::Op::OpSpecConstantFalse: + inst->SetOpcode(spv::Op::OpConstantFalse); modified = true; break; - case SpvOp::SpvOpDecorate: - if (inst->GetSingleWordInOperand(1) == - SpvDecoration::SpvDecorationSpecId) { + case spv::Op::OpDecorate: + if (spv::Decoration(inst->GetSingleWordInOperand(1)) == + spv::Decoration::SpecId) { ctx->KillInst(inst); modified = true; } diff --git a/3rdparty/spirv-tools/source/opt/function.cpp b/3rdparty/spirv-tools/source/opt/function.cpp index bb51df3f9..6c7c949fd 100644 --- a/3rdparty/spirv-tools/source/opt/function.cpp +++ b/3rdparty/spirv-tools/source/opt/function.cpp @@ -264,7 +264,7 @@ std::string Function::PrettyPrint(uint32_t options) const { std::ostringstream str; ForEachInst([&str, options](const Instruction* inst) { str << inst->PrettyPrint(options); - if (inst->opcode() != SpvOpFunctionEnd) { + if (inst->opcode() != spv::Op::OpFunctionEnd) { str << std::endl; } }); diff --git a/3rdparty/spirv-tools/source/opt/function.h b/3rdparty/spirv-tools/source/opt/function.h index 146cbe340..8c0472cd2 100644 --- a/3rdparty/spirv-tools/source/opt/function.h +++ b/3rdparty/spirv-tools/source/opt/function.h @@ -253,7 +253,7 @@ inline void Function::RemoveEmptyBlocks() { auto first_empty = std::remove_if(std::begin(blocks_), std::end(blocks_), [](const std::unique_ptr& bb) -> bool { - return bb->GetLabelInst()->opcode() == SpvOpNop; + return bb->GetLabelInst()->opcode() == spv::Op::OpNop; }); blocks_.erase(first_empty, std::end(blocks_)); } diff --git a/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp b/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp index 4652d72d5..da2764fc8 100644 --- a/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp @@ -158,7 +158,6 @@ #include "source/util/make_unique.h" #include "spirv-tools/libspirv.h" #include "spirv/unified1/GLSL.std.450.h" -#include "spirv/unified1/spirv.h" #include "type_manager.h" #include "types.h" @@ -194,14 +193,15 @@ spvtools::DiagnosticStream GraphicsRobustAccessPass::Fail() { spv_result_t GraphicsRobustAccessPass::IsCompatibleModule() { auto* feature_mgr = context()->get_feature_mgr(); - if (!feature_mgr->HasCapability(SpvCapabilityShader)) + if (!feature_mgr->HasCapability(spv::Capability::Shader)) return Fail() << "Can only process Shader modules"; - if (feature_mgr->HasCapability(SpvCapabilityVariablePointers)) + if (feature_mgr->HasCapability(spv::Capability::VariablePointers)) return Fail() << "Can't process modules with VariablePointers capability"; - if (feature_mgr->HasCapability(SpvCapabilityVariablePointersStorageBuffer)) + if (feature_mgr->HasCapability( + spv::Capability::VariablePointersStorageBuffer)) return Fail() << "Can't process modules with VariablePointersStorageBuffer " "capability"; - if (feature_mgr->HasCapability(SpvCapabilityRuntimeDescriptorArrayEXT)) { + if (feature_mgr->HasCapability(spv::Capability::RuntimeDescriptorArrayEXT)) { // These have a RuntimeArray outside of Block-decorated struct. There // is no way to compute the array length from within SPIR-V. return Fail() << "Can't process modules with RuntimeDescriptorArrayEXT " @@ -210,8 +210,9 @@ spv_result_t GraphicsRobustAccessPass::IsCompatibleModule() { { auto* inst = context()->module()->GetMemoryModel(); - const auto addressing_model = inst->GetSingleWordOperand(0); - if (addressing_model != SpvAddressingModelLogical) + const auto addressing_model = + spv::AddressingModel(inst->GetSingleWordOperand(0)); + if (addressing_model != spv::AddressingModel::Logical) return Fail() << "Addressing model must be Logical. Found " << inst->PrettyPrint(); } @@ -237,11 +238,11 @@ bool GraphicsRobustAccessPass::ProcessAFunction(opt::Function* function) { for (auto& block : *function) { for (auto& inst : block) { switch (inst.opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: access_chains.push_back(&inst); break; - case SpvOpImageTexelPointer: + case spv::Op::OpImageTexelPointer: image_texel_pointers.push_back(&inst); break; default: @@ -268,7 +269,7 @@ void GraphicsRobustAccessPass::ClampIndicesForAccessChain( auto* def_use_mgr = context()->get_def_use_mgr(); auto* type_mgr = context()->get_type_mgr(); const bool have_int64_cap = - context()->get_feature_mgr()->HasCapability(SpvCapabilityInt64); + context()->get_feature_mgr()->HasCapability(spv::Capability::Int64); // Replaces one of the OpAccessChain index operands with a new value. // Updates def-use analysis. @@ -451,7 +452,7 @@ void GraphicsRobustAccessPass::ClampIndicesForAccessChain( // It doesn't matter if 1 is signed or unsigned. auto* one = GetValueForType(1, wider_type); auto* count_minus_1 = InsertInst( - &inst, SpvOpISub, type_mgr->GetId(wider_type), TakeNextId(), + &inst, spv::Op::OpISub, type_mgr->GetId(wider_type), TakeNextId(), {{SPV_OPERAND_TYPE_ID, {count_inst->result_id()}}, {SPV_OPERAND_TYPE_ID, {one->result_id()}}}); auto* zero = GetValueForType(0, wider_type); @@ -486,15 +487,15 @@ void GraphicsRobustAccessPass::ClampIndicesForAccessChain( Instruction* index_inst = GetDef(index_id); switch (pointee_type->opcode()) { - case SpvOpTypeMatrix: // Use column count - case SpvOpTypeVector: // Use component count + case spv::Op::OpTypeMatrix: // Use column count + case spv::Op::OpTypeVector: // Use component count { const uint32_t count = pointee_type->GetSingleWordOperand(2); clamp_to_literal_count(idx, count); pointee_type = GetDef(pointee_type->GetSingleWordOperand(1)); } break; - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { // The array length can be a spec constant, so go through the general // case. Instruction* array_len = GetDef(pointee_type->GetSingleWordOperand(2)); @@ -502,11 +503,11 @@ void GraphicsRobustAccessPass::ClampIndicesForAccessChain( pointee_type = GetDef(pointee_type->GetSingleWordOperand(1)); } break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { // SPIR-V requires the index to be an OpConstant. // We need to know the index literal value so we can compute the next // pointee type. - if (index_inst->opcode() != SpvOpConstant || + if (index_inst->opcode() != spv::Op::OpConstant || !constant_mgr->GetConstantFromInst(index_inst) ->type() ->AsInteger()) { @@ -537,7 +538,7 @@ void GraphicsRobustAccessPass::ClampIndicesForAccessChain( // No need to clamp this index. We just checked that it's valid. } break; - case SpvOpTypeRuntimeArray: { + case spv::Op::OpTypeRuntimeArray: { auto* array_len = MakeRuntimeArrayLengthInst(&inst, idx); if (!array_len) { // We've already signaled an error. return; @@ -571,7 +572,7 @@ uint32_t GraphicsRobustAccessPass::GetGlslInsts() { module_status_.glsl_insts_id = TakeNextId(); std::vector words = spvtools::utils::MakeVector(glsl); auto import_inst = MakeUnique( - context(), SpvOpExtInstImport, 0, module_status_.glsl_insts_id, + context(), spv::Op::OpExtInstImport, 0, module_status_.glsl_insts_id, std::initializer_list{ Operand{SPV_OPERAND_TYPE_LITERAL_STRING, std::move(words)}}); Instruction* inst = import_inst.get(); @@ -609,8 +610,8 @@ opt::Instruction* opt::GraphicsRobustAccessPass::WidenInteger( auto type_id = context()->get_type_mgr()->GetId(unsigned_type); auto conversion_id = TakeNextId(); auto* conversion = InsertInst( - before_inst, (sign_extend ? SpvOpSConvert : SpvOpUConvert), type_id, - conversion_id, {{SPV_OPERAND_TYPE_ID, {value->result_id()}}}); + before_inst, (sign_extend ? spv::Op::OpSConvert : spv::Op::OpUConvert), + type_id, conversion_id, {{SPV_OPERAND_TYPE_ID, {value->result_id()}}}); return conversion; } @@ -628,7 +629,7 @@ Instruction* GraphicsRobustAccessPass::MakeUMinInst( (void)xwidth; (void)ywidth; auto* smin_inst = InsertInst( - where, SpvOpExtInst, x->type_id(), smin_id, + where, spv::Op::OpExtInst, x->type_id(), smin_id, { {SPV_OPERAND_TYPE_ID, {glsl_insts_id}}, {SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, {GLSLstd450UMin}}, @@ -655,7 +656,7 @@ Instruction* GraphicsRobustAccessPass::MakeSClampInst( (void)minwidth; (void)maxwidth; auto* clamp_inst = InsertInst( - where, SpvOpExtInst, x->type_id(), clamp_id, + where, spv::Op::OpExtInst, x->type_id(), clamp_id, { {SPV_OPERAND_TYPE_ID, {glsl_insts_id}}, {SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER, {GLSLstd450SClamp}}, @@ -689,13 +690,13 @@ Instruction* GraphicsRobustAccessPass::MakeRuntimeArrayLengthInst( Instruction* pointer_to_containing_struct = nullptr; while (steps_remaining > 0) { switch (current_access_chain->opcode()) { - case SpvOpCopyObject: + case spv::Op::OpCopyObject: // Whoops. Walk right through this one. current_access_chain = GetDef(current_access_chain->GetSingleWordInOperand(0)); break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: { + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: { const int first_index_operand = 3; // How many indices in this access chain contribute to getting us // to an element in the runtime array? @@ -793,7 +794,8 @@ Instruction* GraphicsRobustAccessPass::MakeRuntimeArrayLengthInst( analysis::Integer uint_type_for_query(32, false); auto* uint_type = type_mgr->GetRegisteredType(&uint_type_for_query); auto* array_len = InsertInst( - access_chain, SpvOpArrayLength, type_mgr->GetId(uint_type), array_len_id, + access_chain, spv::Op::OpArrayLength, type_mgr->GetId(uint_type), + array_len_id, {{SPV_OPERAND_TYPE_ID, {pointer_to_containing_struct->result_id()}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, {member_index_of_runtime_array}}}); return array_len; @@ -839,11 +841,11 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( // Declare the ImageQuery capability if the module doesn't already have it. auto* feature_mgr = context()->get_feature_mgr(); - if (!feature_mgr->HasCapability(SpvCapabilityImageQuery)) { + if (!feature_mgr->HasCapability(spv::Capability::ImageQuery)) { auto cap = MakeUnique( - context(), SpvOpCapability, 0, 0, + context(), spv::Op::OpCapability, 0, 0, std::initializer_list{ - {SPV_OPERAND_TYPE_CAPABILITY, {SpvCapabilityImageQuery}}}); + {SPV_OPERAND_TYPE_CAPABILITY, {spv::Capability::ImageQuery}}}); def_use_mgr->AnalyzeInstDefUse(cap.get()); context()->AddCapability(std::move(cap)); feature_mgr->Analyze(context()->module()); @@ -890,21 +892,21 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( const int arrayness_bonus = arrayed ? 1 : 0; int num_coords = 0; switch (dim) { - case SpvDimBuffer: + case spv::Dim::Buffer: case SpvDim1D: num_coords = 1; break; - case SpvDimCube: + case spv::Dim::Cube: // For cube, we need bounds for x, y, but not face. - case SpvDimRect: + case spv::Dim::Rect: case SpvDim2D: num_coords = 2; break; case SpvDim3D: num_coords = 3; break; - case SpvDimSubpassData: - case SpvDimMax: + case spv::Dim::SubpassData: + case spv::Dim::Max: return Fail() << "Invalid image dimension for OpImageTexelPointer: " << int(dim); break; @@ -941,12 +943,12 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( const uint32_t image_id = TakeNextId(); auto* image = - InsertInst(image_texel_pointer, SpvOpLoad, image_type_id, image_id, + InsertInst(image_texel_pointer, spv::Op::OpLoad, image_type_id, image_id, {{SPV_OPERAND_TYPE_ID, {image_ptr->result_id()}}}); const uint32_t query_size_id = TakeNextId(); auto* query_size = - InsertInst(image_texel_pointer, SpvOpImageQuerySize, + InsertInst(image_texel_pointer, spv::Op::OpImageQuerySize, type_mgr->GetTypeInstruction(query_size_type), query_size_id, {{SPV_OPERAND_TYPE_ID, {image->result_id()}}}); @@ -962,7 +964,7 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( // in the face index ranging from 0 through 5. The inclusive upper bound // on the third coordinate therefore is multiplied by 6. auto* query_size_including_faces = query_size; - if (arrayed && (dim == SpvDimCube)) { + if (arrayed && (dim == spv::Dim::Cube)) { // Multiply the last coordinate by 6. auto* component_6 = constant_mgr->GetConstant(coord_component_type, {6}); const uint32_t component_6_id = @@ -974,7 +976,7 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( constant_mgr->GetDefiningInstruction(multiplicand); const auto query_size_including_faces_id = TakeNextId(); query_size_including_faces = InsertInst( - image_texel_pointer, SpvOpIMul, + image_texel_pointer, spv::Op::OpIMul, type_mgr->GetTypeInstruction(query_size_type), query_size_including_faces_id, {{SPV_OPERAND_TYPE_ID, {query_size_including_faces->result_id()}}, @@ -998,7 +1000,7 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( const uint32_t query_max_including_faces_id = TakeNextId(); auto* query_max_including_faces = InsertInst( - image_texel_pointer, SpvOpISub, + image_texel_pointer, spv::Op::OpISub, type_mgr->GetTypeInstruction(query_size_type), query_max_including_faces_id, {{SPV_OPERAND_TYPE_ID, {query_size_including_faces->result_id()}}, @@ -1016,12 +1018,12 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( // Get the sample count via OpImageQuerySamples const auto query_samples_id = TakeNextId(); auto* query_samples = InsertInst( - image_texel_pointer, SpvOpImageQuerySamples, + image_texel_pointer, spv::Op::OpImageQuerySamples, constant_mgr->GetDefiningInstruction(component_0)->type_id(), query_samples_id, {{SPV_OPERAND_TYPE_ID, {image->result_id()}}}); const auto max_samples_id = TakeNextId(); - auto* max_samples = InsertInst(image_texel_pointer, SpvOpImageQuerySamples, + auto* max_samples = InsertInst(image_texel_pointer, spv::Op::OpImageQuerySamples, query_samples->type_id(), max_samples_id, {{SPV_OPERAND_TYPE_ID, {query_samples_id}}, {SPV_OPERAND_TYPE_ID, {component_1_id}}}); @@ -1043,7 +1045,7 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( } opt::Instruction* GraphicsRobustAccessPass::InsertInst( - opt::Instruction* where_inst, SpvOp opcode, uint32_t type_id, + opt::Instruction* where_inst, spv::Op opcode, uint32_t type_id, uint32_t result_id, const Instruction::OperandList& operands) { module_status_.modified = true; auto* result = where_inst->InsertBefore( diff --git a/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h b/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h index 8f4c9dc7d..a7ffe115b 100644 --- a/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h +++ b/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h @@ -133,7 +133,7 @@ class GraphicsRobustAccessPass : public Pass { // Returns a new instruction inserted before |where_inst|, and created from // the remaining arguments. Registers the definitions and uses of the new // instruction and also records its block. - opt::Instruction* InsertInst(opt::Instruction* where_inst, SpvOp opcode, + opt::Instruction* InsertInst(opt::Instruction* where_inst, spv::Op opcode, uint32_t type_id, uint32_t result_id, const Instruction::OperandList& operands); diff --git a/3rdparty/spirv-tools/source/opt/if_conversion.cpp b/3rdparty/spirv-tools/source/opt/if_conversion.cpp index 1232796e5..5912cf12d 100644 --- a/3rdparty/spirv-tools/source/opt/if_conversion.cpp +++ b/3rdparty/spirv-tools/source/opt/if_conversion.cpp @@ -23,7 +23,7 @@ namespace spvtools { namespace opt { Pass::Status IfConversion::Process() { - if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) { + if (!context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) { return Status::SuccessWithoutChange; } @@ -40,7 +40,7 @@ Pass::Status IfConversion::Process() { // Get an insertion point. auto iter = block.begin(); - while (iter != block.end() && iter->opcode() == SpvOpPhi) { + while (iter != block.end() && iter->opcode() == spv::Op::OpPhi) { ++iter; } @@ -171,23 +171,26 @@ bool IfConversion::CheckBlock(BasicBlock* block, DominatorAnalysis* dominators, *common = dominators->CommonDominator(inc0, inc1); if (!*common || cfg()->IsPseudoEntryBlock(*common)) return false; Instruction* branch = (*common)->terminator(); - if (branch->opcode() != SpvOpBranchConditional) return false; + if (branch->opcode() != spv::Op::OpBranchConditional) return false; auto merge = (*common)->GetMergeInst(); - if (!merge || merge->opcode() != SpvOpSelectionMerge) return false; - if (merge->GetSingleWordInOperand(1) == SpvSelectionControlDontFlattenMask) + if (!merge || merge->opcode() != spv::Op::OpSelectionMerge) return false; + if (spv::SelectionControlMask(merge->GetSingleWordInOperand(1)) == + spv::SelectionControlMask::DontFlatten) { return false; + } if ((*common)->MergeBlockIdIfAny() != block->id()) return false; return true; } bool IfConversion::CheckPhiUsers(Instruction* phi, BasicBlock* block) { - return get_def_use_mgr()->WhileEachUser(phi, [block, - this](Instruction* user) { - if (user->opcode() == SpvOpPhi && context()->get_instr_block(user) == block) - return false; - return true; - }); + return get_def_use_mgr()->WhileEachUser( + phi, [block, this](Instruction* user) { + if (user->opcode() == spv::Op::OpPhi && + context()->get_instr_block(user) == block) + return false; + return true; + }); } uint32_t IfConversion::SplatCondition(analysis::Vector* vec_data_ty, @@ -207,9 +210,9 @@ uint32_t IfConversion::SplatCondition(analysis::Vector* vec_data_ty, bool IfConversion::CheckType(uint32_t id) { Instruction* type = get_def_use_mgr()->GetDef(id); - SpvOp op = type->opcode(); - if (spvOpcodeIsScalarType(op) || op == SpvOpTypePointer || - op == SpvOpTypeVector) + spv::Op op = type->opcode(); + if (spvOpcodeIsScalarType(op) || op == spv::Op::OpTypePointer || + op == spv::Op::OpTypeVector) return true; return false; } @@ -255,7 +258,7 @@ void IfConversion::HoistInstruction(Instruction* inst, BasicBlock* target_block, }); Instruction* insertion_pos = target_block->terminator(); - if ((insertion_pos)->PreviousNode()->opcode() == SpvOpSelectionMerge) { + if ((insertion_pos)->PreviousNode()->opcode() == spv::Op::OpSelectionMerge) { insertion_pos = insertion_pos->PreviousNode(); } inst->RemoveFromList(); diff --git a/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp b/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp index fe9c67993..90a4c2247 100644 --- a/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp @@ -21,26 +21,24 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kTypePointerTypeIdInIdx = 1; - -} // anonymous namespace +constexpr uint32_t kTypePointerTypeIdInIdx = 1; +} // namespace bool InlineOpaquePass::IsOpaqueType(uint32_t typeId) { const Instruction* typeInst = get_def_use_mgr()->GetDef(typeId); switch (typeInst->opcode()) { - case SpvOpTypeSampler: - case SpvOpTypeImage: - case SpvOpTypeSampledImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampledImage: return true; - case SpvOpTypePointer: + case spv::Op::OpTypePointer: return IsOpaqueType( typeInst->GetSingleWordInOperand(kTypePointerTypeIdInIdx)); default: break; } // TODO(greg-lunarg): Handle arrays containing opaque type - if (typeInst->opcode() != SpvOpTypeStruct) return false; + if (typeInst->opcode() != spv::Op::OpTypeStruct) return false; // Return true if any member is opaque return !typeInst->WhileEachInId([this](const uint32_t* tid) { if (IsOpaqueType(*tid)) return false; diff --git a/3rdparty/spirv-tools/source/opt/inline_pass.cpp b/3rdparty/spirv-tools/source/opt/inline_pass.cpp index e14516f75..3f160b24c 100644 --- a/3rdparty/spirv-tools/source/opt/inline_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inline_pass.cpp @@ -23,24 +23,24 @@ #include "source/opt/reflect.h" #include "source/util/make_unique.h" -// Indices of operands in SPIR-V instructions - -static const int kSpvFunctionCallFunctionId = 2; -static const int kSpvFunctionCallArgumentId = 3; -static const int kSpvReturnValueId = 0; - namespace spvtools { namespace opt { +namespace { +// Indices of operands in SPIR-V instructions +constexpr int kSpvFunctionCallFunctionId = 2; +constexpr int kSpvFunctionCallArgumentId = 3; +constexpr int kSpvReturnValueId = 0; +} // namespace uint32_t InlinePass::AddPointerToType(uint32_t type_id, - SpvStorageClass storage_class) { + spv::StorageClass storage_class) { uint32_t resultId = context()->TakeNextId(); if (resultId == 0) { return resultId; } std::unique_ptr type_inst( - new Instruction(context(), SpvOpTypePointer, 0, resultId, + new Instruction(context(), spv::Op::OpTypePointer, 0, resultId, {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, {uint32_t(storage_class)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_id}}})); @@ -48,8 +48,8 @@ uint32_t InlinePass::AddPointerToType(uint32_t type_id, analysis::Type* pointeeTy; std::unique_ptr pointerTy; std::tie(pointeeTy, pointerTy) = - context()->get_type_mgr()->GetTypeAndPointerType(type_id, - SpvStorageClassFunction); + context()->get_type_mgr()->GetTypeAndPointerType( + type_id, spv::StorageClass::Function); context()->get_type_mgr()->RegisterType(resultId, *pointerTy); return resultId; } @@ -57,7 +57,7 @@ uint32_t InlinePass::AddPointerToType(uint32_t type_id, void InlinePass::AddBranch(uint32_t label_id, std::unique_ptr* block_ptr) { std::unique_ptr newBranch( - new Instruction(context(), SpvOpBranch, 0, 0, + new Instruction(context(), spv::Op::OpBranch, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {label_id}}})); (*block_ptr)->AddInstruction(std::move(newBranch)); } @@ -66,7 +66,7 @@ void InlinePass::AddBranchCond(uint32_t cond_id, uint32_t true_id, uint32_t false_id, std::unique_ptr* block_ptr) { std::unique_ptr newBranch( - new Instruction(context(), SpvOpBranchConditional, 0, 0, + new Instruction(context(), spv::Op::OpBranchConditional, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {cond_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {true_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {false_id}}})); @@ -76,7 +76,7 @@ void InlinePass::AddBranchCond(uint32_t cond_id, uint32_t true_id, void InlinePass::AddLoopMerge(uint32_t merge_id, uint32_t continue_id, std::unique_ptr* block_ptr) { std::unique_ptr newLoopMerge(new Instruction( - context(), SpvOpLoopMerge, 0, 0, + context(), spv::Op::OpLoopMerge, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {merge_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {continue_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LOOP_CONTROL, {0}}})); @@ -88,7 +88,7 @@ void InlinePass::AddStore(uint32_t ptr_id, uint32_t val_id, const Instruction* line_inst, const DebugScope& dbg_scope) { std::unique_ptr newStore( - new Instruction(context(), SpvOpStore, 0, 0, + new Instruction(context(), spv::Op::OpStore, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ptr_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {val_id}}})); if (line_inst != nullptr) { @@ -103,7 +103,7 @@ void InlinePass::AddLoad(uint32_t type_id, uint32_t resultId, uint32_t ptr_id, const Instruction* line_inst, const DebugScope& dbg_scope) { std::unique_ptr newLoad( - new Instruction(context(), SpvOpLoad, type_id, resultId, + new Instruction(context(), spv::Op::OpLoad, type_id, resultId, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ptr_id}}})); if (line_inst != nullptr) { newLoad->AddDebugLine(line_inst); @@ -114,27 +114,27 @@ void InlinePass::AddLoad(uint32_t type_id, uint32_t resultId, uint32_t ptr_id, std::unique_ptr InlinePass::NewLabel(uint32_t label_id) { std::unique_ptr newLabel( - new Instruction(context(), SpvOpLabel, 0, label_id, {})); + new Instruction(context(), spv::Op::OpLabel, 0, label_id, {})); return newLabel; } uint32_t InlinePass::GetFalseId() { if (false_id_ != 0) return false_id_; - false_id_ = get_module()->GetGlobalValue(SpvOpConstantFalse); + false_id_ = get_module()->GetGlobalValue(spv::Op::OpConstantFalse); if (false_id_ != 0) return false_id_; - uint32_t boolId = get_module()->GetGlobalValue(SpvOpTypeBool); + uint32_t boolId = get_module()->GetGlobalValue(spv::Op::OpTypeBool); if (boolId == 0) { boolId = context()->TakeNextId(); if (boolId == 0) { return 0; } - get_module()->AddGlobalValue(SpvOpTypeBool, boolId, 0); + get_module()->AddGlobalValue(spv::Op::OpTypeBool, boolId, 0); } false_id_ = context()->TakeNextId(); if (false_id_ == 0) { return 0; } - get_module()->AddGlobalValue(SpvOpConstantFalse, false_id_, boolId); + get_module()->AddGlobalValue(spv::Op::OpConstantFalse, false_id_, boolId); return false_id_; } @@ -157,10 +157,10 @@ bool InlinePass::CloneAndMapLocals( analysis::DebugInlinedAtContext* inlined_at_ctx) { auto callee_block_itr = calleeFn->begin(); auto callee_var_itr = callee_block_itr->begin(); - while (callee_var_itr->opcode() == SpvOp::SpvOpVariable || + while (callee_var_itr->opcode() == spv::Op::OpVariable || callee_var_itr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { - if (callee_var_itr->opcode() != SpvOp::SpvOpVariable) { + if (callee_var_itr->opcode() != spv::Op::OpVariable) { ++callee_var_itr; continue; } @@ -191,10 +191,11 @@ uint32_t InlinePass::CreateReturnVar( "Cannot create a return variable of type void."); // Find or create ptr to callee return type. uint32_t returnVarTypeId = - type_mgr->FindPointerToType(calleeTypeId, SpvStorageClassFunction); + type_mgr->FindPointerToType(calleeTypeId, spv::StorageClass::Function); if (returnVarTypeId == 0) { - returnVarTypeId = AddPointerToType(calleeTypeId, SpvStorageClassFunction); + returnVarTypeId = + AddPointerToType(calleeTypeId, spv::StorageClass::Function); if (returnVarTypeId == 0) { return 0; } @@ -206,17 +207,18 @@ uint32_t InlinePass::CreateReturnVar( return 0; } - std::unique_ptr var_inst( - new Instruction(context(), SpvOpVariable, returnVarTypeId, returnVarId, - {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, - {SpvStorageClassFunction}}})); + std::unique_ptr var_inst(new Instruction( + context(), spv::Op::OpVariable, returnVarTypeId, returnVarId, + {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, + {(uint32_t)spv::StorageClass::Function}}})); new_vars->push_back(std::move(var_inst)); get_decoration_mgr()->CloneDecorations(calleeFn->result_id(), returnVarId); return returnVarId; } bool InlinePass::IsSameBlockOp(const Instruction* inst) const { - return inst->opcode() == SpvOpSampledImage || inst->opcode() == SpvOpImage; + return inst->opcode() == spv::Op::OpSampledImage || + inst->opcode() == spv::Op::OpImage; } bool InlinePass::CloneSameBlockOps( @@ -299,9 +301,9 @@ InstructionList::iterator InlinePass::AddStoresForVariableInitializers( std::unique_ptr* new_blk_ptr, UptrVectorIterator callee_first_block_itr) { auto callee_itr = callee_first_block_itr->begin(); - while (callee_itr->opcode() == SpvOp::SpvOpVariable || + while (callee_itr->opcode() == spv::Op::OpVariable || callee_itr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { - if (callee_itr->opcode() == SpvOp::SpvOpVariable && + if (callee_itr->opcode() == spv::Op::OpVariable && callee_itr->NumInOperands() == 2) { assert(callee2caller.count(callee_itr->result_id()) && "Expected the variable to have already been mapped."); @@ -330,7 +332,8 @@ bool InlinePass::InlineSingleInstruction( BasicBlock* new_blk_ptr, const Instruction* inst, uint32_t dbg_inlined_at) { // If we have return, it must be at the end of the callee. We will handle // it at the end. - if (inst->opcode() == SpvOpReturnValue || inst->opcode() == SpvOpReturn) + if (inst->opcode() == spv::Op::OpReturnValue || + inst->opcode() == spv::Op::OpReturn) return true; // Copy callee instruction and remap all input Ids. @@ -366,7 +369,7 @@ std::unique_ptr InlinePass::InlineReturn( analysis::DebugInlinedAtContext* inlined_at_ctx, Function* calleeFn, const Instruction* inst, uint32_t returnVarId) { // Store return value to return variable. - if (inst->opcode() == SpvOpReturnValue) { + if (inst->opcode() == spv::Op::OpReturnValue) { assert(returnVarId != 0); uint32_t valId = inst->GetInOperand(kSpvReturnValueId).words[0]; const auto mapItr = callee2caller.find(valId); @@ -388,7 +391,8 @@ std::unique_ptr InlinePass::InlineReturn( } if (returnLabelId == 0) return new_blk_ptr; - if (inst->opcode() == SpvOpReturn || inst->opcode() == SpvOpReturnValue) + if (inst->opcode() == spv::Op::OpReturn || + inst->opcode() == spv::Op::OpReturnValue) AddBranch(returnLabelId, &new_blk_ptr); new_blocks->push_back(std::move(new_blk_ptr)); return MakeUnique(NewLabel(returnLabelId)); @@ -499,7 +503,7 @@ void InlinePass::MoveLoopMergeInstToFirstBlock( // Insert a modified copy of the loop merge into the first block. auto loop_merge_itr = last->tail(); --loop_merge_itr; - assert(loop_merge_itr->opcode() == SpvOpLoopMerge); + assert(loop_merge_itr->opcode() == spv::Op::OpLoopMerge); std::unique_ptr cp_inst(loop_merge_itr->Clone(context())); first->tail().InsertBefore(std::move(cp_inst)); @@ -696,7 +700,7 @@ bool InlinePass::GenInlineCode( } bool InlinePass::IsInlinableFunctionCall(const Instruction* inst) { - if (inst->opcode() != SpvOp::SpvOpFunctionCall) return false; + if (inst->opcode() != spv::Op::OpFunctionCall) return false; const uint32_t calleeFnId = inst->GetSingleWordOperand(kSpvFunctionCallFunctionId); const auto ci = inlinable_.find(calleeFnId); @@ -738,7 +742,7 @@ void InlinePass::UpdateSucceedingPhis( bool InlinePass::HasNoReturnInLoop(Function* func) { // If control not structured, do not do loop/return analysis // TODO: Analyze returns in non-structured control flow - if (!context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + if (!context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) return false; const auto structured_analysis = context()->GetStructuredCFGAnalysis(); // Search for returns in structured construct. @@ -776,7 +780,7 @@ bool InlinePass::IsInlinableFunction(Function* func) { if (func->cbegin() == func->cend()) return false; // Do not inline functions with DontInline flag. - if (func->control_mask() & SpvFunctionControlDontInlineMask) { + if (func->control_mask() & uint32_t(spv::FunctionControlMask::DontInline)) { return false; } @@ -811,7 +815,7 @@ bool InlinePass::IsInlinableFunction(Function* func) { bool InlinePass::ContainsAbortOtherThanUnreachable(Function* func) const { return !func->WhileEachInst([](Instruction* inst) { - return inst->opcode() == SpvOpUnreachable || + return inst->opcode() == spv::Op::OpUnreachable || !spvOpcodeIsAbort(inst->opcode()); }); } diff --git a/3rdparty/spirv-tools/source/opt/inline_pass.h b/3rdparty/spirv-tools/source/opt/inline_pass.h index d29c1e074..1c9d60e32 100644 --- a/3rdparty/spirv-tools/source/opt/inline_pass.h +++ b/3rdparty/spirv-tools/source/opt/inline_pass.h @@ -44,7 +44,7 @@ class InlinePass : public Pass { // Add pointer to type to module and return resultId. Returns 0 if the type // could not be created. - uint32_t AddPointerToType(uint32_t type_id, SpvStorageClass storage_class); + uint32_t AddPointerToType(uint32_t type_id, spv::StorageClass storage_class); // Add unconditional branch to labelId to end of block block_ptr. void AddBranch(uint32_t labelId, std::unique_ptr* block_ptr); diff --git a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp index c2c5d6cb4..ca36dd606 100644 --- a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp @@ -16,31 +16,29 @@ #include "inst_bindless_check_pass.h" -namespace { - -// Input Operand Indices -static const int kSpvImageSampleImageIdInIdx = 0; -static const int kSpvSampledImageImageIdInIdx = 0; -static const int kSpvSampledImageSamplerIdInIdx = 1; -static const int kSpvImageSampledImageIdInIdx = 0; -static const int kSpvCopyObjectOperandIdInIdx = 0; -static const int kSpvLoadPtrIdInIdx = 0; -static const int kSpvAccessChainBaseIdInIdx = 0; -static const int kSpvAccessChainIndex0IdInIdx = 1; -static const int kSpvTypeArrayTypeIdInIdx = 0; -static const int kSpvTypeArrayLengthIdInIdx = 1; -static const int kSpvConstantValueInIdx = 0; -static const int kSpvVariableStorageClassInIdx = 0; -static const int kSpvTypePtrTypeIdInIdx = 1; -static const int kSpvTypeImageDim = 1; -static const int kSpvTypeImageDepth = 2; -static const int kSpvTypeImageArrayed = 3; -static const int kSpvTypeImageMS = 4; -static const int kSpvTypeImageSampled = 5; -} // anonymous namespace - namespace spvtools { namespace opt { +namespace { +// Input Operand Indices +constexpr int kSpvImageSampleImageIdInIdx = 0; +constexpr int kSpvSampledImageImageIdInIdx = 0; +constexpr int kSpvSampledImageSamplerIdInIdx = 1; +constexpr int kSpvImageSampledImageIdInIdx = 0; +constexpr int kSpvCopyObjectOperandIdInIdx = 0; +constexpr int kSpvLoadPtrIdInIdx = 0; +constexpr int kSpvAccessChainBaseIdInIdx = 0; +constexpr int kSpvAccessChainIndex0IdInIdx = 1; +constexpr int kSpvTypeArrayTypeIdInIdx = 0; +constexpr int kSpvTypeArrayLengthIdInIdx = 1; +constexpr int kSpvConstantValueInIdx = 0; +constexpr int kSpvVariableStorageClassInIdx = 0; +constexpr int kSpvTypePtrTypeIdInIdx = 1; +constexpr int kSpvTypeImageDim = 1; +constexpr int kSpvTypeImageDepth = 2; +constexpr int kSpvTypeImageArrayed = 3; +constexpr int kSpvTypeImageMS = 4; +constexpr int kSpvTypeImageSampled = 5; +} // namespace uint32_t InstBindlessCheckPass::GenDebugReadLength( uint32_t var_id, InstructionBuilder* builder) { @@ -79,25 +77,25 @@ uint32_t InstBindlessCheckPass::CloneOriginalImage( uint32_t old_image_id, InstructionBuilder* builder) { Instruction* new_image_inst; Instruction* old_image_inst = get_def_use_mgr()->GetDef(old_image_id); - if (old_image_inst->opcode() == SpvOpLoad) { + if (old_image_inst->opcode() == spv::Op::OpLoad) { new_image_inst = builder->AddLoad( old_image_inst->type_id(), old_image_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx)); - } else if (old_image_inst->opcode() == SpvOp::SpvOpSampledImage) { + } else if (old_image_inst->opcode() == spv::Op::OpSampledImage) { uint32_t clone_id = CloneOriginalImage( old_image_inst->GetSingleWordInOperand(kSpvSampledImageImageIdInIdx), builder); new_image_inst = builder->AddBinaryOp( - old_image_inst->type_id(), SpvOpSampledImage, clone_id, + old_image_inst->type_id(), spv::Op::OpSampledImage, clone_id, old_image_inst->GetSingleWordInOperand(kSpvSampledImageSamplerIdInIdx)); - } else if (old_image_inst->opcode() == SpvOp::SpvOpImage) { + } else if (old_image_inst->opcode() == spv::Op::OpImage) { uint32_t clone_id = CloneOriginalImage( old_image_inst->GetSingleWordInOperand(kSpvImageSampledImageIdInIdx), builder); - new_image_inst = - builder->AddUnaryOp(old_image_inst->type_id(), SpvOpImage, clone_id); + new_image_inst = builder->AddUnaryOp(old_image_inst->type_id(), + spv::Op::OpImage, clone_id); } else { - assert(old_image_inst->opcode() == SpvOp::SpvOpCopyObject && + assert(old_image_inst->opcode() == spv::Op::OpCopyObject && "expecting OpCopyObject"); uint32_t clone_id = CloneOriginalImage( old_image_inst->GetSingleWordInOperand(kSpvCopyObjectOperandIdInIdx), @@ -143,38 +141,38 @@ uint32_t InstBindlessCheckPass::CloneOriginalReference( uint32_t InstBindlessCheckPass::GetImageId(Instruction* inst) { switch (inst->opcode()) { - case SpvOp::SpvOpImageSampleImplicitLod: - case SpvOp::SpvOpImageSampleExplicitLod: - case SpvOp::SpvOpImageSampleDrefImplicitLod: - case SpvOp::SpvOpImageSampleDrefExplicitLod: - case SpvOp::SpvOpImageSampleProjImplicitLod: - case SpvOp::SpvOpImageSampleProjExplicitLod: - case SpvOp::SpvOpImageSampleProjDrefImplicitLod: - case SpvOp::SpvOpImageSampleProjDrefExplicitLod: - case SpvOp::SpvOpImageGather: - case SpvOp::SpvOpImageDrefGather: - case SpvOp::SpvOpImageQueryLod: - case SpvOp::SpvOpImageSparseSampleImplicitLod: - case SpvOp::SpvOpImageSparseSampleExplicitLod: - case SpvOp::SpvOpImageSparseSampleDrefImplicitLod: - case SpvOp::SpvOpImageSparseSampleDrefExplicitLod: - case SpvOp::SpvOpImageSparseSampleProjImplicitLod: - case SpvOp::SpvOpImageSparseSampleProjExplicitLod: - case SpvOp::SpvOpImageSparseSampleProjDrefImplicitLod: - case SpvOp::SpvOpImageSparseSampleProjDrefExplicitLod: - case SpvOp::SpvOpImageSparseGather: - case SpvOp::SpvOpImageSparseDrefGather: - case SpvOp::SpvOpImageFetch: - case SpvOp::SpvOpImageRead: - case SpvOp::SpvOpImageQueryFormat: - case SpvOp::SpvOpImageQueryOrder: - case SpvOp::SpvOpImageQuerySizeLod: - case SpvOp::SpvOpImageQuerySize: - case SpvOp::SpvOpImageQueryLevels: - case SpvOp::SpvOpImageQuerySamples: - case SpvOp::SpvOpImageSparseFetch: - case SpvOp::SpvOpImageSparseRead: - case SpvOp::SpvOpImageWrite: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageGather: + case spv::Op::OpImageDrefGather: + case spv::Op::OpImageQueryLod: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSparseSampleProjImplicitLod: + case spv::Op::OpImageSparseSampleProjExplicitLod: + case spv::Op::OpImageSparseSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseGather: + case spv::Op::OpImageSparseDrefGather: + case spv::Op::OpImageFetch: + case spv::Op::OpImageRead: + case spv::Op::OpImageQueryFormat: + case spv::Op::OpImageQueryOrder: + case spv::Op::OpImageQuerySizeLod: + case spv::Op::OpImageQuerySize: + case spv::Op::OpImageQueryLevels: + case spv::Op::OpImageQuerySamples: + case spv::Op::OpImageSparseFetch: + case spv::Op::OpImageSparseRead: + case spv::Op::OpImageWrite: return inst->GetSingleWordInOperand(kSpvImageSampleImageIdInIdx); default: break; @@ -190,56 +188,58 @@ Instruction* InstBindlessCheckPass::GetPointeeTypeInst(Instruction* ptr_inst) { bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst, RefAnalysis* ref) { ref->ref_inst = ref_inst; - if (ref_inst->opcode() == SpvOpLoad || ref_inst->opcode() == SpvOpStore) { + if (ref_inst->opcode() == spv::Op::OpLoad || + ref_inst->opcode() == spv::Op::OpStore) { ref->desc_load_id = 0; ref->ptr_id = ref_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx); Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref->ptr_id); - if (ptr_inst->opcode() != SpvOp::SpvOpAccessChain) return false; + if (ptr_inst->opcode() != spv::Op::OpAccessChain) return false; ref->var_id = ptr_inst->GetSingleWordInOperand(kSpvAccessChainBaseIdInIdx); Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id); - if (var_inst->opcode() != SpvOp::SpvOpVariable) return false; - uint32_t storage_class = - var_inst->GetSingleWordInOperand(kSpvVariableStorageClassInIdx); + if (var_inst->opcode() != spv::Op::OpVariable) return false; + spv::StorageClass storage_class = spv::StorageClass( + var_inst->GetSingleWordInOperand(kSpvVariableStorageClassInIdx)); switch (storage_class) { - case SpvStorageClassUniform: - case SpvStorageClassStorageBuffer: + case spv::StorageClass::Uniform: + case spv::StorageClass::StorageBuffer: break; default: return false; break; } // Check for deprecated storage block form - if (storage_class == SpvStorageClassUniform) { + if (storage_class == spv::StorageClass::Uniform) { uint32_t var_ty_id = var_inst->type_id(); Instruction* var_ty_inst = get_def_use_mgr()->GetDef(var_ty_id); uint32_t ptr_ty_id = var_ty_inst->GetSingleWordInOperand(kSpvTypePtrTypeIdInIdx); Instruction* ptr_ty_inst = get_def_use_mgr()->GetDef(ptr_ty_id); - SpvOp ptr_ty_op = ptr_ty_inst->opcode(); + spv::Op ptr_ty_op = ptr_ty_inst->opcode(); uint32_t block_ty_id = - (ptr_ty_op == SpvOpTypeArray || ptr_ty_op == SpvOpTypeRuntimeArray) + (ptr_ty_op == spv::Op::OpTypeArray || + ptr_ty_op == spv::Op::OpTypeRuntimeArray) ? ptr_ty_inst->GetSingleWordInOperand(kSpvTypeArrayTypeIdInIdx) : ptr_ty_id; assert(get_def_use_mgr()->GetDef(block_ty_id)->opcode() == - SpvOpTypeStruct && + spv::Op::OpTypeStruct && "unexpected block type"); bool block_found = get_decoration_mgr()->FindDecoration( - block_ty_id, SpvDecorationBlock, + block_ty_id, uint32_t(spv::Decoration::Block), [](const Instruction&) { return true; }); if (!block_found) { // If block decoration not found, verify deprecated form of SSBO bool buffer_block_found = get_decoration_mgr()->FindDecoration( - block_ty_id, SpvDecorationBufferBlock, + block_ty_id, uint32_t(spv::Decoration::BufferBlock), [](const Instruction&) { return true; }); USE_ASSERT(buffer_block_found && "block decoration not found"); - storage_class = SpvStorageClassStorageBuffer; + storage_class = spv::StorageClass::StorageBuffer; } } - ref->strg_class = storage_class; + ref->strg_class = uint32_t(storage_class); Instruction* desc_type_inst = GetPointeeTypeInst(var_inst); switch (desc_type_inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: // A load through a descriptor array will have at least 3 operands. We // do not want to instrument loads of descriptors here which are part of // an image-based reference. @@ -261,29 +261,29 @@ bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst, Instruction* desc_load_inst; for (;;) { desc_load_inst = get_def_use_mgr()->GetDef(desc_load_id); - if (desc_load_inst->opcode() == SpvOp::SpvOpSampledImage) + if (desc_load_inst->opcode() == spv::Op::OpSampledImage) desc_load_id = desc_load_inst->GetSingleWordInOperand(kSpvSampledImageImageIdInIdx); - else if (desc_load_inst->opcode() == SpvOp::SpvOpImage) + else if (desc_load_inst->opcode() == spv::Op::OpImage) desc_load_id = desc_load_inst->GetSingleWordInOperand(kSpvImageSampledImageIdInIdx); - else if (desc_load_inst->opcode() == SpvOp::SpvOpCopyObject) + else if (desc_load_inst->opcode() == spv::Op::OpCopyObject) desc_load_id = desc_load_inst->GetSingleWordInOperand(kSpvCopyObjectOperandIdInIdx); else break; } - if (desc_load_inst->opcode() != SpvOp::SpvOpLoad) { + if (desc_load_inst->opcode() != spv::Op::OpLoad) { // TODO(greg-lunarg): Handle additional possibilities? return false; } ref->desc_load_id = desc_load_id; ref->ptr_id = desc_load_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx); Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref->ptr_id); - if (ptr_inst->opcode() == SpvOp::SpvOpVariable) { + if (ptr_inst->opcode() == spv::Op::OpVariable) { ref->desc_idx_id = 0; ref->var_id = ref->ptr_id; - } else if (ptr_inst->opcode() == SpvOp::SpvOpAccessChain) { + } else if (ptr_inst->opcode() == spv::Op::OpAccessChain) { if (ptr_inst->NumInOperands() != 2) { assert(false && "unexpected bindless index number"); return false; @@ -292,7 +292,7 @@ bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst, ptr_inst->GetSingleWordInOperand(kSpvAccessChainIndex0IdInIdx); ref->var_id = ptr_inst->GetSingleWordInOperand(kSpvAccessChainBaseIdInIdx); Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id); - if (var_inst->opcode() != SpvOpVariable) { + if (var_inst->opcode() != spv::Op::OpVariable) { assert(false && "unexpected bindless base"); return false; } @@ -369,13 +369,13 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, uint32_t buff_ty_id; uint32_t ac_in_idx = 1; switch (desc_ty_inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: buff_ty_id = desc_ty_inst->GetSingleWordInOperand(0); ++ac_in_idx; break; default: - assert(desc_ty_inst->opcode() == SpvOpTypeStruct && + assert(desc_ty_inst->opcode() == spv::Op::OpTypeStruct && "unexpected descriptor type"); buff_ty_id = desc_ty_inst->result_id(); break; @@ -393,19 +393,20 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, Instruction* curr_ty_inst = get_def_use_mgr()->GetDef(curr_ty_id); uint32_t curr_offset_id = 0; switch (curr_ty_inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: { + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: { // Get array stride and multiply by current index - uint32_t arr_stride = FindStride(curr_ty_id, SpvDecorationArrayStride); + uint32_t arr_stride = + FindStride(curr_ty_id, uint32_t(spv::Decoration::ArrayStride)); uint32_t arr_stride_id = builder->GetUintConstantId(arr_stride); uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder); Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), SpvOpIMul, arr_stride_id, curr_idx_32b_id); + GetUintId(), spv::Op::OpIMul, arr_stride_id, curr_idx_32b_id); curr_offset_id = curr_offset_inst->result_id(); // Get element type for next step curr_ty_id = curr_ty_inst->GetSingleWordInOperand(0); } break; - case SpvOpTypeMatrix: { + case spv::Op::OpTypeMatrix: { assert(matrix_stride != 0 && "missing matrix stride"); matrix_stride_id = builder->GetUintConstantId(matrix_stride); uint32_t vec_ty_id = curr_ty_inst->GetSingleWordInOperand(0); @@ -423,40 +424,40 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, } uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder); Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), SpvOpIMul, col_stride_id, curr_idx_32b_id); + GetUintId(), spv::Op::OpIMul, col_stride_id, curr_idx_32b_id); curr_offset_id = curr_offset_inst->result_id(); // Get element type for next step curr_ty_id = vec_ty_id; in_matrix = true; } break; - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { // If inside a row major matrix type, multiply index by matrix stride, // else multiply by component size uint32_t comp_ty_id = curr_ty_inst->GetSingleWordInOperand(0u); uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder); if (in_matrix && !col_major) { Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), SpvOpIMul, matrix_stride_id, curr_idx_32b_id); + GetUintId(), spv::Op::OpIMul, matrix_stride_id, curr_idx_32b_id); curr_offset_id = curr_offset_inst->result_id(); } else { uint32_t comp_ty_sz = ByteSize(comp_ty_id, 0u, false, false); uint32_t comp_ty_sz_id = builder->GetUintConstantId(comp_ty_sz); Instruction* curr_offset_inst = builder->AddBinaryOp( - GetUintId(), SpvOpIMul, comp_ty_sz_id, curr_idx_32b_id); + GetUintId(), spv::Op::OpIMul, comp_ty_sz_id, curr_idx_32b_id); curr_offset_id = curr_offset_inst->result_id(); } // Get element type for next step curr_ty_id = comp_ty_id; } break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { // Get buffer byte offset for the referenced member Instruction* curr_idx_inst = get_def_use_mgr()->GetDef(curr_idx_id); - assert(curr_idx_inst->opcode() == SpvOpConstant && + assert(curr_idx_inst->opcode() == spv::Op::OpConstant && "unexpected struct index"); uint32_t member_idx = curr_idx_inst->GetSingleWordInOperand(0); uint32_t member_offset = 0xdeadbeef; bool found = get_decoration_mgr()->FindDecoration( - curr_ty_id, SpvDecorationOffset, + curr_ty_id, uint32_t(spv::Decoration::Offset), [&member_idx, &member_offset](const Instruction& deco_inst) { if (deco_inst.GetSingleWordInOperand(1u) != member_idx) return false; @@ -470,7 +471,7 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, // enclosing struct type at the member index. If none found, reset // stride to 0. found = get_decoration_mgr()->FindDecoration( - curr_ty_id, SpvDecorationMatrixStride, + curr_ty_id, uint32_t(spv::Decoration::MatrixStride), [&member_idx, &matrix_stride](const Instruction& deco_inst) { if (deco_inst.GetSingleWordInOperand(1u) != member_idx) return false; @@ -480,7 +481,7 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, if (!found) matrix_stride = 0; // Look for column major decoration found = get_decoration_mgr()->FindDecoration( - curr_ty_id, SpvDecorationColMajor, + curr_ty_id, uint32_t(spv::Decoration::ColMajor), [&member_idx, &col_major](const Instruction& deco_inst) { if (deco_inst.GetSingleWordInOperand(1u) != member_idx) return false; @@ -496,8 +497,8 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, if (sum_id == 0) sum_id = curr_offset_id; else { - Instruction* sum_inst = - builder->AddBinaryOp(GetUintId(), SpvOpIAdd, sum_id, curr_offset_id); + Instruction* sum_inst = builder->AddBinaryOp(GetUintId(), spv::Op::OpIAdd, + sum_id, curr_offset_id); sum_id = sum_inst->result_id(); } ++ac_in_idx; @@ -507,7 +508,7 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, uint32_t last = bsize - 1; uint32_t last_id = builder->GetUintConstantId(last); Instruction* sum_inst = - builder->AddBinaryOp(GetUintId(), SpvOpIAdd, sum_id, last_id); + builder->AddBinaryOp(GetUintId(), spv::Op::OpIAdd, sum_id, last_id); return sum_inst->result_id(); } @@ -527,8 +528,9 @@ void InstBindlessCheckPass::GenCheckCode( std::unique_ptr merge_label(NewLabel(merge_blk_id)); std::unique_ptr valid_label(NewLabel(valid_blk_id)); std::unique_ptr invalid_label(NewLabel(invalid_blk_id)); - (void)builder.AddConditionalBranch(check_id, valid_blk_id, invalid_blk_id, - merge_blk_id, SpvSelectionControlMaskNone); + (void)builder.AddConditionalBranch( + check_id, valid_blk_id, invalid_blk_id, merge_blk_id, + uint32_t(spv::SelectionControlMask::MaskNone)); // Gen valid bounds branch std::unique_ptr new_blk_ptr( new BasicBlock(std::move(valid_label))); @@ -593,24 +595,24 @@ void InstBindlessCheckPass::GenDescIdxCheckCode( RefAnalysis ref; if (!AnalyzeDescriptorReference(&*ref_inst_itr, &ref)) return; Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref.ptr_id); - if (ptr_inst->opcode() != SpvOp::SpvOpAccessChain) return; + if (ptr_inst->opcode() != spv::Op::OpAccessChain) return; // If index and bound both compile-time constants and index < bound, // return without changing Instruction* var_inst = get_def_use_mgr()->GetDef(ref.var_id); Instruction* desc_type_inst = GetPointeeTypeInst(var_inst); uint32_t length_id = 0; - if (desc_type_inst->opcode() == SpvOpTypeArray) { + if (desc_type_inst->opcode() == spv::Op::OpTypeArray) { length_id = desc_type_inst->GetSingleWordInOperand(kSpvTypeArrayLengthIdInIdx); Instruction* index_inst = get_def_use_mgr()->GetDef(ref.desc_idx_id); Instruction* length_inst = get_def_use_mgr()->GetDef(length_id); - if (index_inst->opcode() == SpvOpConstant && - length_inst->opcode() == SpvOpConstant && + if (index_inst->opcode() == spv::Op::OpConstant && + length_inst->opcode() == spv::Op::OpConstant && index_inst->GetSingleWordInOperand(kSpvConstantValueInIdx) < length_inst->GetSingleWordInOperand(kSpvConstantValueInIdx)) return; } else if (!desc_idx_enabled_ || - desc_type_inst->opcode() != SpvOpTypeRuntimeArray) { + desc_type_inst->opcode() != spv::Op::OpTypeRuntimeArray) { return; } // Move original block's preceding instructions into first new block @@ -624,7 +626,7 @@ void InstBindlessCheckPass::GenDescIdxCheckCode( // If length id not yet set, descriptor array is runtime size so // generate load of length from stage's debug input buffer. if (length_id == 0) { - assert(desc_type_inst->opcode() == SpvOpTypeRuntimeArray && + assert(desc_type_inst->opcode() == spv::Op::OpTypeRuntimeArray && "unexpected bindless type"); length_id = GenDebugReadLength(ref.var_id, &builder); } @@ -633,7 +635,7 @@ void InstBindlessCheckPass::GenDescIdxCheckCode( // for the referenced value. uint32_t desc_idx_32b_id = Gen32BitCvtCode(ref.desc_idx_id, &builder); uint32_t length_32b_id = Gen32BitCvtCode(length_id, &builder); - Instruction* ult_inst = builder.AddBinaryOp(GetBoolId(), SpvOpULessThan, + Instruction* ult_inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpULessThan, desc_idx_32b_id, length_32b_id); ref.desc_idx_id = desc_idx_32b_id; GenCheckCode(ult_inst->result_id(), error_id, 0u, length_id, stage_idx, &ref, @@ -661,9 +663,10 @@ void InstBindlessCheckPass::GenDescInitCheckCode( // TODO(greg-lunarg): Do bounds check for aggregate loads and stores Instruction* ref_ptr_inst = get_def_use_mgr()->GetDef(ref.ptr_id); Instruction* pte_type_inst = GetPointeeTypeInst(ref_ptr_inst); - uint32_t pte_type_op = pte_type_inst->opcode(); - if (pte_type_op == SpvOpTypeArray || pte_type_op == SpvOpTypeRuntimeArray || - pte_type_op == SpvOpTypeStruct) + spv::Op pte_type_op = pte_type_inst->opcode(); + if (pte_type_op == spv::Op::OpTypeArray || + pte_type_op == spv::Op::OpTypeRuntimeArray || + pte_type_op == spv::Op::OpTypeStruct) init_check = true; } // If initialization check and not enabled, return @@ -687,11 +690,13 @@ void InstBindlessCheckPass::GenDescInitCheckCode( // being full reference and false branch being debug output and zero // for the referenced value. Instruction* ult_inst = - builder.AddBinaryOp(GetBoolId(), SpvOpULessThan, ref_id, init_id); - uint32_t error = init_check ? kInstErrorBindlessUninit - : (ref.strg_class == SpvStorageClassUniform - ? kInstErrorBuffOOBUniform - : kInstErrorBuffOOBStorage); + builder.AddBinaryOp(GetBoolId(), spv::Op::OpULessThan, ref_id, init_id); + uint32_t error = + init_check + ? kInstErrorBindlessUninit + : (spv::StorageClass(ref.strg_class) == spv::StorageClass::Uniform + ? kInstErrorBuffOOBUniform + : kInstErrorBuffOOBStorage); uint32_t error_id = builder.GetUintConstantId(error); GenCheckCode(ult_inst->result_id(), error_id, init_check ? 0 : ref_id, init_check ? builder.GetUintConstantId(0u) : init_id, stage_idx, @@ -708,11 +713,11 @@ void InstBindlessCheckPass::GenTexBuffCheckCode( std::vector>* new_blocks) { // Only process OpImageRead and OpImageWrite with no optional operands Instruction* ref_inst = &*ref_inst_itr; - SpvOp op = ref_inst->opcode(); + spv::Op op = ref_inst->opcode(); uint32_t num_in_oprnds = ref_inst->NumInOperands(); - if (!((op == SpvOpImageRead && num_in_oprnds == 2) || - (op == SpvOpImageFetch && num_in_oprnds == 2) || - (op == SpvOpImageWrite && num_in_oprnds == 3))) + if (!((op == spv::Op::OpImageRead && num_in_oprnds == 2) || + (op == spv::Op::OpImageFetch && num_in_oprnds == 2) || + (op == spv::Op::OpImageWrite && num_in_oprnds == 3))) return; // Pull components from descriptor reference RefAnalysis ref; @@ -721,17 +726,20 @@ void InstBindlessCheckPass::GenTexBuffCheckCode( Instruction* image_inst = get_def_use_mgr()->GetDef(ref.image_id); uint32_t image_ty_id = image_inst->type_id(); Instruction* image_ty_inst = get_def_use_mgr()->GetDef(image_ty_id); - if (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageDim) != SpvDimBuffer) + if (spv::Dim(image_ty_inst->GetSingleWordInOperand(kSpvTypeImageDim)) != + spv::Dim::Buffer) { return; + } if (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageDepth) != 0) return; if (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageArrayed) != 0) return; if (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageMS) != 0) return; // Enable ImageQuery Capability if not yet enabled - if (!get_feature_mgr()->HasCapability(SpvCapabilityImageQuery)) { - std::unique_ptr cap_image_query_inst(new Instruction( - context(), SpvOpCapability, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_CAPABILITY, {SpvCapabilityImageQuery}}})); + if (!get_feature_mgr()->HasCapability(spv::Capability::ImageQuery)) { + std::unique_ptr cap_image_query_inst( + new Instruction(context(), spv::Op::OpCapability, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_CAPABILITY, + {uint32_t(spv::Capability::ImageQuery)}}})); get_def_use_mgr()->AnalyzeInstDefUse(&*cap_image_query_inst); context()->AddCapability(std::move(cap_image_query_inst)); } @@ -750,13 +758,13 @@ void InstBindlessCheckPass::GenTexBuffCheckCode( if (ref.desc_idx_id == 0) ref.desc_idx_id = builder.GetUintConstantId(0u); // Get texel buffer size. Instruction* size_inst = - builder.AddUnaryOp(GetUintId(), SpvOpImageQuerySize, ref.image_id); + builder.AddUnaryOp(GetUintId(), spv::Op::OpImageQuerySize, ref.image_id); uint32_t size_id = size_inst->result_id(); // Generate runtime initialization/bounds test code with true branch // being full reference and false branch being debug output and zero // for the referenced value. Instruction* ult_inst = - builder.AddBinaryOp(GetBoolId(), SpvOpULessThan, coord_id, size_id); + builder.AddBinaryOp(GetBoolId(), spv::Op::OpULessThan, coord_id, size_id); uint32_t error = (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageSampled) == 2) ? kInstErrorBuffOOBStorageTexel @@ -778,13 +786,16 @@ void InstBindlessCheckPass::InitializeInstBindlessCheck() { // init check is enabled. if (desc_idx_enabled_ || buffer_bounds_enabled_ || texel_buffer_enabled_) for (auto& anno : get_module()->annotations()) - if (anno.opcode() == SpvOpDecorate) { - if (anno.GetSingleWordInOperand(1u) == SpvDecorationDescriptorSet) + if (anno.opcode() == spv::Op::OpDecorate) { + if (spv::Decoration(anno.GetSingleWordInOperand(1u)) == + spv::Decoration::DescriptorSet) { var2desc_set_[anno.GetSingleWordInOperand(0u)] = anno.GetSingleWordInOperand(2u); - else if (anno.GetSingleWordInOperand(1u) == SpvDecorationBinding) + } else if (spv::Decoration(anno.GetSingleWordInOperand(1u)) == + spv::Decoration::Binding) { var2binding_[anno.GetSingleWordInOperand(0u)] = anno.GetSingleWordInOperand(2u); + } } } diff --git a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp index 3318f88f2..be361e69b 100644 --- a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp @@ -22,9 +22,9 @@ namespace opt { uint32_t InstBuffAddrCheckPass::CloneOriginalReference( Instruction* ref_inst, InstructionBuilder* builder) { // Clone original ref with new result id (if load) - assert( - (ref_inst->opcode() == SpvOpLoad || ref_inst->opcode() == SpvOpStore) && - "unexpected ref"); + assert((ref_inst->opcode() == spv::Op::OpLoad || + ref_inst->opcode() == spv::Op::OpStore) && + "unexpected ref"); std::unique_ptr new_ref_inst(ref_inst->Clone(context())); uint32_t ref_result_id = ref_inst->result_id(); uint32_t new_ref_id = 0; @@ -41,16 +41,17 @@ uint32_t InstBuffAddrCheckPass::CloneOriginalReference( } bool InstBuffAddrCheckPass::IsPhysicalBuffAddrReference(Instruction* ref_inst) { - if (ref_inst->opcode() != SpvOpLoad && ref_inst->opcode() != SpvOpStore) + if (ref_inst->opcode() != spv::Op::OpLoad && + ref_inst->opcode() != spv::Op::OpStore) return false; uint32_t ptr_id = ref_inst->GetSingleWordInOperand(0); analysis::DefUseManager* du_mgr = get_def_use_mgr(); Instruction* ptr_inst = du_mgr->GetDef(ptr_id); - if (ptr_inst->opcode() != SpvOpAccessChain) return false; + if (ptr_inst->opcode() != spv::Op::OpAccessChain) return false; uint32_t ptr_ty_id = ptr_inst->type_id(); Instruction* ptr_ty_inst = du_mgr->GetDef(ptr_ty_id); - if (ptr_ty_inst->GetSingleWordInOperand(0) != - SpvStorageClassPhysicalStorageBufferEXT) + if (spv::StorageClass(ptr_ty_inst->GetSingleWordInOperand(0)) != + spv::StorageClass::PhysicalStorageBufferEXT) return false; return true; } @@ -72,8 +73,9 @@ void InstBuffAddrCheckPass::GenCheckCode( std::unique_ptr merge_label(NewLabel(merge_blk_id)); std::unique_ptr valid_label(NewLabel(valid_blk_id)); std::unique_ptr invalid_label(NewLabel(invalid_blk_id)); - (void)builder.AddConditionalBranch(check_id, valid_blk_id, invalid_blk_id, - merge_blk_id, SpvSelectionControlMaskNone); + (void)builder.AddConditionalBranch( + check_id, valid_blk_id, invalid_blk_id, merge_blk_id, + uint32_t(spv::SelectionControlMask::MaskNone)); // Gen valid branch std::unique_ptr new_blk_ptr( new BasicBlock(std::move(valid_label))); @@ -86,12 +88,12 @@ void InstBuffAddrCheckPass::GenCheckCode( builder.SetInsertPoint(&*new_blk_ptr); // Convert uptr from uint64 to 2 uint32 Instruction* lo_uptr_inst = - builder.AddUnaryOp(GetUintId(), SpvOpUConvert, ref_uptr_id); + builder.AddUnaryOp(GetUintId(), spv::Op::OpUConvert, ref_uptr_id); Instruction* rshift_uptr_inst = - builder.AddBinaryOp(GetUint64Id(), SpvOpShiftRightLogical, ref_uptr_id, - builder.GetUintConstantId(32)); - Instruction* hi_uptr_inst = builder.AddUnaryOp(GetUintId(), SpvOpUConvert, - rshift_uptr_inst->result_id()); + builder.AddBinaryOp(GetUint64Id(), spv::Op::OpShiftRightLogical, + ref_uptr_id, builder.GetUintConstantId(32)); + Instruction* hi_uptr_inst = builder.AddUnaryOp( + GetUintId(), spv::Op::OpUConvert, rshift_uptr_inst->result_id()); GenDebugStreamWrite( uid2offset_[ref_inst->unique_id()], stage_idx, {error_id, lo_uptr_inst->result_id(), hi_uptr_inst->result_id()}, @@ -105,8 +107,8 @@ void InstBuffAddrCheckPass::GenCheckCode( analysis::Type* ref_type = type_mgr->GetType(ref_type_id); if (ref_type->AsPointer() != nullptr) { uint32_t null_u64_id = GetNullId(GetUint64Id()); - Instruction* null_ptr_inst = - builder.AddUnaryOp(ref_type_id, SpvOpConvertUToPtr, null_u64_id); + Instruction* null_ptr_inst = builder.AddUnaryOp( + ref_type_id, spv::Op::OpConvertUToPtr, null_u64_id); null_id = null_ptr_inst->result_id(); } else { null_id = GetNullId(ref_type_id); @@ -133,16 +135,16 @@ void InstBuffAddrCheckPass::GenCheckCode( uint32_t InstBuffAddrCheckPass::GetTypeAlignment(uint32_t type_id) { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); switch (type_inst->opcode()) { - case SpvOpTypeFloat: - case SpvOpTypeInt: - case SpvOpTypeVector: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeVector: return GetTypeLength(type_id); - case SpvOpTypeMatrix: + case spv::Op::OpTypeMatrix: return GetTypeAlignment(type_inst->GetSingleWordInOperand(0)); - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: return GetTypeAlignment(type_inst->GetSingleWordInOperand(0)); - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { uint32_t max = 0; type_inst->ForEachInId([&max, this](const uint32_t* iid) { uint32_t alignment = GetTypeAlignment(*iid); @@ -150,9 +152,9 @@ uint32_t InstBuffAddrCheckPass::GetTypeAlignment(uint32_t type_id) { }); return max; } - case SpvOpTypePointer: - assert(type_inst->GetSingleWordInOperand(0) == - SpvStorageClassPhysicalStorageBufferEXT && + case spv::Op::OpTypePointer: + assert(spv::StorageClass(type_inst->GetSingleWordInOperand(0)) == + spv::StorageClass::PhysicalStorageBufferEXT && "unexpected pointer type"); return 8u; default: @@ -164,29 +166,29 @@ uint32_t InstBuffAddrCheckPass::GetTypeAlignment(uint32_t type_id) { uint32_t InstBuffAddrCheckPass::GetTypeLength(uint32_t type_id) { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); switch (type_inst->opcode()) { - case SpvOpTypeFloat: - case SpvOpTypeInt: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeInt: return type_inst->GetSingleWordInOperand(0) / 8u; - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { uint32_t raw_cnt = type_inst->GetSingleWordInOperand(1); uint32_t adj_cnt = (raw_cnt == 3u) ? 4u : raw_cnt; return adj_cnt * GetTypeLength(type_inst->GetSingleWordInOperand(0)); } - case SpvOpTypeMatrix: + case spv::Op::OpTypeMatrix: return type_inst->GetSingleWordInOperand(1) * GetTypeLength(type_inst->GetSingleWordInOperand(0)); - case SpvOpTypePointer: - assert(type_inst->GetSingleWordInOperand(0) == - SpvStorageClassPhysicalStorageBufferEXT && + case spv::Op::OpTypePointer: + assert(spv::StorageClass(type_inst->GetSingleWordInOperand(0)) == + spv::StorageClass::PhysicalStorageBufferEXT && "unexpected pointer type"); return 8u; - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { uint32_t const_id = type_inst->GetSingleWordInOperand(1); Instruction* const_inst = get_def_use_mgr()->GetDef(const_id); uint32_t cnt = const_inst->GetSingleWordInOperand(0); return cnt * GetTypeLength(type_inst->GetSingleWordInOperand(0)); } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { uint32_t len = 0; type_inst->ForEachInId([&len, this](const uint32_t* iid) { // Align struct length @@ -200,7 +202,7 @@ uint32_t InstBuffAddrCheckPass::GetTypeLength(uint32_t type_id) { }); return len; } - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeRuntimeArray: default: assert(false && "unexpected type"); return 0; @@ -213,7 +215,7 @@ void InstBuffAddrCheckPass::AddParam(uint32_t type_id, uint32_t pid = TakeNextId(); param_vec->push_back(pid); std::unique_ptr param_inst(new Instruction( - get_module()->context(), SpvOpFunctionParameter, type_id, pid, {})); + get_module()->context(), spv::Op::OpFunctionParameter, type_id, pid, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*param_inst); (*input_func)->AddParameter(std::move(param_inst)); } @@ -231,10 +233,10 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { analysis::Function func_ty(type_mgr->GetType(GetBoolId()), param_types); analysis::Type* reg_func_ty = type_mgr->GetRegisteredType(&func_ty); std::unique_ptr func_inst( - new Instruction(get_module()->context(), SpvOpFunction, GetBoolId(), - search_test_func_id_, + new Instruction(get_module()->context(), spv::Op::OpFunction, + GetBoolId(), search_test_func_id_, {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvFunctionControlMaskNone}}, + {uint32_t(spv::FunctionControlMask::MaskNone)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_mgr->GetTypeInstruction(reg_func_ty)}}})); get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); @@ -256,7 +258,7 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { // Branch to search loop header std::unique_ptr hdr_blk_label(NewLabel(hdr_blk_id)); (void)builder.AddInstruction(MakeUnique( - context(), SpvOpBranch, 0, 0, + context(), spv::Op::OpBranch, 0, 0, std::initializer_list{{SPV_OPERAND_TYPE_ID, {hdr_blk_id}}})); input_func->AddBasicBlock(std::move(first_blk_ptr)); // Linear search loop header block @@ -273,12 +275,12 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { uint32_t idx_phi_id = TakeNextId(); uint32_t idx_inc_id = TakeNextId(); std::unique_ptr idx_inc_inst(new Instruction( - context(), SpvOpIAdd, GetUintId(), idx_inc_id, + context(), spv::Op::OpIAdd, GetUintId(), idx_inc_id, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {idx_phi_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {builder.GetUintConstantId(1u)}}})); std::unique_ptr idx_phi_inst(new Instruction( - context(), SpvOpPhi, GetUintId(), idx_phi_id, + context(), spv::Op::OpPhi, GetUintId(), idx_phi_id, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {builder.GetUintConstantId(1u)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {first_blk_id}}, @@ -292,14 +294,15 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { std::unique_ptr bound_test_blk_label( NewLabel(bound_test_blk_id)); (void)builder.AddInstruction(MakeUnique( - context(), SpvOpLoopMerge, 0, 0, + context(), spv::Op::OpLoopMerge, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {bound_test_blk_id}}, {SPV_OPERAND_TYPE_ID, {cont_blk_id}}, - {SPV_OPERAND_TYPE_LITERAL_INTEGER, {SpvLoopControlMaskNone}}})); + {SPV_OPERAND_TYPE_LITERAL_INTEGER, + {uint32_t(spv::LoopControlMask::MaskNone)}}})); // Branch to continue/work block (void)builder.AddInstruction(MakeUnique( - context(), SpvOpBranch, 0, 0, + context(), spv::Op::OpBranch, 0, 0, std::initializer_list{{SPV_OPERAND_TYPE_ID, {cont_blk_id}}})); input_func->AddBasicBlock(std::move(hdr_blk_ptr)); // Continue/Work Block. Read next buffer pointer and break if greater @@ -313,19 +316,19 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { uint32_t ibuf_id = GetInputBufferId(); uint32_t ibuf_ptr_id = GetInputBufferPtrId(); Instruction* uptr_ac_inst = builder.AddTernaryOp( - ibuf_ptr_id, SpvOpAccessChain, ibuf_id, + ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, builder.GetUintConstantId(kDebugInputDataOffset), idx_inc_id); uint32_t ibuf_type_id = GetInputBufferTypeId(); - Instruction* uptr_load_inst = - builder.AddUnaryOp(ibuf_type_id, SpvOpLoad, uptr_ac_inst->result_id()); + Instruction* uptr_load_inst = builder.AddUnaryOp( + ibuf_type_id, spv::Op::OpLoad, uptr_ac_inst->result_id()); // If loaded address greater than ref_ptr arg, break, else branch back to // loop header Instruction* uptr_test_inst = - builder.AddBinaryOp(GetBoolId(), SpvOpUGreaterThan, + builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThan, uptr_load_inst->result_id(), param_vec[0]); - (void)builder.AddConditionalBranch(uptr_test_inst->result_id(), - bound_test_blk_id, hdr_blk_id, - kInvalidId, SpvSelectionControlMaskNone); + (void)builder.AddConditionalBranch( + uptr_test_inst->result_id(), bound_test_blk_id, hdr_blk_id, kInvalidId, + uint32_t(spv::SelectionControlMask::MaskNone)); input_func->AddBasicBlock(std::move(cont_blk_ptr)); // Bounds test block. Read length of selected buffer and test that // all len arg bytes are in buffer. @@ -333,63 +336,65 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { MakeUnique(std::move(bound_test_blk_label)); builder.SetInsertPoint(&*bound_test_blk_ptr); // Decrement index to point to previous/candidate buffer address - Instruction* cand_idx_inst = builder.AddBinaryOp( - GetUintId(), SpvOpISub, idx_inc_id, builder.GetUintConstantId(1u)); + Instruction* cand_idx_inst = + builder.AddBinaryOp(GetUintId(), spv::Op::OpISub, idx_inc_id, + builder.GetUintConstantId(1u)); // Load candidate buffer address Instruction* cand_ac_inst = - builder.AddTernaryOp(ibuf_ptr_id, SpvOpAccessChain, ibuf_id, + builder.AddTernaryOp(ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, builder.GetUintConstantId(kDebugInputDataOffset), cand_idx_inst->result_id()); - Instruction* cand_load_inst = - builder.AddUnaryOp(ibuf_type_id, SpvOpLoad, cand_ac_inst->result_id()); + Instruction* cand_load_inst = builder.AddUnaryOp( + ibuf_type_id, spv::Op::OpLoad, cand_ac_inst->result_id()); // Compute offset of ref_ptr from candidate buffer address - Instruction* offset_inst = builder.AddBinaryOp( - ibuf_type_id, SpvOpISub, param_vec[0], cand_load_inst->result_id()); + Instruction* offset_inst = + builder.AddBinaryOp(ibuf_type_id, spv::Op::OpISub, param_vec[0], + cand_load_inst->result_id()); // Convert ref length to uint64 Instruction* ref_len_64_inst = - builder.AddUnaryOp(ibuf_type_id, SpvOpUConvert, param_vec[1]); + builder.AddUnaryOp(ibuf_type_id, spv::Op::OpUConvert, param_vec[1]); // Add ref length to ref offset to compute end of reference - Instruction* ref_end_inst = - builder.AddBinaryOp(ibuf_type_id, SpvOpIAdd, offset_inst->result_id(), - ref_len_64_inst->result_id()); + Instruction* ref_end_inst = builder.AddBinaryOp( + ibuf_type_id, spv::Op::OpIAdd, offset_inst->result_id(), + ref_len_64_inst->result_id()); // Load starting index of lengths in input buffer and convert to uint32 Instruction* len_start_ac_inst = - builder.AddTernaryOp(ibuf_ptr_id, SpvOpAccessChain, ibuf_id, + builder.AddTernaryOp(ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, builder.GetUintConstantId(kDebugInputDataOffset), builder.GetUintConstantId(0u)); Instruction* len_start_load_inst = builder.AddUnaryOp( - ibuf_type_id, SpvOpLoad, len_start_ac_inst->result_id()); + ibuf_type_id, spv::Op::OpLoad, len_start_ac_inst->result_id()); Instruction* len_start_32_inst = builder.AddUnaryOp( - GetUintId(), SpvOpUConvert, len_start_load_inst->result_id()); + GetUintId(), spv::Op::OpUConvert, len_start_load_inst->result_id()); // Decrement search index to get candidate buffer length index - Instruction* cand_len_idx_inst = - builder.AddBinaryOp(GetUintId(), SpvOpISub, cand_idx_inst->result_id(), - builder.GetUintConstantId(1u)); + Instruction* cand_len_idx_inst = builder.AddBinaryOp( + GetUintId(), spv::Op::OpISub, cand_idx_inst->result_id(), + builder.GetUintConstantId(1u)); // Add candidate length index to start index Instruction* len_idx_inst = builder.AddBinaryOp( - GetUintId(), SpvOpIAdd, cand_len_idx_inst->result_id(), + GetUintId(), spv::Op::OpIAdd, cand_len_idx_inst->result_id(), len_start_32_inst->result_id()); // Load candidate buffer length Instruction* len_ac_inst = - builder.AddTernaryOp(ibuf_ptr_id, SpvOpAccessChain, ibuf_id, + builder.AddTernaryOp(ibuf_ptr_id, spv::Op::OpAccessChain, ibuf_id, builder.GetUintConstantId(kDebugInputDataOffset), len_idx_inst->result_id()); - Instruction* len_load_inst = - builder.AddUnaryOp(ibuf_type_id, SpvOpLoad, len_ac_inst->result_id()); + Instruction* len_load_inst = builder.AddUnaryOp( + ibuf_type_id, spv::Op::OpLoad, len_ac_inst->result_id()); // Test if reference end within candidate buffer length Instruction* len_test_inst = builder.AddBinaryOp( - GetBoolId(), SpvOpULessThanEqual, ref_end_inst->result_id(), + GetBoolId(), spv::Op::OpULessThanEqual, ref_end_inst->result_id(), len_load_inst->result_id()); // Return test result (void)builder.AddInstruction(MakeUnique( - context(), SpvOpReturnValue, 0, 0, + context(), spv::Op::OpReturnValue, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {len_test_inst->result_id()}}})); // Close block input_func->AddBasicBlock(std::move(bound_test_blk_ptr)); // Close function and add function to module - std::unique_ptr func_end_inst( - new Instruction(get_module()->context(), SpvOpFunctionEnd, 0, 0, {})); + std::unique_ptr func_end_inst(new Instruction( + get_module()->context(), spv::Op::OpFunctionEnd, 0, 0, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst); input_func->SetFunctionEnd(std::move(func_end_inst)); context()->AddFunction(std::move(input_func)); @@ -403,18 +408,18 @@ uint32_t InstBuffAddrCheckPass::GenSearchAndTest(Instruction* ref_inst, InstructionBuilder* builder, uint32_t* ref_uptr_id) { // Enable Int64 if necessary - if (!get_feature_mgr()->HasCapability(SpvCapabilityInt64)) { + if (!get_feature_mgr()->HasCapability(spv::Capability::Int64)) { std::unique_ptr cap_int64_inst(new Instruction( - context(), SpvOpCapability, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_CAPABILITY, {SpvCapabilityInt64}}})); + context(), spv::Op::OpCapability, 0, 0, + std::initializer_list{{SPV_OPERAND_TYPE_CAPABILITY, + {uint32_t(spv::Capability::Int64)}}})); get_def_use_mgr()->AnalyzeInstDefUse(&*cap_int64_inst); context()->AddCapability(std::move(cap_int64_inst)); } // Convert reference pointer to uint64 uint32_t ref_ptr_id = ref_inst->GetSingleWordInOperand(0); Instruction* ref_uptr_inst = - builder->AddUnaryOp(GetUint64Id(), SpvOpConvertPtrToU, ref_ptr_id); + builder->AddUnaryOp(GetUint64Id(), spv::Op::OpConvertPtrToU, ref_ptr_id); *ref_uptr_id = ref_uptr_inst->result_id(); // Compute reference length in bytes analysis::DefUseManager* du_mgr = get_def_use_mgr(); @@ -427,7 +432,7 @@ uint32_t InstBuffAddrCheckPass::GenSearchAndTest(Instruction* ref_inst, const std::vector args = {GetSearchAndTestFuncId(), *ref_uptr_id, ref_len_id}; Instruction* call_inst = - builder->AddNaryOp(GetBoolId(), SpvOpFunctionCall, args); + builder->AddNaryOp(GetBoolId(), spv::Op::OpFunctionCall, args); uint32_t retval = call_inst->result_id(); return retval; } @@ -485,7 +490,7 @@ Pass::Status InstBuffAddrCheckPass::ProcessImpl() { Pass::Status InstBuffAddrCheckPass::Process() { if (!get_feature_mgr()->HasCapability( - SpvCapabilityPhysicalStorageBufferAddressesEXT)) + spv::Capability::PhysicalStorageBufferAddressesEXT)) return Status::SuccessWithoutChange; InitInstBuffAddrCheck(); return ProcessImpl(); diff --git a/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp index 4218138f9..151b94c73 100644 --- a/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp @@ -35,7 +35,7 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, uint32_t c_ty_id = type_mgr->GetId(c_ty); for (uint32_t c = 0; c < v_ty->element_count(); ++c) { Instruction* c_inst = builder->AddIdLiteralOp( - c_ty_id, SpvOpCompositeExtract, val_inst->result_id(), c); + c_ty_id, spv::Op::OpCompositeExtract, val_inst->result_id(), c); GenOutputValues(c_inst, val_ids, builder); } return; @@ -44,8 +44,9 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, // Select between uint32 zero or one uint32_t zero_id = builder->GetUintConstantId(0); uint32_t one_id = builder->GetUintConstantId(1); - Instruction* sel_inst = builder->AddTernaryOp( - GetUintId(), SpvOpSelect, val_inst->result_id(), one_id, zero_id); + Instruction* sel_inst = + builder->AddTernaryOp(GetUintId(), spv::Op::OpSelect, + val_inst->result_id(), one_id, zero_id); val_ids->push_back(sel_inst->result_id()); return; } @@ -55,21 +56,21 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, case 16: { // Convert float16 to float32 and recurse Instruction* f32_inst = builder->AddUnaryOp( - GetFloatId(), SpvOpFConvert, val_inst->result_id()); + GetFloatId(), spv::Op::OpFConvert, val_inst->result_id()); GenOutputValues(f32_inst, val_ids, builder); return; } case 64: { // Bitcast float64 to uint64 and recurse Instruction* ui64_inst = builder->AddUnaryOp( - GetUint64Id(), SpvOpBitcast, val_inst->result_id()); + GetUint64Id(), spv::Op::OpBitcast, val_inst->result_id()); GenOutputValues(ui64_inst, val_ids, builder); return; } case 32: { // Bitcase float32 to uint32 - Instruction* bc_inst = builder->AddUnaryOp(GetUintId(), SpvOpBitcast, - val_inst->result_id()); + Instruction* bc_inst = builder->AddUnaryOp( + GetUintId(), spv::Op::OpBitcast, val_inst->result_id()); val_ids->push_back(bc_inst->result_id()); return; } @@ -85,17 +86,17 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, Instruction* ui64_inst = val_inst; if (i_ty->IsSigned()) { // Bitcast sint64 to uint64 - ui64_inst = builder->AddUnaryOp(GetUint64Id(), SpvOpBitcast, + ui64_inst = builder->AddUnaryOp(GetUint64Id(), spv::Op::OpBitcast, val_inst->result_id()); } // Break uint64 into 2x uint32 Instruction* lo_ui64_inst = builder->AddUnaryOp( - GetUintId(), SpvOpUConvert, ui64_inst->result_id()); + GetUintId(), spv::Op::OpUConvert, ui64_inst->result_id()); Instruction* rshift_ui64_inst = builder->AddBinaryOp( - GetUint64Id(), SpvOpShiftRightLogical, ui64_inst->result_id(), - builder->GetUintConstantId(32)); + GetUint64Id(), spv::Op::OpShiftRightLogical, + ui64_inst->result_id(), builder->GetUintConstantId(32)); Instruction* hi_ui64_inst = builder->AddUnaryOp( - GetUintId(), SpvOpUConvert, rshift_ui64_inst->result_id()); + GetUintId(), spv::Op::OpUConvert, rshift_ui64_inst->result_id()); val_ids->push_back(lo_ui64_inst->result_id()); val_ids->push_back(hi_ui64_inst->result_id()); return; @@ -104,12 +105,12 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, Instruction* ui8_inst = val_inst; if (i_ty->IsSigned()) { // Bitcast sint8 to uint8 - ui8_inst = builder->AddUnaryOp(GetUint8Id(), SpvOpBitcast, + ui8_inst = builder->AddUnaryOp(GetUint8Id(), spv::Op::OpBitcast, val_inst->result_id()); } // Convert uint8 to uint32 Instruction* ui32_inst = builder->AddUnaryOp( - GetUintId(), SpvOpUConvert, ui8_inst->result_id()); + GetUintId(), spv::Op::OpUConvert, ui8_inst->result_id()); val_ids->push_back(ui32_inst->result_id()); return; } @@ -117,7 +118,7 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, Instruction* ui32_inst = val_inst; if (i_ty->IsSigned()) { // Bitcast sint32 to uint32 - ui32_inst = builder->AddUnaryOp(GetUintId(), SpvOpBitcast, + ui32_inst = builder->AddUnaryOp(GetUintId(), spv::Op::OpBitcast, val_inst->result_id()); } // uint32 needs no further processing @@ -158,7 +159,7 @@ void InstDebugPrintfPass::GenOutputCode( return; } Instruction* opnd_inst = get_def_use_mgr()->GetDef(*iid); - if (opnd_inst->opcode() == SpvOpString) { + if (opnd_inst->opcode() == spv::Op::OpString) { uint32_t string_id_id = builder.GetUintConstantId(*iid); val_ids.push_back(string_id_id); } else { @@ -176,7 +177,7 @@ void InstDebugPrintfPass::GenDebugPrintfCode( std::vector>* new_blocks) { // If not DebugPrintf OpExtInst, return. Instruction* printf_inst = &*ref_inst_itr; - if (printf_inst->opcode() != SpvOpExtInst) return; + if (printf_inst->opcode() != spv::Op::OpExtInst) return; if (printf_inst->GetSingleWordInOperand(0) != ext_inst_printf_id_) return; if (printf_inst->GetSingleWordInOperand(1) != NonSemanticDebugPrintfDebugPrintf) diff --git a/3rdparty/spirv-tools/source/opt/instruction.cpp b/3rdparty/spirv-tools/source/opt/instruction.cpp index e775a9926..ece6baf92 100644 --- a/3rdparty/spirv-tools/source/opt/instruction.cpp +++ b/3rdparty/spirv-tools/source/opt/instruction.cpp @@ -24,38 +24,37 @@ namespace spvtools { namespace opt { - namespace { // Indices used to get particular operands out of instructions using InOperand. -const uint32_t kTypeImageDimIndex = 1; -const uint32_t kLoadBaseIndex = 0; -const uint32_t kPointerTypeStorageClassIndex = 0; -const uint32_t kVariableStorageClassIndex = 0; -const uint32_t kTypeImageSampledIndex = 5; +constexpr uint32_t kTypeImageDimIndex = 1; +constexpr uint32_t kLoadBaseIndex = 0; +constexpr uint32_t kPointerTypeStorageClassIndex = 0; +constexpr uint32_t kVariableStorageClassIndex = 0; +constexpr uint32_t kTypeImageSampledIndex = 5; // Constants for OpenCL.DebugInfo.100 / NonSemantic.Shader.DebugInfo.100 // extension instructions. -const uint32_t kExtInstSetIdInIdx = 0; -const uint32_t kExtInstInstructionInIdx = 1; -const uint32_t kDebugScopeNumWords = 7; -const uint32_t kDebugScopeNumWordsWithoutInlinedAt = 6; -const uint32_t kDebugNoScopeNumWords = 5; +constexpr uint32_t kExtInstSetIdInIdx = 0; +constexpr uint32_t kExtInstInstructionInIdx = 1; +constexpr uint32_t kDebugScopeNumWords = 7; +constexpr uint32_t kDebugScopeNumWordsWithoutInlinedAt = 6; +constexpr uint32_t kDebugNoScopeNumWords = 5; // Number of operands of an OpBranchConditional instruction // with weights. -const uint32_t kOpBranchConditionalWithWeightsNumOperands = 5; +constexpr uint32_t kOpBranchConditionalWithWeightsNumOperands = 5; } // namespace Instruction::Instruction(IRContext* c) : utils::IntrusiveNodeBase(), context_(c), - opcode_(SpvOpNop), + opcode_(spv::Op::OpNop), has_type_id_(false), has_result_id_(false), unique_id_(c->TakeNextUniqueId()), dbg_scope_(kNoDebugScope, kNoInlinedAt) {} -Instruction::Instruction(IRContext* c, SpvOp op) +Instruction::Instruction(IRContext* c, spv::Op op) : utils::IntrusiveNodeBase(), context_(c), opcode_(op), @@ -68,12 +67,13 @@ Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst, std::vector&& dbg_line) : utils::IntrusiveNodeBase(), context_(c), - opcode_(static_cast(inst.opcode)), + opcode_(static_cast(inst.opcode)), has_type_id_(inst.type_id != 0), has_result_id_(inst.result_id != 0), unique_id_(c->TakeNextUniqueId()), dbg_line_insts_(std::move(dbg_line)), dbg_scope_(kNoDebugScope, kNoInlinedAt) { + operands_.reserve(inst.num_operands); for (uint32_t i = 0; i < inst.num_operands; ++i) { const auto& current_payload = inst.operands[i]; operands_.emplace_back( @@ -88,11 +88,12 @@ Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst, const DebugScope& dbg_scope) : utils::IntrusiveNodeBase(), context_(c), - opcode_(static_cast(inst.opcode)), + opcode_(static_cast(inst.opcode)), has_type_id_(inst.type_id != 0), has_result_id_(inst.result_id != 0), unique_id_(c->TakeNextUniqueId()), dbg_scope_(dbg_scope) { + operands_.reserve(inst.num_operands); for (uint32_t i = 0; i < inst.num_operands; ++i) { const auto& current_payload = inst.operands[i]; operands_.emplace_back( @@ -101,7 +102,7 @@ Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst, } } -Instruction::Instruction(IRContext* c, SpvOp op, uint32_t ty_id, +Instruction::Instruction(IRContext* c, spv::Op op, uint32_t ty_id, uint32_t res_id, const OperandList& in_operands) : utils::IntrusiveNodeBase(), context_(c), @@ -111,6 +112,14 @@ Instruction::Instruction(IRContext* c, SpvOp op, uint32_t ty_id, unique_id_(c->TakeNextUniqueId()), operands_(), dbg_scope_(kNoDebugScope, kNoInlinedAt) { + size_t operands_size = in_operands.size(); + if (has_type_id_) { + operands_size++; + } + if (has_result_id_) { + operands_size++; + } + operands_.reserve(operands_size); if (has_type_id_) { operands_.emplace_back(spv_operand_type_t::SPV_OPERAND_TYPE_TYPE_ID, std::initializer_list{ty_id}); @@ -179,7 +188,7 @@ uint32_t Instruction::NumInOperandWords() const { } bool Instruction::HasBranchWeights() const { - if (opcode_ == SpvOpBranchConditional && + if (opcode_ == spv::Op::OpBranchConditional && NumOperands() == kOpBranchConditionalWithWeightsNumOperands) { return true; } @@ -208,13 +217,13 @@ bool Instruction::IsReadOnlyLoad() const { return false; } - if (address_def->opcode() == SpvOpVariable) { + if (address_def->opcode() == spv::Op::OpVariable) { if (address_def->IsReadOnlyPointer()) { return true; } } - if (address_def->opcode() == SpvOpLoad) { + if (address_def->opcode() == spv::Op::OpLoad) { const analysis::Type* address_type = context()->get_type_mgr()->GetType(address_def->type_id()); if (address_type->AsSampledImage() != nullptr) { @@ -235,12 +244,12 @@ Instruction* Instruction::GetBaseAddress() const { bool done = false; while (!done) { switch (base_inst->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: - case SpvOpImageTexelPointer: - case SpvOpCopyObject: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpCopyObject: // All of these instructions have the base pointer use a base pointer // in in-operand 0. base = base_inst->GetSingleWordInOperand(0); @@ -255,20 +264,20 @@ Instruction* Instruction::GetBaseAddress() const { } bool Instruction::IsReadOnlyPointer() const { - if (context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) + if (context()->get_feature_mgr()->HasCapability(spv::Capability::Shader)) return IsReadOnlyPointerShaders(); else return IsReadOnlyPointerKernel(); } bool Instruction::IsVulkanStorageImage() const { - if (opcode() != SpvOpTypePointer) { + if (opcode() != spv::Op::OpTypePointer) { return false; } - uint32_t storage_class = - GetSingleWordInOperand(kPointerTypeStorageClassIndex); - if (storage_class != SpvStorageClassUniformConstant) { + spv::StorageClass storage_class = + spv::StorageClass(GetSingleWordInOperand(kPointerTypeStorageClassIndex)); + if (storage_class != spv::StorageClass::UniformConstant) { return false; } @@ -276,17 +285,18 @@ bool Instruction::IsVulkanStorageImage() const { context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); // Unpack the optional layer of arraying. - if (base_type->opcode() == SpvOpTypeArray || - base_type->opcode() == SpvOpTypeRuntimeArray) { + if (base_type->opcode() == spv::Op::OpTypeArray || + base_type->opcode() == spv::Op::OpTypeRuntimeArray) { base_type = context()->get_def_use_mgr()->GetDef( base_type->GetSingleWordInOperand(0)); } - if (base_type->opcode() != SpvOpTypeImage) { + if (base_type->opcode() != spv::Op::OpTypeImage) { return false; } - if (base_type->GetSingleWordInOperand(kTypeImageDimIndex) == SpvDimBuffer) { + if (spv::Dim(base_type->GetSingleWordInOperand(kTypeImageDimIndex)) == + spv::Dim::Buffer) { return false; } @@ -296,13 +306,13 @@ bool Instruction::IsVulkanStorageImage() const { } bool Instruction::IsVulkanSampledImage() const { - if (opcode() != SpvOpTypePointer) { + if (opcode() != spv::Op::OpTypePointer) { return false; } - uint32_t storage_class = - GetSingleWordInOperand(kPointerTypeStorageClassIndex); - if (storage_class != SpvStorageClassUniformConstant) { + spv::StorageClass storage_class = + spv::StorageClass(GetSingleWordInOperand(kPointerTypeStorageClassIndex)); + if (storage_class != spv::StorageClass::UniformConstant) { return false; } @@ -310,17 +320,18 @@ bool Instruction::IsVulkanSampledImage() const { context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); // Unpack the optional layer of arraying. - if (base_type->opcode() == SpvOpTypeArray || - base_type->opcode() == SpvOpTypeRuntimeArray) { + if (base_type->opcode() == spv::Op::OpTypeArray || + base_type->opcode() == spv::Op::OpTypeRuntimeArray) { base_type = context()->get_def_use_mgr()->GetDef( base_type->GetSingleWordInOperand(0)); } - if (base_type->opcode() != SpvOpTypeImage) { + if (base_type->opcode() != spv::Op::OpTypeImage) { return false; } - if (base_type->GetSingleWordInOperand(kTypeImageDimIndex) == SpvDimBuffer) { + if (spv::Dim(base_type->GetSingleWordInOperand(kTypeImageDimIndex)) == + spv::Dim::Buffer) { return false; } @@ -330,13 +341,13 @@ bool Instruction::IsVulkanSampledImage() const { } bool Instruction::IsVulkanStorageTexelBuffer() const { - if (opcode() != SpvOpTypePointer) { + if (opcode() != spv::Op::OpTypePointer) { return false; } - uint32_t storage_class = - GetSingleWordInOperand(kPointerTypeStorageClassIndex); - if (storage_class != SpvStorageClassUniformConstant) { + spv::StorageClass storage_class = + spv::StorageClass(GetSingleWordInOperand(kPointerTypeStorageClassIndex)); + if (storage_class != spv::StorageClass::UniformConstant) { return false; } @@ -344,17 +355,18 @@ bool Instruction::IsVulkanStorageTexelBuffer() const { context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); // Unpack the optional layer of arraying. - if (base_type->opcode() == SpvOpTypeArray || - base_type->opcode() == SpvOpTypeRuntimeArray) { + if (base_type->opcode() == spv::Op::OpTypeArray || + base_type->opcode() == spv::Op::OpTypeRuntimeArray) { base_type = context()->get_def_use_mgr()->GetDef( base_type->GetSingleWordInOperand(0)); } - if (base_type->opcode() != SpvOpTypeImage) { + if (base_type->opcode() != spv::Op::OpTypeImage) { return false; } - if (base_type->GetSingleWordInOperand(kTypeImageDimIndex) != SpvDimBuffer) { + if (spv::Dim(base_type->GetSingleWordInOperand(kTypeImageDimIndex)) != + spv::Dim::Buffer) { return false; } @@ -366,7 +378,7 @@ bool Instruction::IsVulkanStorageTexelBuffer() const { bool Instruction::IsVulkanStorageBuffer() const { // Is there a difference between a "Storage buffer" and a "dynamic storage // buffer" in SPIR-V and do we care about the difference? - if (opcode() != SpvOpTypePointer) { + if (opcode() != spv::Op::OpTypePointer) { return false; } @@ -374,28 +386,28 @@ bool Instruction::IsVulkanStorageBuffer() const { context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); // Unpack the optional layer of arraying. - if (base_type->opcode() == SpvOpTypeArray || - base_type->opcode() == SpvOpTypeRuntimeArray) { + if (base_type->opcode() == spv::Op::OpTypeArray || + base_type->opcode() == spv::Op::OpTypeRuntimeArray) { base_type = context()->get_def_use_mgr()->GetDef( base_type->GetSingleWordInOperand(0)); } - if (base_type->opcode() != SpvOpTypeStruct) { + if (base_type->opcode() != spv::Op::OpTypeStruct) { return false; } - uint32_t storage_class = - GetSingleWordInOperand(kPointerTypeStorageClassIndex); - if (storage_class == SpvStorageClassUniform) { + spv::StorageClass storage_class = + spv::StorageClass(GetSingleWordInOperand(kPointerTypeStorageClassIndex)); + if (storage_class == spv::StorageClass::Uniform) { bool is_buffer_block = false; context()->get_decoration_mgr()->ForEachDecoration( - base_type->result_id(), SpvDecorationBufferBlock, + base_type->result_id(), uint32_t(spv::Decoration::BufferBlock), [&is_buffer_block](const Instruction&) { is_buffer_block = true; }); return is_buffer_block; - } else if (storage_class == SpvStorageClassStorageBuffer) { + } else if (storage_class == spv::StorageClass::StorageBuffer) { bool is_block = false; context()->get_decoration_mgr()->ForEachDecoration( - base_type->result_id(), SpvDecorationBlock, + base_type->result_id(), uint32_t(spv::Decoration::Block), [&is_block](const Instruction&) { is_block = true; }); return is_block; } @@ -403,13 +415,14 @@ bool Instruction::IsVulkanStorageBuffer() const { } bool Instruction::IsVulkanStorageBufferVariable() const { - if (opcode() != SpvOpVariable) { + if (opcode() != spv::Op::OpVariable) { return false; } - uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex); - if (storage_class == SpvStorageClassStorageBuffer || - storage_class == SpvStorageClassUniform) { + spv::StorageClass storage_class = + spv::StorageClass(GetSingleWordInOperand(kVariableStorageClassIndex)); + if (storage_class == spv::StorageClass::StorageBuffer || + storage_class == spv::StorageClass::Uniform) { Instruction* var_type = context()->get_def_use_mgr()->GetDef(type_id()); return var_type != nullptr && var_type->IsVulkanStorageBuffer(); } @@ -418,13 +431,13 @@ bool Instruction::IsVulkanStorageBufferVariable() const { } bool Instruction::IsVulkanUniformBuffer() const { - if (opcode() != SpvOpTypePointer) { + if (opcode() != spv::Op::OpTypePointer) { return false; } - uint32_t storage_class = - GetSingleWordInOperand(kPointerTypeStorageClassIndex); - if (storage_class != SpvStorageClassUniform) { + spv::StorageClass storage_class = + spv::StorageClass(GetSingleWordInOperand(kPointerTypeStorageClassIndex)); + if (storage_class != spv::StorageClass::Uniform) { return false; } @@ -432,19 +445,19 @@ bool Instruction::IsVulkanUniformBuffer() const { context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(1)); // Unpack the optional layer of arraying. - if (base_type->opcode() == SpvOpTypeArray || - base_type->opcode() == SpvOpTypeRuntimeArray) { + if (base_type->opcode() == spv::Op::OpTypeArray || + base_type->opcode() == spv::Op::OpTypeRuntimeArray) { base_type = context()->get_def_use_mgr()->GetDef( base_type->GetSingleWordInOperand(0)); } - if (base_type->opcode() != SpvOpTypeStruct) { + if (base_type->opcode() != spv::Op::OpTypeStruct) { return false; } bool is_block = false; context()->get_decoration_mgr()->ForEachDecoration( - base_type->result_id(), SpvDecorationBlock, + base_type->result_id(), uint32_t(spv::Decoration::Block), [&is_block](const Instruction&) { is_block = true; }); return is_block; } @@ -455,27 +468,27 @@ bool Instruction::IsReadOnlyPointerShaders() const { } Instruction* type_def = context()->get_def_use_mgr()->GetDef(type_id()); - if (type_def->opcode() != SpvOpTypePointer) { + if (type_def->opcode() != spv::Op::OpTypePointer) { return false; } - uint32_t storage_class = - type_def->GetSingleWordInOperand(kPointerTypeStorageClassIndex); + spv::StorageClass storage_class = spv::StorageClass( + type_def->GetSingleWordInOperand(kPointerTypeStorageClassIndex)); switch (storage_class) { - case SpvStorageClassUniformConstant: + case spv::StorageClass::UniformConstant: if (!type_def->IsVulkanStorageImage() && !type_def->IsVulkanStorageTexelBuffer()) { return true; } break; - case SpvStorageClassUniform: + case spv::StorageClass::Uniform: if (!type_def->IsVulkanStorageBuffer()) { return true; } break; - case SpvStorageClassPushConstant: - case SpvStorageClassInput: + case spv::StorageClass::PushConstant: + case spv::StorageClass::Input: return true; default: break; @@ -483,7 +496,7 @@ bool Instruction::IsReadOnlyPointerShaders() const { bool is_nonwritable = false; context()->get_decoration_mgr()->ForEachDecoration( - result_id(), SpvDecorationNonWritable, + result_id(), uint32_t(spv::Decoration::NonWritable), [&is_nonwritable](const Instruction&) { is_nonwritable = true; }); return is_nonwritable; } @@ -494,14 +507,14 @@ bool Instruction::IsReadOnlyPointerKernel() const { } Instruction* type_def = context()->get_def_use_mgr()->GetDef(type_id()); - if (type_def->opcode() != SpvOpTypePointer) { + if (type_def->opcode() != spv::Op::OpTypePointer) { return false; } - uint32_t storage_class = - type_def->GetSingleWordInOperand(kPointerTypeStorageClassIndex); + spv::StorageClass storage_class = spv::StorageClass( + type_def->GetSingleWordInOperand(kPointerTypeStorageClassIndex)); - return storage_class == SpvStorageClassUniformConstant; + return storage_class == spv::StorageClass::UniformConstant; } void Instruction::UpdateLexicalScope(uint32_t scope) { @@ -564,13 +577,13 @@ bool Instruction::IsDebugLineInst() const { bool Instruction::IsLineInst() const { return IsLine() || IsNoLine(); } bool Instruction::IsLine() const { - if (opcode() == SpvOpLine) return true; + if (opcode() == spv::Op::OpLine) return true; NonSemanticShaderDebugInfo100Instructions ext_opt = GetShader100DebugOpcode(); return ext_opt == NonSemanticShaderDebugInfo100DebugLine; } bool Instruction::IsNoLine() const { - if (opcode() == SpvOpNoLine) return true; + if (opcode() == spv::Op::OpNoLine) return true; NonSemanticShaderDebugInfo100Instructions ext_opt = GetShader100DebugOpcode(); return ext_opt == NonSemanticShaderDebugInfo100DebugNoLine; } @@ -597,33 +610,35 @@ bool Instruction::IsValidBasePointer() const { } Instruction* type = context()->get_def_use_mgr()->GetDef(tid); - if (type->opcode() != SpvOpTypePointer) { + if (type->opcode() != spv::Op::OpTypePointer) { return false; } auto feature_mgr = context()->get_feature_mgr(); - if (feature_mgr->HasCapability(SpvCapabilityAddresses)) { + if (feature_mgr->HasCapability(spv::Capability::Addresses)) { // TODO: The rules here could be more restrictive. return true; } - if (opcode() == SpvOpVariable || opcode() == SpvOpFunctionParameter) { + if (opcode() == spv::Op::OpVariable || + opcode() == spv::Op::OpFunctionParameter) { return true; } // With variable pointers, there are more valid base pointer objects. // Variable pointers implicitly declares Variable pointers storage buffer. - SpvStorageClass storage_class = - static_cast(type->GetSingleWordInOperand(0)); - if ((feature_mgr->HasCapability(SpvCapabilityVariablePointersStorageBuffer) && - storage_class == SpvStorageClassStorageBuffer) || - (feature_mgr->HasCapability(SpvCapabilityVariablePointers) && - storage_class == SpvStorageClassWorkgroup)) { + spv::StorageClass storage_class = + static_cast(type->GetSingleWordInOperand(0)); + if ((feature_mgr->HasCapability( + spv::Capability::VariablePointersStorageBuffer) && + storage_class == spv::StorageClass::StorageBuffer) || + (feature_mgr->HasCapability(spv::Capability::VariablePointers) && + storage_class == spv::StorageClass::Workgroup)) { switch (opcode()) { - case SpvOpPhi: - case SpvOpSelect: - case SpvOpFunctionCall: - case SpvOpConstantNull: + case spv::Op::OpPhi: + case spv::Op::OpSelect: + case spv::Op::OpFunctionCall: + case spv::Op::OpConstantNull: return true; default: break; @@ -641,7 +656,7 @@ bool Instruction::IsValidBasePointer() const { } OpenCLDebugInfo100Instructions Instruction::GetOpenCL100DebugOpcode() const { - if (opcode() != SpvOpExtInst) { + if (opcode() != spv::Op::OpExtInst) { return OpenCLDebugInfo100InstructionsMax; } @@ -660,7 +675,7 @@ OpenCLDebugInfo100Instructions Instruction::GetOpenCL100DebugOpcode() const { NonSemanticShaderDebugInfo100Instructions Instruction::GetShader100DebugOpcode() const { - if (opcode() != SpvOpExtInst) { + if (opcode() != spv::Op::OpExtInst) { return NonSemanticShaderDebugInfo100InstructionsMax; } @@ -682,7 +697,7 @@ NonSemanticShaderDebugInfo100Instructions Instruction::GetShader100DebugOpcode() } CommonDebugInfoInstructions Instruction::GetCommonDebugOpcode() const { - if (opcode() != SpvOpExtInst) { + if (opcode() != spv::Op::OpExtInst) { return CommonDebugInfoInstructionsMax; } @@ -712,25 +727,25 @@ bool Instruction::IsValidBaseImage() const { } Instruction* type = context()->get_def_use_mgr()->GetDef(tid); - return (type->opcode() == SpvOpTypeImage || - type->opcode() == SpvOpTypeSampledImage); + return (type->opcode() == spv::Op::OpTypeImage || + type->opcode() == spv::Op::OpTypeSampledImage); } bool Instruction::IsOpaqueType() const { - if (opcode() == SpvOpTypeStruct) { + if (opcode() == spv::Op::OpTypeStruct) { bool is_opaque = false; ForEachInOperand([&is_opaque, this](const uint32_t* op_id) { Instruction* type_inst = context()->get_def_use_mgr()->GetDef(*op_id); is_opaque |= type_inst->IsOpaqueType(); }); return is_opaque; - } else if (opcode() == SpvOpTypeArray) { + } else if (opcode() == spv::Op::OpTypeArray) { uint32_t sub_type_id = GetSingleWordInOperand(0); Instruction* sub_type_inst = context()->get_def_use_mgr()->GetDef(sub_type_id); return sub_type_inst->IsOpaqueType(); } else { - return opcode() == SpvOpTypeRuntimeArray || + return opcode() == spv::Op::OpTypeRuntimeArray || spvOpcodeIsBaseOpaqueType(opcode()); } } @@ -765,22 +780,23 @@ bool Instruction::IsFoldableByFoldScalar() const { bool Instruction::IsFloatingPointFoldingAllowed() const { // TODO: Add the rules for kernels. For now it will be pessimistic. // For now, do not support capabilities introduced by SPV_KHR_float_controls. - if (!context_->get_feature_mgr()->HasCapability(SpvCapabilityShader) || - context_->get_feature_mgr()->HasCapability(SpvCapabilityDenormPreserve) || + if (!context_->get_feature_mgr()->HasCapability(spv::Capability::Shader) || context_->get_feature_mgr()->HasCapability( - SpvCapabilityDenormFlushToZero) || + spv::Capability::DenormPreserve) || context_->get_feature_mgr()->HasCapability( - SpvCapabilitySignedZeroInfNanPreserve) || + spv::Capability::DenormFlushToZero) || context_->get_feature_mgr()->HasCapability( - SpvCapabilityRoundingModeRTZ) || + spv::Capability::SignedZeroInfNanPreserve) || context_->get_feature_mgr()->HasCapability( - SpvCapabilityRoundingModeRTE)) { + spv::Capability::RoundingModeRTZ) || + context_->get_feature_mgr()->HasCapability( + spv::Capability::RoundingModeRTE)) { return false; } bool is_nocontract = false; context_->get_decoration_mgr()->WhileEachDecoration( - result_id(), SpvDecorationNoContraction, + result_id(), uint32_t(spv::Decoration::NoContraction), [&is_nocontract](const Instruction&) { is_nocontract = true; return false; @@ -816,101 +832,101 @@ void Instruction::Dump() const { bool Instruction::IsOpcodeCodeMotionSafe() const { switch (opcode_) { - case SpvOpNop: - case SpvOpUndef: - case SpvOpLoad: - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpArrayLength: - case SpvOpVectorExtractDynamic: - case SpvOpVectorInsertDynamic: - case SpvOpVectorShuffle: - case SpvOpCompositeConstruct: - case SpvOpCompositeExtract: - case SpvOpCompositeInsert: - case SpvOpCopyObject: - case SpvOpTranspose: - case SpvOpConvertFToU: - case SpvOpConvertFToS: - case SpvOpConvertSToF: - case SpvOpConvertUToF: - case SpvOpUConvert: - case SpvOpSConvert: - case SpvOpFConvert: - case SpvOpQuantizeToF16: - case SpvOpBitcast: - case SpvOpSNegate: - case SpvOpFNegate: - case SpvOpIAdd: - case SpvOpFAdd: - case SpvOpISub: - case SpvOpFSub: - case SpvOpIMul: - case SpvOpFMul: - case SpvOpUDiv: - case SpvOpSDiv: - case SpvOpFDiv: - case SpvOpUMod: - case SpvOpSRem: - case SpvOpSMod: - case SpvOpFRem: - case SpvOpFMod: - case SpvOpVectorTimesScalar: - case SpvOpMatrixTimesScalar: - case SpvOpVectorTimesMatrix: - case SpvOpMatrixTimesVector: - case SpvOpMatrixTimesMatrix: - case SpvOpOuterProduct: - case SpvOpDot: - case SpvOpIAddCarry: - case SpvOpISubBorrow: - case SpvOpUMulExtended: - case SpvOpSMulExtended: - case SpvOpAny: - case SpvOpAll: - case SpvOpIsNan: - case SpvOpIsInf: - case SpvOpLogicalEqual: - case SpvOpLogicalNotEqual: - case SpvOpLogicalOr: - case SpvOpLogicalAnd: - case SpvOpLogicalNot: - case SpvOpSelect: - case SpvOpIEqual: - case SpvOpINotEqual: - case SpvOpUGreaterThan: - case SpvOpSGreaterThan: - case SpvOpUGreaterThanEqual: - case SpvOpSGreaterThanEqual: - case SpvOpULessThan: - case SpvOpSLessThan: - case SpvOpULessThanEqual: - case SpvOpSLessThanEqual: - case SpvOpFOrdEqual: - case SpvOpFUnordEqual: - case SpvOpFOrdNotEqual: - case SpvOpFUnordNotEqual: - case SpvOpFOrdLessThan: - case SpvOpFUnordLessThan: - case SpvOpFOrdGreaterThan: - case SpvOpFUnordGreaterThan: - case SpvOpFOrdLessThanEqual: - case SpvOpFUnordLessThanEqual: - case SpvOpFOrdGreaterThanEqual: - case SpvOpFUnordGreaterThanEqual: - case SpvOpShiftRightLogical: - case SpvOpShiftRightArithmetic: - case SpvOpShiftLeftLogical: - case SpvOpBitwiseOr: - case SpvOpBitwiseXor: - case SpvOpBitwiseAnd: - case SpvOpNot: - case SpvOpBitFieldInsert: - case SpvOpBitFieldSExtract: - case SpvOpBitFieldUExtract: - case SpvOpBitReverse: - case SpvOpBitCount: - case SpvOpSizeOf: + case spv::Op::OpNop: + case spv::Op::OpUndef: + case spv::Op::OpLoad: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpArrayLength: + case spv::Op::OpVectorExtractDynamic: + case spv::Op::OpVectorInsertDynamic: + case spv::Op::OpVectorShuffle: + case spv::Op::OpCompositeConstruct: + case spv::Op::OpCompositeExtract: + case spv::Op::OpCompositeInsert: + case spv::Op::OpCopyObject: + case spv::Op::OpTranspose: + case spv::Op::OpConvertFToU: + case spv::Op::OpConvertFToS: + case spv::Op::OpConvertSToF: + case spv::Op::OpConvertUToF: + case spv::Op::OpUConvert: + case spv::Op::OpSConvert: + case spv::Op::OpFConvert: + case spv::Op::OpQuantizeToF16: + case spv::Op::OpBitcast: + case spv::Op::OpSNegate: + case spv::Op::OpFNegate: + case spv::Op::OpIAdd: + case spv::Op::OpFAdd: + case spv::Op::OpISub: + case spv::Op::OpFSub: + case spv::Op::OpIMul: + case spv::Op::OpFMul: + case spv::Op::OpUDiv: + case spv::Op::OpSDiv: + case spv::Op::OpFDiv: + case spv::Op::OpUMod: + case spv::Op::OpSRem: + case spv::Op::OpSMod: + case spv::Op::OpFRem: + case spv::Op::OpFMod: + case spv::Op::OpVectorTimesScalar: + case spv::Op::OpMatrixTimesScalar: + case spv::Op::OpVectorTimesMatrix: + case spv::Op::OpMatrixTimesVector: + case spv::Op::OpMatrixTimesMatrix: + case spv::Op::OpOuterProduct: + case spv::Op::OpDot: + case spv::Op::OpIAddCarry: + case spv::Op::OpISubBorrow: + case spv::Op::OpUMulExtended: + case spv::Op::OpSMulExtended: + case spv::Op::OpAny: + case spv::Op::OpAll: + case spv::Op::OpIsNan: + case spv::Op::OpIsInf: + case spv::Op::OpLogicalEqual: + case spv::Op::OpLogicalNotEqual: + case spv::Op::OpLogicalOr: + case spv::Op::OpLogicalAnd: + case spv::Op::OpLogicalNot: + case spv::Op::OpSelect: + case spv::Op::OpIEqual: + case spv::Op::OpINotEqual: + case spv::Op::OpUGreaterThan: + case spv::Op::OpSGreaterThan: + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpULessThan: + case spv::Op::OpSLessThan: + case spv::Op::OpULessThanEqual: + case spv::Op::OpSLessThanEqual: + case spv::Op::OpFOrdEqual: + case spv::Op::OpFUnordEqual: + case spv::Op::OpFOrdNotEqual: + case spv::Op::OpFUnordNotEqual: + case spv::Op::OpFOrdLessThan: + case spv::Op::OpFUnordLessThan: + case spv::Op::OpFOrdGreaterThan: + case spv::Op::OpFUnordGreaterThan: + case spv::Op::OpFOrdLessThanEqual: + case spv::Op::OpFUnordLessThanEqual: + case spv::Op::OpFOrdGreaterThanEqual: + case spv::Op::OpFUnordGreaterThanEqual: + case spv::Op::OpShiftRightLogical: + case spv::Op::OpShiftRightArithmetic: + case spv::Op::OpShiftLeftLogical: + case spv::Op::OpBitwiseOr: + case spv::Op::OpBitwiseXor: + case spv::Op::OpBitwiseAnd: + case spv::Op::OpNot: + case spv::Op::OpBitFieldInsert: + case spv::Op::OpBitFieldSExtract: + case spv::Op::OpBitFieldUExtract: + case spv::Op::OpBitReverse: + case spv::Op::OpBitCount: + case spv::Op::OpSizeOf: return true; default: return false; @@ -922,7 +938,7 @@ bool Instruction::IsScalarizable() const { return true; } - if (opcode() == SpvOpExtInst) { + if (opcode() == spv::Op::OpExtInst) { uint32_t instSetId = context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450(); @@ -997,16 +1013,16 @@ bool Instruction::IsOpcodeSafeToDelete() const { } switch (opcode()) { - case SpvOpDPdx: - case SpvOpDPdy: - case SpvOpFwidth: - case SpvOpDPdxFine: - case SpvOpDPdyFine: - case SpvOpFwidthFine: - case SpvOpDPdxCoarse: - case SpvOpDPdyCoarse: - case SpvOpFwidthCoarse: - case SpvOpImageQueryLod: + case spv::Op::OpDPdx: + case spv::Op::OpDPdy: + case spv::Op::OpFwidth: + case spv::Op::OpDPdxFine: + case spv::Op::OpDPdyFine: + case spv::Op::OpFwidthFine: + case spv::Op::OpDPdxCoarse: + case spv::Op::OpDPdyCoarse: + case spv::Op::OpFwidthCoarse: + case spv::Op::OpImageQueryLod: return true; default: return false; @@ -1015,7 +1031,7 @@ bool Instruction::IsOpcodeSafeToDelete() const { bool Instruction::IsNonSemanticInstruction() const { if (!HasResultId()) return false; - if (opcode() != SpvOpExtInst) return false; + if (opcode() != spv::Op::OpExtInst) return false; auto import_inst = context()->get_def_use_mgr()->GetDef(GetSingleWordInOperand(0)); @@ -1035,7 +1051,7 @@ void DebugScope::ToBinary(uint32_t type_id, uint32_t result_id, num_words = kDebugScopeNumWordsWithoutInlinedAt; } std::vector operands = { - (num_words << 16) | static_cast(SpvOpExtInst), + (num_words << 16) | static_cast(spv::Op::OpExtInst), type_id, result_id, ext_set, diff --git a/3rdparty/spirv-tools/source/opt/instruction.h b/3rdparty/spirv-tools/source/opt/instruction.h index e79c6289b..22736bff8 100644 --- a/3rdparty/spirv-tools/source/opt/instruction.h +++ b/3rdparty/spirv-tools/source/opt/instruction.h @@ -36,8 +36,8 @@ #include "source/util/string_utils.h" #include "spirv-tools/libspirv.h" -const uint32_t kNoDebugScope = 0; -const uint32_t kNoInlinedAt = 0; +constexpr uint32_t kNoDebugScope = 0; +constexpr uint32_t kNoInlinedAt = 0; namespace spvtools { namespace opt { @@ -190,7 +190,7 @@ class Instruction : public utils::IntrusiveNodeBase { Instruction() : utils::IntrusiveNodeBase(), context_(nullptr), - opcode_(SpvOpNop), + opcode_(spv::Op::OpNop), has_type_id_(false), has_result_id_(false), unique_id_(0), @@ -200,7 +200,7 @@ class Instruction : public utils::IntrusiveNodeBase { Instruction(IRContext*); // Creates an instruction with the given opcode |op| and no additional logical // operands. - Instruction(IRContext*, SpvOp); + Instruction(IRContext*, spv::Op); // Creates an instruction using the given spv_parsed_instruction_t |inst|. All // the data inside |inst| will be copied and owned in this instance. And keep // record of line-related debug instructions |dbg_line| ahead of this @@ -213,7 +213,7 @@ class Instruction : public utils::IntrusiveNodeBase { // Creates an instruction with the given opcode |op|, type id: |ty_id|, // result id: |res_id| and input operands: |in_operands|. - Instruction(IRContext* c, SpvOp op, uint32_t ty_id, uint32_t res_id, + Instruction(IRContext* c, spv::Op op, uint32_t ty_id, uint32_t res_id, const OperandList& in_operands); // TODO: I will want to remove these, but will first have to remove the use of @@ -235,12 +235,12 @@ class Instruction : public utils::IntrusiveNodeBase { IRContext* context() const { return context_; } - SpvOp opcode() const { return opcode_; } + spv::Op opcode() const { return opcode_; } // Sets the opcode of this instruction to a specific opcode. Note this may // invalidate the instruction. // TODO(qining): Remove this function when instruction building and insertion // is well implemented. - void SetOpcode(SpvOp op) { opcode_ = op; } + void SetOpcode(spv::Op op) { opcode_ = op; } uint32_t type_id() const { return has_type_id_ ? GetSingleWordOperand(0) : 0; } @@ -625,7 +625,7 @@ class Instruction : public utils::IntrusiveNodeBase { bool IsValidBaseImage() const; IRContext* context_; // IR Context - SpvOp opcode_; // Opcode + spv::Op opcode_; // Opcode bool has_type_id_; // True if the instruction has a type id bool has_result_id_; // True if the instruction has a result id uint32_t unique_id_; // Unique instruction id @@ -732,12 +732,12 @@ inline void Instruction::SetResultType(uint32_t ty_id) { } inline bool Instruction::IsNop() const { - return opcode_ == SpvOpNop && !has_type_id_ && !has_result_id_ && + return opcode_ == spv::Op::OpNop && !has_type_id_ && !has_result_id_ && operands_.empty(); } inline void Instruction::ToNop() { - opcode_ = SpvOpNop; + opcode_ = spv::Op::OpNop; has_type_id_ = false; has_result_id_ = false; operands_.clear(); @@ -879,12 +879,12 @@ inline void Instruction::ForEachInOperand( inline bool Instruction::HasLabels() const { switch (opcode_) { - case SpvOpSelectionMerge: - case SpvOpBranch: - case SpvOpLoopMerge: - case SpvOpBranchConditional: - case SpvOpSwitch: - case SpvOpPhi: + case spv::Op::OpSelectionMerge: + case spv::Op::OpBranch: + case spv::Op::OpLoopMerge: + case spv::Op::OpBranchConditional: + case spv::Op::OpSwitch: + case spv::Op::OpPhi: return true; break; default: diff --git a/3rdparty/spirv-tools/source/opt/instrument_pass.cpp b/3rdparty/spirv-tools/source/opt/instrument_pass.cpp index d143d5959..441d943f7 100644 --- a/3rdparty/spirv-tools/source/opt/instrument_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/instrument_pass.cpp @@ -19,20 +19,15 @@ #include "source/cfa.h" #include "source/spirv_constant.h" -namespace { - -// Common Parameter Positions -static const int kInstCommonParamInstIdx = 0; -static const int kInstCommonParamCnt = 1; - -// Indices of operands in SPIR-V instructions -static const int kEntryPointExecutionModelInIdx = 0; -static const int kEntryPointFunctionIdInIdx = 1; - -} // anonymous namespace - namespace spvtools { namespace opt { +namespace { +// Common Parameter Positions +constexpr int kInstCommonParamInstIdx = 0; +constexpr int kInstCommonParamCnt = 1; +// Indices of operands in SPIR-V instructions +constexpr int kEntryPointFunctionIdInIdx = 1; +} // namespace void InstrumentPass::MovePreludeCode( BasicBlock::iterator ref_inst_itr, @@ -83,7 +78,7 @@ void InstrumentPass::MovePostludeCode( std::unique_ptr InstrumentPass::NewLabel(uint32_t label_id) { std::unique_ptr newLabel( - new Instruction(context(), SpvOpLabel, 0, label_id, {})); + new Instruction(context(), spv::Op::OpLabel, 0, label_id, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*newLabel); return newLabel; } @@ -91,7 +86,7 @@ std::unique_ptr InstrumentPass::NewLabel(uint32_t label_id) { std::unique_ptr InstrumentPass::NewName( uint32_t id, const std::string& name_str) { std::unique_ptr new_name(new Instruction( - context(), SpvOpName, 0, 0, + context(), spv::Op::OpName, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {id}}, {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}})); @@ -124,7 +119,7 @@ std::unique_ptr InstrumentPass::NewGlobalName( std::unique_ptr InstrumentPass::NewMemberName( uint32_t id, uint32_t member_index, const std::string& name_str) { std::unique_ptr new_name(new Instruction( - context(), SpvOpMemberName, 0, 0, + context(), spv::Op::OpMemberName, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {id}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, {member_index}}, @@ -145,10 +140,10 @@ uint32_t InstrumentPass::Gen32BitCvtCode(uint32_t val_id, analysis::Type* val_32b_reg_ty = type_mgr->GetRegisteredType(&val_32b_ty); uint32_t val_32b_reg_ty_id = type_mgr->GetId(val_32b_reg_ty); if (is_signed) - return builder->AddUnaryOp(val_32b_reg_ty_id, SpvOpSConvert, val_id) + return builder->AddUnaryOp(val_32b_reg_ty_id, spv::Op::OpSConvert, val_id) ->result_id(); else - return builder->AddUnaryOp(val_32b_reg_ty_id, SpvOpUConvert, val_id) + return builder->AddUnaryOp(val_32b_reg_ty_id, spv::Op::OpUConvert, val_id) ->result_id(); } @@ -161,7 +156,7 @@ uint32_t InstrumentPass::GenUintCastCode(uint32_t val_id, uint32_t val_ty_id = get_def_use_mgr()->GetDef(val_32b_id)->type_id(); analysis::Integer* val_ty = type_mgr->GetType(val_ty_id)->AsInteger(); if (!val_ty->IsSigned()) return val_32b_id; - return builder->AddUnaryOp(GetUintId(), SpvOpBitcast, val_32b_id) + return builder->AddUnaryOp(GetUintId(), spv::Op::OpBitcast, val_32b_id) ->result_id(); } @@ -173,15 +168,16 @@ void InstrumentPass::GenDebugOutputFieldCode(uint32_t base_offset_id, uint32_t val_id = GenUintCastCode(field_value_id, builder); // Store value Instruction* data_idx_inst = - builder->AddBinaryOp(GetUintId(), SpvOpIAdd, base_offset_id, + builder->AddBinaryOp(GetUintId(), spv::Op::OpIAdd, base_offset_id, builder->GetUintConstantId(field_offset)); uint32_t buf_id = GetOutputBufferId(); uint32_t buf_uint_ptr_id = GetOutputBufferPtrId(); Instruction* achain_inst = - builder->AddTernaryOp(buf_uint_ptr_id, SpvOpAccessChain, buf_id, + builder->AddTernaryOp(buf_uint_ptr_id, spv::Op::OpAccessChain, buf_id, builder->GetUintConstantId(kDebugOutputDataOffset), data_idx_inst->result_id()); - (void)builder->AddBinaryOp(0, SpvOpStore, achain_inst->result_id(), val_id); + (void)builder->AddBinaryOp(0, spv::Op::OpStore, achain_inst->result_id(), + val_id); } void InstrumentPass::GenCommonStreamWriteCode(uint32_t record_sz, @@ -207,7 +203,7 @@ void InstrumentPass::GenFragCoordEltDebugOutputCode( uint32_t base_offset_id, uint32_t uint_frag_coord_id, uint32_t element, InstructionBuilder* builder) { Instruction* element_val_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, uint_frag_coord_id, element); + GetUintId(), spv::Op::OpCompositeExtract, uint_frag_coord_id, element); GenDebugOutputFieldCode(base_offset_id, kInstFragOutFragCoordX + element, element_val_inst->result_id(), builder); } @@ -216,7 +212,8 @@ uint32_t InstrumentPass::GenVarLoad(uint32_t var_id, InstructionBuilder* builder) { Instruction* var_inst = get_def_use_mgr()->GetDef(var_id); uint32_t type_id = GetPointeeTypeId(var_inst); - Instruction* load_inst = builder->AddUnaryOp(type_id, SpvOpLoad, var_id); + Instruction* load_inst = + builder->AddUnaryOp(type_id, spv::Op::OpLoad, var_id); return load_inst->result_id(); } @@ -233,31 +230,31 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx, uint32_t base_offset_id, InstructionBuilder* builder) { // TODO(greg-lunarg): Add support for all stages - switch (stage_idx) { - case SpvExecutionModelVertex: { + switch (spv::ExecutionModel(stage_idx)) { + case spv::ExecutionModel::Vertex: { // Load and store VertexId and InstanceId GenBuiltinOutputCode( - context()->GetBuiltinInputVarId(SpvBuiltInVertexIndex), + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::VertexIndex)), kInstVertOutVertexIndex, base_offset_id, builder); - GenBuiltinOutputCode( - context()->GetBuiltinInputVarId(SpvBuiltInInstanceIndex), - kInstVertOutInstanceIndex, base_offset_id, builder); + GenBuiltinOutputCode(context()->GetBuiltinInputVarId( + uint32_t(spv::BuiltIn::InstanceIndex)), + kInstVertOutInstanceIndex, base_offset_id, builder); } break; - case SpvExecutionModelGLCompute: - case SpvExecutionModelTaskNV: - case SpvExecutionModelMeshNV: - case SpvExecutionModelTaskEXT: - case SpvExecutionModelMeshEXT: { + case spv::ExecutionModel::GLCompute: + case spv::ExecutionModel::TaskNV: + case spv::ExecutionModel::MeshNV: + case spv::ExecutionModel::TaskEXT: + case spv::ExecutionModel::MeshEXT: { // Load and store GlobalInvocationId. - uint32_t load_id = GenVarLoad( - context()->GetBuiltinInputVarId(SpvBuiltInGlobalInvocationId), - builder); + uint32_t load_id = GenVarLoad(context()->GetBuiltinInputVarId(uint32_t( + spv::BuiltIn::GlobalInvocationId)), + builder); Instruction* x_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, load_id, 0); + GetUintId(), spv::Op::OpCompositeExtract, load_id, 0); Instruction* y_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, load_id, 1); + GetUintId(), spv::Op::OpCompositeExtract, load_id, 1); Instruction* z_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, load_id, 2); + GetUintId(), spv::Op::OpCompositeExtract, load_id, 2); GenDebugOutputFieldCode(base_offset_id, kInstCompOutGlobalInvocationIdX, x_inst->result_id(), builder); GenDebugOutputFieldCode(base_offset_id, kInstCompOutGlobalInvocationIdY, @@ -265,69 +262,71 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx, GenDebugOutputFieldCode(base_offset_id, kInstCompOutGlobalInvocationIdZ, z_inst->result_id(), builder); } break; - case SpvExecutionModelGeometry: { + case spv::ExecutionModel::Geometry: { // Load and store PrimitiveId and InvocationId. GenBuiltinOutputCode( - context()->GetBuiltinInputVarId(SpvBuiltInPrimitiveId), + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)), kInstGeomOutPrimitiveId, base_offset_id, builder); GenBuiltinOutputCode( - context()->GetBuiltinInputVarId(SpvBuiltInInvocationId), + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::InvocationId)), kInstGeomOutInvocationId, base_offset_id, builder); } break; - case SpvExecutionModelTessellationControl: { + case spv::ExecutionModel::TessellationControl: { // Load and store InvocationId and PrimitiveId GenBuiltinOutputCode( - context()->GetBuiltinInputVarId(SpvBuiltInInvocationId), + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::InvocationId)), kInstTessCtlOutInvocationId, base_offset_id, builder); GenBuiltinOutputCode( - context()->GetBuiltinInputVarId(SpvBuiltInPrimitiveId), + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)), kInstTessCtlOutPrimitiveId, base_offset_id, builder); } break; - case SpvExecutionModelTessellationEvaluation: { + case spv::ExecutionModel::TessellationEvaluation: { // Load and store PrimitiveId and TessCoord.uv GenBuiltinOutputCode( - context()->GetBuiltinInputVarId(SpvBuiltInPrimitiveId), + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)), kInstTessEvalOutPrimitiveId, base_offset_id, builder); uint32_t load_id = GenVarLoad( - context()->GetBuiltinInputVarId(SpvBuiltInTessCoord), builder); + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::TessCoord)), + builder); Instruction* uvec3_cast_inst = - builder->AddUnaryOp(GetVec3UintId(), SpvOpBitcast, load_id); + builder->AddUnaryOp(GetVec3UintId(), spv::Op::OpBitcast, load_id); uint32_t uvec3_cast_id = uvec3_cast_inst->result_id(); Instruction* u_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, uvec3_cast_id, 0); + GetUintId(), spv::Op::OpCompositeExtract, uvec3_cast_id, 0); Instruction* v_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, uvec3_cast_id, 1); + GetUintId(), spv::Op::OpCompositeExtract, uvec3_cast_id, 1); GenDebugOutputFieldCode(base_offset_id, kInstTessEvalOutTessCoordU, u_inst->result_id(), builder); GenDebugOutputFieldCode(base_offset_id, kInstTessEvalOutTessCoordV, v_inst->result_id(), builder); } break; - case SpvExecutionModelFragment: { + case spv::ExecutionModel::Fragment: { // Load FragCoord and convert to Uint Instruction* frag_coord_inst = builder->AddUnaryOp( - GetVec4FloatId(), SpvOpLoad, - context()->GetBuiltinInputVarId(SpvBuiltInFragCoord)); + GetVec4FloatId(), spv::Op::OpLoad, + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::FragCoord))); Instruction* uint_frag_coord_inst = builder->AddUnaryOp( - GetVec4UintId(), SpvOpBitcast, frag_coord_inst->result_id()); + GetVec4UintId(), spv::Op::OpBitcast, frag_coord_inst->result_id()); for (uint32_t u = 0; u < 2u; ++u) GenFragCoordEltDebugOutputCode( base_offset_id, uint_frag_coord_inst->result_id(), u, builder); } break; - case SpvExecutionModelRayGenerationNV: - case SpvExecutionModelIntersectionNV: - case SpvExecutionModelAnyHitNV: - case SpvExecutionModelClosestHitNV: - case SpvExecutionModelMissNV: - case SpvExecutionModelCallableNV: { + case spv::ExecutionModel::RayGenerationNV: + case spv::ExecutionModel::IntersectionNV: + case spv::ExecutionModel::AnyHitNV: + case spv::ExecutionModel::ClosestHitNV: + case spv::ExecutionModel::MissNV: + case spv::ExecutionModel::CallableNV: { // Load and store LaunchIdNV. uint32_t launch_id = GenVarLoad( - context()->GetBuiltinInputVarId(SpvBuiltInLaunchIdNV), builder); + context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::LaunchIdNV)), + builder); Instruction* x_launch_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, launch_id, 0); + GetUintId(), spv::Op::OpCompositeExtract, launch_id, 0); Instruction* y_launch_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, launch_id, 1); + GetUintId(), spv::Op::OpCompositeExtract, launch_id, 1); Instruction* z_launch_inst = builder->AddIdLiteralOp( - GetUintId(), SpvOpCompositeExtract, launch_id, 2); + GetUintId(), spv::Op::OpCompositeExtract, launch_id, 2); GenDebugOutputFieldCode(base_offset_id, kInstRayTracingOutLaunchIdX, x_launch_inst->result_id(), builder); GenDebugOutputFieldCode(base_offset_id, kInstRayTracingOutLaunchIdY, @@ -349,7 +348,7 @@ void InstrumentPass::GenDebugStreamWrite( std::vector args = {output_func_id, builder->GetUintConstantId(instruction_idx)}; (void)args.insert(args.end(), validation_ids.begin(), validation_ids.end()); - (void)builder->AddNaryOp(GetVoidId(), SpvOpFunctionCall, args); + (void)builder->AddNaryOp(GetVoidId(), spv::Op::OpFunctionCall, args); } bool InstrumentPass::AllConstant(const std::vector& ids) { @@ -385,13 +384,15 @@ uint32_t InstrumentPass::GenDebugDirectRead( builder.SetInsertPoint(insert_before); } uint32_t res_id = - builder.AddNaryOp(GetUintId(), SpvOpFunctionCall, args)->result_id(); + builder.AddNaryOp(GetUintId(), spv::Op::OpFunctionCall, args) + ->result_id(); if (insert_in_first_block) call2id_[args] = res_id; return res_id; } bool InstrumentPass::IsSameBlockOp(const Instruction* inst) const { - return inst->opcode() == SpvOpSampledImage || inst->opcode() == SpvOpImage; + return inst->opcode() == spv::Op::OpSampledImage || + inst->opcode() == spv::Op::OpImage; } void InstrumentPass::CloneSameBlockOps( @@ -457,7 +458,7 @@ void InstrumentPass::UpdateSucceedingPhis( uint32_t InstrumentPass::GetOutputBufferPtrId() { if (output_buffer_ptr_id_ == 0) { output_buffer_ptr_id_ = context()->get_type_mgr()->FindPointerToType( - GetUintId(), SpvStorageClassStorageBuffer); + GetUintId(), spv::StorageClass::StorageBuffer); } return output_buffer_ptr_id_; } @@ -470,7 +471,7 @@ uint32_t InstrumentPass::GetInputBufferTypeId() { uint32_t InstrumentPass::GetInputBufferPtrId() { if (input_buffer_ptr_id_ == 0) { input_buffer_ptr_id_ = context()->get_type_mgr()->FindPointerToType( - GetInputBufferTypeId(), SpvStorageClassStorageBuffer); + GetInputBufferTypeId(), spv::StorageClass::StorageBuffer); } return input_buffer_ptr_id_; } @@ -519,8 +520,8 @@ analysis::Type* InstrumentPass::GetUintXRuntimeArrayType( // invalidated after this pass. assert(context()->get_def_use_mgr()->NumUses(uint_arr_ty_id) == 0 && "used RuntimeArray type returned"); - deco_mgr->AddDecorationVal(uint_arr_ty_id, SpvDecorationArrayStride, - width / 8u); + deco_mgr->AddDecorationVal( + uint_arr_ty_id, uint32_t(spv::Decoration::ArrayStride), width / 8u); } return *rarr_ty; } @@ -548,7 +549,7 @@ uint32_t InstrumentPass::GetOutputBufferId() { analysis::Type* reg_uint_rarr_ty = GetUintRuntimeArrayType(32); analysis::Integer uint_ty(32, false); analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty); - analysis::Struct buf_ty({reg_uint_ty, reg_uint_rarr_ty}); + analysis::Struct buf_ty({reg_uint_ty, reg_uint_ty, reg_uint_rarr_ty}); analysis::Type* reg_buf_ty = type_mgr->GetRegisteredType(&buf_ty); uint32_t obufTyId = type_mgr->GetTypeInstruction(reg_buf_ty); // By the Vulkan spec, a pre-existing struct containing a RuntimeArray @@ -559,26 +560,30 @@ uint32_t InstrumentPass::GetOutputBufferId() { // invalidated after this pass. assert(context()->get_def_use_mgr()->NumUses(obufTyId) == 0 && "used struct type returned"); - deco_mgr->AddDecoration(obufTyId, SpvDecorationBlock); + deco_mgr->AddDecoration(obufTyId, uint32_t(spv::Decoration::Block)); + deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputFlagsOffset, + uint32_t(spv::Decoration::Offset), 0); deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputSizeOffset, - SpvDecorationOffset, 0); + uint32_t(spv::Decoration::Offset), 4); deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputDataOffset, - SpvDecorationOffset, 4); + uint32_t(spv::Decoration::Offset), 8); uint32_t obufTyPtrId_ = - type_mgr->FindPointerToType(obufTyId, SpvStorageClassStorageBuffer); + type_mgr->FindPointerToType(obufTyId, spv::StorageClass::StorageBuffer); output_buffer_id_ = TakeNextId(); std::unique_ptr newVarOp(new Instruction( - context(), SpvOpVariable, obufTyPtrId_, output_buffer_id_, + context(), spv::Op::OpVariable, obufTyPtrId_, output_buffer_id_, {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvStorageClassStorageBuffer}}})); + {uint32_t(spv::StorageClass::StorageBuffer)}}})); context()->AddGlobalValue(std::move(newVarOp)); context()->AddDebug2Inst(NewGlobalName(obufTyId, "OutputBuffer")); - context()->AddDebug2Inst(NewMemberName(obufTyId, 0, "written_count")); - context()->AddDebug2Inst(NewMemberName(obufTyId, 1, "data")); + context()->AddDebug2Inst(NewMemberName(obufTyId, 0, "flags")); + context()->AddDebug2Inst(NewMemberName(obufTyId, 1, "written_count")); + context()->AddDebug2Inst(NewMemberName(obufTyId, 2, "data")); context()->AddDebug2Inst(NewGlobalName(output_buffer_id_, "output_buffer")); - deco_mgr->AddDecorationVal(output_buffer_id_, SpvDecorationDescriptorSet, - desc_set_); - deco_mgr->AddDecorationVal(output_buffer_id_, SpvDecorationBinding, + deco_mgr->AddDecorationVal( + output_buffer_id_, uint32_t(spv::Decoration::DescriptorSet), desc_set_); + deco_mgr->AddDecorationVal(output_buffer_id_, + uint32_t(spv::Decoration::Binding), GetOutputBufferBinding()); AddStorageBufferExt(); if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { @@ -610,22 +615,24 @@ uint32_t InstrumentPass::GetInputBufferId() { // invalidated after this pass. assert(context()->get_def_use_mgr()->NumUses(ibufTyId) == 0 && "used struct type returned"); - deco_mgr->AddDecoration(ibufTyId, SpvDecorationBlock); - deco_mgr->AddMemberDecoration(ibufTyId, 0, SpvDecorationOffset, 0); + deco_mgr->AddDecoration(ibufTyId, uint32_t(spv::Decoration::Block)); + deco_mgr->AddMemberDecoration(ibufTyId, 0, + uint32_t(spv::Decoration::Offset), 0); uint32_t ibufTyPtrId_ = - type_mgr->FindPointerToType(ibufTyId, SpvStorageClassStorageBuffer); + type_mgr->FindPointerToType(ibufTyId, spv::StorageClass::StorageBuffer); input_buffer_id_ = TakeNextId(); std::unique_ptr newVarOp(new Instruction( - context(), SpvOpVariable, ibufTyPtrId_, input_buffer_id_, + context(), spv::Op::OpVariable, ibufTyPtrId_, input_buffer_id_, {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvStorageClassStorageBuffer}}})); + {uint32_t(spv::StorageClass::StorageBuffer)}}})); context()->AddGlobalValue(std::move(newVarOp)); context()->AddDebug2Inst(NewGlobalName(ibufTyId, "InputBuffer")); context()->AddDebug2Inst(NewMemberName(ibufTyId, 0, "data")); context()->AddDebug2Inst(NewGlobalName(input_buffer_id_, "input_buffer")); - deco_mgr->AddDecorationVal(input_buffer_id_, SpvDecorationDescriptorSet, - desc_set_); - deco_mgr->AddDecorationVal(input_buffer_id_, SpvDecorationBinding, + deco_mgr->AddDecorationVal( + input_buffer_id_, uint32_t(spv::Decoration::DescriptorSet), desc_set_); + deco_mgr->AddDecorationVal(input_buffer_id_, + uint32_t(spv::Decoration::Binding), GetInputBufferBinding()); AddStorageBufferExt(); if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { @@ -746,10 +753,10 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, analysis::Function func_ty(type_mgr->GetType(GetVoidId()), param_types); analysis::Type* reg_func_ty = type_mgr->GetRegisteredType(&func_ty); std::unique_ptr func_inst( - new Instruction(get_module()->context(), SpvOpFunction, GetVoidId(), - param2output_func_id_[param_cnt], + new Instruction(get_module()->context(), spv::Op::OpFunction, + GetVoidId(), param2output_func_id_[param_cnt], {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvFunctionControlMaskNone}}, + {uint32_t(spv::FunctionControlMask::MaskNone)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_mgr->GetTypeInstruction(reg_func_ty)}}})); get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); @@ -761,7 +768,7 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, uint32_t pid = TakeNextId(); param_vec.push_back(pid); std::unique_ptr param_inst( - new Instruction(get_module()->context(), SpvOpFunctionParameter, + new Instruction(get_module()->context(), spv::Op::OpFunctionParameter, GetUintId(), pid, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*param_inst); output_func->AddParameter(std::move(param_inst)); @@ -780,37 +787,39 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, uint32_t buf_id = GetOutputBufferId(); uint32_t buf_uint_ptr_id = GetOutputBufferPtrId(); Instruction* obuf_curr_sz_ac_inst = - builder.AddBinaryOp(buf_uint_ptr_id, SpvOpAccessChain, buf_id, + builder.AddBinaryOp(buf_uint_ptr_id, spv::Op::OpAccessChain, buf_id, builder.GetUintConstantId(kDebugOutputSizeOffset)); // Fetch the current debug buffer written size atomically, adding the // size of the record to be written. uint32_t obuf_record_sz_id = builder.GetUintConstantId(obuf_record_sz); - uint32_t mask_none_id = builder.GetUintConstantId(SpvMemoryAccessMaskNone); - uint32_t scope_invok_id = builder.GetUintConstantId(SpvScopeInvocation); + uint32_t mask_none_id = + builder.GetUintConstantId(uint32_t(spv::MemoryAccessMask::MaskNone)); + uint32_t scope_invok_id = + builder.GetUintConstantId(uint32_t(spv::Scope::Invocation)); Instruction* obuf_curr_sz_inst = builder.AddQuadOp( - GetUintId(), SpvOpAtomicIAdd, obuf_curr_sz_ac_inst->result_id(), + GetUintId(), spv::Op::OpAtomicIAdd, obuf_curr_sz_ac_inst->result_id(), scope_invok_id, mask_none_id, obuf_record_sz_id); uint32_t obuf_curr_sz_id = obuf_curr_sz_inst->result_id(); // Compute new written size Instruction* obuf_new_sz_inst = - builder.AddBinaryOp(GetUintId(), SpvOpIAdd, obuf_curr_sz_id, + builder.AddBinaryOp(GetUintId(), spv::Op::OpIAdd, obuf_curr_sz_id, builder.GetUintConstantId(obuf_record_sz)); // Fetch the data bound Instruction* obuf_bnd_inst = - builder.AddIdLiteralOp(GetUintId(), SpvOpArrayLength, + builder.AddIdLiteralOp(GetUintId(), spv::Op::OpArrayLength, GetOutputBufferId(), kDebugOutputDataOffset); // Test that new written size is less than or equal to debug output // data bound Instruction* obuf_safe_inst = builder.AddBinaryOp( - GetBoolId(), SpvOpULessThanEqual, obuf_new_sz_inst->result_id(), + GetBoolId(), spv::Op::OpULessThanEqual, obuf_new_sz_inst->result_id(), obuf_bnd_inst->result_id()); uint32_t merge_blk_id = TakeNextId(); uint32_t write_blk_id = TakeNextId(); std::unique_ptr merge_label(NewLabel(merge_blk_id)); std::unique_ptr write_label(NewLabel(write_blk_id)); - (void)builder.AddConditionalBranch(obuf_safe_inst->result_id(), - write_blk_id, merge_blk_id, merge_blk_id, - SpvSelectionControlMaskNone); + (void)builder.AddConditionalBranch( + obuf_safe_inst->result_id(), write_blk_id, merge_blk_id, merge_blk_id, + uint32_t(spv::SelectionControlMask::MaskNone)); // Close safety test block and gen write block output_func->AddBasicBlock(std::move(new_blk_ptr)); new_blk_ptr = MakeUnique(std::move(write_label)); @@ -830,10 +839,10 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, new_blk_ptr = MakeUnique(std::move(merge_label)); builder.SetInsertPoint(&*new_blk_ptr); // Close merge block and function and add function to module - (void)builder.AddNullaryOp(0, SpvOpReturn); + (void)builder.AddNullaryOp(0, spv::Op::OpReturn); output_func->AddBasicBlock(std::move(new_blk_ptr)); - std::unique_ptr func_end_inst( - new Instruction(get_module()->context(), SpvOpFunctionEnd, 0, 0, {})); + std::unique_ptr func_end_inst(new Instruction( + get_module()->context(), spv::Op::OpFunctionEnd, 0, 0, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst); output_func->SetFunctionEnd(std::move(func_end_inst)); context()->AddFunction(std::move(output_func)); @@ -860,9 +869,9 @@ uint32_t InstrumentPass::GetDirectReadFunctionId(uint32_t param_cnt) { analysis::Function func_ty(type_mgr->GetType(ibuf_type_id), param_types); analysis::Type* reg_func_ty = type_mgr->GetRegisteredType(&func_ty); std::unique_ptr func_inst(new Instruction( - get_module()->context(), SpvOpFunction, ibuf_type_id, func_id, + get_module()->context(), spv::Op::OpFunction, ibuf_type_id, func_id, {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvFunctionControlMaskNone}}, + {uint32_t(spv::FunctionControlMask::MaskNone)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_mgr->GetTypeInstruction(reg_func_ty)}}})); get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); @@ -873,8 +882,9 @@ uint32_t InstrumentPass::GetDirectReadFunctionId(uint32_t param_cnt) { for (uint32_t c = 0; c < param_cnt; ++c) { uint32_t pid = TakeNextId(); param_vec.push_back(pid); - std::unique_ptr param_inst(new Instruction( - get_module()->context(), SpvOpFunctionParameter, GetUintId(), pid, {})); + std::unique_ptr param_inst( + new Instruction(get_module()->context(), spv::Op::OpFunctionParameter, + GetUintId(), pid, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*param_inst); input_func->AddParameter(std::move(param_inst)); } @@ -899,27 +909,27 @@ uint32_t InstrumentPass::GetDirectReadFunctionId(uint32_t param_cnt) { } else { if (ibuf_type_id != GetUintId()) { Instruction* ucvt_inst = - builder.AddUnaryOp(GetUintId(), SpvOpUConvert, last_value_id); + builder.AddUnaryOp(GetUintId(), spv::Op::OpUConvert, last_value_id); last_value_id = ucvt_inst->result_id(); } Instruction* offset_inst = builder.AddBinaryOp( - GetUintId(), SpvOpIAdd, last_value_id, param_vec[p]); + GetUintId(), spv::Op::OpIAdd, last_value_id, param_vec[p]); offset_id = offset_inst->result_id(); } Instruction* ac_inst = builder.AddTernaryOp( - buf_ptr_id, SpvOpAccessChain, buf_id, + buf_ptr_id, spv::Op::OpAccessChain, buf_id, builder.GetUintConstantId(kDebugInputDataOffset), offset_id); Instruction* load_inst = - builder.AddUnaryOp(ibuf_type_id, SpvOpLoad, ac_inst->result_id()); + builder.AddUnaryOp(ibuf_type_id, spv::Op::OpLoad, ac_inst->result_id()); last_value_id = load_inst->result_id(); } (void)builder.AddInstruction(MakeUnique( - context(), SpvOpReturnValue, 0, 0, + context(), spv::Op::OpReturnValue, 0, 0, std::initializer_list{{SPV_OPERAND_TYPE_ID, {last_value_id}}})); // Close block and function and add function to module input_func->AddBasicBlock(std::move(new_blk_ptr)); - std::unique_ptr func_end_inst( - new Instruction(get_module()->context(), SpvOpFunctionEnd, 0, 0, {})); + std::unique_ptr func_end_inst(new Instruction( + get_module()->context(), spv::Op::OpFunctionEnd, 0, 0, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst); input_func->SetFunctionEnd(std::move(func_end_inst)); context()->AddFunction(std::move(input_func)); @@ -970,7 +980,7 @@ bool InstrumentPass::InstrumentFunction(Function* func, uint32_t stage_idx, // block. This will allow function calls to be inserted into the first // block without interfering with the instrumentation algorithm. if (opt_direct_reads_ && !first_block_split) { - if (ii->opcode() != SpvOpVariable) { + if (ii->opcode() != spv::Op::OpVariable) { SplitBlock(ii, bi, &new_blks); first_block_split = true; } @@ -1001,7 +1011,9 @@ bool InstrumentPass::InstrumentFunction(Function* func, uint32_t stage_idx, // Restart instrumenting at beginning of last new block, // but skip over any new phi or copy instruction. ii = bi->begin(); - if (ii->opcode() == SpvOpPhi || ii->opcode() == SpvOpCopyObject) ++ii; + if (ii->opcode() == spv::Op::OpPhi || + ii->opcode() == spv::Op::OpCopyObject) + ++ii; new_blks.clear(); } } @@ -1039,35 +1051,24 @@ bool InstrumentPass::InstProcessEntryPointCallTree(InstProcessFunction& pfn) { // one model per module. In such cases we will need // to clone any functions which are in the call trees of entrypoints // with differing execution models. - uint32_t ecnt = 0; - uint32_t stage = SpvExecutionModelMax; - for (auto& e : get_module()->entry_points()) { - if (ecnt == 0) - stage = e.GetSingleWordInOperand(kEntryPointExecutionModelInIdx); - else if (e.GetSingleWordInOperand(kEntryPointExecutionModelInIdx) != - stage) { - if (consumer()) { - std::string message = "Mixed stage shader module not supported"; - consumer()(SPV_MSG_ERROR, 0, {0, 0, 0}, message.c_str()); - } - return false; - } - ++ecnt; - } + spv::ExecutionModel stage = context()->GetStage(); // Check for supported stages - if (stage != SpvExecutionModelVertex && stage != SpvExecutionModelFragment && - stage != SpvExecutionModelGeometry && - stage != SpvExecutionModelGLCompute && - stage != SpvExecutionModelTessellationControl && - stage != SpvExecutionModelTessellationEvaluation && - stage != SpvExecutionModelTaskNV && stage != SpvExecutionModelMeshNV && - stage != SpvExecutionModelRayGenerationNV && - stage != SpvExecutionModelIntersectionNV && - stage != SpvExecutionModelAnyHitNV && - stage != SpvExecutionModelClosestHitNV && - stage != SpvExecutionModelMissNV && - stage != SpvExecutionModelCallableNV && - stage != SpvExecutionModelTaskEXT && stage != SpvExecutionModelMeshEXT) { + if (stage != spv::ExecutionModel::Vertex && + stage != spv::ExecutionModel::Fragment && + stage != spv::ExecutionModel::Geometry && + stage != spv::ExecutionModel::GLCompute && + stage != spv::ExecutionModel::TessellationControl && + stage != spv::ExecutionModel::TessellationEvaluation && + stage != spv::ExecutionModel::TaskNV && + stage != spv::ExecutionModel::MeshNV && + stage != spv::ExecutionModel::RayGenerationNV && + stage != spv::ExecutionModel::IntersectionNV && + stage != spv::ExecutionModel::AnyHitNV && + stage != spv::ExecutionModel::ClosestHitNV && + stage != spv::ExecutionModel::MissNV && + stage != spv::ExecutionModel::CallableNV && + stage != spv::ExecutionModel::TaskEXT && + stage != spv::ExecutionModel::MeshEXT) { if (consumer()) { std::string message = "Stage not supported by instrumentation"; consumer()(SPV_MSG_ERROR, 0, {0, 0, 0}, message.c_str()); @@ -1079,7 +1080,7 @@ bool InstrumentPass::InstProcessEntryPointCallTree(InstProcessFunction& pfn) { for (auto& e : get_module()->entry_points()) { roots.push(e.GetSingleWordInOperand(kEntryPointFunctionIdInIdx)); } - bool modified = InstProcessCallTreeFromRoots(pfn, &roots, stage); + bool modified = InstProcessCallTreeFromRoots(pfn, &roots, uint32_t(stage)); return modified; } diff --git a/3rdparty/spirv-tools/source/opt/instrument_pass.h b/3rdparty/spirv-tools/source/opt/instrument_pass.h index 215b02635..e98ba88e4 100644 --- a/3rdparty/spirv-tools/source/opt/instrument_pass.h +++ b/3rdparty/spirv-tools/source/opt/instrument_pass.h @@ -55,13 +55,14 @@ namespace spvtools { namespace opt { - +namespace { // Validation Ids // These are used to identify the general validation being done and map to // its output buffers. -static const uint32_t kInstValidationIdBindless = 0; -static const uint32_t kInstValidationIdBuffAddr = 1; -static const uint32_t kInstValidationIdDebugPrintf = 2; +constexpr uint32_t kInstValidationIdBindless = 0; +constexpr uint32_t kInstValidationIdBuffAddr = 1; +constexpr uint32_t kInstValidationIdDebugPrintf = 2; +} // namespace class InstrumentPass : public Pass { using cbb_ptr = const BasicBlock*; diff --git a/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp b/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp index 1b2cb3636..08477cbdd 100644 --- a/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp +++ b/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp @@ -23,29 +23,28 @@ #include "source/opt/type_manager.h" #include "source/util/make_unique.h" -const static uint32_t kOpDecorateDecorationInOperandIndex = 1; -const static uint32_t kOpDecorateLiteralInOperandIndex = 2; -const static uint32_t kOpEntryPointInOperandInterface = 3; -const static uint32_t kOpVariableStorageClassInOperandIndex = 0; -const static uint32_t kOpTypeArrayElemTypeInOperandIndex = 0; -const static uint32_t kOpTypeArrayLengthInOperandIndex = 1; -const static uint32_t kOpTypeMatrixColCountInOperandIndex = 1; -const static uint32_t kOpTypeMatrixColTypeInOperandIndex = 0; -const static uint32_t kOpTypePtrTypeInOperandIndex = 1; -const static uint32_t kOpConstantValueInOperandIndex = 0; - namespace spvtools { namespace opt { namespace { +constexpr uint32_t kOpDecorateDecorationInOperandIndex = 1; +constexpr uint32_t kOpDecorateLiteralInOperandIndex = 2; +constexpr uint32_t kOpEntryPointInOperandInterface = 3; +constexpr uint32_t kOpVariableStorageClassInOperandIndex = 0; +constexpr uint32_t kOpTypeArrayElemTypeInOperandIndex = 0; +constexpr uint32_t kOpTypeArrayLengthInOperandIndex = 1; +constexpr uint32_t kOpTypeMatrixColCountInOperandIndex = 1; +constexpr uint32_t kOpTypeMatrixColTypeInOperandIndex = 0; +constexpr uint32_t kOpTypePtrTypeInOperandIndex = 1; +constexpr uint32_t kOpConstantValueInOperandIndex = 0; // Get the length of the OpTypeArray |array_type|. uint32_t GetArrayLength(analysis::DefUseManager* def_use_mgr, Instruction* array_type) { - assert(array_type->opcode() == SpvOpTypeArray); + assert(array_type->opcode() == spv::Op::OpTypeArray); uint32_t const_int_id = array_type->GetSingleWordInOperand(kOpTypeArrayLengthInOperandIndex); Instruction* array_length_inst = def_use_mgr->GetDef(const_int_id); - assert(array_length_inst->opcode() == SpvOpConstant); + assert(array_length_inst->opcode() == spv::Op::OpConstant); return array_length_inst->GetSingleWordInOperand( kOpConstantValueInOperandIndex); } @@ -53,7 +52,7 @@ uint32_t GetArrayLength(analysis::DefUseManager* def_use_mgr, // Get the element type instruction of the OpTypeArray |array_type|. Instruction* GetArrayElementType(analysis::DefUseManager* def_use_mgr, Instruction* array_type) { - assert(array_type->opcode() == SpvOpTypeArray); + assert(array_type->opcode() == spv::Op::OpTypeArray); uint32_t elem_type_id = array_type->GetSingleWordInOperand(kOpTypeArrayElemTypeInOperandIndex); return def_use_mgr->GetDef(elem_type_id); @@ -62,7 +61,7 @@ Instruction* GetArrayElementType(analysis::DefUseManager* def_use_mgr, // Get the column type instruction of the OpTypeMatrix |matrix_type|. Instruction* GetMatrixColumnType(analysis::DefUseManager* def_use_mgr, Instruction* matrix_type) { - assert(matrix_type->opcode() == SpvOpTypeMatrix); + assert(matrix_type->opcode() == spv::Op::OpTypeMatrix); uint32_t column_type_id = matrix_type->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex); return def_use_mgr->GetDef(column_type_id); @@ -77,14 +76,14 @@ uint32_t GetComponentTypeOfArrayMatrix(analysis::DefUseManager* def_use_mgr, if (depth_to_component == 0) return type_id; Instruction* type_inst = def_use_mgr->GetDef(type_id); - if (type_inst->opcode() == SpvOpTypeArray) { + if (type_inst->opcode() == spv::Op::OpTypeArray) { uint32_t elem_type_id = type_inst->GetSingleWordInOperand(kOpTypeArrayElemTypeInOperandIndex); return GetComponentTypeOfArrayMatrix(def_use_mgr, elem_type_id, depth_to_component - 1); } - assert(type_inst->opcode() == SpvOpTypeMatrix); + assert(type_inst->opcode() == spv::Op::OpTypeMatrix); uint32_t column_type_id = type_inst->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex); return GetComponentTypeOfArrayMatrix(def_use_mgr, column_type_id, @@ -94,7 +93,7 @@ uint32_t GetComponentTypeOfArrayMatrix(analysis::DefUseManager* def_use_mgr, // Creates an OpDecorate instruction whose Target is |var_id| and Decoration is // |decoration|. Adds |literal| as an extra operand of the instruction. void CreateDecoration(analysis::DecorationManager* decoration_mgr, - uint32_t var_id, SpvDecoration decoration, + uint32_t var_id, spv::Decoration decoration, uint32_t literal) { std::vector operands({ {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}}, @@ -102,7 +101,7 @@ void CreateDecoration(analysis::DecorationManager* decoration_mgr, {static_cast(decoration)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {literal}}, }); - decoration_mgr->AddDecoration(SpvOpDecorate, std::move(operands)); + decoration_mgr->AddDecoration(spv::Op::OpDecorate, std::move(operands)); } // Replaces load instructions with composite construct instructions in all the @@ -128,8 +127,8 @@ void ReplaceLoadWithCompositeConstruct( } // Returns the storage class of the instruction |var|. -SpvStorageClass GetStorageClass(Instruction* var) { - return static_cast( +spv::StorageClass GetStorageClass(Instruction* var) { + return static_cast( var->GetSingleWordInOperand(kOpVariableStorageClassInOperandIndex)); } @@ -137,16 +136,17 @@ SpvStorageClass GetStorageClass(Instruction* var) { bool InterfaceVariableScalarReplacement::HasExtraArrayness( Instruction& entry_point, Instruction* var) { - SpvExecutionModel execution_model = - static_cast(entry_point.GetSingleWordInOperand(0)); - if (execution_model != SpvExecutionModelTessellationEvaluation && - execution_model != SpvExecutionModelTessellationControl) { + spv::ExecutionModel execution_model = + static_cast(entry_point.GetSingleWordInOperand(0)); + if (execution_model != spv::ExecutionModel::TessellationEvaluation && + execution_model != spv::ExecutionModel::TessellationControl) { return false; } - if (!context()->get_decoration_mgr()->HasDecoration(var->result_id(), - SpvDecorationPatch)) { - if (execution_model == SpvExecutionModelTessellationControl) return true; - return GetStorageClass(var) != SpvStorageClassOutput; + if (!context()->get_decoration_mgr()->HasDecoration( + var->result_id(), uint32_t(spv::Decoration::Patch))) { + if (execution_model == spv::ExecutionModel::TessellationControl) + return true; + return GetStorageClass(var) != spv::StorageClass::Output; } return false; } @@ -163,7 +163,7 @@ bool InterfaceVariableScalarReplacement:: bool InterfaceVariableScalarReplacement::GetVariableLocation( Instruction* var, uint32_t* location) { return !context()->get_decoration_mgr()->WhileEachDecoration( - var->result_id(), SpvDecorationLocation, + var->result_id(), uint32_t(spv::Decoration::Location), [location](const Instruction& inst) { *location = inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex); @@ -174,7 +174,7 @@ bool InterfaceVariableScalarReplacement::GetVariableLocation( bool InterfaceVariableScalarReplacement::GetVariableComponent( Instruction* var, uint32_t* component) { return !context()->get_decoration_mgr()->WhileEachDecoration( - var->result_id(), SpvDecorationComponent, + var->result_id(), uint32_t(spv::Decoration::Component), [component](const Instruction& inst) { *component = inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex); @@ -190,11 +190,11 @@ InterfaceVariableScalarReplacement::CollectInterfaceVariables( i < entry_point.NumInOperands(); ++i) { Instruction* interface_var = context()->get_def_use_mgr()->GetDef( entry_point.GetSingleWordInOperand(i)); - assert(interface_var->opcode() == SpvOpVariable); + assert(interface_var->opcode() == spv::Op::OpVariable); - SpvStorageClass storage_class = GetStorageClass(interface_var); - if (storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + spv::StorageClass storage_class = GetStorageClass(interface_var); + if (storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { continue; } @@ -205,10 +205,10 @@ InterfaceVariableScalarReplacement::CollectInterfaceVariables( void InterfaceVariableScalarReplacement::KillInstructionAndUsers( Instruction* inst) { - if (inst->opcode() == SpvOpEntryPoint) { + if (inst->opcode() == spv::Op::OpEntryPoint) { return; } - if (inst->opcode() != SpvOpAccessChain) { + if (inst->opcode() != spv::Op::OpAccessChain) { context()->KillInst(inst); return; } @@ -232,10 +232,10 @@ void InterfaceVariableScalarReplacement::KillLocationAndComponentDecorations( uint32_t var_id) { context()->get_decoration_mgr()->RemoveDecorationsFrom( var_id, [](const Instruction& inst) { - uint32_t decoration = - inst.GetSingleWordInOperand(kOpDecorateDecorationInOperandIndex); - return decoration == SpvDecorationLocation || - decoration == SpvDecorationComponent; + spv::Decoration decoration = spv::Decoration( + inst.GetSingleWordInOperand(kOpDecorateDecorationInOperandIndex)); + return decoration == spv::Decoration::Location || + decoration == spv::Decoration::Component; }); } @@ -307,9 +307,9 @@ void InterfaceVariableScalarReplacement::AddLocationAndComponentDecorations( if (!vars.HasMultipleComponents()) { uint32_t var_id = vars.GetComponentVariable()->result_id(); CreateDecoration(context()->get_decoration_mgr(), var_id, - SpvDecorationLocation, *location); + spv::Decoration::Location, *location); CreateDecoration(context()->get_decoration_mgr(), var_id, - SpvDecorationComponent, component); + spv::Decoration::Component, component); ++(*location); return; } @@ -389,15 +389,15 @@ bool InterfaceVariableScalarReplacement::ReplaceComponentOfInterfaceVarWith( std::unordered_map* loads_to_component_values, std::unordered_map* loads_for_access_chain_to_component_values) { - SpvOp opcode = interface_var_user->opcode(); - if (opcode == SpvOpStore) { + spv::Op opcode = interface_var_user->opcode(); + if (opcode == spv::Op::OpStore) { uint32_t value_id = interface_var_user->GetSingleWordInOperand(1); StoreComponentOfValueToScalarVar(value_id, interface_var_component_indices, scalar_var, extra_array_index, interface_var_user); return true; } - if (opcode == SpvOpLoad) { + if (opcode == spv::Op::OpLoad) { Instruction* scalar_load = LoadScalarVar(scalar_var, extra_array_index, interface_var_user); loads_to_component_values->insert({interface_var_user, scalar_load}); @@ -408,25 +408,25 @@ bool InterfaceVariableScalarReplacement::ReplaceComponentOfInterfaceVarWith( // them only for the first element of the extra array. if (extra_array_index && *extra_array_index != 0) return true; - if (opcode == SpvOpDecorateId || opcode == SpvOpDecorateString || - opcode == SpvOpDecorate) { + if (opcode == spv::Op::OpDecorateId || opcode == spv::Op::OpDecorateString || + opcode == spv::Op::OpDecorate) { CloneAnnotationForVariable(interface_var_user, scalar_var->result_id()); return true; } - if (opcode == SpvOpName) { + if (opcode == spv::Op::OpName) { std::unique_ptr new_inst(interface_var_user->Clone(context())); new_inst->SetInOperand(0, {scalar_var->result_id()}); context()->AddDebug2Inst(std::move(new_inst)); return true; } - if (opcode == SpvOpEntryPoint) { + if (opcode == spv::Op::OpEntryPoint) { return ReplaceInterfaceVarInEntryPoint(interface_var, interface_var_user, scalar_var->result_id()); } - if (opcode == SpvOpAccessChain) { + if (opcode == spv::Op::OpAccessChain) { ReplaceAccessChainWith(interface_var_user, interface_var_component_indices, scalar_var, loads_for_access_chain_to_component_values); @@ -445,8 +445,8 @@ bool InterfaceVariableScalarReplacement::ReplaceComponentOfInterfaceVarWith( void InterfaceVariableScalarReplacement::UseBaseAccessChainForAccessChain( Instruction* access_chain, Instruction* base_access_chain) { - assert(base_access_chain->opcode() == SpvOpAccessChain && - access_chain->opcode() == SpvOpAccessChain && + assert(base_access_chain->opcode() == spv::Op::OpAccessChain && + access_chain->opcode() == spv::Op::OpAccessChain && access_chain->GetSingleWordInOperand(0) == base_access_chain->result_id()); Instruction::OperandList new_operands; @@ -470,10 +470,10 @@ Instruction* InterfaceVariableScalarReplacement::CreateAccessChainToVar( uint32_t ptr_type_id = GetPointerType(*component_type_id, GetStorageClass(var)); - std::unique_ptr new_access_chain( - new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(), - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {var->result_id()}}})); + std::unique_ptr new_access_chain(new Instruction( + context(), spv::Op::OpAccessChain, ptr_type_id, TakeNextId(), + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {var->result_id()}}})); for (uint32_t index_id : index_ids) { new_access_chain->AddOperand({SPV_OPERAND_TYPE_ID, {index_id}}); } @@ -489,13 +489,13 @@ Instruction* InterfaceVariableScalarReplacement::CreateAccessChainWithIndex( Instruction* insert_before) { uint32_t ptr_type_id = GetPointerType(component_type_id, GetStorageClass(var)); - uint32_t index_id = context()->get_constant_mgr()->GetUIntConst(index); - std::unique_ptr new_access_chain( - new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(), - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {var->result_id()}}, - {SPV_OPERAND_TYPE_ID, {index_id}}, - })); + uint32_t index_id = context()->get_constant_mgr()->GetUIntConstId(index); + std::unique_ptr new_access_chain(new Instruction( + context(), spv::Op::OpAccessChain, ptr_type_id, TakeNextId(), + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {var->result_id()}}, + {SPV_OPERAND_TYPE_ID, {index_id}}, + })); Instruction* inst = new_access_chain.get(); context()->get_def_use_mgr()->AnalyzeInstDefUse(inst); insert_before->InsertBefore(std::move(new_access_chain)); @@ -519,20 +519,20 @@ void InterfaceVariableScalarReplacement::ReplaceAccessChainWith( [this, access_chain, &indexes, &interface_var_component_indices, scalar_var, loads_to_component_values](Instruction* user) { switch (user->opcode()) { - case SpvOpAccessChain: { + case spv::Op::OpAccessChain: { UseBaseAccessChainForAccessChain(user, access_chain); ReplaceAccessChainWith(user, interface_var_component_indices, scalar_var, loads_to_component_values); return; } - case SpvOpStore: { + case spv::Op::OpStore: { uint32_t value_id = user->GetSingleWordInOperand(1); StoreComponentOfValueToAccessChainToScalarVar( value_id, interface_var_component_indices, scalar_var, indexes, user); return; } - case SpvOpLoad: { + case spv::Op::OpLoad: { Instruction* value = LoadAccessChainToVar(scalar_var, indexes, user); loads_to_component_values->insert({user, value}); @@ -546,9 +546,9 @@ void InterfaceVariableScalarReplacement::ReplaceAccessChainWith( void InterfaceVariableScalarReplacement::CloneAnnotationForVariable( Instruction* annotation_inst, uint32_t var_id) { - assert(annotation_inst->opcode() == SpvOpDecorate || - annotation_inst->opcode() == SpvOpDecorateId || - annotation_inst->opcode() == SpvOpDecorateString); + assert(annotation_inst->opcode() == spv::Op::OpDecorate || + annotation_inst->opcode() == spv::Op::OpDecorateId || + annotation_inst->opcode() == spv::Op::OpDecorateString); std::unique_ptr new_inst(annotation_inst->Clone(context())); new_inst->SetInOperand(0, {var_id}); context()->AddAnnotationInst(std::move(new_inst)); @@ -593,13 +593,13 @@ bool InterfaceVariableScalarReplacement::ReplaceInterfaceVarInEntryPoint( uint32_t InterfaceVariableScalarReplacement::GetPointeeTypeIdOfVar( Instruction* var) { - assert(var->opcode() == SpvOpVariable); + assert(var->opcode() == spv::Op::OpVariable); uint32_t ptr_type_id = var->type_id(); analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); Instruction* ptr_type_inst = def_use_mgr->GetDef(ptr_type_id); - assert(ptr_type_inst->opcode() == SpvOpTypePointer && + assert(ptr_type_inst->opcode() == spv::Op::OpTypePointer && "Variable must have a pointer type."); return ptr_type_inst->GetSingleWordInOperand(kOpTypePtrTypeInOperandIndex); } @@ -643,7 +643,7 @@ Instruction* InterfaceVariableScalarReplacement::LoadScalarVar( Instruction* InterfaceVariableScalarReplacement::CreateLoad( uint32_t type_id, Instruction* ptr, Instruction* insert_before) { std::unique_ptr load( - new Instruction(context(), SpvOpLoad, type_id, TakeNextId(), + new Instruction(context(), spv::Op::OpLoad, type_id, TakeNextId(), std::initializer_list{ {SPV_OPERAND_TYPE_ID, {ptr->result_id()}}})); Instruction* load_inst = load.get(); @@ -660,7 +660,7 @@ void InterfaceVariableScalarReplacement::StoreComponentOfValueTo( component_type_id, value_id, component_indices, extra_array_index)); std::unique_ptr new_store( - new Instruction(context(), SpvOpStore)); + new Instruction(context(), spv::Op::OpStore)); new_store->AddOperand({SPV_OPERAND_TYPE_ID, {ptr->result_id()}}); new_store->AddOperand( {SPV_OPERAND_TYPE_ID, {composite_extract->result_id()}}); @@ -678,7 +678,7 @@ Instruction* InterfaceVariableScalarReplacement::CreateCompositeExtract( const std::vector& indexes, const uint32_t* extra_first_index) { uint32_t component_id = TakeNextId(); Instruction* composite_extract = new Instruction( - context(), SpvOpCompositeExtract, type_id, component_id, + context(), spv::Op::OpCompositeExtract, type_id, component_id, std::initializer_list{{SPV_OPERAND_TYPE_ID, {composite_id}}}); if (extra_first_index) { composite_extract->AddOperand( @@ -731,8 +731,8 @@ InterfaceVariableScalarReplacement::CreateCompositeConstructForComponentOfLoad( depth_to_component); } uint32_t new_id = context()->TakeNextId(); - std::unique_ptr new_composite_construct( - new Instruction(context(), SpvOpCompositeConstruct, type_id, new_id, {})); + std::unique_ptr new_composite_construct(new Instruction( + context(), spv::Op::OpCompositeConstruct, type_id, new_id, {})); Instruction* composite_construct = new_composite_construct.get(); def_use_mgr->AnalyzeInstDefUse(composite_construct); @@ -781,7 +781,7 @@ uint32_t InterfaceVariableScalarReplacement::GetArrayType( uint32_t elem_type_id, uint32_t array_length) { analysis::Type* elem_type = context()->get_type_mgr()->GetType(elem_type_id); uint32_t array_length_id = - context()->get_constant_mgr()->GetUIntConst(array_length); + context()->get_constant_mgr()->GetUIntConstId(array_length); analysis::Array array_type( elem_type, analysis::Array::LengthInfo{array_length_id, {0, array_length}}); @@ -789,7 +789,7 @@ uint32_t InterfaceVariableScalarReplacement::GetArrayType( } uint32_t InterfaceVariableScalarReplacement::GetPointerType( - uint32_t type_id, SpvStorageClass storage_class) { + uint32_t type_id, spv::StorageClass storage_class) { analysis::Type* type = context()->get_type_mgr()->GetType(type_id); analysis::Pointer ptr_type(type, storage_class); return context()->get_type_mgr()->GetTypeInstruction(&ptr_type); @@ -797,9 +797,9 @@ uint32_t InterfaceVariableScalarReplacement::GetPointerType( InterfaceVariableScalarReplacement::NestedCompositeComponents InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForArray( - Instruction* interface_var_type, SpvStorageClass storage_class, + Instruction* interface_var_type, spv::StorageClass storage_class, uint32_t extra_array_length) { - assert(interface_var_type->opcode() == SpvOpTypeArray); + assert(interface_var_type->opcode() == spv::Op::OpTypeArray); analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); uint32_t array_length = GetArrayLength(def_use_mgr, interface_var_type); @@ -818,9 +818,9 @@ InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForArray( InterfaceVariableScalarReplacement::NestedCompositeComponents InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForMatrix( - Instruction* interface_var_type, SpvStorageClass storage_class, + Instruction* interface_var_type, spv::StorageClass storage_class, uint32_t extra_array_length) { - assert(interface_var_type->opcode() == SpvOpTypeMatrix); + assert(interface_var_type->opcode() == spv::Op::OpTypeMatrix); analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); uint32_t column_count = interface_var_type->GetSingleWordInOperand( @@ -841,16 +841,16 @@ InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForMatrix( InterfaceVariableScalarReplacement::NestedCompositeComponents InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForReplacement( - Instruction* interface_var_type, SpvStorageClass storage_class, + Instruction* interface_var_type, spv::StorageClass storage_class, uint32_t extra_array_length) { // Handle array case. - if (interface_var_type->opcode() == SpvOpTypeArray) { + if (interface_var_type->opcode() == spv::Op::OpTypeArray) { return CreateScalarInterfaceVarsForArray(interface_var_type, storage_class, extra_array_length); } // Handle matrix case. - if (interface_var_type->opcode() == SpvOpTypeMatrix) { + if (interface_var_type->opcode() == spv::Op::OpTypeMatrix) { return CreateScalarInterfaceVarsForMatrix(interface_var_type, storage_class, extra_array_length); } @@ -865,7 +865,7 @@ InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForReplacement( context()->get_type_mgr()->FindPointerToType(type_id, storage_class); uint32_t id = TakeNextId(); std::unique_ptr variable( - new Instruction(context(), SpvOpVariable, ptr_type_id, id, + new Instruction(context(), spv::Op::OpVariable, ptr_type_id, id, std::initializer_list{ {SPV_OPERAND_TYPE_STORAGE_CLASS, {static_cast(storage_class)}}})); @@ -948,8 +948,8 @@ InterfaceVariableScalarReplacement::ReplaceInterfaceVarsWithScalars( return Pass::Status::Failure; } - if (interface_var_type->opcode() != SpvOpTypeArray && - interface_var_type->opcode() != SpvOpTypeMatrix) { + if (interface_var_type->opcode() != spv::Op::OpTypeArray && + interface_var_type->opcode() != spv::Op::OpTypeMatrix) { continue; } diff --git a/3rdparty/spirv-tools/source/opt/interface_var_sroa.h b/3rdparty/spirv-tools/source/opt/interface_var_sroa.h index 23baad0ad..df7511bf3 100644 --- a/3rdparty/spirv-tools/source/opt/interface_var_sroa.h +++ b/3rdparty/spirv-tools/source/opt/interface_var_sroa.h @@ -115,7 +115,7 @@ class InterfaceVariableScalarReplacement : public Pass { // |extra_array_length| is not zero, adds the extra arrayness to the created // scalar variables. NestedCompositeComponents CreateScalarInterfaceVarsForReplacement( - Instruction* interface_var_type, SpvStorageClass storage_class, + Instruction* interface_var_type, spv::StorageClass storage_class, uint32_t extra_array_length); // Creates scalar variables with the storage classe |storage_class| to replace @@ -123,7 +123,7 @@ class InterfaceVariableScalarReplacement : public Pass { // If |extra_array_length| is not zero, adds the extra arrayness to all the // scalar variables. NestedCompositeComponents CreateScalarInterfaceVarsForArray( - Instruction* interface_var_type, SpvStorageClass storage_class, + Instruction* interface_var_type, spv::StorageClass storage_class, uint32_t extra_array_length); // Creates scalar variables with the storage classe |storage_class| to replace @@ -131,7 +131,7 @@ class InterfaceVariableScalarReplacement : public Pass { // with. If |extra_array_length| is not zero, adds the extra arrayness to all // the scalar variables. NestedCompositeComponents CreateScalarInterfaceVarsForMatrix( - Instruction* interface_var_type, SpvStorageClass storage_class, + Instruction* interface_var_type, spv::StorageClass storage_class, uint32_t extra_array_length); // Recursively adds Location and Component decorations to variables in @@ -345,7 +345,7 @@ class InterfaceVariableScalarReplacement : public Pass { // Returns the result id of OpTypePointer instrunction whose Type // operand is |type_id| and Storage Class operand is |storage_class|. - uint32_t GetPointerType(uint32_t type_id, SpvStorageClass storage_class); + uint32_t GetPointerType(uint32_t type_id, spv::StorageClass storage_class); // Kills an instrunction |inst| and its users. void KillInstructionAndUsers(Instruction* inst); diff --git a/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp b/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp index e8cdd99f1..bb6f6108c 100644 --- a/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp @@ -25,11 +25,10 @@ namespace spvtools { namespace opt { - namespace { // Input Operand Indices -static const int kSpvVariableStorageClassInIdx = 0; +constexpr int kSpvVariableStorageClassInIdx = 0; // Folding rule function which attempts to replace |op(OpLoad(a),...)| // by |op(a,...)|, where |op| is one of the GLSLstd450 InterpolateAt* @@ -45,12 +44,12 @@ bool ReplaceInternalInterpolate(IRContext* ctx, Instruction* inst, uint32_t op1_id = inst->GetSingleWordInOperand(2); Instruction* load_inst = ctx->get_def_use_mgr()->GetDef(op1_id); - if (load_inst->opcode() != SpvOpLoad) return false; + if (load_inst->opcode() != spv::Op::OpLoad) return false; Instruction* base_inst = load_inst->GetBaseAddress(); - USE_ASSERT(base_inst->opcode() == SpvOpVariable && - base_inst->GetSingleWordInOperand(kSpvVariableStorageClassInIdx) == - SpvStorageClassInput && + USE_ASSERT(base_inst->opcode() == spv::Op::OpVariable && + spv::StorageClass(base_inst->GetSingleWordInOperand( + kSpvVariableStorageClassInIdx)) == spv::StorageClass::Input && "unexpected interpolant in InterpolateAt*"); uint32_t ptr_id = load_inst->GetSingleWordInOperand(0); diff --git a/3rdparty/spirv-tools/source/opt/ir_builder.h b/3rdparty/spirv-tools/source/opt/ir_builder.h index 9d4fa8fe3..93289a61a 100644 --- a/3rdparty/spirv-tools/source/opt/ir_builder.h +++ b/3rdparty/spirv-tools/source/opt/ir_builder.h @@ -30,7 +30,7 @@ namespace opt { // In SPIR-V, ids are encoded as uint16_t, this id is guaranteed to be always // invalid. -const uint32_t kInvalidId = std::numeric_limits::max(); +constexpr uint32_t kInvalidId = std::numeric_limits::max(); // Helper class to abstract instruction construction and insertion. // The instruction builder can preserve the following analyses (specified via @@ -58,7 +58,7 @@ class InstructionBuilder { : InstructionBuilder(context, parent_block, parent_block->end(), preserved_analyses) {} - Instruction* AddNullaryOp(uint32_t type_id, SpvOp opcode) { + Instruction* AddNullaryOp(uint32_t type_id, spv::Op opcode) { uint32_t result_id = 0; if (type_id != 0) { result_id = GetContext()->TakeNextId(); @@ -71,7 +71,7 @@ class InstructionBuilder { return AddInstruction(std::move(new_inst)); } - Instruction* AddUnaryOp(uint32_t type_id, SpvOp opcode, uint32_t operand1) { + Instruction* AddUnaryOp(uint32_t type_id, spv::Op opcode, uint32_t operand1) { uint32_t result_id = 0; if (type_id != 0) { result_id = GetContext()->TakeNextId(); @@ -85,7 +85,7 @@ class InstructionBuilder { return AddInstruction(std::move(newUnOp)); } - Instruction* AddBinaryOp(uint32_t type_id, SpvOp opcode, uint32_t operand1, + Instruction* AddBinaryOp(uint32_t type_id, spv::Op opcode, uint32_t operand1, uint32_t operand2) { uint32_t result_id = 0; if (type_id != 0) { @@ -95,13 +95,14 @@ class InstructionBuilder { } } std::unique_ptr newBinOp(new Instruction( - GetContext(), opcode, type_id, opcode == SpvOpStore ? 0 : result_id, + GetContext(), opcode, type_id, + opcode == spv::Op::OpStore ? 0 : result_id, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {operand1}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {operand2}}})); return AddInstruction(std::move(newBinOp)); } - Instruction* AddTernaryOp(uint32_t type_id, SpvOp opcode, uint32_t operand1, + Instruction* AddTernaryOp(uint32_t type_id, spv::Op opcode, uint32_t operand1, uint32_t operand2, uint32_t operand3) { uint32_t result_id = 0; if (type_id != 0) { @@ -118,7 +119,7 @@ class InstructionBuilder { return AddInstruction(std::move(newTernOp)); } - Instruction* AddQuadOp(uint32_t type_id, SpvOp opcode, uint32_t operand1, + Instruction* AddQuadOp(uint32_t type_id, spv::Op opcode, uint32_t operand1, uint32_t operand2, uint32_t operand3, uint32_t operand4) { uint32_t result_id = 0; @@ -137,7 +138,7 @@ class InstructionBuilder { return AddInstruction(std::move(newQuadOp)); } - Instruction* AddIdLiteralOp(uint32_t type_id, SpvOp opcode, uint32_t id, + Instruction* AddIdLiteralOp(uint32_t type_id, spv::Op opcode, uint32_t id, uint32_t uliteral) { uint32_t result_id = 0; if (type_id != 0) { @@ -157,7 +158,7 @@ class InstructionBuilder { // |typid| must be the id of the instruction's type. // |operands| must be a sequence of operand ids. // Use |result| for the result id if non-zero. - Instruction* AddNaryOp(uint32_t type_id, SpvOp opcode, + Instruction* AddNaryOp(uint32_t type_id, spv::Op opcode, const std::vector& operands, uint32_t result = 0) { std::vector ops; @@ -174,10 +175,10 @@ class InstructionBuilder { // Creates a new selection merge instruction. // The id |merge_id| is the merge basic block id. Instruction* AddSelectionMerge( - uint32_t merge_id, - uint32_t selection_control = SpvSelectionControlMaskNone) { + uint32_t merge_id, uint32_t selection_control = static_cast( + spv::SelectionControlMask::MaskNone)) { std::unique_ptr new_branch_merge(new Instruction( - GetContext(), SpvOpSelectionMerge, 0, 0, + GetContext(), spv::Op::OpSelectionMerge, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {merge_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_SELECTION_CONTROL, {selection_control}}})); @@ -189,9 +190,10 @@ class InstructionBuilder { // |continue_id| is the id of the continue block. // |loop_control| are the loop control flags to be added to the instruction. Instruction* AddLoopMerge(uint32_t merge_id, uint32_t continue_id, - uint32_t loop_control = SpvLoopControlMaskNone) { + uint32_t loop_control = static_cast( + spv::LoopControlMask::MaskNone)) { std::unique_ptr new_branch_merge(new Instruction( - GetContext(), SpvOpLoopMerge, 0, 0, + GetContext(), spv::Op::OpLoopMerge, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {merge_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {continue_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_LOOP_CONTROL, {loop_control}}})); @@ -203,7 +205,7 @@ class InstructionBuilder { // well formed. Instruction* AddBranch(uint32_t label_id) { std::unique_ptr new_branch(new Instruction( - GetContext(), SpvOpBranch, 0, 0, + GetContext(), spv::Op::OpBranch, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {label_id}}})); return AddInstruction(std::move(new_branch)); } @@ -226,12 +228,13 @@ class InstructionBuilder { Instruction* AddConditionalBranch( uint32_t cond_id, uint32_t true_id, uint32_t false_id, uint32_t merge_id = kInvalidId, - uint32_t selection_control = SpvSelectionControlMaskNone) { + uint32_t selection_control = + static_cast(spv::SelectionControlMask::MaskNone)) { if (merge_id != kInvalidId) { AddSelectionMerge(merge_id, selection_control); } std::unique_ptr new_branch(new Instruction( - GetContext(), SpvOpBranchConditional, 0, 0, + GetContext(), spv::Op::OpBranchConditional, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {cond_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {true_id}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {false_id}}})); @@ -255,7 +258,8 @@ class InstructionBuilder { uint32_t selector_id, uint32_t default_id, const std::vector>& targets, uint32_t merge_id = kInvalidId, - uint32_t selection_control = SpvSelectionControlMaskNone) { + uint32_t selection_control = + static_cast(spv::SelectionControlMask::MaskNone)) { if (merge_id != kInvalidId) { AddSelectionMerge(merge_id, selection_control); } @@ -272,7 +276,7 @@ class InstructionBuilder { Operand{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {target.second}}); } std::unique_ptr new_switch( - new Instruction(GetContext(), SpvOpSwitch, 0, 0, operands)); + new Instruction(GetContext(), spv::Op::OpSwitch, 0, 0, operands)); return AddInstruction(std::move(new_switch)); } @@ -283,7 +287,7 @@ class InstructionBuilder { Instruction* AddPhi(uint32_t type, const std::vector& incomings, uint32_t result = 0) { assert(incomings.size() % 2 == 0 && "A sequence of pairs is expected"); - return AddNaryOp(type, SpvOpPhi, incomings, result); + return AddNaryOp(type, spv::Op::OpPhi, incomings, result); } // Creates an addition instruction. @@ -294,7 +298,7 @@ class InstructionBuilder { Instruction* AddIAdd(uint32_t type, uint32_t op1, uint32_t op2) { // TODO(1841): Handle id overflow. std::unique_ptr inst(new Instruction( - GetContext(), SpvOpIAdd, type, GetContext()->TakeNextId(), + GetContext(), spv::Op::OpIAdd, type, GetContext()->TakeNextId(), {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}})); return AddInstruction(std::move(inst)); } @@ -308,7 +312,7 @@ class InstructionBuilder { uint32_t type = GetContext()->get_type_mgr()->GetId(&bool_type); // TODO(1841): Handle id overflow. std::unique_ptr inst(new Instruction( - GetContext(), SpvOpULessThan, type, GetContext()->TakeNextId(), + GetContext(), spv::Op::OpULessThan, type, GetContext()->TakeNextId(), {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}})); return AddInstruction(std::move(inst)); } @@ -322,7 +326,7 @@ class InstructionBuilder { uint32_t type = GetContext()->get_type_mgr()->GetId(&bool_type); // TODO(1841): Handle id overflow. std::unique_ptr inst(new Instruction( - GetContext(), SpvOpSLessThan, type, GetContext()->TakeNextId(), + GetContext(), spv::Op::OpSLessThan, type, GetContext()->TakeNextId(), {{SPV_OPERAND_TYPE_ID, {op1}}, {SPV_OPERAND_TYPE_ID, {op2}}})); return AddInstruction(std::move(inst)); } @@ -352,7 +356,7 @@ class InstructionBuilder { uint32_t false_value) { // TODO(1841): Handle id overflow. std::unique_ptr select(new Instruction( - GetContext(), SpvOpSelect, type, GetContext()->TakeNextId(), + GetContext(), spv::Op::OpSelect, type, GetContext()->TakeNextId(), std::initializer_list{{SPV_OPERAND_TYPE_ID, {cond}}, {SPV_OPERAND_TYPE_ID, {true_value}}, {SPV_OPERAND_TYPE_ID, {false_value}}})); @@ -378,7 +382,7 @@ class InstructionBuilder { } // TODO(1841): Handle id overflow. std::unique_ptr construct( - new Instruction(GetContext(), SpvOpCompositeConstruct, type, + new Instruction(GetContext(), spv::Op::OpCompositeConstruct, type, GetContext()->TakeNextId(), ops)); return AddInstruction(std::move(construct)); } @@ -447,7 +451,7 @@ class InstructionBuilder { // TODO(1841): Handle id overflow. std::unique_ptr new_inst( - new Instruction(GetContext(), SpvOpCompositeExtract, type, + new Instruction(GetContext(), spv::Op::OpCompositeExtract, type, GetContext()->TakeNextId(), operands)); return AddInstruction(std::move(new_inst)); } @@ -455,7 +459,7 @@ class InstructionBuilder { // Creates an unreachable instruction. Instruction* AddUnreachable() { std::unique_ptr select( - new Instruction(GetContext(), SpvOpUnreachable, 0, 0, + new Instruction(GetContext(), spv::Op::OpUnreachable, 0, 0, std::initializer_list{})); return AddInstruction(std::move(select)); } @@ -471,7 +475,7 @@ class InstructionBuilder { // TODO(1841): Handle id overflow. std::unique_ptr new_inst( - new Instruction(GetContext(), SpvOpAccessChain, type_id, + new Instruction(GetContext(), spv::Op::OpAccessChain, type_id, GetContext()->TakeNextId(), operands)); return AddInstruction(std::move(new_inst)); } @@ -482,7 +486,7 @@ class InstructionBuilder { // TODO(1841): Handle id overflow. std::unique_ptr new_inst( - new Instruction(GetContext(), SpvOpLoad, type_id, + new Instruction(GetContext(), spv::Op::OpLoad, type_id, GetContext()->TakeNextId(), operands)); return AddInstruction(std::move(new_inst)); } @@ -491,7 +495,7 @@ class InstructionBuilder { std::vector operands; operands.push_back({SPV_OPERAND_TYPE_ID, {storage_class}}); std::unique_ptr new_inst( - new Instruction(GetContext(), SpvOpVariable, type_id, + new Instruction(GetContext(), spv::Op::OpVariable, type_id, GetContext()->TakeNextId(), operands)); return AddInstruction(std::move(new_inst)); } @@ -502,7 +506,7 @@ class InstructionBuilder { operands.push_back({SPV_OPERAND_TYPE_ID, {obj_id}}); std::unique_ptr new_inst( - new Instruction(GetContext(), SpvOpStore, 0, 0, operands)); + new Instruction(GetContext(), spv::Op::OpStore, 0, 0, operands)); return AddInstruction(std::move(new_inst)); } @@ -518,8 +522,9 @@ class InstructionBuilder { if (result_id == 0) { return nullptr; } - std::unique_ptr new_inst(new Instruction( - GetContext(), SpvOpFunctionCall, result_type, result_id, operands)); + std::unique_ptr new_inst( + new Instruction(GetContext(), spv::Op::OpFunctionCall, result_type, + result_id, operands)); return AddInstruction(std::move(new_inst)); } @@ -538,8 +543,9 @@ class InstructionBuilder { return nullptr; } - std::unique_ptr new_inst(new Instruction( - GetContext(), SpvOpVectorShuffle, result_type, result_id, operands)); + std::unique_ptr new_inst( + new Instruction(GetContext(), spv::Op::OpVectorShuffle, result_type, + result_id, operands)); return AddInstruction(std::move(new_inst)); } @@ -560,7 +566,7 @@ class InstructionBuilder { } std::unique_ptr new_inst(new Instruction( - GetContext(), SpvOpExtInst, result_type, result_id, operands)); + GetContext(), spv::Op::OpExtInst, result_type, result_id, operands)); return AddInstruction(std::move(new_inst)); } diff --git a/3rdparty/spirv-tools/source/opt/ir_context.cpp b/3rdparty/spirv-tools/source/opt/ir_context.cpp index c9c3f1b5d..889a671d0 100644 --- a/3rdparty/spirv-tools/source/opt/ir_context.cpp +++ b/3rdparty/spirv-tools/source/opt/ir_context.cpp @@ -22,23 +22,21 @@ #include "source/opt/mem_pass.h" #include "source/opt/reflect.h" +namespace spvtools { +namespace opt { namespace { - -static const int kSpvDecorateTargetIdInIdx = 0; -static const int kSpvDecorateDecorationInIdx = 1; -static const int kSpvDecorateBuiltinInIdx = 2; -static const int kEntryPointInterfaceInIdx = 3; -static const int kEntryPointFunctionIdInIdx = 1; +constexpr int kSpvDecorateTargetIdInIdx = 0; +constexpr int kSpvDecorateDecorationInIdx = 1; +constexpr int kSpvDecorateBuiltinInIdx = 2; +constexpr int kEntryPointInterfaceInIdx = 3; +constexpr int kEntryPointFunctionIdInIdx = 1; +constexpr int kEntryPointExecutionModelInIdx = 0; // Constants for OpenCL.DebugInfo.100 / NonSemantic.Shader.DebugInfo.100 // extension instructions. -static const uint32_t kDebugFunctionOperandFunctionIndex = 13; -static const uint32_t kDebugGlobalVariableOperandVariableIndex = 11; - -} // anonymous namespace - -namespace spvtools { -namespace opt { +constexpr uint32_t kDebugFunctionOperandFunctionIndex = 13; +constexpr uint32_t kDebugGlobalVariableOperandVariableIndex = 11; +} // namespace void IRContext::BuildInvalidAnalyses(IRContext::Analysis set) { set = Analysis(set & ~valid_analyses_); @@ -152,6 +150,9 @@ void IRContext::InvalidateAnalyses(IRContext::Analysis analyses_to_invalidate) { if (analyses_to_invalidate & kAnalysisConstants) { constant_mgr_.reset(nullptr); } + if (analyses_to_invalidate & kAnalysisLiveness) { + liveness_mgr_.reset(nullptr); + } if (analyses_to_invalidate & kAnalysisTypes) { type_mgr_.reset(nullptr); } @@ -195,7 +196,8 @@ Instruction* IRContext::KillInst(Instruction* inst) { if (constant_mgr_ && IsConstantInst(inst->opcode())) { constant_mgr_->RemoveId(inst->result_id()); } - if (inst->opcode() == SpvOpCapability || inst->opcode() == SpvOpExtension) { + if (inst->opcode() == spv::Op::OpCapability || + inst->opcode() == spv::Op::OpExtension) { // We reset the feature manager, instead of updating it, because it is just // as much work. We would have to remove all capabilities implied by this // capability that are not also implied by the remaining OpCapability @@ -398,8 +400,8 @@ void IRContext::AnalyzeUses(Instruction* inst) { if (AreAnalysesValid(kAnalysisDebugInfo)) { get_debug_info_mgr()->AnalyzeDebugInst(inst); } - if (id_to_name_ && - (inst->opcode() == SpvOpName || inst->opcode() == SpvOpMemberName)) { + if (id_to_name_ && (inst->opcode() == spv::Op::OpName || + inst->opcode() == spv::Op::OpMemberName)) { id_to_name_->insert({inst->GetSingleWordInOperand(0), inst}); } } @@ -427,7 +429,7 @@ void IRContext::KillOperandFromDebugInstructions(Instruction* inst) { const auto opcode = inst->opcode(); const uint32_t id = inst->result_id(); // Kill id of OpFunction from DebugFunction. - if (opcode == SpvOpFunction) { + if (opcode == spv::Op::OpFunction) { for (auto it = module()->ext_inst_debuginfo_begin(); it != module()->ext_inst_debuginfo_end(); ++it) { if (it->GetOpenCL100DebugOpcode() != OpenCLDebugInfo100DebugFunction) @@ -441,7 +443,7 @@ void IRContext::KillOperandFromDebugInstructions(Instruction* inst) { } } // Kill id of OpVariable for global variable from DebugGlobalVariable. - if (opcode == SpvOpVariable || IsConstantInst(opcode)) { + if (opcode == spv::Op::OpVariable || IsConstantInst(opcode)) { for (auto it = module()->ext_inst_debuginfo_begin(); it != module()->ext_inst_debuginfo_end(); ++it) { if (it->GetCommonDebugOpcode() != CommonDebugInfoDebugGlobalVariable) @@ -457,255 +459,259 @@ void IRContext::KillOperandFromDebugInstructions(Instruction* inst) { } void IRContext::AddCombinatorsForCapability(uint32_t capability) { - if (capability == SpvCapabilityShader) { - combinator_ops_[0].insert({SpvOpNop, - SpvOpUndef, - SpvOpConstant, - SpvOpConstantTrue, - SpvOpConstantFalse, - SpvOpConstantComposite, - SpvOpConstantSampler, - SpvOpConstantNull, - SpvOpTypeVoid, - SpvOpTypeBool, - SpvOpTypeInt, - SpvOpTypeFloat, - SpvOpTypeVector, - SpvOpTypeMatrix, - SpvOpTypeImage, - SpvOpTypeSampler, - SpvOpTypeSampledImage, - SpvOpTypeAccelerationStructureNV, - SpvOpTypeAccelerationStructureKHR, - SpvOpTypeRayQueryKHR, - SpvOpTypeArray, - SpvOpTypeRuntimeArray, - SpvOpTypeStruct, - SpvOpTypeOpaque, - SpvOpTypePointer, - SpvOpTypeFunction, - SpvOpTypeEvent, - SpvOpTypeDeviceEvent, - SpvOpTypeReserveId, - SpvOpTypeQueue, - SpvOpTypePipe, - SpvOpTypeForwardPointer, - SpvOpVariable, - SpvOpImageTexelPointer, - SpvOpLoad, - SpvOpAccessChain, - SpvOpInBoundsAccessChain, - SpvOpArrayLength, - SpvOpVectorExtractDynamic, - SpvOpVectorInsertDynamic, - SpvOpVectorShuffle, - SpvOpCompositeConstruct, - SpvOpCompositeExtract, - SpvOpCompositeInsert, - SpvOpCopyObject, - SpvOpTranspose, - SpvOpSampledImage, - SpvOpImageSampleImplicitLod, - SpvOpImageSampleExplicitLod, - SpvOpImageSampleDrefImplicitLod, - SpvOpImageSampleDrefExplicitLod, - SpvOpImageSampleProjImplicitLod, - SpvOpImageSampleProjExplicitLod, - SpvOpImageSampleProjDrefImplicitLod, - SpvOpImageSampleProjDrefExplicitLod, - SpvOpImageFetch, - SpvOpImageGather, - SpvOpImageDrefGather, - SpvOpImageRead, - SpvOpImage, - SpvOpImageQueryFormat, - SpvOpImageQueryOrder, - SpvOpImageQuerySizeLod, - SpvOpImageQuerySize, - SpvOpImageQueryLevels, - SpvOpImageQuerySamples, - SpvOpConvertFToU, - SpvOpConvertFToS, - SpvOpConvertSToF, - SpvOpConvertUToF, - SpvOpUConvert, - SpvOpSConvert, - SpvOpFConvert, - SpvOpQuantizeToF16, - SpvOpBitcast, - SpvOpSNegate, - SpvOpFNegate, - SpvOpIAdd, - SpvOpFAdd, - SpvOpISub, - SpvOpFSub, - SpvOpIMul, - SpvOpFMul, - SpvOpUDiv, - SpvOpSDiv, - SpvOpFDiv, - SpvOpUMod, - SpvOpSRem, - SpvOpSMod, - SpvOpFRem, - SpvOpFMod, - SpvOpVectorTimesScalar, - SpvOpMatrixTimesScalar, - SpvOpVectorTimesMatrix, - SpvOpMatrixTimesVector, - SpvOpMatrixTimesMatrix, - SpvOpOuterProduct, - SpvOpDot, - SpvOpIAddCarry, - SpvOpISubBorrow, - SpvOpUMulExtended, - SpvOpSMulExtended, - SpvOpAny, - SpvOpAll, - SpvOpIsNan, - SpvOpIsInf, - SpvOpLogicalEqual, - SpvOpLogicalNotEqual, - SpvOpLogicalOr, - SpvOpLogicalAnd, - SpvOpLogicalNot, - SpvOpSelect, - SpvOpIEqual, - SpvOpINotEqual, - SpvOpUGreaterThan, - SpvOpSGreaterThan, - SpvOpUGreaterThanEqual, - SpvOpSGreaterThanEqual, - SpvOpULessThan, - SpvOpSLessThan, - SpvOpULessThanEqual, - SpvOpSLessThanEqual, - SpvOpFOrdEqual, - SpvOpFUnordEqual, - SpvOpFOrdNotEqual, - SpvOpFUnordNotEqual, - SpvOpFOrdLessThan, - SpvOpFUnordLessThan, - SpvOpFOrdGreaterThan, - SpvOpFUnordGreaterThan, - SpvOpFOrdLessThanEqual, - SpvOpFUnordLessThanEqual, - SpvOpFOrdGreaterThanEqual, - SpvOpFUnordGreaterThanEqual, - SpvOpShiftRightLogical, - SpvOpShiftRightArithmetic, - SpvOpShiftLeftLogical, - SpvOpBitwiseOr, - SpvOpBitwiseXor, - SpvOpBitwiseAnd, - SpvOpNot, - SpvOpBitFieldInsert, - SpvOpBitFieldSExtract, - SpvOpBitFieldUExtract, - SpvOpBitReverse, - SpvOpBitCount, - SpvOpPhi, - SpvOpImageSparseSampleImplicitLod, - SpvOpImageSparseSampleExplicitLod, - SpvOpImageSparseSampleDrefImplicitLod, - SpvOpImageSparseSampleDrefExplicitLod, - SpvOpImageSparseSampleProjImplicitLod, - SpvOpImageSparseSampleProjExplicitLod, - SpvOpImageSparseSampleProjDrefImplicitLod, - SpvOpImageSparseSampleProjDrefExplicitLod, - SpvOpImageSparseFetch, - SpvOpImageSparseGather, - SpvOpImageSparseDrefGather, - SpvOpImageSparseTexelsResident, - SpvOpImageSparseRead, - SpvOpSizeOf}); + spv::Capability cap = spv::Capability(capability); + if (cap == spv::Capability::Shader) { + combinator_ops_[0].insert( + {(uint32_t)spv::Op::OpNop, + (uint32_t)spv::Op::OpUndef, + (uint32_t)spv::Op::OpConstant, + (uint32_t)spv::Op::OpConstantTrue, + (uint32_t)spv::Op::OpConstantFalse, + (uint32_t)spv::Op::OpConstantComposite, + (uint32_t)spv::Op::OpConstantSampler, + (uint32_t)spv::Op::OpConstantNull, + (uint32_t)spv::Op::OpTypeVoid, + (uint32_t)spv::Op::OpTypeBool, + (uint32_t)spv::Op::OpTypeInt, + (uint32_t)spv::Op::OpTypeFloat, + (uint32_t)spv::Op::OpTypeVector, + (uint32_t)spv::Op::OpTypeMatrix, + (uint32_t)spv::Op::OpTypeImage, + (uint32_t)spv::Op::OpTypeSampler, + (uint32_t)spv::Op::OpTypeSampledImage, + (uint32_t)spv::Op::OpTypeAccelerationStructureNV, + (uint32_t)spv::Op::OpTypeAccelerationStructureKHR, + (uint32_t)spv::Op::OpTypeRayQueryKHR, + (uint32_t)spv::Op::OpTypeHitObjectNV, + (uint32_t)spv::Op::OpTypeArray, + (uint32_t)spv::Op::OpTypeRuntimeArray, + (uint32_t)spv::Op::OpTypeStruct, + (uint32_t)spv::Op::OpTypeOpaque, + (uint32_t)spv::Op::OpTypePointer, + (uint32_t)spv::Op::OpTypeFunction, + (uint32_t)spv::Op::OpTypeEvent, + (uint32_t)spv::Op::OpTypeDeviceEvent, + (uint32_t)spv::Op::OpTypeReserveId, + (uint32_t)spv::Op::OpTypeQueue, + (uint32_t)spv::Op::OpTypePipe, + (uint32_t)spv::Op::OpTypeForwardPointer, + (uint32_t)spv::Op::OpVariable, + (uint32_t)spv::Op::OpImageTexelPointer, + (uint32_t)spv::Op::OpLoad, + (uint32_t)spv::Op::OpAccessChain, + (uint32_t)spv::Op::OpInBoundsAccessChain, + (uint32_t)spv::Op::OpArrayLength, + (uint32_t)spv::Op::OpVectorExtractDynamic, + (uint32_t)spv::Op::OpVectorInsertDynamic, + (uint32_t)spv::Op::OpVectorShuffle, + (uint32_t)spv::Op::OpCompositeConstruct, + (uint32_t)spv::Op::OpCompositeExtract, + (uint32_t)spv::Op::OpCompositeInsert, + (uint32_t)spv::Op::OpCopyObject, + (uint32_t)spv::Op::OpTranspose, + (uint32_t)spv::Op::OpSampledImage, + (uint32_t)spv::Op::OpImageSampleImplicitLod, + (uint32_t)spv::Op::OpImageSampleExplicitLod, + (uint32_t)spv::Op::OpImageSampleDrefImplicitLod, + (uint32_t)spv::Op::OpImageSampleDrefExplicitLod, + (uint32_t)spv::Op::OpImageSampleProjImplicitLod, + (uint32_t)spv::Op::OpImageSampleProjExplicitLod, + (uint32_t)spv::Op::OpImageSampleProjDrefImplicitLod, + (uint32_t)spv::Op::OpImageSampleProjDrefExplicitLod, + (uint32_t)spv::Op::OpImageFetch, + (uint32_t)spv::Op::OpImageGather, + (uint32_t)spv::Op::OpImageDrefGather, + (uint32_t)spv::Op::OpImageRead, + (uint32_t)spv::Op::OpImage, + (uint32_t)spv::Op::OpImageQueryFormat, + (uint32_t)spv::Op::OpImageQueryOrder, + (uint32_t)spv::Op::OpImageQuerySizeLod, + (uint32_t)spv::Op::OpImageQuerySize, + (uint32_t)spv::Op::OpImageQueryLevels, + (uint32_t)spv::Op::OpImageQuerySamples, + (uint32_t)spv::Op::OpConvertFToU, + (uint32_t)spv::Op::OpConvertFToS, + (uint32_t)spv::Op::OpConvertSToF, + (uint32_t)spv::Op::OpConvertUToF, + (uint32_t)spv::Op::OpUConvert, + (uint32_t)spv::Op::OpSConvert, + (uint32_t)spv::Op::OpFConvert, + (uint32_t)spv::Op::OpQuantizeToF16, + (uint32_t)spv::Op::OpBitcast, + (uint32_t)spv::Op::OpSNegate, + (uint32_t)spv::Op::OpFNegate, + (uint32_t)spv::Op::OpIAdd, + (uint32_t)spv::Op::OpFAdd, + (uint32_t)spv::Op::OpISub, + (uint32_t)spv::Op::OpFSub, + (uint32_t)spv::Op::OpIMul, + (uint32_t)spv::Op::OpFMul, + (uint32_t)spv::Op::OpUDiv, + (uint32_t)spv::Op::OpSDiv, + (uint32_t)spv::Op::OpFDiv, + (uint32_t)spv::Op::OpUMod, + (uint32_t)spv::Op::OpSRem, + (uint32_t)spv::Op::OpSMod, + (uint32_t)spv::Op::OpFRem, + (uint32_t)spv::Op::OpFMod, + (uint32_t)spv::Op::OpVectorTimesScalar, + (uint32_t)spv::Op::OpMatrixTimesScalar, + (uint32_t)spv::Op::OpVectorTimesMatrix, + (uint32_t)spv::Op::OpMatrixTimesVector, + (uint32_t)spv::Op::OpMatrixTimesMatrix, + (uint32_t)spv::Op::OpOuterProduct, + (uint32_t)spv::Op::OpDot, + (uint32_t)spv::Op::OpIAddCarry, + (uint32_t)spv::Op::OpISubBorrow, + (uint32_t)spv::Op::OpUMulExtended, + (uint32_t)spv::Op::OpSMulExtended, + (uint32_t)spv::Op::OpAny, + (uint32_t)spv::Op::OpAll, + (uint32_t)spv::Op::OpIsNan, + (uint32_t)spv::Op::OpIsInf, + (uint32_t)spv::Op::OpLogicalEqual, + (uint32_t)spv::Op::OpLogicalNotEqual, + (uint32_t)spv::Op::OpLogicalOr, + (uint32_t)spv::Op::OpLogicalAnd, + (uint32_t)spv::Op::OpLogicalNot, + (uint32_t)spv::Op::OpSelect, + (uint32_t)spv::Op::OpIEqual, + (uint32_t)spv::Op::OpINotEqual, + (uint32_t)spv::Op::OpUGreaterThan, + (uint32_t)spv::Op::OpSGreaterThan, + (uint32_t)spv::Op::OpUGreaterThanEqual, + (uint32_t)spv::Op::OpSGreaterThanEqual, + (uint32_t)spv::Op::OpULessThan, + (uint32_t)spv::Op::OpSLessThan, + (uint32_t)spv::Op::OpULessThanEqual, + (uint32_t)spv::Op::OpSLessThanEqual, + (uint32_t)spv::Op::OpFOrdEqual, + (uint32_t)spv::Op::OpFUnordEqual, + (uint32_t)spv::Op::OpFOrdNotEqual, + (uint32_t)spv::Op::OpFUnordNotEqual, + (uint32_t)spv::Op::OpFOrdLessThan, + (uint32_t)spv::Op::OpFUnordLessThan, + (uint32_t)spv::Op::OpFOrdGreaterThan, + (uint32_t)spv::Op::OpFUnordGreaterThan, + (uint32_t)spv::Op::OpFOrdLessThanEqual, + (uint32_t)spv::Op::OpFUnordLessThanEqual, + (uint32_t)spv::Op::OpFOrdGreaterThanEqual, + (uint32_t)spv::Op::OpFUnordGreaterThanEqual, + (uint32_t)spv::Op::OpShiftRightLogical, + (uint32_t)spv::Op::OpShiftRightArithmetic, + (uint32_t)spv::Op::OpShiftLeftLogical, + (uint32_t)spv::Op::OpBitwiseOr, + (uint32_t)spv::Op::OpBitwiseXor, + (uint32_t)spv::Op::OpBitwiseAnd, + (uint32_t)spv::Op::OpNot, + (uint32_t)spv::Op::OpBitFieldInsert, + (uint32_t)spv::Op::OpBitFieldSExtract, + (uint32_t)spv::Op::OpBitFieldUExtract, + (uint32_t)spv::Op::OpBitReverse, + (uint32_t)spv::Op::OpBitCount, + (uint32_t)spv::Op::OpPhi, + (uint32_t)spv::Op::OpImageSparseSampleImplicitLod, + (uint32_t)spv::Op::OpImageSparseSampleExplicitLod, + (uint32_t)spv::Op::OpImageSparseSampleDrefImplicitLod, + (uint32_t)spv::Op::OpImageSparseSampleDrefExplicitLod, + (uint32_t)spv::Op::OpImageSparseSampleProjImplicitLod, + (uint32_t)spv::Op::OpImageSparseSampleProjExplicitLod, + (uint32_t)spv::Op::OpImageSparseSampleProjDrefImplicitLod, + (uint32_t)spv::Op::OpImageSparseSampleProjDrefExplicitLod, + (uint32_t)spv::Op::OpImageSparseFetch, + (uint32_t)spv::Op::OpImageSparseGather, + (uint32_t)spv::Op::OpImageSparseDrefGather, + (uint32_t)spv::Op::OpImageSparseTexelsResident, + (uint32_t)spv::Op::OpImageSparseRead, + (uint32_t)spv::Op::OpSizeOf}); } } void IRContext::AddCombinatorsForExtension(Instruction* extension) { - assert(extension->opcode() == SpvOpExtInstImport && + assert(extension->opcode() == spv::Op::OpExtInstImport && "Expecting an import of an extension's instruction set."); const std::string extension_name = extension->GetInOperand(0).AsString(); if (extension_name == "GLSL.std.450") { - combinator_ops_[extension->result_id()] = {GLSLstd450Round, - GLSLstd450RoundEven, - GLSLstd450Trunc, - GLSLstd450FAbs, - GLSLstd450SAbs, - GLSLstd450FSign, - GLSLstd450SSign, - GLSLstd450Floor, - GLSLstd450Ceil, - GLSLstd450Fract, - GLSLstd450Radians, - GLSLstd450Degrees, - GLSLstd450Sin, - GLSLstd450Cos, - GLSLstd450Tan, - GLSLstd450Asin, - GLSLstd450Acos, - GLSLstd450Atan, - GLSLstd450Sinh, - GLSLstd450Cosh, - GLSLstd450Tanh, - GLSLstd450Asinh, - GLSLstd450Acosh, - GLSLstd450Atanh, - GLSLstd450Atan2, - GLSLstd450Pow, - GLSLstd450Exp, - GLSLstd450Log, - GLSLstd450Exp2, - GLSLstd450Log2, - GLSLstd450Sqrt, - GLSLstd450InverseSqrt, - GLSLstd450Determinant, - GLSLstd450MatrixInverse, - GLSLstd450ModfStruct, - GLSLstd450FMin, - GLSLstd450UMin, - GLSLstd450SMin, - GLSLstd450FMax, - GLSLstd450UMax, - GLSLstd450SMax, - GLSLstd450FClamp, - GLSLstd450UClamp, - GLSLstd450SClamp, - GLSLstd450FMix, - GLSLstd450IMix, - GLSLstd450Step, - GLSLstd450SmoothStep, - GLSLstd450Fma, - GLSLstd450FrexpStruct, - GLSLstd450Ldexp, - GLSLstd450PackSnorm4x8, - GLSLstd450PackUnorm4x8, - GLSLstd450PackSnorm2x16, - GLSLstd450PackUnorm2x16, - GLSLstd450PackHalf2x16, - GLSLstd450PackDouble2x32, - GLSLstd450UnpackSnorm2x16, - GLSLstd450UnpackUnorm2x16, - GLSLstd450UnpackHalf2x16, - GLSLstd450UnpackSnorm4x8, - GLSLstd450UnpackUnorm4x8, - GLSLstd450UnpackDouble2x32, - GLSLstd450Length, - GLSLstd450Distance, - GLSLstd450Cross, - GLSLstd450Normalize, - GLSLstd450FaceForward, - GLSLstd450Reflect, - GLSLstd450Refract, - GLSLstd450FindILsb, - GLSLstd450FindSMsb, - GLSLstd450FindUMsb, - GLSLstd450InterpolateAtCentroid, - GLSLstd450InterpolateAtSample, - GLSLstd450InterpolateAtOffset, - GLSLstd450NMin, - GLSLstd450NMax, - GLSLstd450NClamp}; + combinator_ops_[extension->result_id()] = { + (uint32_t)GLSLstd450Round, + (uint32_t)GLSLstd450RoundEven, + (uint32_t)GLSLstd450Trunc, + (uint32_t)GLSLstd450FAbs, + (uint32_t)GLSLstd450SAbs, + (uint32_t)GLSLstd450FSign, + (uint32_t)GLSLstd450SSign, + (uint32_t)GLSLstd450Floor, + (uint32_t)GLSLstd450Ceil, + (uint32_t)GLSLstd450Fract, + (uint32_t)GLSLstd450Radians, + (uint32_t)GLSLstd450Degrees, + (uint32_t)GLSLstd450Sin, + (uint32_t)GLSLstd450Cos, + (uint32_t)GLSLstd450Tan, + (uint32_t)GLSLstd450Asin, + (uint32_t)GLSLstd450Acos, + (uint32_t)GLSLstd450Atan, + (uint32_t)GLSLstd450Sinh, + (uint32_t)GLSLstd450Cosh, + (uint32_t)GLSLstd450Tanh, + (uint32_t)GLSLstd450Asinh, + (uint32_t)GLSLstd450Acosh, + (uint32_t)GLSLstd450Atanh, + (uint32_t)GLSLstd450Atan2, + (uint32_t)GLSLstd450Pow, + (uint32_t)GLSLstd450Exp, + (uint32_t)GLSLstd450Log, + (uint32_t)GLSLstd450Exp2, + (uint32_t)GLSLstd450Log2, + (uint32_t)GLSLstd450Sqrt, + (uint32_t)GLSLstd450InverseSqrt, + (uint32_t)GLSLstd450Determinant, + (uint32_t)GLSLstd450MatrixInverse, + (uint32_t)GLSLstd450ModfStruct, + (uint32_t)GLSLstd450FMin, + (uint32_t)GLSLstd450UMin, + (uint32_t)GLSLstd450SMin, + (uint32_t)GLSLstd450FMax, + (uint32_t)GLSLstd450UMax, + (uint32_t)GLSLstd450SMax, + (uint32_t)GLSLstd450FClamp, + (uint32_t)GLSLstd450UClamp, + (uint32_t)GLSLstd450SClamp, + (uint32_t)GLSLstd450FMix, + (uint32_t)GLSLstd450IMix, + (uint32_t)GLSLstd450Step, + (uint32_t)GLSLstd450SmoothStep, + (uint32_t)GLSLstd450Fma, + (uint32_t)GLSLstd450FrexpStruct, + (uint32_t)GLSLstd450Ldexp, + (uint32_t)GLSLstd450PackSnorm4x8, + (uint32_t)GLSLstd450PackUnorm4x8, + (uint32_t)GLSLstd450PackSnorm2x16, + (uint32_t)GLSLstd450PackUnorm2x16, + (uint32_t)GLSLstd450PackHalf2x16, + (uint32_t)GLSLstd450PackDouble2x32, + (uint32_t)GLSLstd450UnpackSnorm2x16, + (uint32_t)GLSLstd450UnpackUnorm2x16, + (uint32_t)GLSLstd450UnpackHalf2x16, + (uint32_t)GLSLstd450UnpackSnorm4x8, + (uint32_t)GLSLstd450UnpackUnorm4x8, + (uint32_t)GLSLstd450UnpackDouble2x32, + (uint32_t)GLSLstd450Length, + (uint32_t)GLSLstd450Distance, + (uint32_t)GLSLstd450Cross, + (uint32_t)GLSLstd450Normalize, + (uint32_t)GLSLstd450FaceForward, + (uint32_t)GLSLstd450Reflect, + (uint32_t)GLSLstd450Refract, + (uint32_t)GLSLstd450FindILsb, + (uint32_t)GLSLstd450FindSMsb, + (uint32_t)GLSLstd450FindUMsb, + (uint32_t)GLSLstd450InterpolateAtCentroid, + (uint32_t)GLSLstd450InterpolateAtSample, + (uint32_t)GLSLstd450InterpolateAtOffset, + (uint32_t)GLSLstd450NMin, + (uint32_t)GLSLstd450NMax, + (uint32_t)GLSLstd450NClamp}; } else { // Map the result id to the empty set. combinator_ops_[extension->result_id()]; @@ -713,8 +719,9 @@ void IRContext::AddCombinatorsForExtension(Instruction* extension) { } void IRContext::InitializeCombinators() { - get_feature_mgr()->GetCapabilities()->ForEach( - [this](SpvCapability cap) { AddCombinatorsForCapability(cap); }); + get_feature_mgr()->GetCapabilities()->ForEach([this](spv::Capability cap) { + AddCombinatorsForCapability(uint32_t(cap)); + }); for (auto& extension : module()->ext_inst_imports()) { AddCombinatorsForExtension(&extension); @@ -724,8 +731,8 @@ void IRContext::InitializeCombinators() { } void IRContext::RemoveFromIdToName(const Instruction* inst) { - if (id_to_name_ && - (inst->opcode() == SpvOpName || inst->opcode() == SpvOpMemberName)) { + if (id_to_name_ && (inst->opcode() == spv::Op::OpName || + inst->opcode() == spv::Op::OpMemberName)) { auto range = id_to_name_->equal_range(inst->GetSingleWordInOperand(0)); for (auto it = range.first; it != range.second; ++it) { if (it->second == inst) { @@ -754,15 +761,17 @@ LoopDescriptor* IRContext::GetLoopDescriptor(const Function* f) { uint32_t IRContext::FindBuiltinInputVar(uint32_t builtin) { for (auto& a : module_->annotations()) { - if (a.opcode() != SpvOpDecorate) continue; - if (a.GetSingleWordInOperand(kSpvDecorateDecorationInIdx) != - SpvDecorationBuiltIn) + if (spv::Op(a.opcode()) != spv::Op::OpDecorate) continue; + if (spv::Decoration(a.GetSingleWordInOperand( + kSpvDecorateDecorationInIdx)) != spv::Decoration::BuiltIn) continue; if (a.GetSingleWordInOperand(kSpvDecorateBuiltinInIdx) != builtin) continue; uint32_t target_id = a.GetSingleWordInOperand(kSpvDecorateTargetIdInIdx); Instruction* b_var = get_def_use_mgr()->GetDef(target_id); - if (b_var->opcode() != SpvOpVariable) continue; - if (b_var->GetSingleWordInOperand(0) != SpvStorageClassInput) continue; + if (b_var->opcode() != spv::Op::OpVariable) continue; + if (spv::StorageClass(b_var->GetSingleWordInOperand(0)) != + spv::StorageClass::Input) + continue; return target_id; } return 0; @@ -798,39 +807,39 @@ uint32_t IRContext::GetBuiltinInputVarId(uint32_t builtin) { // TODO(greg-lunarg): Add support for all builtins analysis::TypeManager* type_mgr = get_type_mgr(); analysis::Type* reg_type; - switch (builtin) { - case SpvBuiltInFragCoord: { + switch (spv::BuiltIn(builtin)) { + case spv::BuiltIn::FragCoord: { analysis::Float float_ty(32); analysis::Type* reg_float_ty = type_mgr->GetRegisteredType(&float_ty); analysis::Vector v4float_ty(reg_float_ty, 4); reg_type = type_mgr->GetRegisteredType(&v4float_ty); break; } - case SpvBuiltInVertexIndex: - case SpvBuiltInInstanceIndex: - case SpvBuiltInPrimitiveId: - case SpvBuiltInInvocationId: - case SpvBuiltInSubgroupLocalInvocationId: { + case spv::BuiltIn::VertexIndex: + case spv::BuiltIn::InstanceIndex: + case spv::BuiltIn::PrimitiveId: + case spv::BuiltIn::InvocationId: + case spv::BuiltIn::SubgroupLocalInvocationId: { analysis::Integer uint_ty(32, false); reg_type = type_mgr->GetRegisteredType(&uint_ty); break; } - case SpvBuiltInGlobalInvocationId: - case SpvBuiltInLaunchIdNV: { + case spv::BuiltIn::GlobalInvocationId: + case spv::BuiltIn::LaunchIdNV: { analysis::Integer uint_ty(32, false); analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty); analysis::Vector v3uint_ty(reg_uint_ty, 3); reg_type = type_mgr->GetRegisteredType(&v3uint_ty); break; } - case SpvBuiltInTessCoord: { + case spv::BuiltIn::TessCoord: { analysis::Float float_ty(32); analysis::Type* reg_float_ty = type_mgr->GetRegisteredType(&float_ty); analysis::Vector v3float_ty(reg_float_ty, 3); reg_type = type_mgr->GetRegisteredType(&v3float_ty); break; } - case SpvBuiltInSubgroupLtMask: { + case spv::BuiltIn::SubgroupLtMask: { analysis::Integer uint_ty(32, false); analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty); analysis::Vector v4uint_ty(reg_uint_ty, 4); @@ -844,17 +853,17 @@ uint32_t IRContext::GetBuiltinInputVarId(uint32_t builtin) { } uint32_t type_id = type_mgr->GetTypeInstruction(reg_type); uint32_t varTyPtrId = - type_mgr->FindPointerToType(type_id, SpvStorageClassInput); + type_mgr->FindPointerToType(type_id, spv::StorageClass::Input); // TODO(1841): Handle id overflow. var_id = TakeNextId(); std::unique_ptr newVarOp( - new Instruction(this, SpvOpVariable, varTyPtrId, var_id, + new Instruction(this, spv::Op::OpVariable, varTyPtrId, var_id, {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvStorageClassInput}}})); + {uint32_t(spv::StorageClass::Input)}}})); get_def_use_mgr()->AnalyzeInstDefUse(&*newVarOp); module()->AddGlobalValue(std::move(newVarOp)); - get_decoration_mgr()->AddDecorationVal(var_id, SpvDecorationBuiltIn, - builtin); + get_decoration_mgr()->AddDecorationVal( + var_id, uint32_t(spv::Decoration::BuiltIn), builtin); AddVarToEntryPoints(var_id); } builtin_var_id_map_[builtin] = var_id; @@ -864,7 +873,7 @@ uint32_t IRContext::GetBuiltinInputVarId(uint32_t builtin) { void IRContext::AddCalls(const Function* func, std::queue* todo) { for (auto bi = func->begin(); bi != func->end(); ++bi) for (auto ii = bi->begin(); ii != bi->end(); ++ii) - if (ii->opcode() == SpvOpFunctionCall) + if (ii->opcode() == spv::Op::OpFunctionCall) todo->push(ii->GetSingleWordInOperand(0)); } @@ -889,12 +898,12 @@ bool IRContext::ProcessReachableCallTree(ProcessFunction& pfn) { for (auto& a : annotations()) { // TODO: Handle group decorations as well. Currently not generate by any // front-end, but could be coming. - if (a.opcode() == SpvOp::SpvOpDecorate) { - if (a.GetSingleWordOperand(1) == - SpvDecoration::SpvDecorationLinkageAttributes) { + if (a.opcode() == spv::Op::OpDecorate) { + if (spv::Decoration(a.GetSingleWordOperand(1)) == + spv::Decoration::LinkageAttributes) { uint32_t lastOperand = a.NumOperands() - 1; - if (a.GetSingleWordOperand(lastOperand) == - SpvLinkageType::SpvLinkageTypeExport) { + if (spv::LinkageType(a.GetSingleWordOperand(lastOperand)) == + spv::LinkageType::Export) { uint32_t id = a.GetSingleWordOperand(0); if (GetFunction(id)) { roots.push(id); @@ -1058,5 +1067,26 @@ bool IRContext::IsReachable(const opt::BasicBlock& bb) { return GetDominatorAnalysis(enclosing_function) ->Dominates(enclosing_function->entry().get(), &bb); } + +spv::ExecutionModel IRContext::GetStage() { + const auto& entry_points = module()->entry_points(); + if (entry_points.empty()) { + return spv::ExecutionModel::Max; + } + + uint32_t stage = entry_points.begin()->GetSingleWordInOperand( + kEntryPointExecutionModelInIdx); + auto it = std::find_if( + entry_points.begin(), entry_points.end(), [stage](const Instruction& x) { + return x.GetSingleWordInOperand(kEntryPointExecutionModelInIdx) != + stage; + }); + if (it != entry_points.end()) { + EmitErrorMessage("Mixed stage shader module not supported", &(*it)); + } + + return static_cast(stage); +} + } // namespace opt } // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/ir_context.h b/3rdparty/spirv-tools/source/opt/ir_context.h index 2f27942b4..35075de17 100644 --- a/3rdparty/spirv-tools/source/opt/ir_context.h +++ b/3rdparty/spirv-tools/source/opt/ir_context.h @@ -35,6 +35,7 @@ #include "source/opt/dominator_analysis.h" #include "source/opt/feature_manager.h" #include "source/opt/fold.h" +#include "source/opt/liveness.h" #include "source/opt/loop_descriptor.h" #include "source/opt/module.h" #include "source/opt/register_pressure.h" @@ -81,6 +82,7 @@ class IRContext { kAnalysisConstants = 1 << 14, kAnalysisTypes = 1 << 15, kAnalysisDebugInfo = 1 << 16, + kAnalysisLiveness = 1 << 17, kAnalysisEnd = 1 << 17 }; @@ -201,7 +203,7 @@ class IRContext { inline IteratorRange ext_inst_debuginfo() const; // Add |capability| to the module, if it is not already enabled. - inline void AddCapability(SpvCapability capability); + inline void AddCapability(spv::Capability capability); // Appends a capability instruction to this module. inline void AddCapability(std::unique_ptr&& c); @@ -248,6 +250,15 @@ class IRContext { return def_use_mgr_.get(); } + // Returns a pointer to a liveness manager. If the liveness manager is + // invalid, it is rebuilt first. + analysis::LivenessManager* get_liveness_mgr() { + if (!AreAnalysesValid(kAnalysisLiveness)) { + BuildLivenessManager(); + } + return liveness_mgr_.get(); + } + // Returns a pointer to a value number table. If the liveness analysis is // invalid, it is rebuilt first. ValueNumberTable* GetValueNumberTable() { @@ -367,6 +378,11 @@ class IRContext { // having more than one name. This method returns the first one it finds. inline Instruction* GetMemberName(uint32_t struct_type_id, uint32_t index); + // Copy names from |old_id| to |new_id|. Only copy member name if index is + // less than |max_member_index|. + inline void CloneNames(const uint32_t old_id, const uint32_t new_id, + const uint32_t max_member_index = UINT32_MAX); + // Sets the message consumer to the given |consumer|. |consumer| which will be // invoked every time there is a message to be communicated to the outside. void SetMessageConsumer(MessageConsumer c) { consumer_ = std::move(c); } @@ -475,14 +491,14 @@ class IRContext { if (!AreAnalysesValid(kAnalysisCombinators)) { InitializeCombinators(); } - const uint32_t kExtInstSetIdInIndx = 0; - const uint32_t kExtInstInstructionInIndx = 1; + constexpr uint32_t kExtInstSetIdInIndx = 0; + constexpr uint32_t kExtInstInstructionInIndx = 1; - if (inst->opcode() != SpvOpExtInst) { - return combinator_ops_[0].count(inst->opcode()) != 0; + if (inst->opcode() != spv::Op::OpExtInst) { + return combinator_ops_[0].count(uint32_t(inst->opcode())) != 0; } else { uint32_t set = inst->GetSingleWordInOperand(kExtInstSetIdInIndx); - uint32_t op = inst->GetSingleWordInOperand(kExtInstInstructionInIndx); + auto op = inst->GetSingleWordInOperand(kExtInstInstructionInIndx); return combinator_ops_[set].count(op) != 0; } } @@ -591,7 +607,7 @@ class IRContext { } Function* GetFunction(Instruction* inst) { - if (inst->opcode() != SpvOpFunction) { + if (inst->opcode() != spv::Op::OpFunction) { return nullptr; } return GetFunction(inst->result_id()); @@ -625,6 +641,10 @@ class IRContext { // the function that contains |bb|. bool IsReachable(const opt::BasicBlock& bb); + // Return the stage of the module. Will generate error if entry points don't + // all have the same stage. + spv::ExecutionModel GetStage(); + private: // Builds the def-use manager from scratch, even if it was already valid. void BuildDefUseManager() { @@ -632,6 +652,12 @@ class IRContext { valid_analyses_ = valid_analyses_ | kAnalysisDefUse; } + // Builds the liveness manager from scratch, even if it was already valid. + void BuildLivenessManager() { + liveness_mgr_ = MakeUnique(this); + valid_analyses_ = valid_analyses_ | kAnalysisLiveness; + } + // Builds the instruction-block map for the whole module. void BuildInstrToBlockMapping() { instr_to_block_.clear(); @@ -852,6 +878,9 @@ class IRContext { std::unique_ptr struct_cfg_analysis_; + // The liveness manager for |module_|. + std::unique_ptr liveness_mgr_; + // The maximum legal value for the id bound. uint32_t max_id_bound_; @@ -1014,10 +1043,10 @@ IteratorRange IRContext::ext_inst_debuginfo() return ((const Module*)module_.get())->ext_inst_debuginfo(); } -void IRContext::AddCapability(SpvCapability capability) { +void IRContext::AddCapability(spv::Capability capability) { if (!get_feature_mgr()->HasCapability(capability)) { std::unique_ptr capability_inst(new Instruction( - this, SpvOpCapability, 0, 0, + this, spv::Op::OpCapability, 0, 0, {{SPV_OPERAND_TYPE_CAPABILITY, {static_cast(capability)}}})); AddCapability(std::move(capability_inst)); } @@ -1027,7 +1056,7 @@ void IRContext::AddCapability(std::unique_ptr&& c) { AddCombinatorsForCapability(c->GetSingleWordInOperand(0)); if (feature_mgr_ != nullptr) { feature_mgr_->AddCapability( - static_cast(c->GetSingleWordInOperand(0))); + static_cast(c->GetSingleWordInOperand(0))); } if (AreAnalysesValid(kAnalysisDefUse)) { get_def_use_mgr()->AnalyzeInstDefUse(c.get()); @@ -1038,7 +1067,7 @@ void IRContext::AddCapability(std::unique_ptr&& c) { void IRContext::AddExtension(const std::string& ext_name) { std::vector ext_words = spvtools::utils::MakeVector(ext_name); AddExtension(std::unique_ptr( - new Instruction(this, SpvOpExtension, 0u, 0u, + new Instruction(this, spv::Op::OpExtension, 0u, 0u, {{SPV_OPERAND_TYPE_LITERAL_STRING, ext_words}}))); } @@ -1055,7 +1084,7 @@ void IRContext::AddExtension(std::unique_ptr&& e) { void IRContext::AddExtInstImport(const std::string& name) { std::vector ext_words = spvtools::utils::MakeVector(name); AddExtInstImport(std::unique_ptr( - new Instruction(this, SpvOpExtInstImport, 0u, TakeNextId(), + new Instruction(this, spv::Op::OpExtInstImport, 0u, TakeNextId(), {{SPV_OPERAND_TYPE_LITERAL_STRING, ext_words}}))); } @@ -1088,7 +1117,8 @@ void IRContext::AddDebug1Inst(std::unique_ptr&& d) { void IRContext::AddDebug2Inst(std::unique_ptr&& d) { if (AreAnalysesValid(kAnalysisNameMap)) { - if (d->opcode() == SpvOpName || d->opcode() == SpvOpMemberName) { + if (d->opcode() == spv::Op::OpName || + d->opcode() == spv::Op::OpMemberName) { // OpName and OpMemberName do not have result-ids. The target of the // instruction is at InOperand index 0. id_to_name_->insert({d->GetSingleWordInOperand(0), d.get()}); @@ -1151,8 +1181,8 @@ void IRContext::UpdateDefUse(Instruction* inst) { void IRContext::BuildIdToNameMap() { id_to_name_ = MakeUnique>(); for (Instruction& debug_inst : debugs2()) { - if (debug_inst.opcode() == SpvOpMemberName || - debug_inst.opcode() == SpvOpName) { + if (debug_inst.opcode() == spv::Op::OpMemberName || + debug_inst.opcode() == spv::Op::OpName) { id_to_name_->insert({debug_inst.GetSingleWordInOperand(0), &debug_inst}); } } @@ -1175,7 +1205,7 @@ Instruction* IRContext::GetMemberName(uint32_t struct_type_id, uint32_t index) { auto result = id_to_name_->equal_range(struct_type_id); for (auto i = result.first; i != result.second; ++i) { auto* name_instr = i->second; - if (name_instr->opcode() == SpvOpMemberName && + if (name_instr->opcode() == spv::Op::OpMemberName && name_instr->GetSingleWordInOperand(1) == index) { return name_instr; } @@ -1183,6 +1213,25 @@ Instruction* IRContext::GetMemberName(uint32_t struct_type_id, uint32_t index) { return nullptr; } +void IRContext::CloneNames(const uint32_t old_id, const uint32_t new_id, + const uint32_t max_member_index) { + std::vector> names_to_add; + auto names = GetNames(old_id); + for (auto n : names) { + Instruction* old_name_inst = n.second; + if (old_name_inst->opcode() == spv::Op::OpMemberName) { + auto midx = old_name_inst->GetSingleWordInOperand(1); + if (midx >= max_member_index) continue; + } + std::unique_ptr new_name_inst(old_name_inst->Clone(this)); + new_name_inst->SetInOperand(0, {new_id}); + names_to_add.push_back(std::move(new_name_inst)); + } + // We can't add the new names when we are iterating over name range above. + // We can add all the new names now. + for (auto& new_name : names_to_add) AddDebug2Inst(std::move(new_name)); +} + } // namespace opt } // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/ir_loader.cpp b/3rdparty/spirv-tools/source/opt/ir_loader.cpp index 734ad554b..e9b7bbfc2 100644 --- a/3rdparty/spirv-tools/source/opt/ir_loader.cpp +++ b/3rdparty/spirv-tools/source/opt/ir_loader.cpp @@ -24,12 +24,13 @@ #include "source/opt/reflect.h" #include "source/util/make_unique.h" -static const uint32_t kExtInstSetIndex = 4; -static const uint32_t kLexicalScopeIndex = 5; -static const uint32_t kInlinedAtIndex = 6; - namespace spvtools { namespace opt { +namespace { +constexpr uint32_t kExtInstSetIndex = 4; +constexpr uint32_t kLexicalScopeIndex = 5; +constexpr uint32_t kInlinedAtIndex = 6; +} // namespace IrLoader::IrLoader(const MessageConsumer& consumer, Module* m) : consumer_(consumer), @@ -39,9 +40,9 @@ IrLoader::IrLoader(const MessageConsumer& consumer, Module* m) last_dbg_scope_(kNoDebugScope, kNoInlinedAt) {} bool IsLineInst(const spv_parsed_instruction_t* inst) { - const auto opcode = static_cast(inst->opcode); + const auto opcode = static_cast(inst->opcode); if (IsOpLineInst(opcode)) return true; - if (opcode != SpvOpExtInst) return false; + if (opcode != spv::Op::OpExtInst) return false; if (inst->ext_inst_type != SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) return false; const uint32_t ext_inst_index = inst->words[kExtInstSetIndex]; @@ -63,8 +64,9 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { // If it is a DebugScope or DebugNoScope of debug extension, we do not // create a new instruction, but simply keep the information in // struct DebugScope. - const auto opcode = static_cast(inst->opcode); - if (opcode == SpvOpExtInst && spvExtInstIsDebugInfo(inst->ext_inst_type)) { + const auto opcode = static_cast(inst->opcode); + if (opcode == spv::Op::OpExtInst && + spvExtInstIsDebugInfo(inst->ext_inst_type)) { const uint32_t ext_inst_index = inst->words[kExtInstSetIndex]; if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 || inst->ext_inst_type == @@ -130,13 +132,13 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { // Handle function and basic block boundaries first, then normal // instructions. - if (opcode == SpvOpFunction) { + if (opcode == spv::Op::OpFunction) { if (function_ != nullptr) { Error(consumer_, src, loc, "function inside function"); return false; } function_ = MakeUnique(std::move(spv_inst)); - } else if (opcode == SpvOpFunctionEnd) { + } else if (opcode == spv::Op::OpFunctionEnd) { if (function_ == nullptr) { Error(consumer_, src, loc, "OpFunctionEnd without corresponding OpFunction"); @@ -149,7 +151,7 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { function_->SetFunctionEnd(std::move(spv_inst)); module_->AddFunction(std::move(function_)); function_ = nullptr; - } else if (opcode == SpvOpLabel) { + } else if (opcode == spv::Op::OpLabel) { if (function_ == nullptr) { Error(consumer_, src, loc, "OpLabel outside function"); return false; @@ -179,20 +181,20 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { } else { if (function_ == nullptr) { // Outside function definition SPIRV_ASSERT(consumer_, block_ == nullptr); - if (opcode == SpvOpCapability) { + if (opcode == spv::Op::OpCapability) { module_->AddCapability(std::move(spv_inst)); - } else if (opcode == SpvOpExtension) { + } else if (opcode == spv::Op::OpExtension) { module_->AddExtension(std::move(spv_inst)); - } else if (opcode == SpvOpExtInstImport) { + } else if (opcode == spv::Op::OpExtInstImport) { module_->AddExtInstImport(std::move(spv_inst)); - } else if (opcode == SpvOpMemoryModel) { + } else if (opcode == spv::Op::OpMemoryModel) { module_->SetMemoryModel(std::move(spv_inst)); - } else if (opcode == SpvOpSamplerImageAddressingModeNV) { + } else if (opcode == spv::Op::OpSamplerImageAddressingModeNV) { module_->SetSampledImageAddressMode(std::move(spv_inst)); - } else if (opcode == SpvOpEntryPoint) { + } else if (opcode == spv::Op::OpEntryPoint) { module_->AddEntryPoint(std::move(spv_inst)); - } else if (opcode == SpvOpExecutionMode || - opcode == SpvOpExecutionModeId) { + } else if (opcode == spv::Op::OpExecutionMode || + opcode == spv::Op::OpExecutionModeId) { module_->AddExecutionMode(std::move(spv_inst)); } else if (IsDebug1Inst(opcode)) { module_->AddDebug1Inst(std::move(spv_inst)); @@ -204,13 +206,13 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { module_->AddAnnotationInst(std::move(spv_inst)); } else if (IsTypeInst(opcode)) { module_->AddType(std::move(spv_inst)); - } else if (IsConstantInst(opcode) || opcode == SpvOpVariable || - opcode == SpvOpUndef) { + } else if (IsConstantInst(opcode) || opcode == spv::Op::OpVariable || + opcode == spv::Op::OpUndef) { module_->AddGlobalValue(std::move(spv_inst)); - } else if (opcode == SpvOpExtInst && + } else if (opcode == spv::Op::OpExtInst && spvExtInstIsDebugInfo(inst->ext_inst_type)) { module_->AddExtInstDebugInfo(std::move(spv_inst)); - } else if (opcode == SpvOpExtInst && + } else if (opcode == spv::Op::OpExtInst && spvExtInstIsNonSemantic(inst->ext_inst_type)) { // If there are no functions, add the non-semantic instructions to the // global values. Otherwise append it to the list of the last function. @@ -229,11 +231,11 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { return false; } } else { - if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) + if (opcode == spv::Op::OpLoopMerge || opcode == spv::Op::OpSelectionMerge) last_dbg_scope_ = DebugScope(kNoDebugScope, kNoInlinedAt); if (last_dbg_scope_.GetLexicalScope() != kNoDebugScope) spv_inst->SetDebugScope(last_dbg_scope_); - if (opcode == SpvOpExtInst && + if (opcode == spv::Op::OpExtInst && spvExtInstIsDebugInfo(inst->ext_inst_type)) { const uint32_t ext_inst_index = inst->words[kExtInstSetIndex]; if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) { @@ -322,7 +324,7 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) { } } else { if (block_ == nullptr) { // Inside function but outside blocks - if (opcode != SpvOpFunctionParameter) { + if (opcode != spv::Op::OpFunctionParameter) { Errorf(consumer_, src, loc, "Non-OpFunctionParameter (opcode: %d) found inside " "function but outside basic block", diff --git a/3rdparty/spirv-tools/source/opt/licm_pass.cpp b/3rdparty/spirv-tools/source/opt/licm_pass.cpp index 82851fd27..514518b46 100644 --- a/3rdparty/spirv-tools/source/opt/licm_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/licm_pass.cpp @@ -126,8 +126,8 @@ bool LICMPass::HoistInstruction(Loop* loop, Instruction* inst) { } Instruction* insertion_point = &*pre_header_bb->tail(); Instruction* previous_node = insertion_point->PreviousNode(); - if (previous_node && (previous_node->opcode() == SpvOpLoopMerge || - previous_node->opcode() == SpvOpSelectionMerge)) { + if (previous_node && (previous_node->opcode() == spv::Op::OpLoopMerge || + previous_node->opcode() == spv::Op::OpSelectionMerge)) { insertion_point = previous_node; } diff --git a/3rdparty/spirv-tools/source/opt/liveness.cpp b/3rdparty/spirv-tools/source/opt/liveness.cpp new file mode 100644 index 000000000..fdf3f4e11 --- /dev/null +++ b/3rdparty/spirv-tools/source/opt/liveness.cpp @@ -0,0 +1,332 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// Copyright (c) 2022 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "source/opt/liveness.h" + +#include "source/opt/ir_context.h" + +namespace spvtools { +namespace opt { +namespace analysis { +namespace { +constexpr uint32_t kDecorationLocationInIdx = 2; +constexpr uint32_t kOpDecorateMemberMemberInIdx = 1; +constexpr uint32_t kOpDecorateMemberLocationInIdx = 3; +constexpr uint32_t kOpDecorateBuiltInLiteralInIdx = 2; +constexpr uint32_t kOpDecorateMemberBuiltInLiteralInIdx = 3; +} // namespace + +LivenessManager::LivenessManager(IRContext* ctx) : ctx_(ctx), computed_(false) { + // Liveness sets computed when queried +} + +void LivenessManager::InitializeAnalysis() { + live_locs_.clear(); + live_builtins_.clear(); + // Mark all builtins live for frag shader. + if (context()->GetStage() == spv::ExecutionModel::Fragment) { + live_builtins_.insert(uint32_t(spv::BuiltIn::PointSize)); + live_builtins_.insert(uint32_t(spv::BuiltIn::ClipDistance)); + live_builtins_.insert(uint32_t(spv::BuiltIn::CullDistance)); + } +} + +bool LivenessManager::IsAnalyzedBuiltin(uint32_t bi) { + // There are only three builtins that can be analyzed and removed between + // two stages: PointSize, ClipDistance and CullDistance. All others are + // always consumed implicitly by the downstream stage. + const auto builtin = spv::BuiltIn(bi); + return builtin == spv::BuiltIn::PointSize || + builtin == spv::BuiltIn::ClipDistance || + builtin == spv::BuiltIn::CullDistance; +} + +bool LivenessManager::AnalyzeBuiltIn(uint32_t id) { + auto deco_mgr = context()->get_decoration_mgr(); + bool saw_builtin = false; + // Analyze all builtin decorations of |id|. + (void)deco_mgr->ForEachDecoration( + id, uint32_t(spv::Decoration::BuiltIn), + [this, &saw_builtin](const Instruction& deco_inst) { + saw_builtin = true; + // No need to process builtins in frag shader. All assumed used. + if (context()->GetStage() == spv::ExecutionModel::Fragment) return; + uint32_t builtin = uint32_t(spv::BuiltIn::Max); + if (deco_inst.opcode() == spv::Op::OpDecorate) + builtin = + deco_inst.GetSingleWordInOperand(kOpDecorateBuiltInLiteralInIdx); + else if (deco_inst.opcode() == spv::Op::OpMemberDecorate) + builtin = deco_inst.GetSingleWordInOperand( + kOpDecorateMemberBuiltInLiteralInIdx); + else + assert(false && "unexpected decoration"); + if (IsAnalyzedBuiltin(builtin)) live_builtins_.insert(builtin); + }); + return saw_builtin; +} + +void LivenessManager::MarkLocsLive(uint32_t start, uint32_t count) { + auto finish = start + count; + for (uint32_t u = start; u < finish; ++u) { + live_locs_.insert(u); + } +} + +uint32_t LivenessManager::GetLocSize(const analysis::Type* type) const { + auto arr_type = type->AsArray(); + if (arr_type) { + auto comp_type = arr_type->element_type(); + auto len_info = arr_type->length_info(); + assert(len_info.words[0] == analysis::Array::LengthInfo::kConstant && + "unexpected array length"); + auto comp_len = len_info.words[1]; + return comp_len * GetLocSize(comp_type); + } + auto struct_type = type->AsStruct(); + if (struct_type) { + uint32_t size = 0u; + for (auto& el_type : struct_type->element_types()) + size += GetLocSize(el_type); + return size; + } + auto mat_type = type->AsMatrix(); + if (mat_type) { + auto cnt = mat_type->element_count(); + auto comp_type = mat_type->element_type(); + return cnt * GetLocSize(comp_type); + } + auto vec_type = type->AsVector(); + if (vec_type) { + auto comp_type = vec_type->element_type(); + if (comp_type->AsInteger()) return 1; + auto float_type = comp_type->AsFloat(); + assert(float_type && "unexpected vector component type"); + auto width = float_type->width(); + if (width == 32 || width == 16) return 1; + assert(width == 64 && "unexpected float type width"); + auto comp_cnt = vec_type->element_count(); + return (comp_cnt > 2) ? 2 : 1; + } + assert((type->AsInteger() || type->AsFloat()) && "unexpected input type"); + return 1; +} + +const analysis::Type* LivenessManager::GetComponentType( + uint32_t index, const analysis::Type* agg_type) const { + auto arr_type = agg_type->AsArray(); + if (arr_type) return arr_type->element_type(); + auto struct_type = agg_type->AsStruct(); + if (struct_type) return struct_type->element_types()[index]; + auto mat_type = agg_type->AsMatrix(); + if (mat_type) return mat_type->element_type(); + auto vec_type = agg_type->AsVector(); + assert(vec_type && "unexpected non-aggregate type"); + return vec_type->element_type(); +} + +uint32_t LivenessManager::GetLocOffset(uint32_t index, + const analysis::Type* agg_type) const { + auto arr_type = agg_type->AsArray(); + if (arr_type) return index * GetLocSize(arr_type->element_type()); + auto struct_type = agg_type->AsStruct(); + if (struct_type) { + uint32_t offset = 0u; + uint32_t cnt = 0u; + for (auto& el_type : struct_type->element_types()) { + if (cnt == index) break; + offset += GetLocSize(el_type); + ++cnt; + } + return offset; + } + auto mat_type = agg_type->AsMatrix(); + if (mat_type) return index * GetLocSize(mat_type->element_type()); + auto vec_type = agg_type->AsVector(); + assert(vec_type && "unexpected non-aggregate type"); + auto comp_type = vec_type->element_type(); + auto flt_type = comp_type->AsFloat(); + if (flt_type && flt_type->width() == 64u && index >= 2u) return 1; + return 0; +} + +void LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac, + const analysis::Type** curr_type, + uint32_t* offset, bool* no_loc, + bool is_patch, bool input) { + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::DecorationManager* deco_mgr = context()->get_decoration_mgr(); + // For tesc, tese and geom input variables, and tesc output variables, + // first array index does not contribute to offset. + auto stage = context()->GetStage(); + bool skip_first_index = false; + if ((input && (stage == spv::ExecutionModel::TessellationControl || + stage == spv::ExecutionModel::TessellationEvaluation || + stage == spv::ExecutionModel::Geometry)) || + (!input && stage == spv::ExecutionModel::TessellationControl)) + skip_first_index = !is_patch; + uint32_t ocnt = 0; + ac->WhileEachInOperand([this, &ocnt, def_use_mgr, type_mgr, deco_mgr, + curr_type, offset, no_loc, + skip_first_index](const uint32_t* opnd) { + if (ocnt >= 1) { + // Skip first index's contribution to offset if indicated + if (ocnt == 1 && skip_first_index) { + auto arr_type = (*curr_type)->AsArray(); + assert(arr_type && "unexpected wrapper type"); + *curr_type = arr_type->element_type(); + ocnt++; + return true; + } + // If any non-constant index, mark the entire current object and return. + auto idx_inst = def_use_mgr->GetDef(*opnd); + if (idx_inst->opcode() != spv::Op::OpConstant) return false; + // If current type is struct, look for location decoration on member and + // reset offset if found. + auto index = idx_inst->GetSingleWordInOperand(0); + auto str_type = (*curr_type)->AsStruct(); + if (str_type) { + uint32_t loc = 0; + auto str_type_id = type_mgr->GetId(str_type); + bool no_mem_loc = deco_mgr->WhileEachDecoration( + str_type_id, uint32_t(spv::Decoration::Location), + [&loc, index, no_loc](const Instruction& deco) { + assert(deco.opcode() == spv::Op::OpMemberDecorate && + "unexpected decoration"); + if (deco.GetSingleWordInOperand(kOpDecorateMemberMemberInIdx) == + index) { + loc = + deco.GetSingleWordInOperand(kOpDecorateMemberLocationInIdx); + *no_loc = false; + return false; + } + return true; + }); + if (!no_mem_loc) { + *offset = loc; + *curr_type = GetComponentType(index, *curr_type); + ocnt++; + return true; + } + } + + // Update offset and current type based on constant index. + *offset += GetLocOffset(index, *curr_type); + *curr_type = GetComponentType(index, *curr_type); + } + ocnt++; + return true; + }); +} + +void LivenessManager::MarkRefLive(const Instruction* ref, Instruction* var) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::DecorationManager* deco_mgr = context()->get_decoration_mgr(); + // Find variable location if present. + uint32_t loc = 0; + auto var_id = var->result_id(); + bool no_loc = deco_mgr->WhileEachDecoration( + var_id, uint32_t(spv::Decoration::Location), + [&loc](const Instruction& deco) { + assert(deco.opcode() == spv::Op::OpDecorate && "unexpected decoration"); + loc = deco.GetSingleWordInOperand(kDecorationLocationInIdx); + return false; + }); + // Find patch decoration if present + bool is_patch = !deco_mgr->WhileEachDecoration( + var_id, uint32_t(spv::Decoration::Patch), [](const Instruction& deco) { + if (deco.opcode() != spv::Op::OpDecorate) + assert(false && "unexpected decoration"); + return false; + }); + // If use is a load, mark all locations of var + auto ptr_type = type_mgr->GetType(var->type_id())->AsPointer(); + assert(ptr_type && "unexpected var type"); + auto var_type = ptr_type->pointee_type(); + if (ref->opcode() == spv::Op::OpLoad) { + assert(!no_loc && "missing input variable location"); + MarkLocsLive(loc, GetLocSize(var_type)); + return; + } + // Mark just those locations indicated by access chain + assert((ref->opcode() == spv::Op::OpAccessChain || + ref->opcode() == spv::Op::OpInBoundsAccessChain) && + "unexpected use of input variable"); + // Traverse access chain, compute location offset and type of reference + // through constant indices and mark those locs live. Assert if no location + // found. + uint32_t offset = loc; + auto curr_type = var_type; + AnalyzeAccessChainLoc(ref, &curr_type, &offset, &no_loc, is_patch); + assert(!no_loc && "missing input variable location"); + MarkLocsLive(offset, GetLocSize(curr_type)); +} + +void LivenessManager::ComputeLiveness() { + InitializeAnalysis(); + analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + // Process all input variables + for (auto& var : context()->types_values()) { + if (var.opcode() != spv::Op::OpVariable) { + continue; + } + analysis::Type* var_type = type_mgr->GetType(var.type_id()); + analysis::Pointer* ptr_type = var_type->AsPointer(); + if (ptr_type->storage_class() != spv::StorageClass::Input) { + continue; + } + // If var is builtin, mark live if analyzed and continue to next variable + auto var_id = var.result_id(); + if (AnalyzeBuiltIn(var_id)) continue; + // If interface block with builtin members, mark live if analyzed and + // continue to next variable. Input interface blocks will only appear + // in tesc, tese and geom shaders. Will need to strip off one level of + // arrayness to get to block type. + auto pte_type = ptr_type->pointee_type(); + auto arr_type = pte_type->AsArray(); + if (arr_type) { + auto elt_type = arr_type->element_type(); + auto str_type = elt_type->AsStruct(); + if (str_type) { + auto str_type_id = type_mgr->GetId(str_type); + if (AnalyzeBuiltIn(str_type_id)) continue; + } + } + // Mark all used locations of var live + def_use_mgr->ForEachUser(var_id, [this, &var](Instruction* user) { + auto op = user->opcode(); + if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || + op == spv::Op::OpDecorate) { + return; + } + MarkRefLive(user, &var); + }); + } +} + +void LivenessManager::GetLiveness(std::unordered_set* live_locs, + std::unordered_set* live_builtins) { + if (!computed_) { + ComputeLiveness(); + computed_ = true; + } + *live_locs = live_locs_; + *live_builtins = live_builtins_; +} + +} // namespace analysis +} // namespace opt +} // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/liveness.h b/3rdparty/spirv-tools/source/opt/liveness.h new file mode 100644 index 000000000..7d8a9fb40 --- /dev/null +++ b/3rdparty/spirv-tools/source/opt/liveness.h @@ -0,0 +1,99 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// Copyright (c) 2022 LunarG Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SOURCE_OPT_LIVENESS_H_ +#define SOURCE_OPT_LIVENESS_H_ + +#include +#include + +namespace spvtools { +namespace opt { + +class IRContext; +class Instruction; + +namespace analysis { + +class Type; + +// This class represents the liveness of the input variables of a module +class LivenessManager { + public: + LivenessManager(IRContext* ctx); + + // Copy liveness info into |live_locs| and |builtin_locs|. + void GetLiveness(std::unordered_set* live_locs, + std::unordered_set* live_builtins); + + // Return true if builtin |bi| is being analyzed. + bool IsAnalyzedBuiltin(uint32_t bi); + + // Determine starting loc |offset| and the type |cur_type| of + // access chain |ac|. Set |no_loc| to true if no loc found. + // |is_patch| indicates if patch variable. |input| is true + // if input variable, otherwise output variable. + void AnalyzeAccessChainLoc(const Instruction* ac, + const analysis::Type** curr_type, uint32_t* offset, + bool* no_loc, bool is_patch, bool input = true); + + // Return size of |type_id| in units of locations + uint32_t GetLocSize(const analysis::Type* type) const; + + private: + IRContext* context() const { return ctx_; } + + // Initialize analysis + void InitializeAnalysis(); + + // Analyze |id| for builtin var and struct members. Return true if builtins + // found. + bool AnalyzeBuiltIn(uint32_t id); + + // Mark all live locations resulting from |user| of |var| at |loc|. + void MarkRefLive(const Instruction* user, Instruction* var); + + // Mark |count| locations starting at location |start|. + void MarkLocsLive(uint32_t start, uint32_t count); + + // Return type of component of aggregate type |agg_type| at |index| + const analysis::Type* GetComponentType(uint32_t index, + const analysis::Type* agg_type) const; + + // Return offset of |index| into aggregate type |agg_type| in units of + // input locations + uint32_t GetLocOffset(uint32_t index, const analysis::Type* agg_type) const; + + // Populate live_locs_ and live_builtins_ + void ComputeLiveness(); + + // IR context that owns this liveness manager. + IRContext* ctx_; + + // True if live_locs_ and live_builtins_ are computed + bool computed_; + + // Live locations + std::unordered_set live_locs_; + + // Live builtins + std::unordered_set live_builtins_; +}; + +} // namespace analysis +} // namespace opt +} // namespace spvtools + +#endif // SOURCE_OPT_LIVENESS_H_ diff --git a/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp b/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp index d11682f34..66e881336 100644 --- a/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp @@ -23,16 +23,13 @@ namespace spvtools { namespace opt { - namespace { - -const uint32_t kStoreValIdInIdx = 1; -const uint32_t kAccessChainPtrIdInIdx = 0; - -} // anonymous namespace +constexpr uint32_t kStoreValIdInIdx = 1; +constexpr uint32_t kAccessChainPtrIdInIdx = 0; +} // namespace void LocalAccessChainConvertPass::BuildAndAppendInst( - SpvOp opcode, uint32_t typeId, uint32_t resultId, + spv::Op opcode, uint32_t typeId, uint32_t resultId, const std::vector& in_opnds, std::vector>* newInsts) { std::unique_ptr newInst( @@ -51,9 +48,9 @@ uint32_t LocalAccessChainConvertPass::BuildAndAppendVarLoad( *varId = ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx); const Instruction* varInst = get_def_use_mgr()->GetDef(*varId); - assert(varInst->opcode() == SpvOpVariable); + assert(varInst->opcode() == spv::Op::OpVariable); *varPteTypeId = GetPointeeTypeId(varInst); - BuildAndAppendInst(SpvOpLoad, *varPteTypeId, ldResultId, + BuildAndAppendInst(spv::Op::OpLoad, *varPteTypeId, ldResultId, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {*varId}}}, newInsts); return ldResultId; @@ -108,7 +105,8 @@ bool LocalAccessChainConvertPass::ReplaceAccessChainLoad( new_inst[0]->UpdateDebugInfoFrom(original_load); context()->get_decoration_mgr()->CloneDecorations( - original_load->result_id(), ldResultId, {SpvDecorationRelaxedPrecision}); + original_load->result_id(), ldResultId, + {spv::Decoration::RelaxedPrecision}); original_load->InsertBefore(std::move(new_inst)); context()->get_debug_info_mgr()->AnalyzeDebugInst( original_load->PreviousNode()); @@ -123,7 +121,7 @@ bool LocalAccessChainConvertPass::ReplaceAccessChainLoad( new_operands.emplace_back( Operand({spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ldResultId}})); AppendConstantOperands(address_inst, &new_operands); - original_load->SetOpcode(SpvOpCompositeExtract); + original_load->SetOpcode(spv::Op::OpCompositeExtract); original_load->ReplaceOperands(new_operands); context()->UpdateDefUse(original_load); return true; @@ -136,7 +134,7 @@ bool LocalAccessChainConvertPass::GenAccessChainStoreReplacement( // An access chain with no indices is essentially a copy. However, we still // have to create a new store because the old ones will be deleted. BuildAndAppendInst( - SpvOpStore, 0, 0, + spv::Op::OpStore, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ptrInst->GetSingleWordInOperand(kAccessChainPtrIdInIdx)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}}, @@ -154,7 +152,7 @@ bool LocalAccessChainConvertPass::GenAccessChainStoreReplacement( } context()->get_decoration_mgr()->CloneDecorations( - varId, ldResultId, {SpvDecorationRelaxedPrecision}); + varId, ldResultId, {spv::Decoration::RelaxedPrecision}); // Build and append Insert const uint32_t insResultId = TakeNextId(); @@ -165,14 +163,14 @@ bool LocalAccessChainConvertPass::GenAccessChainStoreReplacement( {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {valId}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {ldResultId}}}; AppendConstantOperands(ptrInst, &ins_in_opnds); - BuildAndAppendInst(SpvOpCompositeInsert, varPteTypeId, insResultId, + BuildAndAppendInst(spv::Op::OpCompositeInsert, varPteTypeId, insResultId, ins_in_opnds, newInsts); context()->get_decoration_mgr()->CloneDecorations( - varId, insResultId, {SpvDecorationRelaxedPrecision}); + varId, insResultId, {spv::Decoration::RelaxedPrecision}); // Build and append Store - BuildAndAppendInst(SpvOpStore, 0, 0, + BuildAndAppendInst(spv::Op::OpStore, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {varId}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {insResultId}}}, newInsts); @@ -185,7 +183,7 @@ bool LocalAccessChainConvertPass::Is32BitConstantIndexAccessChain( return acp->WhileEachInId([&inIdx, this](const uint32_t* tid) { if (inIdx > 0) { Instruction* opInst = get_def_use_mgr()->GetDef(*tid); - if (opInst->opcode() != SpvOpConstant) return false; + if (opInst->opcode() != spv::Op::OpConstant) return false; const auto* index = context()->get_constant_mgr()->GetConstantFromInst(opInst); int64_t index_value = index->GetSignExtendedValue(); @@ -204,13 +202,13 @@ bool LocalAccessChainConvertPass::HasOnlySupportedRefs(uint32_t ptrId) { user->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) { return true; } - SpvOp op = user->opcode(); - if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { + spv::Op op = user->opcode(); + if (IsNonPtrAccessChain(op) || op == spv::Op::OpCopyObject) { if (!HasOnlySupportedRefs(user->result_id())) { return false; } - } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && - !IsNonTypeDecorate(op)) { + } else if (op != spv::Op::OpStore && op != spv::Op::OpLoad && + op != spv::Op::OpName && !IsNonTypeDecorate(op)) { return false; } return true; @@ -225,12 +223,12 @@ void LocalAccessChainConvertPass::FindTargetVars(Function* func) { for (auto bi = func->begin(); bi != func->end(); ++bi) { for (auto ii = bi->begin(); ii != bi->end(); ++ii) { switch (ii->opcode()) { - case SpvOpStore: - case SpvOpLoad: { + case spv::Op::OpStore: + case spv::Op::OpLoad: { uint32_t varId; Instruction* ptrInst = GetPtr(&*ii, &varId); if (!IsTargetVar(varId)) break; - const SpvOp op = ptrInst->opcode(); + const spv::Op op = ptrInst->opcode(); // Rule out variables with non-supported refs eg function calls if (!HasOnlySupportedRefs(varId)) { seen_non_target_vars_.insert(varId); @@ -276,7 +274,7 @@ Pass::Status LocalAccessChainConvertPass::ConvertLocalAccessChains( std::vector dead_instructions; for (auto ii = bi->begin(); ii != bi->end(); ++ii) { switch (ii->opcode()) { - case SpvOpLoad: { + case spv::Op::OpLoad: { uint32_t varId; Instruction* ptrInst = GetPtr(&*ii, &varId); if (!IsNonPtrAccessChain(ptrInst->opcode())) break; @@ -286,7 +284,7 @@ Pass::Status LocalAccessChainConvertPass::ConvertLocalAccessChains( } modified = true; } break; - case SpvOpStore: { + case spv::Op::OpStore: { uint32_t varId; Instruction* store = &*ii; Instruction* ptrInst = GetPtr(store, &varId); @@ -347,7 +345,7 @@ bool LocalAccessChainConvertPass::AllExtensionsSupported() const { // for the capability. This pass is only looking at function scope symbols, // so we do not care if there are variable pointers on storage buffers. if (context()->get_feature_mgr()->HasCapability( - SpvCapabilityVariablePointers)) + spv::Capability::VariablePointers)) return false; // If any extension not in allowlist, return false for (auto& ei : get_module()->extensions()) { @@ -359,7 +357,7 @@ bool LocalAccessChainConvertPass::AllExtensionsSupported() const { // around unknown extended // instruction sets even if they are non-semantic for (auto& inst : context()->module()->ext_inst_imports()) { - assert(inst.opcode() == SpvOpExtInstImport && + assert(inst.opcode() == spv::Op::OpExtInstImport && "Expecting an import of an extension's instruction set."); const std::string extension_name = inst.GetInOperand(0).AsString(); if (spvtools::utils::starts_with(extension_name, "NonSemantic.") && @@ -375,7 +373,8 @@ Pass::Status LocalAccessChainConvertPass::ProcessImpl() { // support required in KillNamesAndDecorates(). // TODO(greg-lunarg): Add support for OpGroupDecorate for (auto& ai : get_module()->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + if (ai.opcode() == spv::Op::OpGroupDecorate) + return Status::SuccessWithoutChange; // Do not process if any disallowed extensions are enabled if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; diff --git a/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h b/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h index c3731b1c9..0cda196f6 100644 --- a/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h +++ b/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h @@ -64,7 +64,7 @@ class LocalAccessChainConvertPass : public MemPass { // Build instruction from |opcode|, |typeId|, |resultId|, and |in_opnds|. // Append to |newInsts|. - void BuildAndAppendInst(SpvOp opcode, uint32_t typeId, uint32_t resultId, + void BuildAndAppendInst(spv::Op opcode, uint32_t typeId, uint32_t resultId, const std::vector& in_opnds, std::vector>* newInsts); diff --git a/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp index a58e8e4cc..c1789c885 100644 --- a/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp @@ -24,10 +24,8 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kStoreValIdInIdx = 1; - -} // anonymous namespace +constexpr uint32_t kStoreValIdInIdx = 1; +} // namespace bool LocalSingleBlockLoadStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) { if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true; @@ -37,13 +35,13 @@ bool LocalSingleBlockLoadStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) { dbg_op == CommonDebugInfoDebugValue) { return true; } - SpvOp op = user->opcode(); - if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { + spv::Op op = user->opcode(); + if (IsNonPtrAccessChain(op) || op == spv::Op::OpCopyObject) { if (!HasOnlySupportedRefs(user->result_id())) { return false; } - } else if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && - !IsNonTypeDecorate(op)) { + } else if (op != spv::Op::OpStore && op != spv::Op::OpLoad && + op != spv::Op::OpName && !IsNonTypeDecorate(op)) { return false; } return true; @@ -68,7 +66,7 @@ bool LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElim( for (auto ii = next; ii != bi->end(); ii = next) { ++next; switch (ii->opcode()) { - case SpvOpStore: { + case spv::Op::OpStore: { // Verify store variable is target type uint32_t varId; Instruction* ptrInst = GetPtr(&*ii, &varId); @@ -77,7 +75,7 @@ bool LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElim( // If a store to the whole variable, remember it for succeeding // loads and stores. Otherwise forget any previous store to that // variable. - if (ptrInst->opcode() == SpvOpVariable) { + if (ptrInst->opcode() == spv::Op::OpVariable) { // If a previous store to same variable, mark the store // for deletion if not still used. Don't delete store // if debugging; let ssa-rewrite and DCE handle it @@ -114,14 +112,14 @@ bool LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElim( var2load_.erase(varId); } } break; - case SpvOpLoad: { + case spv::Op::OpLoad: { // Verify store variable is target type uint32_t varId; Instruction* ptrInst = GetPtr(&*ii, &varId); if (!IsTargetVar(varId)) continue; if (!HasOnlySupportedRefs(varId)) continue; uint32_t replId = 0; - if (ptrInst->opcode() == SpvOpVariable) { + if (ptrInst->opcode() == spv::Op::OpVariable) { // If a load from a variable, look for a previous store or // load from that variable and use its value. auto si = var2store_.find(varId); @@ -146,11 +144,11 @@ bool LocalSingleBlockLoadStoreElimPass::LocalSingleBlockLoadStoreElim( instructions_to_kill.push_back(&*ii); modified = true; } else { - if (ptrInst->opcode() == SpvOpVariable) + if (ptrInst->opcode() == spv::Op::OpVariable) var2load_[varId] = &*ii; // register load } } break; - case SpvOpFunctionCall: { + case spv::Op::OpFunctionCall: { // Conservatively assume all locals are redefined for now. // TODO(): Handle more optimally var2store_.clear(); @@ -192,7 +190,7 @@ bool LocalSingleBlockLoadStoreElimPass::AllExtensionsSupported() const { // around unknown extended // instruction sets even if they are non-semantic for (auto& inst : context()->module()->ext_inst_imports()) { - assert(inst.opcode() == SpvOpExtInstImport && + assert(inst.opcode() == spv::Op::OpExtInstImport && "Expecting an import of an extension's instruction set."); const std::string extension_name = inst.GetInOperand(0).AsString(); if (spvtools::utils::starts_with(extension_name, "NonSemantic.") && @@ -205,14 +203,15 @@ bool LocalSingleBlockLoadStoreElimPass::AllExtensionsSupported() const { Pass::Status LocalSingleBlockLoadStoreElimPass::ProcessImpl() { // Assumes relaxed logical addressing only (see instruction.h). - if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + if (context()->get_feature_mgr()->HasCapability(spv::Capability::Addresses)) return Status::SuccessWithoutChange; // Do not process if module contains OpGroupDecorate. Additional // support required in KillNamesAndDecorates(). // TODO(greg-lunarg): Add support for OpGroupDecorate for (auto& ai : get_module()->annotations()) - if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; + if (ai.opcode() == spv::Op::OpGroupDecorate) + return Status::SuccessWithoutChange; // If any extensions in the module are not explicitly supported, // return unmodified. if (!AllExtensionsSupported()) return Status::SuccessWithoutChange; diff --git a/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp index 81648c7ba..e494689fa 100644 --- a/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp @@ -23,13 +23,10 @@ namespace spvtools { namespace opt { - namespace { - -const uint32_t kStoreValIdInIdx = 1; -const uint32_t kVariableInitIdInIdx = 1; - -} // anonymous namespace +constexpr uint32_t kStoreValIdInIdx = 1; +constexpr uint32_t kVariableInitIdInIdx = 1; +} // namespace bool LocalSingleStoreElimPass::LocalSingleStoreElim(Function* func) { bool modified = false; @@ -37,7 +34,7 @@ bool LocalSingleStoreElimPass::LocalSingleStoreElim(Function* func) { // Check all function scope variables in |func|. BasicBlock* entry_block = &*func->begin(); for (Instruction& inst : *entry_block) { - if (inst.opcode() != SpvOpVariable) { + if (inst.opcode() != spv::Op::OpVariable) { break; } @@ -57,7 +54,7 @@ bool LocalSingleStoreElimPass::AllExtensionsSupported() const { // around unknown extended // instruction sets even if they are non-semantic for (auto& inst : context()->module()->ext_inst_imports()) { - assert(inst.opcode() == SpvOpExtInstImport && + assert(inst.opcode() == spv::Op::OpExtInstImport && "Expecting an import of an extension's instruction set."); const std::string extension_name = inst.GetInOperand(0).AsString(); if (spvtools::utils::starts_with(extension_name, "NonSemantic.") && @@ -70,7 +67,7 @@ bool LocalSingleStoreElimPass::AllExtensionsSupported() const { Pass::Status LocalSingleStoreElimPass::ProcessImpl() { // Assumes relaxed logical addressing only (see instruction.h) - if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + if (context()->get_feature_mgr()->HasCapability(spv::Capability::Addresses)) return Status::SuccessWithoutChange; // Do not process if any disallowed extensions are enabled @@ -194,7 +191,7 @@ Instruction* LocalSingleStoreElimPass::FindSingleStoreAndCheckUses( for (Instruction* user : users) { switch (user->opcode()) { - case SpvOpStore: + case spv::Op::OpStore: // Since we are in the relaxed addressing mode, the use has to be the // base address of the store, and not the value being store. Otherwise, // we would have a pointer to a pointer to function scope memory, which @@ -206,19 +203,19 @@ Instruction* LocalSingleStoreElimPass::FindSingleStoreAndCheckUses( return nullptr; } break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: if (FeedsAStore(user)) { // Has a partial store. Cannot propagate that. return nullptr; } break; - case SpvOpLoad: - case SpvOpImageTexelPointer: - case SpvOpName: - case SpvOpCopyObject: + case spv::Op::OpLoad: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpName: + case spv::Op::OpCopyObject: break; - case SpvOpExtInst: { + case spv::Op::OpExtInst: { auto dbg_op = user->GetCommonDebugOpcode(); if (dbg_op == CommonDebugInfoDebugDeclare || dbg_op == CommonDebugInfoDebugValue) { @@ -243,7 +240,7 @@ void LocalSingleStoreElimPass::FindUses( analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); def_use_mgr->ForEachUser(var_inst, [users, this](Instruction* user) { users->push_back(user); - if (user->opcode() == SpvOpCopyObject) { + if (user->opcode() == spv::Op::OpCopyObject) { FindUses(user, users); } }); @@ -253,15 +250,15 @@ bool LocalSingleStoreElimPass::FeedsAStore(Instruction* inst) const { analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); return !def_use_mgr->WhileEachUser(inst, [this](Instruction* user) { switch (user->opcode()) { - case SpvOpStore: + case spv::Op::OpStore: return false; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpCopyObject: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpCopyObject: return !FeedsAStore(user); - case SpvOpLoad: - case SpvOpImageTexelPointer: - case SpvOpName: + case spv::Op::OpLoad: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpName: return true; default: // Don't know if this instruction modifies the variable. @@ -279,7 +276,7 @@ bool LocalSingleStoreElimPass::RewriteLoads( context()->GetDominatorAnalysis(store_block->GetParent()); uint32_t stored_id; - if (store_inst->opcode() == SpvOpStore) + if (store_inst->opcode() == spv::Op::OpStore) stored_id = store_inst->GetSingleWordInOperand(kStoreValIdInIdx); else stored_id = store_inst->GetSingleWordInOperand(kVariableInitIdInIdx); @@ -287,12 +284,12 @@ bool LocalSingleStoreElimPass::RewriteLoads( *all_rewritten = true; bool modified = false; for (Instruction* use : uses) { - if (use->opcode() == SpvOpStore) continue; + if (use->opcode() == spv::Op::OpStore) continue; auto dbg_op = use->GetCommonDebugOpcode(); if (dbg_op == CommonDebugInfoDebugDeclare || dbg_op == CommonDebugInfoDebugValue) continue; - if (use->opcode() == SpvOpLoad && + if (use->opcode() == spv::Op::OpLoad && dominator_analysis->Dominates(store_inst, use)) { modified = true; context()->KillNamesAndDecorates(use->result_id()); diff --git a/3rdparty/spirv-tools/source/opt/loop_dependence.cpp b/3rdparty/spirv-tools/source/opt/loop_dependence.cpp index d8de699bf..d7256bf84 100644 --- a/3rdparty/spirv-tools/source/opt/loop_dependence.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_dependence.cpp @@ -192,8 +192,8 @@ bool LoopDependenceAnalysis::GetDependence(const Instruction* source, Instruction* destination_access_chain = GetOperandDefinition(destination, 0); auto num_access_chains = - (source_access_chain->opcode() == SpvOpAccessChain) + - (destination_access_chain->opcode() == SpvOpAccessChain); + (source_access_chain->opcode() == spv::Op::OpAccessChain) + + (destination_access_chain->opcode() == spv::Op::OpAccessChain); // If neither is an access chain, then they are load/store to a variable. if (num_access_chains == 0) { @@ -211,7 +211,8 @@ bool LoopDependenceAnalysis::GetDependence(const Instruction* source, // If only one is an access chain, it could be accessing a part of a struct if (num_access_chains == 1) { - auto source_is_chain = source_access_chain->opcode() == SpvOpAccessChain; + auto source_is_chain = + source_access_chain->opcode() == spv::Op::OpAccessChain; auto access_chain = source_is_chain ? source_access_chain : destination_access_chain; auto variable = @@ -238,8 +239,8 @@ bool LoopDependenceAnalysis::GetDependence(const Instruction* source, GetOperandDefinition(destination_access_chain, 0); // Nested access chains are not supported yet, bail out. - if (source_array->opcode() == SpvOpAccessChain || - destination_array->opcode() == SpvOpAccessChain) { + if (source_array->opcode() == spv::Op::OpAccessChain || + destination_array->opcode() == spv::Op::OpAccessChain) { for (auto& entry : distance_vector->GetEntries()) { entry = DistanceEntry(); } diff --git a/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp b/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp index de27a0a72..929c9404b 100644 --- a/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp @@ -54,20 +54,20 @@ SENode* LoopDependenceAnalysis::GetLowerBound(const Loop* loop) { } Instruction* lower_inst = GetOperandDefinition(cond_inst, 0); switch (cond_inst->opcode()) { - case SpvOpULessThan: - case SpvOpSLessThan: - case SpvOpULessThanEqual: - case SpvOpSLessThanEqual: - case SpvOpUGreaterThan: - case SpvOpSGreaterThan: - case SpvOpUGreaterThanEqual: - case SpvOpSGreaterThanEqual: { + case spv::Op::OpULessThan: + case spv::Op::OpSLessThan: + case spv::Op::OpULessThanEqual: + case spv::Op::OpSLessThanEqual: + case spv::Op::OpUGreaterThan: + case spv::Op::OpSGreaterThan: + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: { // If we have a phi we are looking at the induction variable. We look // through the phi to the initial value of the phi upon entering the loop. - if (lower_inst->opcode() == SpvOpPhi) { + if (lower_inst->opcode() == spv::Op::OpPhi) { lower_inst = GetOperandDefinition(lower_inst, 0); // We don't handle looking through multiple phis. - if (lower_inst->opcode() == SpvOpPhi) { + if (lower_inst->opcode() == spv::Op::OpPhi) { return nullptr; } } @@ -86,8 +86,8 @@ SENode* LoopDependenceAnalysis::GetUpperBound(const Loop* loop) { } Instruction* upper_inst = GetOperandDefinition(cond_inst, 1); switch (cond_inst->opcode()) { - case SpvOpULessThan: - case SpvOpSLessThan: { + case spv::Op::OpULessThan: + case spv::Op::OpSLessThan: { // When we have a < condition we must subtract 1 from the analyzed upper // instruction. SENode* upper_bound = scalar_evolution_.SimplifyExpression( @@ -96,8 +96,8 @@ SENode* LoopDependenceAnalysis::GetUpperBound(const Loop* loop) { scalar_evolution_.CreateConstant(1))); return upper_bound; } - case SpvOpUGreaterThan: - case SpvOpSGreaterThan: { + case spv::Op::OpUGreaterThan: + case spv::Op::OpSGreaterThan: { // When we have a > condition we must add 1 to the analyzed upper // instruction. SENode* upper_bound = @@ -106,10 +106,10 @@ SENode* LoopDependenceAnalysis::GetUpperBound(const Loop* loop) { scalar_evolution_.CreateConstant(1))); return upper_bound; } - case SpvOpULessThanEqual: - case SpvOpSLessThanEqual: - case SpvOpUGreaterThanEqual: - case SpvOpSGreaterThanEqual: { + case spv::Op::OpULessThanEqual: + case spv::Op::OpSLessThanEqual: + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: { // We don't need to modify the results of analyzing when we have <= or >=. SENode* upper_bound = scalar_evolution_.SimplifyExpression( scalar_evolution_.AnalyzeInstruction(upper_inst)); diff --git a/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp b/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp index 13982d181..172b97815 100644 --- a/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp @@ -39,7 +39,7 @@ namespace opt { Instruction* Loop::GetInductionStepOperation( const Instruction* induction) const { // Induction must be a phi instruction. - assert(induction->opcode() == SpvOpPhi); + assert(induction->opcode() == spv::Op::OpPhi); Instruction* step = nullptr; @@ -75,8 +75,8 @@ Instruction* Loop::GetInductionStepOperation( return nullptr; } - if (def_use_manager->GetDef(lhs)->opcode() != SpvOp::SpvOpConstant && - def_use_manager->GetDef(rhs)->opcode() != SpvOp::SpvOpConstant) { + if (def_use_manager->GetDef(lhs)->opcode() != spv::Op::OpConstant && + def_use_manager->GetDef(rhs)->opcode() != spv::Op::OpConstant) { return nullptr; } @@ -85,31 +85,31 @@ Instruction* Loop::GetInductionStepOperation( // Returns true if the |step| operation is an induction variable step operation // which is currently handled. -bool Loop::IsSupportedStepOp(SpvOp step) const { +bool Loop::IsSupportedStepOp(spv::Op step) const { switch (step) { - case SpvOp::SpvOpISub: - case SpvOp::SpvOpIAdd: + case spv::Op::OpISub: + case spv::Op::OpIAdd: return true; default: return false; } } -bool Loop::IsSupportedCondition(SpvOp condition) const { +bool Loop::IsSupportedCondition(spv::Op condition) const { switch (condition) { // < - case SpvOp::SpvOpULessThan: - case SpvOp::SpvOpSLessThan: + case spv::Op::OpULessThan: + case spv::Op::OpSLessThan: // > - case SpvOp::SpvOpUGreaterThan: - case SpvOp::SpvOpSGreaterThan: + case spv::Op::OpUGreaterThan: + case spv::Op::OpSGreaterThan: // >= - case SpvOp::SpvOpSGreaterThanEqual: - case SpvOp::SpvOpUGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpUGreaterThanEqual: // <= - case SpvOp::SpvOpSLessThanEqual: - case SpvOp::SpvOpULessThanEqual: + case spv::Op::OpSLessThanEqual: + case spv::Op::OpULessThanEqual: return true; default: @@ -117,7 +117,8 @@ bool Loop::IsSupportedCondition(SpvOp condition) const { } } -int64_t Loop::GetResidualConditionValue(SpvOp condition, int64_t initial_value, +int64_t Loop::GetResidualConditionValue(spv::Op condition, + int64_t initial_value, int64_t step_value, size_t number_of_iterations, size_t factor) { @@ -128,13 +129,13 @@ int64_t Loop::GetResidualConditionValue(SpvOp condition, int64_t initial_value, // loop where just less than or greater than. Adding or subtracting one should // give a functionally equivalent value. switch (condition) { - case SpvOp::SpvOpSGreaterThanEqual: - case SpvOp::SpvOpUGreaterThanEqual: { + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpUGreaterThanEqual: { remainder -= 1; break; } - case SpvOp::SpvOpSLessThanEqual: - case SpvOp::SpvOpULessThanEqual: { + case spv::Op::OpSLessThanEqual: + case spv::Op::OpULessThanEqual: { remainder += 1; break; } @@ -152,7 +153,7 @@ Instruction* Loop::GetConditionInst() const { } Instruction* branch_conditional = &*condition_block->tail(); if (!branch_conditional || - branch_conditional->opcode() != SpvOpBranchConditional) { + branch_conditional->opcode() != spv::Op::OpBranchConditional) { return nullptr; } Instruction* condition_inst = context_->get_def_use_mgr()->GetDef( @@ -318,7 +319,7 @@ void Loop::SetMergeBlock(BasicBlock* merge) { void Loop::SetPreHeaderBlock(BasicBlock* preheader) { if (preheader) { assert(!IsInsideLoop(preheader) && "The preheader block is in the loop"); - assert(preheader->tail()->opcode() == SpvOpBranch && + assert(preheader->tail()->opcode() == spv::Op::OpBranch && "The preheader block does not unconditionally branch to the header " "block"); assert(preheader->tail()->GetSingleWordOperand(0) == @@ -387,7 +388,7 @@ void Loop::GetMergingBlocks( namespace { -static inline bool IsBasicBlockSafeToClone(IRContext* context, BasicBlock* bb) { +inline bool IsBasicBlockSafeToClone(IRContext* context, BasicBlock* bb) { for (Instruction& inst : *bb) { if (!inst.IsBranch() && !context->IsCombinatorInstruction(&inst)) return false; @@ -443,7 +444,7 @@ bool Loop::IsLCSSA() const { BasicBlock* parent = ir_context->get_instr_block(use); assert(parent && "Invalid analysis"); if (IsInsideLoop(parent)) return true; - if (use->opcode() != SpvOpPhi) return false; + if (use->opcode() != spv::Op::OpPhi) return false; return exit_blocks.count(parent->id()); })) return false; @@ -486,7 +487,7 @@ void Loop::ComputeLoopStructuredOrder( ordered_loop_blocks->push_back(loop_preheader_); bool is_shader = - context_->get_feature_mgr()->HasCapability(SpvCapabilityShader); + context_->get_feature_mgr()->HasCapability(spv::Capability::Shader); if (!is_shader) { cfg.ForEachBlockInReversePostOrder( loop_header_, [ordered_loop_blocks, this](BasicBlock* bb) { @@ -647,7 +648,7 @@ BasicBlock* Loop::FindConditionBlock() const { const Instruction& branch = *bb->ctail(); // Make sure the branch is a conditional branch. - if (branch.opcode() != SpvOpBranchConditional) return nullptr; + if (branch.opcode() != spv::Op::OpBranchConditional) return nullptr; // Make sure one of the two possible branches is to the merge block. if (branch.GetSingleWordInOperand(1) == loop_merge_->id() || @@ -716,7 +717,7 @@ bool Loop::FindNumberOfIterations(const Instruction* induction, } // If this is a subtraction step we should negate the step value. - if (step_inst->opcode() == SpvOp::SpvOpISub) { + if (step_inst->opcode() == spv::Op::OpISub) { step_value = -step_value; } @@ -753,7 +754,7 @@ bool Loop::FindNumberOfIterations(const Instruction* induction, // |step_value| where diff is calculated differently according to the // |condition| and uses the |condition_value| and |init_value|. If diff / // |step_value| is NOT cleanly divisible then we add one to the sum. -int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value, +int64_t Loop::GetIterations(spv::Op condition, int64_t condition_value, int64_t init_value, int64_t step_value) const { if (step_value == 0) { return 0; @@ -762,8 +763,8 @@ int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value, int64_t diff = 0; switch (condition) { - case SpvOp::SpvOpSLessThan: - case SpvOp::SpvOpULessThan: { + case spv::Op::OpSLessThan: + case spv::Op::OpULessThan: { // If the condition is not met to begin with the loop will never iterate. if (!(init_value < condition_value)) return 0; @@ -778,8 +779,8 @@ int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value, break; } - case SpvOp::SpvOpSGreaterThan: - case SpvOp::SpvOpUGreaterThan: { + case spv::Op::OpSGreaterThan: + case spv::Op::OpUGreaterThan: { // If the condition is not met to begin with the loop will never iterate. if (!(init_value > condition_value)) return 0; @@ -795,12 +796,12 @@ int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value, break; } - case SpvOp::SpvOpSGreaterThanEqual: - case SpvOp::SpvOpUGreaterThanEqual: { + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpUGreaterThanEqual: { // If the condition is not met to begin with the loop will never iterate. if (!(init_value >= condition_value)) return 0; - // We subtract one to make it the same as SpvOpGreaterThan as it is + // We subtract one to make it the same as spv::Op::OpGreaterThan as it is // functionally equivalent. diff = init_value - (condition_value - 1); @@ -814,13 +815,13 @@ int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value, break; } - case SpvOp::SpvOpSLessThanEqual: - case SpvOp::SpvOpULessThanEqual: { + case spv::Op::OpSLessThanEqual: + case spv::Op::OpULessThanEqual: { // If the condition is not met to begin with the loop will never iterate. if (!(init_value <= condition_value)) return 0; - // We add one to make it the same as SpvOpLessThan as it is functionally - // equivalent. + // We add one to make it the same as spv::Op::OpLessThan as it is + // functionally equivalent. diff = (condition_value + 1) - init_value; // If the operation is a less than operation then the diff and step must @@ -854,7 +855,7 @@ int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value, void Loop::GetInductionVariables( std::vector& induction_variables) const { for (Instruction& inst : *loop_header_) { - if (inst.opcode() == SpvOp::SpvOpPhi) { + if (inst.opcode() == spv::Op::OpPhi) { induction_variables.push_back(&inst); } } @@ -867,7 +868,7 @@ Instruction* Loop::FindConditionVariable( Instruction* induction = nullptr; // Verify that the branch instruction is a conditional branch. - if (branch_inst.opcode() == SpvOp::SpvOpBranchConditional) { + if (branch_inst.opcode() == spv::Op::OpBranchConditional) { // From the branch instruction find the branch condition. analysis::DefUseManager* def_use_manager = context_->get_def_use_mgr(); @@ -883,7 +884,8 @@ Instruction* Loop::FindConditionVariable( def_use_manager->GetDef(condition->GetSingleWordOperand(2)); // Make sure the variable instruction used is a phi. - if (!variable_inst || variable_inst->opcode() != SpvOpPhi) return nullptr; + if (!variable_inst || variable_inst->opcode() != spv::Op::OpPhi) + return nullptr; // Make sure the phi instruction only has two incoming blocks. Each // incoming block will be represented by two in operands in the phi diff --git a/3rdparty/spirv-tools/source/opt/loop_descriptor.h b/3rdparty/spirv-tools/source/opt/loop_descriptor.h index df012274c..35256bc3f 100644 --- a/3rdparty/spirv-tools/source/opt/loop_descriptor.h +++ b/3rdparty/spirv-tools/source/opt/loop_descriptor.h @@ -316,12 +316,12 @@ class Loop { // Returns true if we can deduce the number of loop iterations in the step // operation |step|. IsSupportedCondition must also be true for the condition // instruction. - bool IsSupportedStepOp(SpvOp step) const; + bool IsSupportedStepOp(spv::Op step) const; // Returns true if we can deduce the number of loop iterations in the // condition operation |condition|. IsSupportedStepOp must also be true for // the step instruction. - bool IsSupportedCondition(SpvOp condition) const; + bool IsSupportedCondition(spv::Op condition) const; // Creates the list of the loop's basic block in structured order and store // the result in |ordered_loop_blocks|. If |include_pre_header| is true, the @@ -335,7 +335,7 @@ class Loop { // Given the loop |condition|, |initial_value|, |step_value|, the trip count // |number_of_iterations|, and the |unroll_factor| requested, get the new // condition value for the residual loop. - static int64_t GetResidualConditionValue(SpvOp condition, + static int64_t GetResidualConditionValue(spv::Op condition, int64_t initial_value, int64_t step_value, size_t number_of_iterations, @@ -400,7 +400,7 @@ class Loop { // the induction variable. This method will return the number of iterations in // a loop with those values for a given |condition|. Returns 0 if the number // of iterations could not be computed. - int64_t GetIterations(SpvOp condition, int64_t condition_value, + int64_t GetIterations(spv::Op condition, int64_t condition_value, int64_t init_value, int64_t step_value) const; // This is to allow for loops to be removed mid iteration without invalidating diff --git a/3rdparty/spirv-tools/source/opt/loop_fission.cpp b/3rdparty/spirv-tools/source/opt/loop_fission.cpp index b4df8c621..2ae05c3c3 100644 --- a/3rdparty/spirv-tools/source/opt/loop_fission.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_fission.cpp @@ -110,10 +110,10 @@ class LoopFissionImpl { }; bool LoopFissionImpl::MovableInstruction(const Instruction& inst) const { - return inst.opcode() == SpvOp::SpvOpLoad || - inst.opcode() == SpvOp::SpvOpStore || - inst.opcode() == SpvOp::SpvOpSelectionMerge || - inst.opcode() == SpvOp::SpvOpPhi || inst.IsOpcodeCodeMotionSafe(); + return inst.opcode() == spv::Op::OpLoad || + inst.opcode() == spv::Op::OpStore || + inst.opcode() == spv::Op::OpSelectionMerge || + inst.opcode() == spv::Op::OpPhi || inst.IsOpcodeCodeMotionSafe(); } void LoopFissionImpl::TraverseUseDef(Instruction* inst, @@ -143,14 +143,14 @@ void LoopFissionImpl::TraverseUseDef(Instruction* inst, // same labels (i.e phis). We already preempt the inclusion of // OpSelectionMerge by adding related instructions to the seen_instructions_ // set. - if (user->opcode() == SpvOp::SpvOpLoopMerge || - user->opcode() == SpvOp::SpvOpLabel) + if (user->opcode() == spv::Op::OpLoopMerge || + user->opcode() == spv::Op::OpLabel) return; // If the |report_loads| flag is set, set the class field // load_used_in_condition_ to false. This is used to check that none of the // condition checks in the loop rely on loads. - if (user->opcode() == SpvOp::SpvOpLoad && report_loads) { + if (user->opcode() == spv::Op::OpLoad && report_loads) { load_used_in_condition_ = true; } @@ -167,7 +167,7 @@ void LoopFissionImpl::TraverseUseDef(Instruction* inst, user->ForEachInOperand(traverse_operand); // For the first traversal we want to ignore the users of the phi. - if (ignore_phi_users && user->opcode() == SpvOp::SpvOpPhi) return; + if (ignore_phi_users && user->opcode() == spv::Op::OpPhi) return; // Traverse each user with this lambda. def_use->ForEachUser(user, traverser_functor); @@ -214,7 +214,7 @@ bool LoopFissionImpl::GroupInstructionsByUseDef() { for (Instruction& inst : block) { // Ignore all instructions related to control flow. - if (inst.opcode() == SpvOp::SpvOpSelectionMerge || inst.IsBranch()) { + if (inst.opcode() == spv::Op::OpSelectionMerge || inst.IsBranch()) { TraverseUseDef(&inst, &instructions_to_ignore, true, true); } } @@ -229,8 +229,8 @@ bool LoopFissionImpl::GroupInstructionsByUseDef() { for (Instruction& inst : block) { // Record the order that each load/store is seen. - if (inst.opcode() == SpvOp::SpvOpLoad || - inst.opcode() == SpvOp::SpvOpStore) { + if (inst.opcode() == spv::Op::OpLoad || + inst.opcode() == spv::Op::OpStore) { instruction_order_[&inst] = instruction_order_.size(); } @@ -292,9 +292,9 @@ bool LoopFissionImpl::CanPerformSplit() { // Populate the above lists. for (Instruction* inst : cloned_loop_instructions_) { - if (inst->opcode() == SpvOp::SpvOpStore) { + if (inst->opcode() == spv::Op::OpStore) { set_one_stores.push_back(inst); - } else if (inst->opcode() == SpvOp::SpvOpLoad) { + } else if (inst->opcode() == spv::Op::OpLoad) { set_one_loads.push_back(inst); } @@ -316,7 +316,7 @@ bool LoopFissionImpl::CanPerformSplit() { // Look at the dependency between the loads in the original and stores in // the cloned loops. - if (inst->opcode() == SpvOp::SpvOpLoad) { + if (inst->opcode() == spv::Op::OpLoad) { for (Instruction* store : set_one_stores) { DistanceVector vec{loop_depth}; @@ -334,7 +334,7 @@ bool LoopFissionImpl::CanPerformSplit() { } } } - } else if (inst->opcode() == SpvOp::SpvOpStore) { + } else if (inst->opcode() == spv::Op::OpStore) { for (Instruction* load : set_one_loads) { DistanceVector vec{loop_depth}; @@ -387,7 +387,7 @@ Loop* LoopFissionImpl::SplitLoop() { if (cloned_loop_instructions_.count(&inst) == 1 && original_loop_instructions_.count(&inst) == 0) { instructions_to_kill.push_back(&inst); - if (inst.opcode() == SpvOp::SpvOpPhi) { + if (inst.opcode() == spv::Op::OpPhi) { context_->ReplaceAllUsesWith( inst.result_id(), clone_results.value_map_[inst.result_id()]); } diff --git a/3rdparty/spirv-tools/source/opt/loop_fusion.cpp b/3rdparty/spirv-tools/source/opt/loop_fusion.cpp index f3aab2837..dc6355306 100644 --- a/3rdparty/spirv-tools/source/opt/loop_fusion.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_fusion.cpp @@ -23,7 +23,6 @@ namespace spvtools { namespace opt { - namespace { // Append all the loops nested in |loop| to |loops|. @@ -193,14 +192,15 @@ bool LoopFusion::AreCompatible() { // in LCSSA form. for (auto block : block_to_check) { for (auto& inst : *block) { - if (inst.opcode() == SpvOpStore) { + if (inst.opcode() == spv::Op::OpStore) { // Get the definition of the target to check it's function scope so // there are no observable side effects. auto variable = context_->get_def_use_mgr()->GetDef(inst.GetSingleWordInOperand(0)); - if (variable->opcode() != SpvOpVariable || - variable->GetSingleWordInOperand(0) != SpvStorageClassFunction) { + if (variable->opcode() != spv::Op::OpVariable || + spv::StorageClass(variable->GetSingleWordInOperand(0)) != + spv::StorageClass::Function) { return false; } @@ -209,7 +209,7 @@ bool LoopFusion::AreCompatible() { context_->get_def_use_mgr()->ForEachUse( inst.GetSingleWordInOperand(0), [&is_used](Instruction* use_inst, uint32_t) { - if (use_inst->opcode() == SpvOpLoad) { + if (use_inst->opcode() == spv::Op::OpLoad) { is_used = true; } }); @@ -217,11 +217,11 @@ bool LoopFusion::AreCompatible() { if (is_used) { return false; } - } else if (inst.opcode() == SpvOpPhi) { + } else if (inst.opcode() == spv::Op::OpPhi) { if (inst.NumInOperands() != 2) { return false; } - } else if (inst.opcode() != SpvOpBranch) { + } else if (inst.opcode() != spv::Op::OpBranch) { return false; } } @@ -234,10 +234,12 @@ bool LoopFusion::ContainsBarriersOrFunctionCalls(Loop* loop) { for (const auto& block : loop->GetBlocks()) { for (const auto& inst : *containing_function_->FindBlock(block)) { auto opcode = inst.opcode(); - if (opcode == SpvOpFunctionCall || opcode == SpvOpControlBarrier || - opcode == SpvOpMemoryBarrier || opcode == SpvOpTypeNamedBarrier || - opcode == SpvOpNamedBarrierInitialize || - opcode == SpvOpMemoryNamedBarrier) { + if (opcode == spv::Op::OpFunctionCall || + opcode == spv::Op::OpControlBarrier || + opcode == spv::Op::OpMemoryBarrier || + opcode == spv::Op::OpTypeNamedBarrier || + opcode == spv::Op::OpNamedBarrierInitialize || + opcode == spv::Op::OpMemoryNamedBarrier) { return true; } } @@ -344,7 +346,7 @@ std::map> LoopFusion::LocationToMemOps( auto access_location = context_->get_def_use_mgr()->GetDef( instruction->GetSingleWordInOperand(0)); - while (access_location->opcode() == SpvOpAccessChain) { + while (access_location->opcode() == spv::Op::OpAccessChain) { access_location = context_->get_def_use_mgr()->GetDef( access_location->GetSingleWordInOperand(0)); } @@ -366,9 +368,9 @@ LoopFusion::GetLoadsAndStoresInLoop(Loop* loop) { } for (auto& instruction : *containing_function_->FindBlock(block_id)) { - if (instruction.opcode() == SpvOpLoad) { + if (instruction.opcode() == spv::Op::OpLoad) { loads.push_back(&instruction); - } else if (instruction.opcode() == SpvOpStore) { + } else if (instruction.opcode() == spv::Op::OpStore) { stores.push_back(&instruction); } } @@ -556,7 +558,7 @@ void LoopFusion::Fuse() { // Update merge block id in the header of |loop_0_| to the merge block of // |loop_1_|. loop_0_->GetHeaderBlock()->ForEachInst([this](Instruction* inst) { - if (inst->opcode() == SpvOpLoopMerge) { + if (inst->opcode() == spv::Op::OpLoopMerge) { inst->SetInOperand(0, {loop_1_->GetMergeBlock()->id()}); } }); @@ -564,7 +566,7 @@ void LoopFusion::Fuse() { // Update condition branch target in |loop_0_| to the merge block of // |loop_1_|. condition_block_of_0->ForEachInst([this](Instruction* inst) { - if (inst->opcode() == SpvOpBranchConditional) { + if (inst->opcode() == spv::Op::OpBranchConditional) { auto loop_0_merge_block_id = loop_0_->GetMergeBlock()->id(); if (inst->GetSingleWordInOperand(1) == loop_0_merge_block_id) { @@ -579,7 +581,8 @@ void LoopFusion::Fuse() { // the header of |loop_1_| to the header of |loop_0_|. std::vector instructions_to_move{}; for (auto& instruction : *loop_1_->GetHeaderBlock()) { - if (instruction.opcode() == SpvOpPhi && &instruction != induction_1_) { + if (instruction.opcode() == spv::Op::OpPhi && + &instruction != induction_1_) { instructions_to_move.push_back(&instruction); } } diff --git a/3rdparty/spirv-tools/source/opt/loop_peeling.cpp b/3rdparty/spirv-tools/source/opt/loop_peeling.cpp index 34f0a8d26..d51227303 100644 --- a/3rdparty/spirv-tools/source/opt/loop_peeling.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_peeling.cpp @@ -29,6 +29,21 @@ namespace spvtools { namespace opt { +namespace { +// Gather the set of blocks for all the path from |entry| to |root|. +void GetBlocksInPath(uint32_t block, uint32_t entry, + std::unordered_set* blocks_in_path, + const CFG& cfg) { + for (uint32_t pid : cfg.preds(block)) { + if (blocks_in_path->insert(pid).second) { + if (pid != entry) { + GetBlocksInPath(pid, entry, blocks_in_path, cfg); + } + } + } +} +} // namespace + size_t LoopPeelingPass::code_grow_threshold_ = 1000; void LoopPeeling::DuplicateAndConnectLoop( @@ -186,7 +201,7 @@ void LoopPeeling::GetIteratorUpdateOperations( operations->insert(iterator); iterator->ForEachInId([def_use_mgr, loop, operations, this](uint32_t* id) { Instruction* insn = def_use_mgr->GetDef(*id); - if (insn->opcode() == SpvOpLabel) { + if (insn->opcode() == spv::Op::OpLabel) { return; } if (operations->count(insn)) { @@ -199,19 +214,6 @@ void LoopPeeling::GetIteratorUpdateOperations( }); } -// Gather the set of blocks for all the path from |entry| to |root|. -static void GetBlocksInPath(uint32_t block, uint32_t entry, - std::unordered_set* blocks_in_path, - const CFG& cfg) { - for (uint32_t pid : cfg.preds(block)) { - if (blocks_in_path->insert(pid).second) { - if (pid != entry) { - GetBlocksInPath(pid, entry, blocks_in_path, cfg); - } - } - } -} - bool LoopPeeling::IsConditionCheckSideEffectFree() const { CFG& cfg = *context_->cfg(); @@ -231,9 +233,9 @@ bool LoopPeeling::IsConditionCheckSideEffectFree() const { if (!bb->WhileEachInst([this](Instruction* insn) { if (insn->IsBranch()) return true; switch (insn->opcode()) { - case SpvOpLabel: - case SpvOpSelectionMerge: - case SpvOpLoopMerge: + case spv::Op::OpLabel: + case spv::Op::OpSelectionMerge: + case spv::Op::OpLoopMerge: return true; default: break; @@ -322,7 +324,7 @@ void LoopPeeling::FixExitCondition( BasicBlock* condition_block = cfg.block(condition_block_id); Instruction* exit_condition = condition_block->terminator(); - assert(exit_condition->opcode() == SpvOpBranchConditional); + assert(exit_condition->opcode() == spv::Op::OpBranchConditional); BasicBlock::iterator insert_point = condition_block->tail(); if (condition_block->GetMergeInst()) { --insert_point; @@ -350,7 +352,7 @@ BasicBlock* LoopPeeling::CreateBlockBefore(BasicBlock* bb) { // TODO(1841): Handle id overflow. std::unique_ptr new_bb = MakeUnique(std::unique_ptr(new Instruction( - context_, SpvOpLabel, 0, context_->TakeNextId(), {}))); + context_, spv::Op::OpLabel, 0, context_->TakeNextId(), {}))); // Update the loop descriptor. Loop* in_loop = (*loop_utils_.GetLoopDescriptor())[bb]; if (in_loop) { @@ -791,18 +793,18 @@ uint32_t LoopPeelingPass::LoopPeelingInfo::GetFirstNonLoopInvariantOperand( return 0; } -static bool IsHandledCondition(SpvOp opcode) { +static bool IsHandledCondition(spv::Op opcode) { switch (opcode) { - case SpvOpIEqual: - case SpvOpINotEqual: - case SpvOpUGreaterThan: - case SpvOpSGreaterThan: - case SpvOpUGreaterThanEqual: - case SpvOpSGreaterThanEqual: - case SpvOpULessThan: - case SpvOpSLessThan: - case SpvOpULessThanEqual: - case SpvOpSLessThanEqual: + case spv::Op::OpIEqual: + case spv::Op::OpINotEqual: + case spv::Op::OpUGreaterThan: + case spv::Op::OpSGreaterThan: + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpULessThan: + case spv::Op::OpSLessThan: + case spv::Op::OpULessThanEqual: + case spv::Op::OpSLessThanEqual: return true; default: return false; @@ -811,7 +813,7 @@ static bool IsHandledCondition(SpvOp opcode) { LoopPeelingPass::LoopPeelingInfo::Direction LoopPeelingPass::LoopPeelingInfo::GetPeelingInfo(BasicBlock* bb) const { - if (bb->terminator()->opcode() != SpvOpBranchConditional) { + if (bb->terminator()->opcode() != spv::Op::OpBranchConditional) { return GetNoneDirection(); } @@ -886,27 +888,27 @@ LoopPeelingPass::LoopPeelingInfo::GetPeelingInfo(BasicBlock* bb) const { switch (condition->opcode()) { default: return GetNoneDirection(); - case SpvOpIEqual: - case SpvOpINotEqual: + case spv::Op::OpIEqual: + case spv::Op::OpINotEqual: return HandleEquality(lhs, rhs); - case SpvOpUGreaterThan: - case SpvOpSGreaterThan: { + case spv::Op::OpUGreaterThan: + case spv::Op::OpSGreaterThan: { cmp_operator = CmpOperator::kGT; break; } - case SpvOpULessThan: - case SpvOpSLessThan: { + case spv::Op::OpULessThan: + case spv::Op::OpSLessThan: { cmp_operator = CmpOperator::kLT; break; } // We add one to transform >= into > and <= into <. - case SpvOpUGreaterThanEqual: - case SpvOpSGreaterThanEqual: { + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpSGreaterThanEqual: { cmp_operator = CmpOperator::kGE; break; } - case SpvOpULessThanEqual: - case SpvOpSLessThanEqual: { + case spv::Op::OpULessThanEqual: + case spv::Op::OpSLessThanEqual: { cmp_operator = CmpOperator::kLE; break; } diff --git a/3rdparty/spirv-tools/source/opt/loop_unroller.cpp b/3rdparty/spirv-tools/source/opt/loop_unroller.cpp index 6f4e6f413..07b529d49 100644 --- a/3rdparty/spirv-tools/source/opt/loop_unroller.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_unroller.cpp @@ -68,10 +68,10 @@ namespace opt { namespace { // Loop control constant value for DontUnroll flag. -static const uint32_t kLoopControlDontUnrollIndex = 2; +constexpr uint32_t kLoopControlDontUnrollIndex = 2; // Operand index of the loop control parameter of the OpLoopMerge. -static const uint32_t kLoopControlIndex = 2; +constexpr uint32_t kLoopControlIndex = 2; // This utility class encapsulates some of the state we need to maintain between // loop unrolls. Specifically it maintains key blocks and the induction variable @@ -336,8 +336,7 @@ class LoopUnrollerUtilsImpl { // Retrieve the index of the OpPhi instruction |phi| which corresponds to the // incoming |block| id. -static uint32_t GetPhiIndexFromLabel(const BasicBlock* block, - const Instruction* phi) { +uint32_t GetPhiIndexFromLabel(const BasicBlock* block, const Instruction* phi) { for (uint32_t i = 1; i < phi->NumInOperands(); i += 2) { if (block->id() == phi->GetSingleWordInOperand(i)) { return i; @@ -382,7 +381,7 @@ void LoopUnrollerUtilsImpl::PartiallyUnrollResidualFactor(Loop* loop, size_t factor) { // TODO(1841): Handle id overflow. std::unique_ptr new_label{new Instruction( - context_, SpvOp::SpvOpLabel, 0, context_->TakeNextId(), {})}; + context_, spv::Op::OpLabel, 0, context_->TakeNextId(), {})}; std::unique_ptr new_exit_bb{new BasicBlock(std::move(new_label))}; new_exit_bb->SetParent(&function_); @@ -991,7 +990,7 @@ bool LoopUtils::CanPerformUnroll() { // Check that we can find and process the induction variable. const Instruction* induction = loop_->FindConditionVariable(condition); - if (!induction || induction->opcode() != SpvOpPhi) return false; + if (!induction || induction->opcode() != spv::Op::OpPhi) return false; // Check that we can find the number of loop iterations. if (!loop_->FindNumberOfIterations(induction, &*condition->ctail(), nullptr)) @@ -1002,7 +1001,7 @@ bool LoopUtils::CanPerformUnroll() { // iteration counts. This can cause timeouts and memouts during fuzzing that // are not classed as bugs. To avoid this noise, loop unrolling is not applied // to loops with large iteration counts when fuzzing. - const size_t kFuzzerIterationLimit = 100; + constexpr size_t kFuzzerIterationLimit = 100; size_t num_iterations; loop_->FindNumberOfIterations(induction, &*condition->ctail(), &num_iterations); @@ -1015,7 +1014,7 @@ bool LoopUtils::CanPerformUnroll() { // block. const Instruction& branch = *loop_->GetLatchBlock()->ctail(); bool branching_assumption = - branch.opcode() == SpvOpBranch && + branch.opcode() == spv::Op::OpBranch && branch.GetSingleWordInOperand(0) == loop_->GetHeaderBlock()->id(); if (!branching_assumption) { return false; @@ -1043,10 +1042,10 @@ bool LoopUtils::CanPerformUnroll() { // exit the loop. for (uint32_t label_id : loop_->GetBlocks()) { const BasicBlock* block = context_->cfg()->block(label_id); - if (block->ctail()->opcode() == SpvOp::SpvOpKill || - block->ctail()->opcode() == SpvOp::SpvOpReturn || - block->ctail()->opcode() == SpvOp::SpvOpReturnValue || - block->ctail()->opcode() == SpvOp::SpvOpTerminateInvocation) { + if (block->ctail()->opcode() == spv::Op::OpKill || + block->ctail()->opcode() == spv::Op::OpReturn || + block->ctail()->opcode() == spv::Op::OpReturnValue || + block->ctail()->opcode() == spv::Op::OpTerminateInvocation) { return false; } } diff --git a/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp b/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp index 1ee7e5e22..b00d66de8 100644 --- a/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp @@ -37,12 +37,7 @@ namespace spvtools { namespace opt { namespace { - -static const uint32_t kTypePointerStorageClassInIdx = 0; - -} // anonymous namespace - -namespace { +constexpr uint32_t kTypePointerStorageClassInIdx = 0; // This class handle the unswitch procedure for a given loop. // The unswitch will not happen if: @@ -77,7 +72,7 @@ class LoopUnswitch { } if (bb->terminator()->IsBranch() && - bb->terminator()->opcode() != SpvOpBranch) { + bb->terminator()->opcode() != spv::Op::OpBranch) { if (IsConditionNonConstantLoopInvariant(bb->terminator())) { switch_block_ = bb; break; @@ -104,7 +99,7 @@ class LoopUnswitch { // TODO(1841): Handle id overflow. BasicBlock* bb = &*ip.InsertBefore(std::unique_ptr( new BasicBlock(std::unique_ptr(new Instruction( - context_, SpvOpLabel, 0, context_->TakeNextId(), {}))))); + context_, spv::Op::OpLabel, 0, context_->TakeNextId(), {}))))); bb->SetParent(function_); def_use_mgr->AnalyzeInstDef(bb->GetLabelInst()); context_->set_instr_block(bb->GetLabelInst(), bb); @@ -113,7 +108,7 @@ class LoopUnswitch { } Instruction* GetValueForDefaultPathForSwitch(Instruction* switch_inst) { - assert(switch_inst->opcode() == SpvOpSwitch && + assert(switch_inst->opcode() == spv::Op::OpSwitch && "The given instructoin must be an OpSwitch."); // Find a value that can be used to select the default path. @@ -291,7 +286,7 @@ class LoopUnswitch { ///////////////////////////// Instruction* iv_condition = &*switch_block_->tail(); - SpvOp iv_opcode = iv_condition->opcode(); + spv::Op iv_opcode = iv_condition->opcode(); Instruction* condition = def_use_mgr->GetDef(iv_condition->GetOperand(0).words[0]); @@ -304,7 +299,7 @@ class LoopUnswitch { std::vector> constant_branch; // Special case for the original loop Instruction* original_loop_constant_value; - if (iv_opcode == SpvOpBranchConditional) { + if (iv_opcode == spv::Op::OpBranchConditional) { constant_branch.emplace_back( cst_mgr->GetDefiningInstruction(cst_mgr->GetConstant(cond_type, {0})), nullptr); @@ -401,7 +396,7 @@ class LoopUnswitch { // Delete the old jump context_->KillInst(&*if_block->tail()); InstructionBuilder builder(context_, if_block); - if (iv_opcode == SpvOpBranchConditional) { + if (iv_opcode == spv::Op::OpBranchConditional) { assert(constant_branch.size() == 1); builder.AddConditionalBranch( condition->result_id(), original_loop_target->id(), @@ -509,7 +504,8 @@ class LoopUnswitch { bool& is_uniform = dynamically_uniform_[var->result_id()]; is_uniform = false; - dec_mgr->WhileEachDecoration(var->result_id(), SpvDecorationUniform, + dec_mgr->WhileEachDecoration(var->result_id(), + uint32_t(spv::Decoration::Uniform), [&is_uniform](const Instruction&) { is_uniform = true; return false; @@ -526,14 +522,14 @@ class LoopUnswitch { if (!post_dom_tree.Dominates(parent->id(), entry->id())) { return is_uniform = false; } - if (var->opcode() == SpvOpLoad) { + if (var->opcode() == spv::Op::OpLoad) { const uint32_t PtrTypeId = def_use_mgr->GetDef(var->GetSingleWordInOperand(0))->type_id(); const Instruction* PtrTypeInst = def_use_mgr->GetDef(PtrTypeId); - uint32_t storage_class = - PtrTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx); - if (storage_class != SpvStorageClassUniform && - storage_class != SpvStorageClassUniformConstant) { + auto storage_class = spv::StorageClass( + PtrTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx)); + if (storage_class != spv::StorageClass::Uniform && + storage_class != spv::StorageClass::UniformConstant) { return is_uniform = false; } } else { @@ -553,7 +549,7 @@ class LoopUnswitch { // dynamically uniform. bool IsConditionNonConstantLoopInvariant(Instruction* insn) { assert(insn->IsBranch()); - assert(insn->opcode() != SpvOpBranch); + assert(insn->opcode() != spv::Op::OpBranch); analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr(); Instruction* condition = def_use_mgr->GetDef(insn->GetOperand(0).words[0]); diff --git a/3rdparty/spirv-tools/source/opt/loop_utils.cpp b/3rdparty/spirv-tools/source/opt/loop_utils.cpp index 8c6d355d6..20494e12b 100644 --- a/3rdparty/spirv-tools/source/opt/loop_utils.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_utils.cpp @@ -28,12 +28,11 @@ namespace spvtools { namespace opt { - namespace { // Return true if |bb| is dominated by at least one block in |exits| -static inline bool DominatesAnExit(BasicBlock* bb, - const std::unordered_set& exits, - const DominatorTree& dom_tree) { +inline bool DominatesAnExit(BasicBlock* bb, + const std::unordered_set& exits, + const DominatorTree& dom_tree) { for (BasicBlock* e_bb : exits) if (dom_tree.Dominates(bb, e_bb)) return true; return false; @@ -71,10 +70,10 @@ class LCSSARewriter { // UpdateManagers. void RewriteUse(BasicBlock* bb, Instruction* user, uint32_t operand_index) { assert( - (user->opcode() != SpvOpPhi || bb != GetParent(user)) && + (user->opcode() != spv::Op::OpPhi || bb != GetParent(user)) && "The root basic block must be the incoming edge if |user| is a phi " "instruction"); - assert((user->opcode() == SpvOpPhi || bb == GetParent(user)) && + assert((user->opcode() == spv::Op::OpPhi || bb == GetParent(user)) && "The root basic block must be the instruction parent if |user| is " "not " "phi instruction"); @@ -293,7 +292,7 @@ inline void MakeSetClosedSSA(IRContext* context, Function* function, assert(use_parent); if (blocks.count(use_parent->id())) return; - if (use->opcode() == SpvOpPhi) { + if (use->opcode() == spv::Op::OpPhi) { // If the use is a Phi instruction and the incoming block is // coming from the loop, then that's consistent with LCSSA form. if (exit_bb.count(use_parent)) { @@ -355,7 +354,7 @@ void LoopUtils::CreateLoopDedicatedExits() { // TODO(1841): Handle id overflow. BasicBlock& exit = *insert_pt.InsertBefore(std::unique_ptr( new BasicBlock(std::unique_ptr(new Instruction( - context_, SpvOpLabel, 0, context_->TakeNextId(), {}))))); + context_, spv::Op::OpLabel, 0, context_->TakeNextId(), {}))))); exit.SetParent(function); // Redirect in loop predecessors to |exit| block. @@ -494,7 +493,7 @@ Loop* LoopUtils::CloneAndAttachLoopToHeader(LoopCloningResult* cloning_result) { // Create a new exit block/label for the new loop. // TODO(1841): Handle id overflow. std::unique_ptr new_label{new Instruction( - context_, SpvOp::SpvOpLabel, 0, context_->TakeNextId(), {})}; + context_, spv::Op::OpLabel, 0, context_->TakeNextId(), {})}; std::unique_ptr new_exit_bb{new BasicBlock(std::move(new_label))}; new_exit_bb->SetParent(loop_->GetMergeBlock()->GetParent()); @@ -680,9 +679,9 @@ void CodeMetrics::Analyze(const Loop& loop) { const BasicBlock* bb = cfg.block(id); size_t bb_size = 0; bb->ForEachInst([&bb_size](const Instruction* insn) { - if (insn->opcode() == SpvOpLabel) return; + if (insn->opcode() == spv::Op::OpLabel) return; if (insn->IsNop()) return; - if (insn->opcode() == SpvOpPhi) return; + if (insn->opcode() == spv::Op::OpPhi) return; bb_size++; }); block_sizes_[bb->id()] = bb_size; diff --git a/3rdparty/spirv-tools/source/opt/mem_pass.cpp b/3rdparty/spirv-tools/source/opt/mem_pass.cpp index ca4889b7c..5f5929186 100644 --- a/3rdparty/spirv-tools/source/opt/mem_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/mem_pass.cpp @@ -28,26 +28,23 @@ namespace spvtools { namespace opt { - namespace { - -const uint32_t kCopyObjectOperandInIdx = 0; -const uint32_t kTypePointerStorageClassInIdx = 0; -const uint32_t kTypePointerTypeIdInIdx = 1; - +constexpr uint32_t kCopyObjectOperandInIdx = 0; +constexpr uint32_t kTypePointerStorageClassInIdx = 0; +constexpr uint32_t kTypePointerTypeIdInIdx = 1; } // namespace bool MemPass::IsBaseTargetType(const Instruction* typeInst) const { switch (typeInst->opcode()) { - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeBool: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeImage: - case SpvOpTypeSampler: - case SpvOpTypeSampledImage: - case SpvOpTypePointer: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeBool: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypePointer: return true; default: break; @@ -57,14 +54,14 @@ bool MemPass::IsBaseTargetType(const Instruction* typeInst) const { bool MemPass::IsTargetType(const Instruction* typeInst) const { if (IsBaseTargetType(typeInst)) return true; - if (typeInst->opcode() == SpvOpTypeArray) { + if (typeInst->opcode() == spv::Op::OpTypeArray) { if (!IsTargetType( get_def_use_mgr()->GetDef(typeInst->GetSingleWordOperand(1)))) { return false; } return true; } - if (typeInst->opcode() != SpvOpTypeStruct) return false; + if (typeInst->opcode() != spv::Op::OpTypeStruct) return false; // All struct members must be math type return typeInst->WhileEachInId([this](const uint32_t* tid) { Instruction* compTypeInst = get_def_use_mgr()->GetDef(*tid); @@ -73,23 +70,24 @@ bool MemPass::IsTargetType(const Instruction* typeInst) const { }); } -bool MemPass::IsNonPtrAccessChain(const SpvOp opcode) const { - return opcode == SpvOpAccessChain || opcode == SpvOpInBoundsAccessChain; +bool MemPass::IsNonPtrAccessChain(const spv::Op opcode) const { + return opcode == spv::Op::OpAccessChain || + opcode == spv::Op::OpInBoundsAccessChain; } bool MemPass::IsPtr(uint32_t ptrId) { uint32_t varId = ptrId; Instruction* ptrInst = get_def_use_mgr()->GetDef(varId); - while (ptrInst->opcode() == SpvOpCopyObject) { + while (ptrInst->opcode() == spv::Op::OpCopyObject) { varId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); ptrInst = get_def_use_mgr()->GetDef(varId); } - const SpvOp op = ptrInst->opcode(); - if (op == SpvOpVariable || IsNonPtrAccessChain(op)) return true; + const spv::Op op = ptrInst->opcode(); + if (op == spv::Op::OpVariable || IsNonPtrAccessChain(op)) return true; const uint32_t varTypeId = ptrInst->type_id(); if (varTypeId == 0) return false; const Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); - return varTypeInst->opcode() == SpvOpTypePointer; + return varTypeInst->opcode() == spv::Op::OpTypePointer; } Instruction* MemPass::GetPtr(uint32_t ptrId, uint32_t* varId) { @@ -97,24 +95,24 @@ Instruction* MemPass::GetPtr(uint32_t ptrId, uint32_t* varId) { Instruction* ptrInst = get_def_use_mgr()->GetDef(*varId); Instruction* varInst; - if (ptrInst->opcode() == SpvOpConstantNull) { + if (ptrInst->opcode() == spv::Op::OpConstantNull) { *varId = 0; return ptrInst; } - if (ptrInst->opcode() != SpvOpVariable && - ptrInst->opcode() != SpvOpFunctionParameter) { + if (ptrInst->opcode() != spv::Op::OpVariable && + ptrInst->opcode() != spv::Op::OpFunctionParameter) { varInst = ptrInst->GetBaseAddress(); } else { varInst = ptrInst; } - if (varInst->opcode() == SpvOpVariable) { + if (varInst->opcode() == spv::Op::OpVariable) { *varId = varInst->result_id(); } else { *varId = 0; } - while (ptrInst->opcode() == SpvOpCopyObject) { + while (ptrInst->opcode() == spv::Op::OpCopyObject) { uint32_t temp = ptrInst->GetSingleWordInOperand(0); ptrInst = get_def_use_mgr()->GetDef(temp); } @@ -123,8 +121,9 @@ Instruction* MemPass::GetPtr(uint32_t ptrId, uint32_t* varId) { } Instruction* MemPass::GetPtr(Instruction* ip, uint32_t* varId) { - assert(ip->opcode() == SpvOpStore || ip->opcode() == SpvOpLoad || - ip->opcode() == SpvOpImageTexelPointer || ip->IsAtomicWithLoad()); + assert(ip->opcode() == spv::Op::OpStore || ip->opcode() == spv::Op::OpLoad || + ip->opcode() == spv::Op::OpImageTexelPointer || + ip->IsAtomicWithLoad()); // All of these opcode place the pointer in position 0. const uint32_t ptrId = ip->GetSingleWordInOperand(0); @@ -133,8 +132,8 @@ Instruction* MemPass::GetPtr(Instruction* ip, uint32_t* varId) { bool MemPass::HasOnlyNamesAndDecorates(uint32_t id) const { return get_def_use_mgr()->WhileEachUser(id, [this](Instruction* user) { - SpvOp op = user->opcode(); - if (op != SpvOpName && !IsNonTypeDecorate(op)) { + spv::Op op = user->opcode(); + if (op != spv::Op::OpName && !IsNonTypeDecorate(op)) { return false; } return true; @@ -147,14 +146,15 @@ void MemPass::KillAllInsts(BasicBlock* bp, bool killLabel) { bool MemPass::HasLoads(uint32_t varId) const { return !get_def_use_mgr()->WhileEachUser(varId, [this](Instruction* user) { - SpvOp op = user->opcode(); + spv::Op op = user->opcode(); // TODO(): The following is slightly conservative. Could be // better handling of non-store/name. - if (IsNonPtrAccessChain(op) || op == SpvOpCopyObject) { + if (IsNonPtrAccessChain(op) || op == spv::Op::OpCopyObject) { if (HasLoads(user->result_id())) { return false; } - } else if (op != SpvOpStore && op != SpvOpName && !IsNonTypeDecorate(op)) { + } else if (op != spv::Op::OpStore && op != spv::Op::OpName && + !IsNonTypeDecorate(op)) { return false; } return true; @@ -164,12 +164,12 @@ bool MemPass::HasLoads(uint32_t varId) const { bool MemPass::IsLiveVar(uint32_t varId) const { const Instruction* varInst = get_def_use_mgr()->GetDef(varId); // assume live if not a variable eg. function parameter - if (varInst->opcode() != SpvOpVariable) return true; + if (varInst->opcode() != spv::Op::OpVariable) return true; // non-function scope vars are live const uint32_t varTypeId = varInst->type_id(); const Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); - if (varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) != - SpvStorageClassFunction) + if (spv::StorageClass(varTypeInst->GetSingleWordInOperand( + kTypePointerStorageClassInIdx)) != spv::StorageClass::Function) return true; // test if variable is loaded from return HasLoads(varId); @@ -177,10 +177,10 @@ bool MemPass::IsLiveVar(uint32_t varId) const { void MemPass::AddStores(uint32_t ptr_id, std::queue* insts) { get_def_use_mgr()->ForEachUser(ptr_id, [this, insts](Instruction* user) { - SpvOp op = user->opcode(); + spv::Op op = user->opcode(); if (IsNonPtrAccessChain(op)) { AddStores(user->result_id(), insts); - } else if (op == SpvOpStore) { + } else if (op == spv::Op::OpStore) { insts->push(user); } }); @@ -193,7 +193,7 @@ void MemPass::DCEInst(Instruction* inst, while (!deadInsts.empty()) { Instruction* di = deadInsts.front(); // Don't delete labels - if (di->opcode() == SpvOpLabel) { + if (di->opcode() == spv::Op::OpLabel) { deadInsts.pop(); continue; } @@ -202,7 +202,7 @@ void MemPass::DCEInst(Instruction* inst, di->ForEachInId([&ids](uint32_t* iid) { ids.insert(*iid); }); uint32_t varId = 0; // Remember variable if dead load - if (di->opcode() == SpvOpLoad) (void)GetPtr(di, &varId); + if (di->opcode() == spv::Op::OpLoad) (void)GetPtr(di, &varId); if (call_back) { call_back(di); } @@ -230,9 +230,9 @@ bool MemPass::HasOnlySupportedRefs(uint32_t varId) { dbg_op == CommonDebugInfoDebugValue) { return true; } - SpvOp op = user->opcode(); - if (op != SpvOpStore && op != SpvOpLoad && op != SpvOpName && - !IsNonTypeDecorate(op)) { + spv::Op op = user->opcode(); + if (op != spv::Op::OpStore && op != spv::Op::OpLoad && + op != spv::Op::OpName && !IsNonTypeDecorate(op)) { return false; } return true; @@ -248,7 +248,7 @@ uint32_t MemPass::Type2Undef(uint32_t type_id) { } std::unique_ptr undef_inst( - new Instruction(context(), SpvOpUndef, type_id, undefId, {})); + new Instruction(context(), spv::Op::OpUndef, type_id, undefId, {})); get_def_use_mgr()->AnalyzeInstDefUse(&*undef_inst); get_module()->AddGlobalValue(std::move(undef_inst)); type2undefs_[type_id] = undefId; @@ -264,11 +264,11 @@ bool MemPass::IsTargetVar(uint32_t varId) { return false; if (seen_target_vars_.find(varId) != seen_target_vars_.end()) return true; const Instruction* varInst = get_def_use_mgr()->GetDef(varId); - if (varInst->opcode() != SpvOpVariable) return false; + if (varInst->opcode() != spv::Op::OpVariable) return false; const uint32_t varTypeId = varInst->type_id(); const Instruction* varTypeInst = get_def_use_mgr()->GetDef(varTypeId); - if (varTypeInst->GetSingleWordInOperand(kTypePointerStorageClassInIdx) != - SpvStorageClassFunction) { + if (spv::StorageClass(varTypeInst->GetSingleWordInOperand( + kTypePointerStorageClassInIdx)) != spv::StorageClass::Function) { seen_non_target_vars_.insert(varId); return false; } @@ -489,8 +489,8 @@ void MemPass::CollectTargetVars(Function* func) { for (auto& blk : *func) { for (auto& inst : blk) { switch (inst.opcode()) { - case SpvOpStore: - case SpvOpLoad: { + case spv::Op::OpStore: + case spv::Op::OpLoad: { uint32_t varId; (void)GetPtr(&inst, &varId); if (!IsTargetVar(varId)) break; diff --git a/3rdparty/spirv-tools/source/opt/mem_pass.h b/3rdparty/spirv-tools/source/opt/mem_pass.h index 5a77670dd..aef9e5ffa 100644 --- a/3rdparty/spirv-tools/source/opt/mem_pass.h +++ b/3rdparty/spirv-tools/source/opt/mem_pass.h @@ -80,7 +80,7 @@ class MemPass : public Pass { bool IsTargetType(const Instruction* typeInst) const; // Returns true if |opcode| is a non-ptr access chain op - bool IsNonPtrAccessChain(const SpvOp opcode) const; + bool IsNonPtrAccessChain(const spv::Op opcode) const; // Given the id |ptrId|, return true if the top-most non-CopyObj is // a variable, a non-ptr access chain or a parameter of pointer type. @@ -117,8 +117,8 @@ class MemPass : public Pass { bool CFGCleanup(Function* func); // Return true if |op| is supported decorate. - inline bool IsNonTypeDecorate(uint32_t op) const { - return (op == SpvOpDecorate || op == SpvOpDecorateId); + inline bool IsNonTypeDecorate(spv::Op op) const { + return (op == spv::Op::OpDecorate || op == spv::Op::OpDecorateId); } // Return the id of an undef value with type |type_id|. Create and insert an diff --git a/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp b/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp index 7710deae2..c262ea073 100644 --- a/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp @@ -30,7 +30,7 @@ namespace opt { Pass::Status MergeReturnPass::Process() { bool is_shader = - context()->get_feature_mgr()->HasCapability(SpvCapabilityShader); + context()->get_feature_mgr()->HasCapability(spv::Capability::Shader); bool failed = false; ProcessFunction pfn = [&failed, is_shader, this](Function* function) { @@ -74,16 +74,16 @@ Pass::Status MergeReturnPass::Process() { void MergeReturnPass::GenerateState(BasicBlock* block) { if (Instruction* mergeInst = block->GetMergeInst()) { - if (mergeInst->opcode() == SpvOpLoopMerge) { + if (mergeInst->opcode() == spv::Op::OpLoopMerge) { // If new loop, break to this loop merge block state_.emplace_back(mergeInst, mergeInst); } else { auto branchInst = mergeInst->NextNode(); - if (branchInst->opcode() == SpvOpSwitch) { + if (branchInst->opcode() == spv::Op::OpSwitch) { // If switch inside of loop, break to innermost loop merge block. // Otherwise need to break to this switch merge block. auto lastMergeInst = state_.back().BreakMergeInst(); - if (lastMergeInst && lastMergeInst->opcode() == SpvOpLoopMerge) + if (lastMergeInst && lastMergeInst->opcode() == spv::Op::OpLoopMerge) state_.emplace_back(lastMergeInst, mergeInst); else state_.emplace_back(mergeInst, mergeInst); @@ -174,7 +174,7 @@ bool MergeReturnPass::ProcessStructured( void MergeReturnPass::CreateReturnBlock() { // Create a label for the new return block std::unique_ptr return_label( - new Instruction(context(), SpvOpLabel, 0u, TakeNextId(), {})); + new Instruction(context(), spv::Op::OpLabel, 0u, TakeNextId(), {})); // Create the new basic block std::unique_ptr return_block( @@ -195,37 +195,41 @@ void MergeReturnPass::CreateReturn(BasicBlock* block) { // Load and return the final return value uint32_t loadId = TakeNextId(); block->AddInstruction(MakeUnique( - context(), SpvOpLoad, function_->type_id(), loadId, + context(), spv::Op::OpLoad, function_->type_id(), loadId, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {return_value_->result_id()}}})); Instruction* var_inst = block->terminator(); context()->AnalyzeDefUse(var_inst); context()->set_instr_block(var_inst, block); context()->get_decoration_mgr()->CloneDecorations( - return_value_->result_id(), loadId, {SpvDecorationRelaxedPrecision}); + return_value_->result_id(), loadId, + {spv::Decoration::RelaxedPrecision}); block->AddInstruction(MakeUnique( - context(), SpvOpReturnValue, 0, 0, + context(), spv::Op::OpReturnValue, 0, 0, std::initializer_list{{SPV_OPERAND_TYPE_ID, {loadId}}})); context()->AnalyzeDefUse(block->terminator()); context()->set_instr_block(block->terminator(), block); } else { - block->AddInstruction(MakeUnique(context(), SpvOpReturn)); + block->AddInstruction( + MakeUnique(context(), spv::Op::OpReturn)); context()->AnalyzeDefUse(block->terminator()); context()->set_instr_block(block->terminator(), block); } } void MergeReturnPass::ProcessStructuredBlock(BasicBlock* block) { - SpvOp tail_opcode = block->tail()->opcode(); - if (tail_opcode == SpvOpReturn || tail_opcode == SpvOpReturnValue) { + spv::Op tail_opcode = block->tail()->opcode(); + if (tail_opcode == spv::Op::OpReturn || + tail_opcode == spv::Op::OpReturnValue) { if (!return_flag_) { AddReturnFlag(); } } - if (tail_opcode == SpvOpReturn || tail_opcode == SpvOpReturnValue || - tail_opcode == SpvOpUnreachable) { + if (tail_opcode == spv::Op::OpReturn || + tail_opcode == spv::Op::OpReturnValue || + tail_opcode == spv::Op::OpUnreachable) { assert(CurrentState().InBreakable() && "Should be in the placeholder construct."); BranchToBlock(block, CurrentState().BreakMergeId()); @@ -234,8 +238,8 @@ void MergeReturnPass::ProcessStructuredBlock(BasicBlock* block) { } void MergeReturnPass::BranchToBlock(BasicBlock* block, uint32_t target) { - if (block->tail()->opcode() == SpvOpReturn || - block->tail()->opcode() == SpvOpReturnValue) { + if (block->tail()->opcode() == spv::Op::OpReturn || + block->tail()->opcode() == spv::Op::OpReturnValue) { RecordReturned(block); RecordReturnValue(block); } @@ -247,7 +251,7 @@ void MergeReturnPass::BranchToBlock(BasicBlock* block, uint32_t target) { UpdatePhiNodes(block, target_block); Instruction* return_inst = block->terminator(); - return_inst->SetOpcode(SpvOpBranch); + return_inst->SetOpcode(spv::Op::OpBranch); return_inst->ReplaceOperands({{SPV_OPERAND_TYPE_ID, {target}}}); context()->get_def_use_mgr()->AnalyzeInstDefUse(return_inst); new_edges_[target_block].insert(block->id()); @@ -276,7 +280,7 @@ void MergeReturnPass::CreatePhiNodesForInst(BasicBlock* merge_block, &inst, [&users_to_update, &dom_tree, &inst, inst_bb, this](Instruction* user) { BasicBlock* user_bb = nullptr; - if (user->opcode() != SpvOpPhi) { + if (user->opcode() != spv::Op::OpPhi) { user_bb = context()->get_instr_block(user); } else { // For OpPhi, the use should be considered to be in the predecessor. @@ -325,15 +329,16 @@ void MergeReturnPass::CreatePhiNodesForInst(BasicBlock* merge_block, // instruction. If not, the Spir-V will be invalid. Instruction* inst_type = get_def_use_mgr()->GetDef(inst.type_id()); bool regenerateInstruction = false; - if (inst_type->opcode() == SpvOpTypePointer) { + if (inst_type->opcode() == spv::Op::OpTypePointer) { if (!context()->get_feature_mgr()->HasCapability( - SpvCapabilityVariablePointers)) { + spv::Capability::VariablePointers)) { regenerateInstruction = true; } - uint32_t storage_class = inst_type->GetSingleWordInOperand(0); - if (storage_class != SpvStorageClassWorkgroup && - storage_class != SpvStorageClassStorageBuffer) { + auto storage_class = + spv::StorageClass(inst_type->GetSingleWordInOperand(0)); + if (storage_class != spv::StorageClass::Workgroup && + storage_class != spv::StorageClass::StorageBuffer) { regenerateInstruction = true; } } @@ -343,7 +348,7 @@ void MergeReturnPass::CreatePhiNodesForInst(BasicBlock* merge_block, uint32_t new_id = TakeNextId(); regen_inst->SetResultId(new_id); Instruction* insert_pos = &*merge_block->begin(); - while (insert_pos->opcode() == SpvOpPhi) { + while (insert_pos->opcode() == spv::Op::OpPhi) { insert_pos = insert_pos->NextNode(); } new_phi = insert_pos->InsertBefore(std::move(regen_inst)); @@ -459,7 +464,7 @@ bool MergeReturnPass::BreakFromConstruct( // Leave the phi instructions behind. auto iter = block->begin(); - while (iter->opcode() == SpvOpPhi) { + while (iter->opcode() == spv::Op::OpPhi) { ++iter; } @@ -478,7 +483,7 @@ bool MergeReturnPass::BreakFromConstruct( // If |block| was a continue target for a loop |old_body| is now the correct // continue target. - if (break_merge_inst->opcode() == SpvOpLoopMerge && + if (break_merge_inst->opcode() == spv::Op::OpLoopMerge && break_merge_inst->GetSingleWordInOperand(1) == block->id()) { break_merge_inst->SetInOperand(1, {old_body->id()}); context()->UpdateDefUse(break_merge_inst); @@ -531,8 +536,8 @@ bool MergeReturnPass::BreakFromConstruct( } void MergeReturnPass::RecordReturned(BasicBlock* block) { - if (block->tail()->opcode() != SpvOpReturn && - block->tail()->opcode() != SpvOpReturnValue) + if (block->tail()->opcode() != spv::Op::OpReturn && + block->tail()->opcode() != spv::Op::OpReturnValue) return; assert(return_flag_ && "Did not generate the return flag variable."); @@ -550,7 +555,7 @@ void MergeReturnPass::RecordReturned(BasicBlock* block) { } std::unique_ptr return_store(new Instruction( - context(), SpvOpStore, 0, 0, + context(), spv::Op::OpStore, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {return_flag_->result_id()}}, {SPV_OPERAND_TYPE_ID, {constant_true_->result_id()}}})); @@ -563,7 +568,7 @@ void MergeReturnPass::RecordReturned(BasicBlock* block) { void MergeReturnPass::RecordReturnValue(BasicBlock* block) { auto terminator = *block->tail(); - if (terminator.opcode() != SpvOpReturnValue) { + if (terminator.opcode() != spv::Op::OpReturnValue) { return; } @@ -571,7 +576,7 @@ void MergeReturnPass::RecordReturnValue(BasicBlock* block) { "Did not generate the variable to hold the return value."); std::unique_ptr value_store(new Instruction( - context(), SpvOpStore, 0, 0, + context(), spv::Op::OpStore, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {return_value_->result_id()}}, {SPV_OPERAND_TYPE_ID, {terminator.GetSingleWordInOperand(0u)}}})); @@ -586,17 +591,19 @@ void MergeReturnPass::AddReturnValue() { if (return_value_) return; uint32_t return_type_id = function_->type_id(); - if (get_def_use_mgr()->GetDef(return_type_id)->opcode() == SpvOpTypeVoid) + if (get_def_use_mgr()->GetDef(return_type_id)->opcode() == + spv::Op::OpTypeVoid) return; uint32_t return_ptr_type = context()->get_type_mgr()->FindPointerToType( - return_type_id, SpvStorageClassFunction); + return_type_id, spv::StorageClass::Function); uint32_t var_id = TakeNextId(); - std::unique_ptr returnValue(new Instruction( - context(), SpvOpVariable, return_ptr_type, var_id, - std::initializer_list{ - {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}})); + std::unique_ptr returnValue( + new Instruction(context(), spv::Op::OpVariable, return_ptr_type, var_id, + std::initializer_list{ + {SPV_OPERAND_TYPE_STORAGE_CLASS, + {uint32_t(spv::StorageClass::Function)}}})); auto insert_iter = function_->begin()->begin(); insert_iter.InsertBefore(std::move(returnValue)); @@ -606,7 +613,7 @@ void MergeReturnPass::AddReturnValue() { context()->set_instr_block(return_value_, entry_block); context()->get_decoration_mgr()->CloneDecorations( - function_->result_id(), var_id, {SpvDecorationRelaxedPrecision}); + function_->result_id(), var_id, {spv::Decoration::RelaxedPrecision}); } void MergeReturnPass::AddReturnFlag() { @@ -625,14 +632,14 @@ void MergeReturnPass::AddReturnFlag() { const_mgr->GetDefiningInstruction(false_const)->result_id(); uint32_t bool_ptr_id = - type_mgr->FindPointerToType(bool_id, SpvStorageClassFunction); + type_mgr->FindPointerToType(bool_id, spv::StorageClass::Function); uint32_t var_id = TakeNextId(); std::unique_ptr returnFlag(new Instruction( - context(), SpvOpVariable, bool_ptr_id, var_id, - std::initializer_list{ - {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}, - {SPV_OPERAND_TYPE_ID, {const_false_id}}})); + context(), spv::Op::OpVariable, bool_ptr_id, var_id, + std::initializer_list{{SPV_OPERAND_TYPE_STORAGE_CLASS, + {uint32_t(spv::StorageClass::Function)}}, + {SPV_OPERAND_TYPE_ID, {const_false_id}}})); auto insert_iter = function_->begin()->begin(); @@ -648,8 +655,8 @@ std::vector MergeReturnPass::CollectReturnBlocks( std::vector return_blocks; for (auto& block : *function) { Instruction& terminator = *block.tail(); - if (terminator.opcode() == SpvOpReturn || - terminator.opcode() == SpvOpReturnValue) { + if (terminator.opcode() == spv::Op::OpReturn || + terminator.opcode() == spv::Op::OpReturnValue) { return_blocks.push_back(&block); } } @@ -670,7 +677,7 @@ void MergeReturnPass::MergeReturnBlocks( // Create new return. std::vector phi_ops; for (auto block : return_blocks) { - if (block->tail()->opcode() == SpvOpReturnValue) { + if (block->tail()->opcode() == spv::Op::OpReturnValue) { phi_ops.push_back( {SPV_OPERAND_TYPE_ID, {block->tail()->GetSingleWordInOperand(0u)}}); phi_ops.push_back({SPV_OPERAND_TYPE_ID, {block->id()}}); @@ -682,12 +689,12 @@ void MergeReturnPass::MergeReturnBlocks( uint32_t phi_result_id = TakeNextId(); uint32_t phi_type_id = function->type_id(); std::unique_ptr phi_inst(new Instruction( - context(), SpvOpPhi, phi_type_id, phi_result_id, phi_ops)); + context(), spv::Op::OpPhi, phi_type_id, phi_result_id, phi_ops)); ret_block_iter->AddInstruction(std::move(phi_inst)); BasicBlock::iterator phiIter = ret_block_iter->tail(); std::unique_ptr return_inst( - new Instruction(context(), SpvOpReturnValue, 0u, 0u, + new Instruction(context(), spv::Op::OpReturnValue, 0u, 0u, {{SPV_OPERAND_TYPE_ID, {phi_result_id}}})); ret_block_iter->AddInstruction(std::move(return_inst)); BasicBlock::iterator ret = ret_block_iter->tail(); @@ -697,14 +704,14 @@ void MergeReturnPass::MergeReturnBlocks( get_def_use_mgr()->AnalyzeInstDef(&*ret); } else { std::unique_ptr return_inst( - new Instruction(context(), SpvOpReturn)); + new Instruction(context(), spv::Op::OpReturn)); ret_block_iter->AddInstruction(std::move(return_inst)); } // Replace returns with branches for (auto block : return_blocks) { context()->ForgetUses(block->terminator()); - block->tail()->SetOpcode(SpvOpBranch); + block->tail()->SetOpcode(spv::Op::OpBranch); block->tail()->ReplaceOperands({{SPV_OPERAND_TYPE_ID, {return_id}}}); get_def_use_mgr()->AnalyzeInstUse(block->terminator()); get_def_use_mgr()->AnalyzeInstUse(block->GetLabelInst()); @@ -789,7 +796,7 @@ bool MergeReturnPass::AddSingleCaseSwitchAroundFunction() { BasicBlock* MergeReturnPass::CreateContinueTarget(uint32_t header_label_id) { std::unique_ptr label( - new Instruction(context(), SpvOpLabel, 0u, TakeNextId(), {})); + new Instruction(context(), spv::Op::OpLabel, 0u, TakeNextId(), {})); // Create the new basic block std::unique_ptr block(new BasicBlock(std::move(label))); @@ -824,7 +831,7 @@ bool MergeReturnPass::CreateSingleCaseSwitch(BasicBlock* merge_target) { // block to make sure the OpVariable instructions remain in the entry block. BasicBlock* start_block = &*function_->begin(); auto split_pos = start_block->begin(); - while (split_pos->opcode() == SpvOpVariable) { + while (split_pos->opcode() == spv::Op::OpVariable) { ++split_pos; } @@ -865,7 +872,7 @@ bool MergeReturnPass::HasNontrivialUnreachableBlocks(Function* function) { if (struct_cfg_analysis->IsContinueBlock(bb.id())) { // |bb| must be an empty block ending with a branch to the header. Instruction* inst = &*bb.begin(); - if (inst->opcode() != SpvOpBranch) { + if (inst->opcode() != spv::Op::OpBranch) { return true; } @@ -875,7 +882,7 @@ bool MergeReturnPass::HasNontrivialUnreachableBlocks(Function* function) { } } else if (struct_cfg_analysis->IsMergeBlock(bb.id())) { // |bb| must be an empty block ending with OpUnreachable. - if (bb.begin()->opcode() != SpvOpUnreachable) { + if (bb.begin()->opcode() != spv::Op::OpUnreachable) { return true; } } else { diff --git a/3rdparty/spirv-tools/source/opt/module.cpp b/3rdparty/spirv-tools/source/opt/module.cpp index c98af8f51..a9710c6a3 100644 --- a/3rdparty/spirv-tools/source/opt/module.cpp +++ b/3rdparty/spirv-tools/source/opt/module.cpp @@ -69,14 +69,14 @@ std::vector Module::GetConstants() const { return const_insts; } -uint32_t Module::GetGlobalValue(SpvOp opcode) const { +uint32_t Module::GetGlobalValue(spv::Op opcode) const { for (auto& inst : types_values_) { if (inst.opcode() == opcode) return inst.result_id(); } return 0; } -void Module::AddGlobalValue(SpvOp opcode, uint32_t result_id, +void Module::AddGlobalValue(spv::Op opcode, uint32_t result_id, uint32_t type_id) { std::unique_ptr newGlobal( new Instruction(context(), opcode, type_id, result_id, {})); @@ -159,7 +159,6 @@ void Module::ToBinary(std::vector* binary, bool skip_nop) const { if (between_merge_and_branch && i->IsLineInst()) { return; } - between_merge_and_branch = false; if (last_line_inst != nullptr) { // If the current instruction is OpLine or DebugLine and it is the same // as the last line instruction that is still effective (can be applied @@ -181,28 +180,30 @@ void Module::ToBinary(std::vector* binary, bool skip_nop) const { ->get_feature_mgr() ->GetExtInstImportId_Shader100DebugInfo(); if (shader_set_id != 0) { - binary->push_back((5 << 16) | static_cast(SpvOpExtInst)); + binary->push_back((5 << 16) | + static_cast(spv::Op::OpExtInst)); binary->push_back(context()->get_type_mgr()->GetVoidTypeId()); binary->push_back(context()->TakeNextId()); binary->push_back(shader_set_id); binary->push_back(NonSemanticShaderDebugInfo100DebugNoLine); } else { - binary->push_back((1 << 16) | static_cast(SpvOpNoLine)); + binary->push_back((1 << 16) | + static_cast(spv::Op::OpNoLine)); } last_line_inst = nullptr; } } - if (opcode == SpvOpLabel) { + if (opcode == spv::Op::OpLabel) { between_label_and_phi_var = true; - } else if (opcode != SpvOpVariable && opcode != SpvOpPhi && + } else if (opcode != spv::Op::OpVariable && opcode != spv::Op::OpPhi && !spvtools::opt::IsOpLineInst(opcode)) { between_label_and_phi_var = false; } if (!(skip_nop && i->IsNop())) { const auto& scope = i->GetDebugScope(); - if (scope != last_scope) { + if (scope != last_scope && !between_merge_and_branch) { // Can only emit nonsemantic instructions after all phi instructions // in a block so don't emit scope instructions before phi instructions // for NonSemantic.Shader.DebugInfo.100. @@ -221,9 +222,11 @@ void Module::ToBinary(std::vector* binary, bool skip_nop) const { i->ToBinaryWithoutAttachedDebugInsts(binary); } // Update the last line instruction. + between_merge_and_branch = false; if (spvOpcodeIsBlockTerminator(opcode) || i->IsNoLine()) { last_line_inst = nullptr; - } else if (opcode == SpvOpLoopMerge || opcode == SpvOpSelectionMerge) { + } else if (opcode == spv::Op::OpLoopMerge || + opcode == spv::Op::OpSelectionMerge) { between_merge_and_branch = true; last_line_inst = nullptr; } else if (i->IsLine()) { @@ -272,7 +275,7 @@ uint32_t Module::GetExtInstImportId(const char* extstr) { std::ostream& operator<<(std::ostream& str, const Module& module) { module.ForEachInst([&str](const Instruction* inst) { str << *inst; - if (inst->opcode() != SpvOpFunctionEnd) { + if (inst->opcode() != spv::Op::OpFunctionEnd) { str << std::endl; } }); diff --git a/3rdparty/spirv-tools/source/opt/module.h b/3rdparty/spirv-tools/source/opt/module.h index 7a6be460e..ed2f3454e 100644 --- a/3rdparty/spirv-tools/source/opt/module.h +++ b/3rdparty/spirv-tools/source/opt/module.h @@ -136,10 +136,10 @@ class Module { std::vector GetConstants() const; // Return result id of global value with |opcode|, 0 if not present. - uint32_t GetGlobalValue(SpvOp opcode) const; + uint32_t GetGlobalValue(spv::Op opcode) const; // Add global value with |opcode|, |result_id| and |type_id| - void AddGlobalValue(SpvOp opcode, uint32_t result_id, uint32_t type_id); + void AddGlobalValue(spv::Op opcode, uint32_t result_id, uint32_t type_id); inline uint32_t id_bound() const { return header_.bound; } diff --git a/3rdparty/spirv-tools/source/opt/optimizer.cpp b/3rdparty/spirv-tools/source/opt/optimizer.cpp index 381589b53..be0daebda 100644 --- a/3rdparty/spirv-tools/source/opt/optimizer.cpp +++ b/3rdparty/spirv-tools/source/opt/optimizer.cpp @@ -60,6 +60,7 @@ struct Optimizer::Impl { spv_target_env target_env; // Target environment. opt::PassManager pass_manager; // Internal implementation pass manager. + std::unordered_set live_locs; // Arg to debug dead output passes }; Optimizer::Optimizer(spv_target_env env) : impl_(new Impl(env)) { @@ -524,7 +525,7 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { } else if (pass_name == "remove-dont-inline") { RegisterPass(CreateRemoveDontInlinePass()); } else if (pass_name == "eliminate-dead-input-components") { - RegisterPass(CreateEliminateDeadInputComponentsPass()); + RegisterPass(CreateEliminateDeadInputComponentsSafePass()); } else if (pass_name == "fix-func-call-param") { RegisterPass(CreateFixFuncCallArgumentsPass()); } else if (pass_name == "convert-to-sampled-image") { @@ -784,14 +785,10 @@ Optimizer::PassToken CreateLocalMultiStoreElimPass() { MakeUnique()); } -Optimizer::PassToken CreateAggressiveDCEPass() { +Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface, + bool remove_outputs) { return MakeUnique( - MakeUnique(false)); -} - -Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface) { - return MakeUnique( - MakeUnique(preserve_interface)); + MakeUnique(preserve_interface, remove_outputs)); } Optimizer::PassToken CreateRemoveUnusedInterfaceVariablesPass() { @@ -1016,7 +1013,34 @@ Optimizer::PassToken CreateInterpolateFixupPass() { Optimizer::PassToken CreateEliminateDeadInputComponentsPass() { return MakeUnique( - MakeUnique()); + MakeUnique(spv::StorageClass::Input, + /* safe_mode */ false)); +} + +Optimizer::PassToken CreateEliminateDeadOutputComponentsPass() { + return MakeUnique( + MakeUnique(spv::StorageClass::Output, + /* safe_mode */ false)); +} + +Optimizer::PassToken CreateEliminateDeadInputComponentsSafePass() { + return MakeUnique( + MakeUnique(spv::StorageClass::Input, + /* safe_mode */ true)); +} + +Optimizer::PassToken CreateAnalyzeLiveInputPass( + std::unordered_set* live_locs, + std::unordered_set* live_builtins) { + return MakeUnique( + MakeUnique(live_locs, live_builtins)); +} + +Optimizer::PassToken CreateEliminateDeadOutputStoresPass( + std::unordered_set* live_locs, + std::unordered_set* live_builtins) { + return MakeUnique( + MakeUnique(live_locs, live_builtins)); } Optimizer::PassToken CreateConvertToSampledImagePass( diff --git a/3rdparty/spirv-tools/source/opt/pass.cpp b/3rdparty/spirv-tools/source/opt/pass.cpp index 017aad10f..75c37407f 100644 --- a/3rdparty/spirv-tools/source/opt/pass.cpp +++ b/3rdparty/spirv-tools/source/opt/pass.cpp @@ -21,11 +21,8 @@ namespace spvtools { namespace opt { - namespace { - -const uint32_t kTypePointerTypeIdInIdx = 1; - +constexpr uint32_t kTypePointerTypeIdInIdx = 1; } // namespace Pass::Pass() : consumer_(nullptr), context_(nullptr), already_run_(false) {} @@ -56,11 +53,11 @@ uint32_t Pass::GetPointeeTypeId(const Instruction* ptrInst) const { Instruction* Pass::GetBaseType(uint32_t ty_id) { Instruction* ty_inst = get_def_use_mgr()->GetDef(ty_id); - if (ty_inst->opcode() == SpvOpTypeMatrix) { + if (ty_inst->opcode() == spv::Op::OpTypeMatrix) { uint32_t vty_id = ty_inst->GetSingleWordInOperand(0); ty_inst = get_def_use_mgr()->GetDef(vty_id); } - if (ty_inst->opcode() == SpvOpTypeVector) { + if (ty_inst->opcode() == spv::Op::OpTypeVector) { uint32_t cty_id = ty_inst->GetSingleWordInOperand(0); ty_inst = get_def_use_mgr()->GetDef(cty_id); } @@ -69,12 +66,12 @@ Instruction* Pass::GetBaseType(uint32_t ty_id) { bool Pass::IsFloat(uint32_t ty_id, uint32_t width) { Instruction* ty_inst = GetBaseType(ty_id); - if (ty_inst->opcode() != SpvOpTypeFloat) return false; + if (ty_inst->opcode() != spv::Op::OpTypeFloat) return false; return ty_inst->GetSingleWordInOperand(0) == width; } uint32_t Pass::GetNullId(uint32_t type_id) { - if (IsFloat(type_id, 16)) context()->AddCapability(SpvCapabilityFloat16); + if (IsFloat(type_id, 16)) context()->AddCapability(spv::Capability::Float16); analysis::TypeManager* type_mgr = context()->get_type_mgr(); analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); const analysis::Type* type = type_mgr->GetType(type_id); diff --git a/3rdparty/spirv-tools/source/opt/passes.h b/3rdparty/spirv-tools/source/opt/passes.h index 21354c77b..eb3b1e5d3 100644 --- a/3rdparty/spirv-tools/source/opt/passes.h +++ b/3rdparty/spirv-tools/source/opt/passes.h @@ -19,6 +19,7 @@ #include "source/opt/aggressive_dead_code_elim_pass.h" #include "source/opt/amd_ext_to_khr.h" +#include "source/opt/analyze_live_input_pass.h" #include "source/opt/block_merge_pass.h" #include "source/opt/ccp_pass.h" #include "source/opt/cfg_cleanup_pass.h" @@ -34,8 +35,9 @@ #include "source/opt/desc_sroa.h" #include "source/opt/eliminate_dead_constant_pass.h" #include "source/opt/eliminate_dead_functions_pass.h" -#include "source/opt/eliminate_dead_input_components_pass.h" +#include "source/opt/eliminate_dead_io_components_pass.h" #include "source/opt/eliminate_dead_members_pass.h" +#include "source/opt/eliminate_dead_output_stores_pass.h" #include "source/opt/empty_pass.h" #include "source/opt/fix_func_call_arguments.h" #include "source/opt/fix_storage_class.h" diff --git a/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp b/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp index 80fb4c535..4904e058b 100644 --- a/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp @@ -24,10 +24,8 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kVariableStorageClassInIdx = 0; -const uint32_t kSpvTypePointerTypeIdInIdx = 1; - +constexpr uint32_t kVariableStorageClassInIdx = 0; +constexpr uint32_t kSpvTypePointerTypeIdInIdx = 1; } // namespace Pass::Status PrivateToLocalPass::Process() { @@ -35,18 +33,18 @@ Pass::Status PrivateToLocalPass::Process() { // Private variables require the shader capability. If this is not a shader, // there is no work to do. - if (context()->get_feature_mgr()->HasCapability(SpvCapabilityAddresses)) + if (context()->get_feature_mgr()->HasCapability(spv::Capability::Addresses)) return Status::SuccessWithoutChange; std::vector> variables_to_move; std::unordered_set localized_variables; for (auto& inst : context()->types_values()) { - if (inst.opcode() != SpvOpVariable) { + if (inst.opcode() != spv::Op::OpVariable) { continue; } - if (inst.GetSingleWordInOperand(kVariableStorageClassInIdx) != - SpvStorageClassPrivate) { + if (spv::StorageClass(inst.GetSingleWordInOperand( + kVariableStorageClassInIdx)) != spv::StorageClass::Private) { continue; } @@ -123,7 +121,8 @@ bool PrivateToLocalPass::MoveVariable(Instruction* variable, context()->ForgetUses(variable); // Update the storage class of the variable. - variable->SetInOperand(kVariableStorageClassInIdx, {SpvStorageClassFunction}); + variable->SetInOperand(kVariableStorageClassInIdx, + {uint32_t(spv::StorageClass::Function)}); // Update the type as well. uint32_t new_type_id = GetNewType(variable->type_id()); @@ -147,7 +146,7 @@ uint32_t PrivateToLocalPass::GetNewType(uint32_t old_type_id) { uint32_t pointee_type_id = old_type_inst->GetSingleWordInOperand(kSpvTypePointerTypeIdInIdx); uint32_t new_type_id = - type_mgr->FindPointerToType(pointee_type_id, SpvStorageClassFunction); + type_mgr->FindPointerToType(pointee_type_id, spv::StorageClass::Function); if (new_type_id != 0) { context()->UpdateDefUse(context()->get_def_use_mgr()->GetDef(new_type_id)); } @@ -161,17 +160,17 @@ bool PrivateToLocalPass::IsValidUse(const Instruction* inst) const { return true; } switch (inst->opcode()) { - case SpvOpLoad: - case SpvOpStore: - case SpvOpImageTexelPointer: // Treat like a load + case spv::Op::OpLoad: + case spv::Op::OpStore: + case spv::Op::OpImageTexelPointer: // Treat like a load return true; - case SpvOpAccessChain: + case spv::Op::OpAccessChain: return context()->get_def_use_mgr()->WhileEachUser( inst, [this](const Instruction* user) { if (!IsValidUse(user)) return false; return true; }); - case SpvOpName: + case spv::Op::OpName: return true; default: return spvOpcodeIsDecoration(inst->opcode()); @@ -188,13 +187,13 @@ bool PrivateToLocalPass::UpdateUse(Instruction* inst, Instruction* user) { return true; } switch (inst->opcode()) { - case SpvOpLoad: - case SpvOpStore: - case SpvOpImageTexelPointer: // Treat like a load + case spv::Op::OpLoad: + case spv::Op::OpStore: + case spv::Op::OpImageTexelPointer: // Treat like a load // The type is fine because it is the type pointed to, and that does not // change. break; - case SpvOpAccessChain: { + case spv::Op::OpAccessChain: { context()->ForgetUses(inst); uint32_t new_type_id = GetNewType(inst->type_id()); if (new_type_id == 0) { @@ -208,8 +207,8 @@ bool PrivateToLocalPass::UpdateUse(Instruction* inst, Instruction* user) { return false; } } break; - case SpvOpName: - case SpvOpEntryPoint: // entry points will be updated separately. + case spv::Op::OpName: + case spv::Op::OpEntryPoint: // entry points will be updated separately. break; default: assert(spvOpcodeIsDecoration(inst->opcode()) && diff --git a/3rdparty/spirv-tools/source/opt/propagator.cpp b/3rdparty/spirv-tools/source/opt/propagator.cpp index 6a1f1aafb..9cd6174cf 100644 --- a/3rdparty/spirv-tools/source/opt/propagator.cpp +++ b/3rdparty/spirv-tools/source/opt/propagator.cpp @@ -134,7 +134,7 @@ bool SSAPropagator::Simulate(Instruction* instr) { // defined at an instruction D that should be simulated again, then the output // of D might affect |instr|, so we should simulate |instr| again. bool has_operands_to_simulate = false; - if (instr->opcode() == SpvOpPhi) { + if (instr->opcode() == spv::Op::OpPhi) { // For Phi instructions, an operand causes the Phi to be simulated again if // the operand comes from an edge that has not yet been traversed or if its // definition should be simulated again. @@ -189,7 +189,7 @@ bool SSAPropagator::Simulate(BasicBlock* block) { // statement in it. if (!BlockHasBeenSimulated(block)) { block->ForEachInst([this, &changed](Instruction* instr) { - if (instr->opcode() != SpvOpPhi) { + if (instr->opcode() != spv::Op::OpPhi) { changed |= Simulate(instr); } }); diff --git a/3rdparty/spirv-tools/source/opt/propagator.h b/3rdparty/spirv-tools/source/opt/propagator.h index ac7c0e7ea..71212c969 100644 --- a/3rdparty/spirv-tools/source/opt/propagator.h +++ b/3rdparty/spirv-tools/source/opt/propagator.h @@ -153,10 +153,10 @@ struct Edge { // std::map values; // const auto visit_fn = [&ctx, &values](Instruction* instr, // BasicBlock** dest_bb) { -// if (instr->opcode() == SpvOpStore) { +// if (instr->opcode() == spv::Op::OpStore) { // uint32_t rhs_id = instr->GetSingleWordOperand(1); // Instruction* rhs_def = ctx->get_def_use_mgr()->GetDef(rhs_id); -// if (rhs_def->opcode() == SpvOpConstant) { +// if (rhs_def->opcode() == spv::Op::OpConstant) { // uint32_t val = rhs_def->GetSingleWordOperand(2); // values[rhs_id] = val; // return SSAPropagator::kInteresting; diff --git a/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp b/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp index 56491b2f2..73a90f066 100644 --- a/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp +++ b/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp @@ -22,23 +22,20 @@ #include "source/opt/ir_context.h" #include "source/util/bit_vector.h" -namespace { - -const uint32_t kExtractCompositeIdInIdx = 0; -const uint32_t kVariableStorageClassInIdx = 0; -const uint32_t kLoadPointerInIdx = 0; - -} // namespace - namespace spvtools { namespace opt { +namespace { +constexpr uint32_t kExtractCompositeIdInIdx = 0; +constexpr uint32_t kVariableStorageClassInIdx = 0; +constexpr uint32_t kLoadPointerInIdx = 0; +} // namespace Pass::Status ReduceLoadSize::Process() { bool modified = false; for (auto& func : *get_module()) { func.ForEachInst([&modified, this](Instruction* inst) { - if (inst->opcode() == SpvOpCompositeExtract) { + if (inst->opcode() == spv::Op::OpCompositeExtract) { if (ShouldReplaceExtract(inst)) { modified |= ReplaceExtract(inst); } @@ -50,7 +47,7 @@ Pass::Status ReduceLoadSize::Process() { } bool ReduceLoadSize::ReplaceExtract(Instruction* inst) { - assert(inst->opcode() == SpvOpCompositeExtract && + assert(inst->opcode() == spv::Op::OpCompositeExtract && "Wrong opcode. Should be OpCompositeExtract."); analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr(); analysis::TypeManager* type_mgr = context()->get_type_mgr(); @@ -60,7 +57,7 @@ bool ReduceLoadSize::ReplaceExtract(Instruction* inst) { inst->GetSingleWordInOperand(kExtractCompositeIdInIdx); Instruction* composite_inst = def_use_mgr->GetDef(composite_id); - if (composite_inst->opcode() != SpvOpLoad) { + if (composite_inst->opcode() != spv::Op::OpLoad) { return false; } @@ -71,16 +68,16 @@ bool ReduceLoadSize::ReplaceExtract(Instruction* inst) { } Instruction* var = composite_inst->GetBaseAddress(); - if (var == nullptr || var->opcode() != SpvOpVariable) { + if (var == nullptr || var->opcode() != spv::Op::OpVariable) { return false; } - SpvStorageClass storage_class = static_cast( + spv::StorageClass storage_class = static_cast( var->GetSingleWordInOperand(kVariableStorageClassInIdx)); switch (storage_class) { - case SpvStorageClassUniform: - case SpvStorageClassUniformConstant: - case SpvStorageClassInput: + case spv::StorageClass::Uniform: + case spv::StorageClass::UniformConstant: + case spv::StorageClass::Input: break; default: return false; @@ -124,7 +121,7 @@ bool ReduceLoadSize::ShouldReplaceExtract(Instruction* inst) { Instruction* op_inst = def_use_mgr->GetDef( inst->GetSingleWordInOperand(kExtractCompositeIdInIdx)); - if (op_inst->opcode() != SpvOpLoad) { + if (op_inst->opcode() != spv::Op::OpLoad) { return false; } @@ -139,7 +136,7 @@ bool ReduceLoadSize::ShouldReplaceExtract(Instruction* inst) { all_elements_used = !def_use_mgr->WhileEachUser(op_inst, [&elements_used](Instruction* use) { if (use->IsCommonDebugInstr()) return true; - if (use->opcode() != SpvOpCompositeExtract || + if (use->opcode() != spv::Op::OpCompositeExtract || use->NumInOperands() == 1) { return false; } diff --git a/3rdparty/spirv-tools/source/opt/reflect.h b/3rdparty/spirv-tools/source/opt/reflect.h index c2ffb0beb..45bb5c57c 100644 --- a/3rdparty/spirv-tools/source/opt/reflect.h +++ b/3rdparty/spirv-tools/source/opt/reflect.h @@ -24,41 +24,49 @@ namespace opt { // following functions tend to be outdated and should be updated when SPIR-V // version bumps. -inline bool IsDebug1Inst(SpvOp opcode) { - return (opcode >= SpvOpSourceContinued && opcode <= SpvOpSourceExtension) || - opcode == SpvOpString; +inline bool IsDebug1Inst(spv::Op opcode) { + return (opcode >= spv::Op::OpSourceContinued && + opcode <= spv::Op::OpSourceExtension) || + opcode == spv::Op::OpString; } -inline bool IsDebug2Inst(SpvOp opcode) { - return opcode == SpvOpName || opcode == SpvOpMemberName; +inline bool IsDebug2Inst(spv::Op opcode) { + return opcode == spv::Op::OpName || opcode == spv::Op::OpMemberName; } -inline bool IsDebug3Inst(SpvOp opcode) { - return opcode == SpvOpModuleProcessed; +inline bool IsDebug3Inst(spv::Op opcode) { + return opcode == spv::Op::OpModuleProcessed; } -inline bool IsOpLineInst(SpvOp opcode) { - return opcode == SpvOpLine || opcode == SpvOpNoLine; +inline bool IsOpLineInst(spv::Op opcode) { + return opcode == spv::Op::OpLine || opcode == spv::Op::OpNoLine; } -inline bool IsAnnotationInst(SpvOp opcode) { - return (opcode >= SpvOpDecorate && opcode <= SpvOpGroupMemberDecorate) || - opcode == SpvOpDecorateId || opcode == SpvOpDecorateStringGOOGLE || - opcode == SpvOpMemberDecorateStringGOOGLE; +inline bool IsAnnotationInst(spv::Op opcode) { + return (opcode >= spv::Op::OpDecorate && + opcode <= spv::Op::OpGroupMemberDecorate) || + opcode == spv::Op::OpDecorateId || + opcode == spv::Op::OpDecorateStringGOOGLE || + opcode == spv::Op::OpMemberDecorateStringGOOGLE; } -inline bool IsTypeInst(SpvOp opcode) { - return (opcode >= SpvOpTypeVoid && opcode <= SpvOpTypeForwardPointer) || - opcode == SpvOpTypePipeStorage || opcode == SpvOpTypeNamedBarrier || - opcode == SpvOpTypeAccelerationStructureNV || - opcode == SpvOpTypeAccelerationStructureKHR || - opcode == SpvOpTypeRayQueryKHR || - opcode == SpvOpTypeCooperativeMatrixNV; +inline bool IsTypeInst(spv::Op opcode) { + return (opcode >= spv::Op::OpTypeVoid && + opcode <= spv::Op::OpTypeForwardPointer) || + opcode == spv::Op::OpTypePipeStorage || + opcode == spv::Op::OpTypeNamedBarrier || + opcode == spv::Op::OpTypeAccelerationStructureNV || + opcode == spv::Op::OpTypeAccelerationStructureKHR || + opcode == spv::Op::OpTypeRayQueryKHR || + opcode == spv::Op::OpTypeCooperativeMatrixNV || + opcode == spv::Op::OpTypeHitObjectNV; } -inline bool IsConstantInst(SpvOp opcode) { - return (opcode >= SpvOpConstantTrue && opcode <= SpvOpSpecConstantOp) || - opcode == SpvOpConstantFunctionPointerINTEL; +inline bool IsConstantInst(spv::Op opcode) { + return (opcode >= spv::Op::OpConstantTrue && + opcode <= spv::Op::OpSpecConstantOp) || + opcode == spv::Op::OpConstantFunctionPointerINTEL; } -inline bool IsCompileTimeConstantInst(SpvOp opcode) { - return opcode >= SpvOpConstantTrue && opcode <= SpvOpConstantNull; +inline bool IsCompileTimeConstantInst(spv::Op opcode) { + return opcode >= spv::Op::OpConstantTrue && opcode <= spv::Op::OpConstantNull; } -inline bool IsSpecConstantInst(SpvOp opcode) { - return opcode >= SpvOpSpecConstantTrue && opcode <= SpvOpSpecConstantOp; +inline bool IsSpecConstantInst(spv::Op opcode) { + return opcode >= spv::Op::OpSpecConstantTrue && + opcode <= spv::Op::OpSpecConstantOp; } } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/register_pressure.cpp b/3rdparty/spirv-tools/source/opt/register_pressure.cpp index 1ad337387..34a8ba3e3 100644 --- a/3rdparty/spirv-tools/source/opt/register_pressure.cpp +++ b/3rdparty/spirv-tools/source/opt/register_pressure.cpp @@ -26,7 +26,6 @@ namespace spvtools { namespace opt { - namespace { // Predicate for the FilterIterator to only consider instructions that are not // phi instructions defined in the basic block |bb|. @@ -36,7 +35,7 @@ class ExcludePhiDefinedInBlock { : context_(context), bb_(bb) {} bool operator()(Instruction* insn) const { - return !(insn->opcode() == SpvOpPhi && + return !(insn->opcode() == spv::Op::OpPhi && context_->get_instr_block(insn) == bb_); } @@ -49,9 +48,9 @@ class ExcludePhiDefinedInBlock { // physical register. bool CreatesRegisterUsage(Instruction* insn) { if (!insn->HasResultId()) return false; - if (insn->opcode() == SpvOpUndef) return false; + if (insn->opcode() == spv::Op::OpUndef) return false; if (IsConstantInst(insn->opcode())) return false; - if (insn->opcode() == SpvOpLabel) return false; + if (insn->opcode() == spv::Op::OpLabel) return false; return true; } @@ -147,7 +146,7 @@ class ComputeRegisterLiveness { live_inout->live_in_ = live_inout->live_out_; for (Instruction& insn : make_range(bb->rbegin(), bb->rend())) { - if (insn.opcode() == SpvOpPhi) { + if (insn.opcode() == spv::Op::OpPhi) { live_inout->live_in_.insert(&insn); break; } @@ -224,7 +223,7 @@ class ComputeRegisterLiveness { for (Instruction& insn : make_range(bb.rbegin(), bb.rend())) { // If it is a phi instruction, the register pressure will not change // anymore. - if (insn.opcode() == SpvOpPhi) { + if (insn.opcode() == spv::Op::OpPhi) { break; } @@ -271,7 +270,7 @@ void RegisterLiveness::RegionRegisterLiveness::AddRegisterClass( RegisterLiveness::RegisterClass reg_class{type, false}; insn->context()->get_decoration_mgr()->WhileEachDecoration( - insn->result_id(), SpvDecorationUniform, + insn->result_id(), uint32_t(spv::Decoration::Uniform), [®_class](const Instruction&) { reg_class.is_uniform_ = true; return false; @@ -325,7 +324,7 @@ void RegisterLiveness::ComputeLoopRegisterPressure( loop_reg_pressure->used_registers_, live_inout->used_registers_); for (Instruction& insn : *bb) { - if (insn.opcode() == SpvOpPhi || !CreatesRegisterUsage(&insn) || + if (insn.opcode() == spv::Op::OpPhi || !CreatesRegisterUsage(&insn) || seen_insn.count(insn.result_id())) { continue; } @@ -386,7 +385,7 @@ void RegisterLiveness::SimulateFusion( [&l1, &l2](Instruction* insn) { BasicBlock* bb = insn->context()->get_instr_block(insn); return insn->HasResultId() && - !(insn->opcode() == SpvOpPhi && + !(insn->opcode() == spv::Op::OpPhi && (bb == l1.GetHeaderBlock() || bb == l2.GetHeaderBlock())); }); @@ -403,7 +402,7 @@ void RegisterLiveness::SimulateFusion( live_inout_info->live_out_.size()); for (Instruction& insn : *bb) { - if (insn.opcode() == SpvOpPhi || !CreatesRegisterUsage(&insn) || + if (insn.opcode() == spv::Op::OpPhi || !CreatesRegisterUsage(&insn) || seen_insn.count(insn.result_id())) { continue; } @@ -434,7 +433,7 @@ void RegisterLiveness::SimulateFusion( live_inout_info->live_out_.size()); for (Instruction& insn : *bb) { - if (insn.opcode() == SpvOpPhi || !CreatesRegisterUsage(&insn) || + if (insn.opcode() == spv::Op::OpPhi || !CreatesRegisterUsage(&insn) || seen_insn.count(insn.result_id())) { continue; } @@ -532,7 +531,7 @@ void RegisterLiveness::SimulateFission( std::unordered_set die_in_block; for (Instruction& insn : make_range(bb->rbegin(), bb->rend())) { - if (insn.opcode() == SpvOpPhi) { + if (insn.opcode() == spv::Op::OpPhi) { break; } diff --git a/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp b/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp index 3fcf87955..df925a251 100644 --- a/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp @@ -25,7 +25,7 @@ bool RelaxFloatOpsPass::IsRelaxable(Instruction* inst) { return target_ops_core_f_rslt_.count(inst->opcode()) != 0 || target_ops_core_f_opnd_.count(inst->opcode()) != 0 || sample_ops_.count(inst->opcode()) != 0 || - (inst->opcode() == SpvOpExtInst && + (inst->opcode() == spv::Op::OpExtInst && inst->GetSingleWordInOperand(0) == context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450() && target_ops_450_.count(inst->GetSingleWordInOperand(1)) != 0); @@ -46,8 +46,9 @@ bool RelaxFloatOpsPass::IsFloat32(Instruction* inst) { bool RelaxFloatOpsPass::IsRelaxed(uint32_t r_id) { for (auto r_inst : get_decoration_mgr()->GetDecorationsFor(r_id, false)) - if (r_inst->opcode() == SpvOpDecorate && - r_inst->GetSingleWordInOperand(1) == SpvDecorationRelaxedPrecision) + if (r_inst->opcode() == spv::Op::OpDecorate && + spv::Decoration(r_inst->GetSingleWordInOperand(1)) == + spv::Decoration::RelaxedPrecision) return true; return false; } @@ -58,7 +59,8 @@ bool RelaxFloatOpsPass::ProcessInst(Instruction* r_inst) { if (!IsFloat32(r_inst)) return false; if (IsRelaxed(r_id)) return false; if (!IsRelaxable(r_inst)) return false; - get_decoration_mgr()->AddDecoration(r_id, SpvDecorationRelaxedPrecision); + get_decoration_mgr()->AddDecoration( + r_id, uint32_t(spv::Decoration::RelaxedPrecision)); return true; } @@ -87,48 +89,48 @@ Pass::Status RelaxFloatOpsPass::Process() { void RelaxFloatOpsPass::Initialize() { target_ops_core_f_rslt_ = { - SpvOpLoad, - SpvOpPhi, - SpvOpVectorExtractDynamic, - SpvOpVectorInsertDynamic, - SpvOpVectorShuffle, - SpvOpCompositeExtract, - SpvOpCompositeConstruct, - SpvOpCompositeInsert, - SpvOpCopyObject, - SpvOpTranspose, - SpvOpConvertSToF, - SpvOpConvertUToF, - SpvOpFConvert, - // SpvOpQuantizeToF16, - SpvOpFNegate, - SpvOpFAdd, - SpvOpFSub, - SpvOpFMul, - SpvOpFDiv, - SpvOpFMod, - SpvOpVectorTimesScalar, - SpvOpMatrixTimesScalar, - SpvOpVectorTimesMatrix, - SpvOpMatrixTimesVector, - SpvOpMatrixTimesMatrix, - SpvOpOuterProduct, - SpvOpDot, - SpvOpSelect, + spv::Op::OpLoad, + spv::Op::OpPhi, + spv::Op::OpVectorExtractDynamic, + spv::Op::OpVectorInsertDynamic, + spv::Op::OpVectorShuffle, + spv::Op::OpCompositeExtract, + spv::Op::OpCompositeConstruct, + spv::Op::OpCompositeInsert, + spv::Op::OpCopyObject, + spv::Op::OpTranspose, + spv::Op::OpConvertSToF, + spv::Op::OpConvertUToF, + spv::Op::OpFConvert, + // spv::Op::OpQuantizeToF16, + spv::Op::OpFNegate, + spv::Op::OpFAdd, + spv::Op::OpFSub, + spv::Op::OpFMul, + spv::Op::OpFDiv, + spv::Op::OpFMod, + spv::Op::OpVectorTimesScalar, + spv::Op::OpMatrixTimesScalar, + spv::Op::OpVectorTimesMatrix, + spv::Op::OpMatrixTimesVector, + spv::Op::OpMatrixTimesMatrix, + spv::Op::OpOuterProduct, + spv::Op::OpDot, + spv::Op::OpSelect, }; target_ops_core_f_opnd_ = { - SpvOpFOrdEqual, - SpvOpFUnordEqual, - SpvOpFOrdNotEqual, - SpvOpFUnordNotEqual, - SpvOpFOrdLessThan, - SpvOpFUnordLessThan, - SpvOpFOrdGreaterThan, - SpvOpFUnordGreaterThan, - SpvOpFOrdLessThanEqual, - SpvOpFUnordLessThanEqual, - SpvOpFOrdGreaterThanEqual, - SpvOpFUnordGreaterThanEqual, + spv::Op::OpFOrdEqual, + spv::Op::OpFUnordEqual, + spv::Op::OpFOrdNotEqual, + spv::Op::OpFUnordNotEqual, + spv::Op::OpFOrdLessThan, + spv::Op::OpFUnordLessThan, + spv::Op::OpFOrdGreaterThan, + spv::Op::OpFUnordGreaterThan, + spv::Op::OpFOrdLessThanEqual, + spv::Op::OpFUnordLessThanEqual, + spv::Op::OpFOrdGreaterThanEqual, + spv::Op::OpFUnordGreaterThanEqual, }; target_ops_450_ = { GLSLstd450Round, GLSLstd450RoundEven, GLSLstd450Trunc, GLSLstd450FAbs, @@ -147,31 +149,31 @@ void RelaxFloatOpsPass::Initialize() { GLSLstd450Ldexp, GLSLstd450Length, GLSLstd450Distance, GLSLstd450Cross, GLSLstd450Normalize, GLSLstd450FaceForward, GLSLstd450Reflect, GLSLstd450Refract, GLSLstd450NMin, GLSLstd450NMax, GLSLstd450NClamp}; - sample_ops_ = {SpvOpImageSampleImplicitLod, - SpvOpImageSampleExplicitLod, - SpvOpImageSampleDrefImplicitLod, - SpvOpImageSampleDrefExplicitLod, - SpvOpImageSampleProjImplicitLod, - SpvOpImageSampleProjExplicitLod, - SpvOpImageSampleProjDrefImplicitLod, - SpvOpImageSampleProjDrefExplicitLod, - SpvOpImageFetch, - SpvOpImageGather, - SpvOpImageDrefGather, - SpvOpImageRead, - SpvOpImageSparseSampleImplicitLod, - SpvOpImageSparseSampleExplicitLod, - SpvOpImageSparseSampleDrefImplicitLod, - SpvOpImageSparseSampleDrefExplicitLod, - SpvOpImageSparseSampleProjImplicitLod, - SpvOpImageSparseSampleProjExplicitLod, - SpvOpImageSparseSampleProjDrefImplicitLod, - SpvOpImageSparseSampleProjDrefExplicitLod, - SpvOpImageSparseFetch, - SpvOpImageSparseGather, - SpvOpImageSparseDrefGather, - SpvOpImageSparseTexelsResident, - SpvOpImageSparseRead}; + sample_ops_ = {spv::Op::OpImageSampleImplicitLod, + spv::Op::OpImageSampleExplicitLod, + spv::Op::OpImageSampleDrefImplicitLod, + spv::Op::OpImageSampleDrefExplicitLod, + spv::Op::OpImageSampleProjImplicitLod, + spv::Op::OpImageSampleProjExplicitLod, + spv::Op::OpImageSampleProjDrefImplicitLod, + spv::Op::OpImageSampleProjDrefExplicitLod, + spv::Op::OpImageFetch, + spv::Op::OpImageGather, + spv::Op::OpImageDrefGather, + spv::Op::OpImageRead, + spv::Op::OpImageSparseSampleImplicitLod, + spv::Op::OpImageSparseSampleExplicitLod, + spv::Op::OpImageSparseSampleDrefImplicitLod, + spv::Op::OpImageSparseSampleDrefExplicitLod, + spv::Op::OpImageSparseSampleProjImplicitLod, + spv::Op::OpImageSparseSampleProjExplicitLod, + spv::Op::OpImageSparseSampleProjDrefImplicitLod, + spv::Op::OpImageSparseSampleProjDrefExplicitLod, + spv::Op::OpImageSparseFetch, + spv::Op::OpImageSparseGather, + spv::Op::OpImageSparseDrefGather, + spv::Op::OpImageSparseTexelsResident, + spv::Op::OpImageSparseRead}; } } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.h b/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.h index 5ee3d73c8..9e4606f8d 100644 --- a/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.h +++ b/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.h @@ -61,17 +61,23 @@ class RelaxFloatOpsPass : public Pass { // Initialize state for converting to half void Initialize(); + struct hasher { + size_t operator()(const spv::Op& op) const noexcept { + return std::hash()(uint32_t(op)); + } + }; + // Set of float result core operations to be processed - std::unordered_set target_ops_core_f_rslt_; + std::unordered_set target_ops_core_f_rslt_; // Set of float operand core operations to be processed - std::unordered_set target_ops_core_f_opnd_; + std::unordered_set target_ops_core_f_opnd_; // Set of 450 extension operations to be processed std::unordered_set target_ops_450_; // Set of sample operations - std::unordered_set sample_ops_; + std::unordered_set sample_ops_; }; } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp b/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp index 4dd1cd4f2..3750bc1fe 100644 --- a/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp @@ -37,10 +37,11 @@ bool RemoveDontInline::ClearDontInlineFunctionControl(Function* function) { uint32_t function_control = function_inst->GetSingleWordInOperand(kFunctionControlInOperandIdx); - if ((function_control & SpvFunctionControlDontInlineMask) == 0) { + if ((function_control & uint32_t(spv::FunctionControlMask::DontInline)) == + 0) { return false; } - function_control &= ~SpvFunctionControlDontInlineMask; + function_control &= ~uint32_t(spv::FunctionControlMask::DontInline); function_inst->SetInOperand(kFunctionControlInOperandIdx, {function_control}); return true; } diff --git a/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp b/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp index 1ed8e2a04..90c3acff2 100644 --- a/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp @@ -70,7 +70,7 @@ bool RemoveDuplicatesPass::RemoveDuplicatesExtInstImports() const { return modified; } - std::unordered_map ext_inst_imports; + std::unordered_map ext_inst_imports; for (auto* i = &*context()->ext_inst_import_begin(); i;) { auto res = ext_inst_imports.emplace(i->GetInOperand(0u).AsString(), i->result_id()); @@ -101,7 +101,8 @@ bool RemoveDuplicatesPass::RemoveDuplicateTypes() const { std::vector visited_forward_pointers; std::vector to_delete; for (auto* i = &*context()->types_values_begin(); i; i = i->NextNode()) { - const bool is_i_forward_pointer = i->opcode() == SpvOpTypeForwardPointer; + const bool is_i_forward_pointer = + i->opcode() == spv::Op::OpTypeForwardPointer; // We only care about types. if (!spvOpcodeGeneratesType(i->opcode()) && !is_i_forward_pointer) { @@ -110,7 +111,7 @@ bool RemoveDuplicatesPass::RemoveDuplicateTypes() const { if (!is_i_forward_pointer) { // Is the current type equal to one of the types we have already visited? - SpvId id_to_keep = 0u; + spv::Id id_to_keep = 0u; analysis::Type* i_type = type_manager.GetType(i->result_id()); assert(i_type); // TODO(dneto0): Use a trie to avoid quadratic behaviour? Extract the @@ -137,7 +138,7 @@ bool RemoveDuplicatesPass::RemoveDuplicateTypes() const { } else { analysis::ForwardPointer i_type( i->GetSingleWordInOperand(0u), - (SpvStorageClass)i->GetSingleWordInOperand(1u)); + (spv::StorageClass)i->GetSingleWordInOperand(1u)); i_type.SetTargetPointer( type_manager.GetType(i_type.target_id())->AsPointer()); diff --git a/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp b/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp index 31e87bd4b..d4df1b2ef 100644 --- a/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.cpp @@ -31,13 +31,14 @@ class RemoveUnusedInterfaceVariablesContext { instruction.ForEachInId([&](const uint32_t* id) { if (used_variables_.count(*id)) return; auto* var = parent_.get_def_use_mgr()->GetDef(*id); - if (!var || var->opcode() != SpvOpVariable) return; - auto storage_class = var->GetSingleWordInOperand(0); - if (storage_class != SpvStorageClassFunction && + if (!var || var->opcode() != spv::Op::OpVariable) return; + auto storage_class = + spv::StorageClass(var->GetSingleWordInOperand(0)); + if (storage_class != spv::StorageClass::Function && (parent_.get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4) || - storage_class == SpvStorageClassInput || - storage_class == SpvStorageClassOutput)) + storage_class == spv::StorageClass::Input || + storage_class == spv::StorageClass::Output)) used_variables_.insert(*id); }); return false; @@ -90,4 +91,4 @@ RemoveUnusedInterfaceVariablesPass::Process() { return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); } } // namespace opt -} // namespace spvtools \ No newline at end of file +} // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp b/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp index e97593ef3..59745e12d 100644 --- a/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp +++ b/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp @@ -21,11 +21,10 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kOpAccessChainInOperandIndexes = 1; -const uint32_t kOpTypePointerInOperandType = 1; -const uint32_t kOpTypeArrayInOperandType = 0; -const uint32_t kOpTypeStructInOperandMember = 0; +constexpr uint32_t kOpAccessChainInOperandIndexes = 1; +constexpr uint32_t kOpTypePointerInOperandType = 1; +constexpr uint32_t kOpTypeArrayInOperandType = 0; +constexpr uint32_t kOpTypeStructInOperandMember = 0; IRContext::Analysis kAnalysisDefUseAndInstrToBlockMapping = IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping; @@ -54,8 +53,8 @@ bool ReplaceDescArrayAccessUsingVarIndex:: std::vector work_list; get_def_use_mgr()->ForEachUser(var, [&work_list](Instruction* use) { switch (use->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: work_list.push_back(use); break; default: @@ -132,8 +131,8 @@ ReplaceDescArrayAccessUsingVarIndex::CollectRequiredImageAndAccessInsts( Instruction* operand = get_def_use_mgr()->GetDef(*idp); if (context()->get_instr_block(operand) != nullptr && (HasImageOrImagePtrType(operand) || - operand->opcode() == SpvOpAccessChain || - operand->opcode() == SpvOpInBoundsAccessChain)) { + operand->opcode() == spv::Op::OpAccessChain || + operand->opcode() == spv::Op::OpInBoundsAccessChain)) { work_list.push(operand); } }; @@ -158,22 +157,22 @@ bool ReplaceDescArrayAccessUsingVarIndex::HasImageOrImagePtrType( bool ReplaceDescArrayAccessUsingVarIndex::IsImageOrImagePtrType( const Instruction* type_inst) const { - if (type_inst->opcode() == SpvOpTypeImage || - type_inst->opcode() == SpvOpTypeSampler || - type_inst->opcode() == SpvOpTypeSampledImage) { + if (type_inst->opcode() == spv::Op::OpTypeImage || + type_inst->opcode() == spv::Op::OpTypeSampler || + type_inst->opcode() == spv::Op::OpTypeSampledImage) { return true; } - if (type_inst->opcode() == SpvOpTypePointer) { + if (type_inst->opcode() == spv::Op::OpTypePointer) { Instruction* pointee_type_inst = get_def_use_mgr()->GetDef( type_inst->GetSingleWordInOperand(kOpTypePointerInOperandType)); return IsImageOrImagePtrType(pointee_type_inst); } - if (type_inst->opcode() == SpvOpTypeArray) { + if (type_inst->opcode() == spv::Op::OpTypeArray) { Instruction* element_type_inst = get_def_use_mgr()->GetDef( type_inst->GetSingleWordInOperand(kOpTypeArrayInOperandType)); return IsImageOrImagePtrType(element_type_inst); } - if (type_inst->opcode() != SpvOpTypeStruct) return false; + if (type_inst->opcode() != spv::Op::OpTypeStruct) return false; for (uint32_t in_operand_idx = kOpTypeStructInOperandMember; in_operand_idx < type_inst->NumInOperands(); ++in_operand_idx) { Instruction* member_type_inst = get_def_use_mgr()->GetDef( @@ -186,16 +185,16 @@ bool ReplaceDescArrayAccessUsingVarIndex::IsImageOrImagePtrType( bool ReplaceDescArrayAccessUsingVarIndex::IsConcreteType( uint32_t type_id) const { Instruction* type_inst = get_def_use_mgr()->GetDef(type_id); - if (type_inst->opcode() == SpvOpTypeInt || - type_inst->opcode() == SpvOpTypeFloat) { + if (type_inst->opcode() == spv::Op::OpTypeInt || + type_inst->opcode() == spv::Op::OpTypeFloat) { return true; } - if (type_inst->opcode() == SpvOpTypeVector || - type_inst->opcode() == SpvOpTypeMatrix || - type_inst->opcode() == SpvOpTypeArray) { + if (type_inst->opcode() == spv::Op::OpTypeVector || + type_inst->opcode() == spv::Op::OpTypeMatrix || + type_inst->opcode() == spv::Op::OpTypeArray) { return IsConcreteType(type_inst->GetSingleWordInOperand(0)); } - if (type_inst->opcode() == SpvOpTypeStruct) { + if (type_inst->opcode() == spv::Op::OpTypeStruct) { for (uint32_t i = 0; i < type_inst->NumInOperands(); ++i) { if (!IsConcreteType(type_inst->GetSingleWordInOperand(i))) return false; } @@ -322,8 +321,8 @@ ReplaceDescArrayAccessUsingVarIndex::SeparateInstructionsIntoNewBlock( } BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateNewBlock() const { - auto* new_block = new BasicBlock(std::unique_ptr( - new Instruction(context(), SpvOpLabel, 0, context()->TakeNextId(), {}))); + auto* new_block = new BasicBlock(std::unique_ptr(new Instruction( + context(), spv::Op::OpLabel, 0, context()->TakeNextId(), {}))); get_def_use_mgr()->AnalyzeInstDefUse(new_block->GetLabelInst()); context()->set_instr_block(new_block->GetLabelInst(), new_block); return new_block; @@ -332,7 +331,7 @@ BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateNewBlock() const { void ReplaceDescArrayAccessUsingVarIndex::UseConstIndexForAccessChain( Instruction* access_chain, uint32_t const_element_idx) const { uint32_t const_element_idx_id = - context()->get_constant_mgr()->GetUIntConst(const_element_idx); + context()->get_constant_mgr()->GetUIntConstId(const_element_idx); access_chain->SetInOperand(kOpAccessChainInOperandIndexes, {const_element_idx_id}); } @@ -422,7 +421,7 @@ void ReplaceDescArrayAccessUsingVarIndex::ReplacePhiIncomingBlock( uint32_t old_incoming_block_id, uint32_t new_incoming_block_id) const { context()->ReplaceAllUsesWithPredicate( old_incoming_block_id, new_incoming_block_id, - [](Instruction* use) { return use->opcode() == SpvOpPhi; }); + [](Instruction* use) { return use->opcode() == spv::Op::OpPhi; }); } } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp b/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp index 1dcd06f59..214097398 100644 --- a/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp +++ b/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp @@ -23,16 +23,16 @@ namespace opt { Pass::Status ReplaceInvalidOpcodePass::Process() { bool modified = false; - if (context()->get_feature_mgr()->HasCapability(SpvCapabilityLinkage)) { + if (context()->get_feature_mgr()->HasCapability(spv::Capability::Linkage)) { return Status::SuccessWithoutChange; } - SpvExecutionModel execution_model = GetExecutionModel(); - if (execution_model == SpvExecutionModelKernel) { + spv::ExecutionModel execution_model = GetExecutionModel(); + if (execution_model == spv::ExecutionModel::Kernel) { // We do not handle kernels. return Status::SuccessWithoutChange; } - if (execution_model == SpvExecutionModelMax) { + if (execution_model == spv::ExecutionModel::Max) { // Mixed execution models for the entry points. This case is not currently // handled. return Status::SuccessWithoutChange; @@ -44,19 +44,19 @@ Pass::Status ReplaceInvalidOpcodePass::Process() { return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange); } -SpvExecutionModel ReplaceInvalidOpcodePass::GetExecutionModel() { - SpvExecutionModel result = SpvExecutionModelMax; +spv::ExecutionModel ReplaceInvalidOpcodePass::GetExecutionModel() { + spv::ExecutionModel result = spv::ExecutionModel::Max; bool first = true; for (Instruction& entry_point : get_module()->entry_points()) { if (first) { - result = - static_cast(entry_point.GetSingleWordInOperand(0)); + result = static_cast( + entry_point.GetSingleWordInOperand(0)); first = false; } else { - SpvExecutionModel current_model = - static_cast(entry_point.GetSingleWordInOperand(0)); + spv::ExecutionModel current_model = static_cast( + entry_point.GetSingleWordInOperand(0)); if (current_model != result) { - result = SpvExecutionModelMax; + result = spv::ExecutionModel::Max; break; } } @@ -65,13 +65,13 @@ SpvExecutionModel ReplaceInvalidOpcodePass::GetExecutionModel() { } bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function, - SpvExecutionModel model) { + spv::ExecutionModel model) { bool modified = false; Instruction* last_line_dbg_inst = nullptr; function->ForEachInst( [model, &modified, &last_line_dbg_inst, this](Instruction* inst) { // Track the debug information so we can have a meaningful message. - if (inst->opcode() == SpvOpLabel || inst->IsNoLine()) { + if (inst->opcode() == spv::Op::OpLabel || inst->IsNoLine()) { last_line_dbg_inst = nullptr; return; } else if (inst->IsLine()) { @@ -80,15 +80,15 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function, } bool replace = false; - if (model != SpvExecutionModelFragment && + if (model != spv::ExecutionModel::Fragment && IsFragmentShaderOnlyInstruction(inst)) { replace = true; } - if (model != SpvExecutionModelTessellationControl && - model != SpvExecutionModelGLCompute) { - if (inst->opcode() == SpvOpControlBarrier) { - assert(model != SpvExecutionModelKernel && + if (model != spv::ExecutionModel::TessellationControl && + model != spv::ExecutionModel::GLCompute) { + if (inst->opcode() == spv::Op::OpControlBarrier) { + assert(model != spv::ExecutionModel::Kernel && "Expecting to be working on a shader module."); replace = true; } @@ -101,7 +101,7 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function, } else { // Get the name of the source file. uint32_t file_name_id = 0; - if (last_line_dbg_inst->opcode() == SpvOpLine) { + if (last_line_dbg_inst->opcode() == spv::Op::OpLine) { file_name_id = last_line_dbg_inst->GetSingleWordInOperand(0); } else { // Shader100::DebugLine uint32_t debug_source_id = @@ -131,26 +131,26 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function, bool ReplaceInvalidOpcodePass::IsFragmentShaderOnlyInstruction( Instruction* inst) { switch (inst->opcode()) { - case SpvOpDPdx: - case SpvOpDPdy: - case SpvOpFwidth: - case SpvOpDPdxFine: - case SpvOpDPdyFine: - case SpvOpFwidthFine: - case SpvOpDPdxCoarse: - case SpvOpDPdyCoarse: - case SpvOpFwidthCoarse: - case SpvOpImageSampleImplicitLod: - case SpvOpImageSampleDrefImplicitLod: - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageQueryLod: + case spv::Op::OpDPdx: + case spv::Op::OpDPdy: + case spv::Op::OpFwidth: + case spv::Op::OpDPdxFine: + case spv::Op::OpDPdyFine: + case spv::Op::OpFwidthFine: + case spv::Op::OpDPdxCoarse: + case spv::Op::OpDPdyCoarse: + case spv::Op::OpFwidthCoarse: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageQueryLod: // TODO: Teach |ReplaceInstruction| to handle block terminators. Then // uncomment the OpKill case. - // case SpvOpKill: - // case SpvOpTerminateInstruction: + // case spv::Op::OpKill: + // case spv::Op::OpTerminateInstruction: return true; default: return false; @@ -183,7 +183,7 @@ uint32_t ReplaceInvalidOpcodePass::GetSpecialConstant(uint32_t type_id) { analysis::TypeManager* type_mgr = context()->get_type_mgr(); Instruction* type = context()->get_def_use_mgr()->GetDef(type_id); - if (type->opcode() == SpvOpTypeVector) { + if (type->opcode() == spv::Op::OpTypeVector) { uint32_t component_const = GetSpecialConstant(type->GetSingleWordInOperand(0)); std::vector ids; @@ -192,7 +192,8 @@ uint32_t ReplaceInvalidOpcodePass::GetSpecialConstant(uint32_t type_id) { } special_const = const_mgr->GetConstant(type_mgr->GetType(type_id), ids); } else { - assert(type->opcode() == SpvOpTypeInt || type->opcode() == SpvOpTypeFloat); + assert(type->opcode() == spv::Op::OpTypeInt || + type->opcode() == spv::Op::OpTypeFloat); std::vector literal_words; for (uint32_t i = 0; i < type->GetSingleWordInOperand(0); i += 32) { literal_words.push_back(0xDEADBEEF); @@ -204,7 +205,7 @@ uint32_t ReplaceInvalidOpcodePass::GetSpecialConstant(uint32_t type_id) { return const_mgr->GetDefiningInstruction(special_const)->result_id(); } -std::string ReplaceInvalidOpcodePass::BuildWarningMessage(SpvOp opcode) { +std::string ReplaceInvalidOpcodePass::BuildWarningMessage(spv::Op opcode) { spv_opcode_desc opcode_info; context()->grammar().lookupOpcode(opcode, &opcode_info); std::string message = "Removing "; diff --git a/3rdparty/spirv-tools/source/opt/replace_invalid_opc.h b/3rdparty/spirv-tools/source/opt/replace_invalid_opc.h index 426bcac5e..3f0d16bba 100644 --- a/3rdparty/spirv-tools/source/opt/replace_invalid_opc.h +++ b/3rdparty/spirv-tools/source/opt/replace_invalid_opc.h @@ -34,13 +34,13 @@ class ReplaceInvalidOpcodePass : public Pass { private: // Returns the execution model that is used by every entry point in the // module. If more than one execution model is used in the module, then the - // return value is SpvExecutionModelMax. - SpvExecutionModel GetExecutionModel(); + // return value is spv::ExecutionModel::Max. + spv::ExecutionModel GetExecutionModel(); // Replaces all instructions in |function| that are invalid with execution // model |mode|, but valid for another shader model, with a special constant // value. See |GetSpecialConstant|. - bool RewriteFunction(Function* function, SpvExecutionModel mode); + bool RewriteFunction(Function* function, spv::ExecutionModel mode); // Returns true if |inst| is valid for fragment shaders only. bool IsFragmentShaderOnlyInstruction(Instruction* inst); @@ -58,7 +58,7 @@ class ReplaceInvalidOpcodePass : public Pass { // width of the type has been reached. For a vector, each element of the // constant will be constructed the same way. uint32_t GetSpecialConstant(uint32_t type_id); - std::string BuildWarningMessage(SpvOp opcode); + std::string BuildWarningMessage(spv::Op opcode); }; } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp b/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp index 2b0a824cf..0c8babe8a 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp +++ b/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp @@ -97,7 +97,7 @@ SENode* ScalarEvolutionAnalysis::CreateRecurrentExpression( SENode* ScalarEvolutionAnalysis::AnalyzeMultiplyOp( const Instruction* multiply) { - assert(multiply->opcode() == SpvOp::SpvOpIMul && + assert(multiply->opcode() == spv::Op::OpIMul && "Multiply node did not come from a multiply instruction"); analysis::DefUseManager* def_use = context_->get_def_use_mgr(); @@ -168,21 +168,21 @@ SENode* ScalarEvolutionAnalysis::AnalyzeInstruction(const Instruction* inst) { SENode* output = nullptr; switch (inst->opcode()) { - case SpvOp::SpvOpPhi: { + case spv::Op::OpPhi: { output = AnalyzePhiInstruction(inst); break; } - case SpvOp::SpvOpConstant: - case SpvOp::SpvOpConstantNull: { + case spv::Op::OpConstant: + case spv::Op::OpConstantNull: { output = AnalyzeConstant(inst); break; } - case SpvOp::SpvOpISub: - case SpvOp::SpvOpIAdd: { + case spv::Op::OpISub: + case spv::Op::OpIAdd: { output = AnalyzeAddOp(inst); break; } - case SpvOp::SpvOpIMul: { + case spv::Op::OpIMul: { output = AnalyzeMultiplyOp(inst); break; } @@ -196,9 +196,9 @@ SENode* ScalarEvolutionAnalysis::AnalyzeInstruction(const Instruction* inst) { } SENode* ScalarEvolutionAnalysis::AnalyzeConstant(const Instruction* inst) { - if (inst->opcode() == SpvOp::SpvOpConstantNull) return CreateConstant(0); + if (inst->opcode() == spv::Op::OpConstantNull) return CreateConstant(0); - assert(inst->opcode() == SpvOp::SpvOpConstant); + assert(inst->opcode() == spv::Op::OpConstant); assert(inst->NumInOperands() == 1); int64_t value = 0; @@ -226,8 +226,8 @@ SENode* ScalarEvolutionAnalysis::AnalyzeConstant(const Instruction* inst) { // Handles both addition and subtraction. If the |sub| flag is set then the // addition will be op1+(-op2) otherwise op1+op2. SENode* ScalarEvolutionAnalysis::AnalyzeAddOp(const Instruction* inst) { - assert((inst->opcode() == SpvOp::SpvOpIAdd || - inst->opcode() == SpvOp::SpvOpISub) && + assert((inst->opcode() == spv::Op::OpIAdd || + inst->opcode() == spv::Op::OpISub) && "Add node must be created from a OpIAdd or OpISub instruction"); analysis::DefUseManager* def_use = context_->get_def_use_mgr(); @@ -239,7 +239,7 @@ SENode* ScalarEvolutionAnalysis::AnalyzeAddOp(const Instruction* inst) { AnalyzeInstruction(def_use->GetDef(inst->GetSingleWordInOperand(1))); // To handle subtraction we wrap the second operand in a unary negation node. - if (inst->opcode() == SpvOp::SpvOpISub) { + if (inst->opcode() == spv::Op::OpISub) { op2 = CreateNegation(op2); } @@ -573,7 +573,7 @@ struct PushToStringImpl { }; template -static void PushToString(T id, std::u32string* str) { +void PushToString(T id, std::u32string* str) { PushToStringImpl{}(id, str); } @@ -928,8 +928,8 @@ namespace { // Remove |node| from the |mul| chain (of the form A * ... * |node| * ... * Z), // if |node| is not in the chain, returns the original chain. -static SENode* RemoveOneNodeFromMultiplyChain(SEMultiplyNode* mul, - const SENode* node) { +SENode* RemoveOneNodeFromMultiplyChain(SEMultiplyNode* mul, + const SENode* node) { SENode* lhs = mul->GetChildren()[0]; SENode* rhs = mul->GetChildren()[1]; if (lhs == node) { diff --git a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp index e27c828b0..bfebb01c8 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp @@ -26,12 +26,13 @@ #include "source/util/make_unique.h" #include "types.h" -static const uint32_t kDebugValueOperandValueIndex = 5; -static const uint32_t kDebugValueOperandExpressionIndex = 6; -static const uint32_t kDebugDeclareOperandVariableIndex = 5; - namespace spvtools { namespace opt { +namespace { +constexpr uint32_t kDebugValueOperandValueIndex = 5; +constexpr uint32_t kDebugValueOperandExpressionIndex = 6; +constexpr uint32_t kDebugDeclareOperandVariableIndex = 5; +} // namespace Pass::Status ScalarReplacementPass::Process() { Status status = Status::SuccessWithoutChange; @@ -56,7 +57,7 @@ Pass::Status ScalarReplacementPass::ProcessFunction(Function* function) { for (auto iter = entry.begin(); iter != entry.end(); ++iter) { // Function storage class OpVariables must appear as the first instructions // of the entry block. - if (iter->opcode() != SpvOpVariable) break; + if (iter->opcode() != spv::Op::OpVariable) break; Instruction* varInst = &*iter; if (CanReplaceVariable(varInst)) { @@ -105,29 +106,29 @@ Pass::Status ScalarReplacementPass::ReplaceVariable( } if (!IsAnnotationInst(user->opcode())) { switch (user->opcode()) { - case SpvOpLoad: + case spv::Op::OpLoad: if (ReplaceWholeLoad(user, replacements)) { dead.push_back(user); } else { return false; } break; - case SpvOpStore: + case spv::Op::OpStore: if (ReplaceWholeStore(user, replacements)) { dead.push_back(user); } else { return false; } break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: if (ReplaceAccessChain(user, replacements)) dead.push_back(user); else return false; break; - case SpvOpName: - case SpvOpMemberName: + case spv::Op::OpName: + case spv::Op::OpMemberName: break; default: assert(false && "Unexpected opcode"); @@ -155,7 +156,7 @@ Pass::Status ScalarReplacementPass::ReplaceVariable( // Attempt to further scalarize. for (auto var : replacements) { - if (var->opcode() == SpvOpVariable) { + if (var->opcode() == spv::Op::OpVariable) { if (get_def_use_mgr()->NumUsers(var) == 0) { context()->KillInst(var); } else if (CanReplaceVariable(var)) { @@ -179,7 +180,7 @@ bool ScalarReplacementPass::ReplaceWholeDebugDeclare( int32_t idx = 0; for (const auto* var : replacements) { Instruction* insert_before = var->NextNode(); - while (insert_before->opcode() == SpvOpVariable) + while (insert_before->opcode() == spv::Op::OpVariable) insert_before = insert_before->NextNode(); assert(insert_before != nullptr && "unexpected end of list"); Instruction* added_dbg_value = @@ -190,7 +191,7 @@ bool ScalarReplacementPass::ReplaceWholeDebugDeclare( if (added_dbg_value == nullptr) return false; added_dbg_value->AddOperand( {SPV_OPERAND_TYPE_ID, - {context()->get_constant_mgr()->GetSIntConst(idx)}}); + {context()->get_constant_mgr()->GetSIntConstId(idx)}}); added_dbg_value->SetOperand(kDebugValueOperandExpressionIndex, {deref_expr->result_id()}); if (context()->AreAnalysesValid(IRContext::Analysis::kAnalysisDefUse)) { @@ -216,7 +217,7 @@ bool ScalarReplacementPass::ReplaceWholeDebugValue( // Append 'Indexes' operand. new_dbg_value->AddOperand( {SPV_OPERAND_TYPE_ID, - {context()->get_constant_mgr()->GetSIntConst(idx)}}); + {context()->get_constant_mgr()->GetSIntConstId(idx)}}); // Insert the new DebugValue to the basic block. auto* added_instr = dbg_value->InsertBefore(std::move(new_dbg_value)); get_def_use_mgr()->AnalyzeInstDefUse(added_instr); @@ -236,7 +237,7 @@ bool ScalarReplacementPass::ReplaceWholeLoad( BasicBlock::iterator where(load); for (auto var : replacements) { // Create a load of each replacement variable. - if (var->opcode() != SpvOpVariable) { + if (var->opcode() != spv::Op::OpVariable) { loads.push_back(var); continue; } @@ -247,7 +248,7 @@ bool ScalarReplacementPass::ReplaceWholeLoad( return false; } std::unique_ptr newLoad( - new Instruction(context(), SpvOpLoad, type->result_id(), loadId, + new Instruction(context(), spv::Op::OpLoad, type->result_id(), loadId, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {var->result_id()}}})); // Copy memory access attributes which start at index 1. Index 0 is the @@ -269,8 +270,9 @@ bool ScalarReplacementPass::ReplaceWholeLoad( return false; } where = load; - std::unique_ptr compositeConstruct(new Instruction( - context(), SpvOpCompositeConstruct, load->type_id(), compositeId, {})); + std::unique_ptr compositeConstruct( + new Instruction(context(), spv::Op::OpCompositeConstruct, load->type_id(), + compositeId, {})); for (auto l : loads) { Operand op(SPV_OPERAND_TYPE_ID, std::initializer_list{l->result_id()}); @@ -294,7 +296,7 @@ bool ScalarReplacementPass::ReplaceWholeStore( uint32_t elementIndex = 0; for (auto var : replacements) { // Create the extract. - if (var->opcode() != SpvOpVariable) { + if (var->opcode() != spv::Op::OpVariable) { elementIndex++; continue; } @@ -305,7 +307,7 @@ bool ScalarReplacementPass::ReplaceWholeStore( return false; } std::unique_ptr extract(new Instruction( - context(), SpvOpCompositeExtract, type->result_id(), extractId, + context(), spv::Op::OpCompositeExtract, type->result_id(), extractId, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {storeInput}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, {elementIndex++}}})); @@ -316,7 +318,7 @@ bool ScalarReplacementPass::ReplaceWholeStore( // Create the store. std::unique_ptr newStore( - new Instruction(context(), SpvOpStore, 0, 0, + new Instruction(context(), spv::Op::OpStore, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {var->result_id()}}, {SPV_OPERAND_TYPE_ID, {extractId}}})); @@ -390,7 +392,7 @@ bool ScalarReplacementPass::CreateReplacementVariables( uint32_t elem = 0; switch (type->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: type->ForEachInOperand( [this, inst, &elem, replacements, &components_used](uint32_t* id) { if (!components_used || components_used->count(elem)) { @@ -401,7 +403,7 @@ bool ScalarReplacementPass::CreateReplacementVariables( elem++; }); break; - case SpvOpTypeArray: + case spv::Op::OpTypeArray: for (uint32_t i = 0; i != GetArrayLength(type); ++i) { if (!components_used || components_used->count(i)) { CreateVariable(type->GetSingleWordInOperand(0u), inst, i, @@ -413,8 +415,8 @@ bool ScalarReplacementPass::CreateReplacementVariables( } break; - case SpvOpTypeMatrix: - case SpvOpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeVector: for (uint32_t i = 0; i != GetNumElements(type); ++i) { CreateVariable(type->GetSingleWordInOperand(0u), inst, i, replacements); } @@ -440,20 +442,20 @@ void ScalarReplacementPass::TransferAnnotations( // no type or member decorations that are necessary to transfer. for (auto inst : get_decoration_mgr()->GetDecorationsFor(source->result_id(), false)) { - assert(inst->opcode() == SpvOpDecorate); - uint32_t decoration = inst->GetSingleWordInOperand(1u); - if (decoration == SpvDecorationInvariant || - decoration == SpvDecorationRestrict) { + assert(inst->opcode() == spv::Op::OpDecorate); + auto decoration = spv::Decoration(inst->GetSingleWordInOperand(1u)); + if (decoration == spv::Decoration::Invariant || + decoration == spv::Decoration::Restrict) { for (auto var : *replacements) { if (var == nullptr) { continue; } - std::unique_ptr annotation( - new Instruction(context(), SpvOpDecorate, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {var->result_id()}}, - {SPV_OPERAND_TYPE_DECORATION, {decoration}}})); + std::unique_ptr annotation(new Instruction( + context(), spv::Op::OpDecorate, 0, 0, + std::initializer_list{ + {SPV_OPERAND_TYPE_ID, {var->result_id()}}, + {SPV_OPERAND_TYPE_DECORATION, {uint32_t(decoration)}}})); for (uint32_t i = 2; i < inst->NumInOperands(); ++i) { Operand copy(inst->GetInOperand(i)); annotation->AddOperand(std::move(copy)); @@ -475,10 +477,11 @@ void ScalarReplacementPass::CreateVariable( replacements->push_back(nullptr); } - std::unique_ptr variable(new Instruction( - context(), SpvOpVariable, ptrId, id, - std::initializer_list{ - {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}})); + std::unique_ptr variable( + new Instruction(context(), spv::Op::OpVariable, ptrId, id, + std::initializer_list{ + {SPV_OPERAND_TYPE_STORAGE_CLASS, + {uint32_t(spv::StorageClass::Function)}}})); BasicBlock* block = context()->get_instr_block(varInst); block->begin().InsertBefore(std::move(variable)); @@ -494,7 +497,7 @@ void ScalarReplacementPass::CreateVariable( for (auto dec_inst : get_decoration_mgr()->GetDecorationsFor(typeInst->result_id(), false)) { uint32_t decoration; - if (dec_inst->opcode() != SpvOpMemberDecorate) { + if (dec_inst->opcode() != spv::Op::OpMemberDecorate) { continue; } @@ -503,10 +506,10 @@ void ScalarReplacementPass::CreateVariable( } decoration = dec_inst->GetSingleWordInOperand(2u); - switch (decoration) { - case SpvDecorationRelaxedPrecision: { + switch (spv::Decoration(decoration)) { + case spv::Decoration::RelaxedPrecision: { std::unique_ptr new_dec_inst( - new Instruction(context(), SpvOpDecorate, 0, 0, {})); + new Instruction(context(), spv::Op::OpDecorate, 0, 0, {})); new_dec_inst->AddOperand(Operand(SPV_OPERAND_TYPE_ID, {id})); for (uint32_t i = 2; i < dec_inst->NumInOperandWords(); ++i) { new_dec_inst->AddOperand(Operand(dec_inst->GetInOperand(i))); @@ -531,8 +534,8 @@ uint32_t ScalarReplacementPass::GetOrCreatePointerType(uint32_t id) { analysis::Type* pointeeTy; std::unique_ptr pointerTy; std::tie(pointeeTy, pointerTy) = - context()->get_type_mgr()->GetTypeAndPointerType(id, - SpvStorageClassFunction); + context()->get_type_mgr()->GetTypeAndPointerType( + id, spv::StorageClass::Function); uint32_t ptrId = 0; if (pointeeTy->IsUniqueType()) { // Non-ambiguous type, just ask the type manager for an id. @@ -544,8 +547,9 @@ uint32_t ScalarReplacementPass::GetOrCreatePointerType(uint32_t id) { // Ambiguous type. We must perform a linear search to try and find the right // type. for (auto global : context()->types_values()) { - if (global.opcode() == SpvOpTypePointer && - global.GetSingleWordInOperand(0u) == SpvStorageClassFunction && + if (global.opcode() == spv::Op::OpTypePointer && + spv::StorageClass(global.GetSingleWordInOperand(0u)) == + spv::StorageClass::Function && global.GetSingleWordInOperand(1u) == id) { if (get_decoration_mgr()->GetDecorationsFor(id, false).empty()) { // Only reuse a decoration-less pointer of the correct type. @@ -562,10 +566,10 @@ uint32_t ScalarReplacementPass::GetOrCreatePointerType(uint32_t id) { ptrId = TakeNextId(); context()->AddType(MakeUnique( - context(), SpvOpTypePointer, 0, ptrId, - std::initializer_list{ - {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}, - {SPV_OPERAND_TYPE_ID, {id}}})); + context(), spv::Op::OpTypePointer, 0, ptrId, + std::initializer_list{{SPV_OPERAND_TYPE_STORAGE_CLASS, + {uint32_t(spv::StorageClass::Function)}}, + {SPV_OPERAND_TYPE_ID, {id}}})); Instruction* ptr = &*--context()->types_values_end(); get_def_use_mgr()->AnalyzeInstDefUse(ptr); pointee_to_pointer_[id] = ptrId; @@ -578,7 +582,7 @@ uint32_t ScalarReplacementPass::GetOrCreatePointerType(uint32_t id) { void ScalarReplacementPass::GetOrCreateInitialValue(Instruction* source, uint32_t index, Instruction* newVar) { - assert(source->opcode() == SpvOpVariable); + assert(source->opcode() == spv::Op::OpVariable); if (source->NumInOperands() < 2) return; uint32_t initId = source->GetSingleWordInOperand(1u); @@ -586,14 +590,14 @@ void ScalarReplacementPass::GetOrCreateInitialValue(Instruction* source, Instruction* init = get_def_use_mgr()->GetDef(initId); uint32_t newInitId = 0; // TODO(dnovillo): Refactor this with constant propagation. - if (init->opcode() == SpvOpConstantNull) { + if (init->opcode() == spv::Op::OpConstantNull) { // Initialize to appropriate NULL. auto iter = type_to_null_.find(storageId); if (iter == type_to_null_.end()) { newInitId = TakeNextId(); type_to_null_[storageId] = newInitId; context()->AddGlobalValue( - MakeUnique(context(), SpvOpConstantNull, storageId, + MakeUnique(context(), spv::Op::OpConstantNull, storageId, newInitId, std::initializer_list{})); Instruction* newNull = &*--context()->types_values_end(); get_def_use_mgr()->AnalyzeInstDefUse(newNull); @@ -604,18 +608,19 @@ void ScalarReplacementPass::GetOrCreateInitialValue(Instruction* source, // Create a new constant extract. newInitId = TakeNextId(); context()->AddGlobalValue(MakeUnique( - context(), SpvOpSpecConstantOp, storageId, newInitId, + context(), spv::Op::OpSpecConstantOp, storageId, newInitId, std::initializer_list{ - {SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER, {SpvOpCompositeExtract}}, + {SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER, + {uint32_t(spv::Op::OpCompositeExtract)}}, {SPV_OPERAND_TYPE_ID, {init->result_id()}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, {index}}})); Instruction* newSpecConst = &*--context()->types_values_end(); get_def_use_mgr()->AnalyzeInstDefUse(newSpecConst); - } else if (init->opcode() == SpvOpConstantComposite) { + } else if (init->opcode() == spv::Op::OpConstantComposite) { // Get the appropriate index constant. newInitId = init->GetSingleWordInOperand(index); Instruction* element = get_def_use_mgr()->GetDef(newInitId); - if (element->opcode() == SpvOpUndef) { + if (element->opcode() == spv::Op::OpUndef) { // Undef is not a valid initializer for a variable. newInitId = 0; } @@ -630,7 +635,7 @@ void ScalarReplacementPass::GetOrCreateInitialValue(Instruction* source, uint64_t ScalarReplacementPass::GetArrayLength( const Instruction* arrayType) const { - assert(arrayType->opcode() == SpvOpTypeArray); + assert(arrayType->opcode() == spv::Op::OpTypeArray); const Instruction* length = get_def_use_mgr()->GetDef(arrayType->GetSingleWordInOperand(1u)); return context() @@ -640,8 +645,8 @@ uint64_t ScalarReplacementPass::GetArrayLength( } uint64_t ScalarReplacementPass::GetNumElements(const Instruction* type) const { - assert(type->opcode() == SpvOpTypeVector || - type->opcode() == SpvOpTypeMatrix); + assert(type->opcode() == spv::Op::OpTypeVector || + type->opcode() == spv::Op::OpTypeMatrix); const Operand& op = type->GetInOperand(1u); assert(op.words.size() <= 2); uint64_t len = 0; @@ -659,7 +664,7 @@ bool ScalarReplacementPass::IsSpecConstant(uint32_t id) const { Instruction* ScalarReplacementPass::GetStorageType( const Instruction* inst) const { - assert(inst->opcode() == SpvOpVariable); + assert(inst->opcode() == spv::Op::OpVariable); uint32_t ptrTypeId = inst->type_id(); uint32_t typeId = @@ -669,10 +674,11 @@ Instruction* ScalarReplacementPass::GetStorageType( bool ScalarReplacementPass::CanReplaceVariable( const Instruction* varInst) const { - assert(varInst->opcode() == SpvOpVariable); + assert(varInst->opcode() == spv::Op::OpVariable); // Can only replace function scope variables. - if (varInst->GetSingleWordInOperand(0u) != SpvStorageClassFunction) { + if (spv::StorageClass(varInst->GetSingleWordInOperand(0u)) != + spv::StorageClass::Function) { return false; } @@ -702,14 +708,14 @@ bool ScalarReplacementPass::CheckType(const Instruction* typeInst) const { } switch (typeInst->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: // Don't bother with empty structs or very large structs. if (typeInst->NumInOperands() == 0 || IsLargerThanSizeLimit(typeInst->NumInOperands())) { return false; } return true; - case SpvOpTypeArray: + case spv::Op::OpTypeArray: if (IsSpecConstant(typeInst->GetSingleWordInOperand(1u))) { return false; } @@ -721,12 +727,12 @@ bool ScalarReplacementPass::CheckType(const Instruction* typeInst) const { // re-enabled. //// Specifically including matrix and vector in an attempt to reduce the //// number of vector registers required. - // case SpvOpTypeMatrix: - // case SpvOpTypeVector: + // case spv::Op::OpTypeMatrix: + // case spv::Op::OpTypeVector: // if (IsLargerThanSizeLimit(GetNumElements(typeInst))) return false; // return true; - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeRuntimeArray: default: return false; } @@ -737,26 +743,26 @@ bool ScalarReplacementPass::CheckTypeAnnotations( for (auto inst : get_decoration_mgr()->GetDecorationsFor(typeInst->result_id(), false)) { uint32_t decoration; - if (inst->opcode() == SpvOpDecorate) { + if (inst->opcode() == spv::Op::OpDecorate) { decoration = inst->GetSingleWordInOperand(1u); } else { - assert(inst->opcode() == SpvOpMemberDecorate); + assert(inst->opcode() == spv::Op::OpMemberDecorate); decoration = inst->GetSingleWordInOperand(2u); } - switch (decoration) { - case SpvDecorationRowMajor: - case SpvDecorationColMajor: - case SpvDecorationArrayStride: - case SpvDecorationMatrixStride: - case SpvDecorationCPacked: - case SpvDecorationInvariant: - case SpvDecorationRestrict: - case SpvDecorationOffset: - case SpvDecorationAlignment: - case SpvDecorationAlignmentId: - case SpvDecorationMaxByteOffset: - case SpvDecorationRelaxedPrecision: + switch (spv::Decoration(decoration)) { + case spv::Decoration::RowMajor: + case spv::Decoration::ColMajor: + case spv::Decoration::ArrayStride: + case spv::Decoration::MatrixStride: + case spv::Decoration::CPacked: + case spv::Decoration::Invariant: + case spv::Decoration::Restrict: + case spv::Decoration::Offset: + case spv::Decoration::Alignment: + case spv::Decoration::AlignmentId: + case spv::Decoration::MaxByteOffset: + case spv::Decoration::RelaxedPrecision: break; default: return false; @@ -769,14 +775,14 @@ bool ScalarReplacementPass::CheckTypeAnnotations( bool ScalarReplacementPass::CheckAnnotations(const Instruction* varInst) const { for (auto inst : get_decoration_mgr()->GetDecorationsFor(varInst->result_id(), false)) { - assert(inst->opcode() == SpvOpDecorate); - uint32_t decoration = inst->GetSingleWordInOperand(1u); + assert(inst->opcode() == spv::Op::OpDecorate); + auto decoration = spv::Decoration(inst->GetSingleWordInOperand(1u)); switch (decoration) { - case SpvDecorationInvariant: - case SpvDecorationRestrict: - case SpvDecorationAlignment: - case SpvDecorationAlignmentId: - case SpvDecorationMaxByteOffset: + case spv::Decoration::Invariant: + case spv::Decoration::Restrict: + case spv::Decoration::Alignment: + case spv::Decoration::AlignmentId: + case spv::Decoration::MaxByteOffset: break; default: return false; @@ -816,8 +822,8 @@ bool ScalarReplacementPass::CheckUses(const Instruction* inst, // Annotations are check as a group separately. if (!IsAnnotationInst(user->opcode())) { switch (user->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: if (index == 2u && user->NumInOperands() > 1) { uint32_t id = user->GetSingleWordInOperand(1u); const Instruction* opInst = get_def_use_mgr()->GetDef(id); @@ -835,16 +841,16 @@ bool ScalarReplacementPass::CheckUses(const Instruction* inst, ok = false; } break; - case SpvOpLoad: + case spv::Op::OpLoad: if (!CheckLoad(user, index)) ok = false; stats->num_full_accesses++; break; - case SpvOpStore: + case spv::Op::OpStore: if (!CheckStore(user, index)) ok = false; stats->num_full_accesses++; break; - case SpvOpName: - case SpvOpMemberName: + case spv::Op::OpName: + case spv::Op::OpMemberName: break; default: ok = false; @@ -861,24 +867,24 @@ bool ScalarReplacementPass::CheckUsesRelaxed(const Instruction* inst) const { get_def_use_mgr()->ForEachUse( inst, [this, &ok](const Instruction* user, uint32_t index) { switch (user->opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: if (index != 2u) { ok = false; } else { if (!CheckUsesRelaxed(user)) ok = false; } break; - case SpvOpLoad: + case spv::Op::OpLoad: if (!CheckLoad(user, index)) ok = false; break; - case SpvOpStore: + case spv::Op::OpStore: if (!CheckStore(user, index)) ok = false; break; - case SpvOpImageTexelPointer: + case spv::Op::OpImageTexelPointer: if (!CheckImageTexelPointer(index)) ok = false; break; - case SpvOpExtInst: + case spv::Op::OpExtInst: if (user->GetCommonDebugOpcode() != CommonDebugInfoDebugDeclare || !CheckDebugDeclare(index)) ok = false; @@ -900,7 +906,8 @@ bool ScalarReplacementPass::CheckLoad(const Instruction* inst, uint32_t index) const { if (index != 2u) return false; if (inst->NumInOperands() >= 2 && - inst->GetSingleWordInOperand(1u) & SpvMemoryAccessVolatileMask) + inst->GetSingleWordInOperand(1u) & + uint32_t(spv::MemoryAccessMask::Volatile)) return false; return true; } @@ -909,7 +916,8 @@ bool ScalarReplacementPass::CheckStore(const Instruction* inst, uint32_t index) const { if (index != 0u) return false; if (inst->NumInOperands() >= 3 && - inst->GetSingleWordInOperand(2u) & SpvMemoryAccessVolatileMask) + inst->GetSingleWordInOperand(2u) & + uint32_t(spv::MemoryAccessMask::Volatile)) return false; return true; } @@ -936,11 +944,11 @@ ScalarReplacementPass::GetUsedComponents(Instruction* inst) { def_use_mgr->WhileEachUser(inst, [&result, def_use_mgr, this](Instruction* use) { switch (use->opcode()) { - case SpvOpLoad: { + case spv::Op::OpLoad: { // Look for extract from the load. std::vector t; if (def_use_mgr->WhileEachUser(use, [&t](Instruction* use2) { - if (use2->opcode() != SpvOpCompositeExtract || + if (use2->opcode() != spv::Op::OpCompositeExtract || use2->NumInOperands() <= 1) { return false; } @@ -954,13 +962,13 @@ ScalarReplacementPass::GetUsedComponents(Instruction* inst) { return false; } } - case SpvOpName: - case SpvOpMemberName: - case SpvOpStore: + case spv::Op::OpName: + case spv::Op::OpMemberName: + case spv::Op::OpStore: // No components are used. return true; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: { + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: { // Add the first index it if is a constant. // TODO: Could be improved by checking if the address is used in a load. analysis::ConstantManager* const_mgr = context()->get_constant_mgr(); @@ -988,16 +996,16 @@ ScalarReplacementPass::GetUsedComponents(Instruction* inst) { uint64_t ScalarReplacementPass::GetMaxLegalIndex( const Instruction* var_inst) const { - assert(var_inst->opcode() == SpvOpVariable && + assert(var_inst->opcode() == spv::Op::OpVariable && "|var_inst| must be a variable instruction."); Instruction* type = GetStorageType(var_inst); switch (type->opcode()) { - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: return type->NumInOperands(); - case SpvOpTypeArray: + case spv::Op::OpTypeArray: return GetArrayLength(type); - case SpvOpTypeMatrix: - case SpvOpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeVector: return GetNumElements(type); default: return 0; diff --git a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h index 6a66dfb80..0bcd2a4e4 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h +++ b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h @@ -33,7 +33,7 @@ namespace opt { // Documented in optimizer.hpp class ScalarReplacementPass : public MemPass { private: - static const uint32_t kDefaultLimit = 100; + static constexpr uint32_t kDefaultLimit = 100; public: ScalarReplacementPass(uint32_t limit = kDefaultLimit) @@ -104,10 +104,10 @@ class ScalarReplacementPass : public MemPass { // Returns true if the uses of |inst| are acceptable for scalarization. // // Recursively checks all the uses of |inst|. For |inst| specifically, only - // allows SpvOpAccessChain, SpvOpInBoundsAccessChain, SpvOpLoad and - // SpvOpStore. Access chains must have the first index be a compile-time - // constant. Subsequent uses of access chains (including other access chains) - // are checked in a more relaxed manner. + // allows spv::Op::OpAccessChain, spv::Op::OpInBoundsAccessChain, + // spv::Op::OpLoad and spv::Op::OpStore. Access chains must have the first + // index be a compile-time constant. Subsequent uses of access chains + // (including other access chains) are checked in a more relaxed manner. bool CheckUses(const Instruction* inst) const; // Helper function for the above |CheckUses|. diff --git a/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp b/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp index 4def2b09a..5125bd153 100644 --- a/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp @@ -30,7 +30,6 @@ namespace spvtools { namespace opt { - namespace { using utils::EncodeNumberStatus; using utils::NumberType; @@ -139,9 +138,9 @@ std::vector ParseDefaultValueBitPattern( // decoration. bool CanHaveSpecIdDecoration(const Instruction& inst) { switch (inst.opcode()) { - case SpvOp::SpvOpSpecConstant: - case SpvOp::SpvOpSpecConstantFalse: - case SpvOp::SpvOpSpecConstantTrue: + case spv::Op::OpSpecConstant: + case spv::Op::OpSpecConstantFalse: + case spv::Op::OpSpecConstantTrue: return true; default: return false; @@ -165,7 +164,7 @@ Instruction* GetSpecIdTargetFromDecorationGroup( if (def_use_mgr->WhileEachUser(&decoration_group_defining_inst, [&group_decorate_inst](Instruction* user) { if (user->opcode() == - SpvOp::SpvOpGroupDecorate) { + spv::Op::OpGroupDecorate) { group_decorate_inst = user; return false; } @@ -217,16 +216,16 @@ Instruction* GetSpecIdTargetFromDecorationGroup( Pass::Status SetSpecConstantDefaultValuePass::Process() { // The operand index of decoration target in an OpDecorate instruction. - const uint32_t kTargetIdOperandIndex = 0; + constexpr uint32_t kTargetIdOperandIndex = 0; // The operand index of the decoration literal in an OpDecorate instruction. - const uint32_t kDecorationOperandIndex = 1; + constexpr uint32_t kDecorationOperandIndex = 1; // The operand index of Spec id literal value in an OpDecorate SpecId // instruction. - const uint32_t kSpecIdLiteralOperandIndex = 2; + constexpr uint32_t kSpecIdLiteralOperandIndex = 2; // The number of operands in an OpDecorate SpecId instruction. - const uint32_t kOpDecorateSpecIdNumOperands = 3; + constexpr uint32_t kOpDecorateSpecIdNumOperands = 3; // The in-operand index of the default value in a OpSpecConstant instruction. - const uint32_t kOpSpecConstantLiteralInOperandIndex = 0; + constexpr uint32_t kOpSpecConstantLiteralInOperandIndex = 0; bool modified = false; // Scan through all the annotation instructions to find 'OpDecorate SpecId' @@ -240,10 +239,10 @@ Pass::Status SetSpecConstantDefaultValuePass::Process() { // default value of the target spec constant. for (Instruction& inst : context()->annotations()) { // Only process 'OpDecorate SpecId' instructions - if (inst.opcode() != SpvOp::SpvOpDecorate) continue; + if (inst.opcode() != spv::Op::OpDecorate) continue; if (inst.NumOperands() != kOpDecorateSpecIdNumOperands) continue; if (inst.GetSingleWordInOperand(kDecorationOperandIndex) != - uint32_t(SpvDecoration::SpvDecorationSpecId)) { + uint32_t(spv::Decoration::SpecId)) { continue; } @@ -255,7 +254,7 @@ Pass::Status SetSpecConstantDefaultValuePass::Process() { // target_id might be a decoration group id. Instruction* spec_inst = nullptr; if (Instruction* target_inst = get_def_use_mgr()->GetDef(target_id)) { - if (target_inst->opcode() == SpvOp::SpvOpDecorationGroup) { + if (target_inst->opcode() == spv::Op::OpDecorationGroup) { spec_inst = GetSpecIdTargetFromDecorationGroup(*target_inst, get_def_use_mgr()); } else { @@ -301,7 +300,7 @@ Pass::Status SetSpecConstantDefaultValuePass::Process() { // Update the operand bit patterns of the spec constant defining // instruction. switch (spec_inst->opcode()) { - case SpvOp::SpvOpSpecConstant: + case spv::Op::OpSpecConstant: // If the new value is the same with the original value, no // need to do anything. Otherwise update the operand words. if (spec_inst->GetInOperand(kOpSpecConstantLiteralInOperandIndex) @@ -311,19 +310,19 @@ Pass::Status SetSpecConstantDefaultValuePass::Process() { modified = true; } break; - case SpvOp::SpvOpSpecConstantTrue: + case spv::Op::OpSpecConstantTrue: // If the new value is also 'true', no need to change anything. // Otherwise, set the opcode to OpSpecConstantFalse; if (!static_cast(bit_pattern.front())) { - spec_inst->SetOpcode(SpvOp::SpvOpSpecConstantFalse); + spec_inst->SetOpcode(spv::Op::OpSpecConstantFalse); modified = true; } break; - case SpvOp::SpvOpSpecConstantFalse: + case spv::Op::OpSpecConstantFalse: // If the new value is also 'false', no need to change anything. // Otherwise, set the opcode to OpSpecConstantTrue; if (static_cast(bit_pattern.front())) { - spec_inst->SetOpcode(SpvOp::SpvOpSpecConstantTrue); + spec_inst->SetOpcode(spv::Op::OpSpecConstantTrue); modified = true; } break; diff --git a/3rdparty/spirv-tools/source/opt/simplification_pass.cpp b/3rdparty/spirv-tools/source/opt/simplification_pass.cpp index 43ec15f80..dbda39728 100644 --- a/3rdparty/spirv-tools/source/opt/simplification_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/simplification_pass.cpp @@ -69,12 +69,12 @@ bool SimplificationPass::SimplifyFunction(Function* function) { &folder, &inst_seen, this](BasicBlock* bb) { for (Instruction* inst = &*bb->begin(); inst; inst = inst->NextNode()) { inst_seen.insert(inst); - if (inst->opcode() == SpvOpPhi) { + if (inst->opcode() == spv::Op::OpPhi) { process_phis.insert(inst); } bool is_foldable_copy = - inst->opcode() == SpvOpCopyObject && + inst->opcode() == spv::Op::OpCopyObject && context()->get_decoration_mgr()->HaveSubsetOfDecorations( inst->result_id(), inst->GetSingleWordInOperand(0)); @@ -91,7 +91,7 @@ bool SimplificationPass::SimplifyFunction(Function* function) { AddNewOperands(inst, &inst_seen, &work_list); - if (inst->opcode() == SpvOpCopyObject) { + if (inst->opcode() == spv::Op::OpCopyObject) { context()->ReplaceAllUsesWithPredicate( inst->result_id(), inst->GetSingleWordInOperand(0), [](Instruction* user) { @@ -104,7 +104,7 @@ bool SimplificationPass::SimplifyFunction(Function* function) { }); inst_to_kill.insert(inst); in_work_list.insert(inst); - } else if (inst->opcode() == SpvOpNop) { + } else if (inst->opcode() == spv::Op::OpNop) { inst_to_kill.insert(inst); in_work_list.insert(inst); } @@ -121,7 +121,7 @@ bool SimplificationPass::SimplifyFunction(Function* function) { inst_seen.insert(inst); bool is_foldable_copy = - inst->opcode() == SpvOpCopyObject && + inst->opcode() == spv::Op::OpCopyObject && context()->get_decoration_mgr()->HaveSubsetOfDecorations( inst->result_id(), inst->GetSingleWordInOperand(0)); @@ -130,7 +130,7 @@ bool SimplificationPass::SimplifyFunction(Function* function) { context()->AnalyzeUses(inst); get_def_use_mgr()->ForEachUser( inst, [&work_list, &in_work_list](Instruction* use) { - if (!use->IsDecoration() && use->opcode() != SpvOpName && + if (!use->IsDecoration() && use->opcode() != spv::Op::OpName && in_work_list.insert(use).second) { work_list.push_back(use); } @@ -138,7 +138,7 @@ bool SimplificationPass::SimplifyFunction(Function* function) { AddNewOperands(inst, &inst_seen, &work_list); - if (inst->opcode() == SpvOpCopyObject) { + if (inst->opcode() == spv::Op::OpCopyObject) { context()->ReplaceAllUsesWithPredicate( inst->result_id(), inst->GetSingleWordInOperand(0), [](Instruction* user) { @@ -150,7 +150,7 @@ bool SimplificationPass::SimplifyFunction(Function* function) { }); inst_to_kill.insert(inst); in_work_list.insert(inst); - } else if (inst->opcode() == SpvOpNop) { + } else if (inst->opcode() == spv::Op::OpNop) { inst_to_kill.insert(inst); in_work_list.insert(inst); } diff --git a/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp b/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp index b61fd0f4c..3037274d3 100644 --- a/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp +++ b/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp @@ -21,32 +21,32 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kOpDecorateInOperandBuiltinDecoration = 2u; -const uint32_t kOpLoadInOperandMemoryOperands = 1u; -const uint32_t kOpEntryPointInOperandEntryPoint = 1u; -const uint32_t kOpEntryPointInOperandInterface = 3u; +constexpr uint32_t kOpDecorateInOperandBuiltinDecoration = 2u; +constexpr uint32_t kOpLoadInOperandMemoryOperands = 1u; +constexpr uint32_t kOpEntryPointInOperandEntryPoint = 1u; +constexpr uint32_t kOpEntryPointInOperandInterface = 3u; bool HasBuiltinDecoration(analysis::DecorationManager* decoration_manager, uint32_t var_id, uint32_t built_in) { return decoration_manager->FindDecoration( - var_id, SpvDecorationBuiltIn, [built_in](const Instruction& inst) { + var_id, uint32_t(spv::Decoration::BuiltIn), + [built_in](const Instruction& inst) { return built_in == inst.GetSingleWordInOperand( kOpDecorateInOperandBuiltinDecoration); }); } -bool IsBuiltInForRayTracingVolatileSemantics(uint32_t built_in) { +bool IsBuiltInForRayTracingVolatileSemantics(spv::BuiltIn built_in) { switch (built_in) { - case SpvBuiltInSMIDNV: - case SpvBuiltInWarpIDNV: - case SpvBuiltInSubgroupSize: - case SpvBuiltInSubgroupLocalInvocationId: - case SpvBuiltInSubgroupEqMask: - case SpvBuiltInSubgroupGeMask: - case SpvBuiltInSubgroupGtMask: - case SpvBuiltInSubgroupLeMask: - case SpvBuiltInSubgroupLtMask: + case spv::BuiltIn::SMIDNV: + case spv::BuiltIn::WarpIDNV: + case spv::BuiltIn::SubgroupSize: + case spv::BuiltIn::SubgroupLocalInvocationId: + case spv::BuiltIn::SubgroupEqMask: + case spv::BuiltIn::SubgroupGeMask: + case spv::BuiltIn::SubgroupGtMask: + case spv::BuiltIn::SubgroupLeMask: + case spv::BuiltIn::SubgroupLtMask: return true; default: return false; @@ -56,16 +56,17 @@ bool IsBuiltInForRayTracingVolatileSemantics(uint32_t built_in) { bool HasBuiltinForRayTracingVolatileSemantics( analysis::DecorationManager* decoration_manager, uint32_t var_id) { return decoration_manager->FindDecoration( - var_id, SpvDecorationBuiltIn, [](const Instruction& inst) { - uint32_t built_in = - inst.GetSingleWordInOperand(kOpDecorateInOperandBuiltinDecoration); + var_id, uint32_t(spv::Decoration::BuiltIn), [](const Instruction& inst) { + spv::BuiltIn built_in = spv::BuiltIn( + inst.GetSingleWordInOperand(kOpDecorateInOperandBuiltinDecoration)); return IsBuiltInForRayTracingVolatileSemantics(built_in); }); } bool HasVolatileDecoration(analysis::DecorationManager* decoration_manager, uint32_t var_id) { - return decoration_manager->HasDecoration(var_id, SpvDecorationVolatile); + return decoration_manager->HasDecoration(var_id, + uint32_t(spv::Decoration::Volatile)); } } // namespace @@ -76,7 +77,7 @@ Pass::Status SpreadVolatileSemantics::Process() { } const bool is_vk_memory_model_enabled = context()->get_feature_mgr()->HasCapability( - SpvCapabilityVulkanMemoryModel); + spv::Capability::VulkanMemoryModel); CollectTargetsForVolatileSemantics(is_vk_memory_model_enabled); // If VulkanMemoryModel capability is not enabled, we have to set Volatile @@ -128,15 +129,16 @@ bool SpreadVolatileSemantics::IsTargetUsedByNonVolatileLoadInEntryPoint( } uint32_t memory_operands = load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands); - return (memory_operands & SpvMemoryAccessVolatileMask) != 0; + return (memory_operands & uint32_t(spv::MemoryAccessMask::Volatile)) != + 0; }, funcs); } bool SpreadVolatileSemantics::HasInterfaceInConflictOfVolatileSemantics() { for (Instruction& entry_point : get_module()->entry_points()) { - SpvExecutionModel execution_model = - static_cast(entry_point.GetSingleWordInOperand(0)); + spv::ExecutionModel execution_model = + static_cast(entry_point.GetSingleWordInOperand(0)); for (uint32_t operand_index = kOpEntryPointInOperandInterface; operand_index < entry_point.NumInOperands(); ++operand_index) { uint32_t var_id = entry_point.GetSingleWordInOperand(operand_index); @@ -170,8 +172,8 @@ void SpreadVolatileSemantics::MarkVolatileSemanticsForVariable( void SpreadVolatileSemantics::CollectTargetsForVolatileSemantics( const bool is_vk_memory_model_enabled) { for (Instruction& entry_point : get_module()->entry_points()) { - SpvExecutionModel execution_model = - static_cast(entry_point.GetSingleWordInOperand(0)); + spv::ExecutionModel execution_model = + static_cast(entry_point.GetSingleWordInOperand(0)); for (uint32_t operand_index = kOpEntryPointInOperandInterface; operand_index < entry_point.NumInOperands(); ++operand_index) { uint32_t var_id = entry_point.GetSingleWordInOperand(operand_index); @@ -194,9 +196,10 @@ void SpreadVolatileSemantics::DecorateVarWithVolatile(Instruction* var) { return; } get_decoration_mgr()->AddDecoration( - SpvOpDecorate, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {SpvDecorationVolatile}}}); + spv::Op::OpDecorate, + {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, + {uint32_t(spv::Decoration::Volatile)}}}); } bool SpreadVolatileSemantics::VisitLoadsOfPointersToVariableInEntries( @@ -217,17 +220,17 @@ bool SpreadVolatileSemantics::VisitLoadsOfPointersToVariableInEntries( return true; } - if (user->opcode() == SpvOpAccessChain || - user->opcode() == SpvOpInBoundsAccessChain || - user->opcode() == SpvOpPtrAccessChain || - user->opcode() == SpvOpInBoundsPtrAccessChain || - user->opcode() == SpvOpCopyObject) { + if (user->opcode() == spv::Op::OpAccessChain || + user->opcode() == spv::Op::OpInBoundsAccessChain || + user->opcode() == spv::Op::OpPtrAccessChain || + user->opcode() == spv::Op::OpInBoundsPtrAccessChain || + user->opcode() == spv::Op::OpCopyObject) { if (ptr_id == user->GetSingleWordInOperand(0)) worklist.push_back(user->result_id()); return true; } - if (user->opcode() != SpvOpLoad) { + if (user->opcode() != spv::Op::OpLoad) { return true; } @@ -250,12 +253,12 @@ void SpreadVolatileSemantics::SetVolatileForLoadsInEntries( [](Instruction* load) { if (load->NumInOperands() <= kOpLoadInOperandMemoryOperands) { load->AddOperand({SPV_OPERAND_TYPE_MEMORY_ACCESS, - {SpvMemoryAccessVolatileMask}}); + {uint32_t(spv::MemoryAccessMask::Volatile)}}); return true; } uint32_t memory_operands = load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands); - memory_operands |= SpvMemoryAccessVolatileMask; + memory_operands |= uint32_t(spv::MemoryAccessMask::Volatile); load->SetInOperand(kOpLoadInOperandMemoryOperands, {memory_operands}); return true; }, @@ -264,29 +267,29 @@ void SpreadVolatileSemantics::SetVolatileForLoadsInEntries( } bool SpreadVolatileSemantics::IsTargetForVolatileSemantics( - uint32_t var_id, SpvExecutionModel execution_model) { + uint32_t var_id, spv::ExecutionModel execution_model) { analysis::DecorationManager* decoration_manager = context()->get_decoration_mgr(); - if (execution_model == SpvExecutionModelFragment) { + if (execution_model == spv::ExecutionModel::Fragment) { return get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 6) && HasBuiltinDecoration(decoration_manager, var_id, - SpvBuiltInHelperInvocation); + uint32_t(spv::BuiltIn::HelperInvocation)); } - if (execution_model == SpvExecutionModelIntersectionKHR || - execution_model == SpvExecutionModelIntersectionNV) { + if (execution_model == spv::ExecutionModel::IntersectionKHR || + execution_model == spv::ExecutionModel::IntersectionNV) { if (HasBuiltinDecoration(decoration_manager, var_id, - SpvBuiltInRayTmaxKHR)) { + uint32_t(spv::BuiltIn::RayTmaxKHR))) { return true; } } switch (execution_model) { - case SpvExecutionModelRayGenerationKHR: - case SpvExecutionModelClosestHitKHR: - case SpvExecutionModelMissKHR: - case SpvExecutionModelCallableKHR: - case SpvExecutionModelIntersectionKHR: + case spv::ExecutionModel::RayGenerationKHR: + case spv::ExecutionModel::ClosestHitKHR: + case spv::ExecutionModel::MissKHR: + case spv::ExecutionModel::CallableKHR: + case spv::ExecutionModel::IntersectionKHR: return HasBuiltinForRayTracingVolatileSemantics(decoration_manager, var_id); default: diff --git a/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h b/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h index 014858d3f..4cbb526fe 100644 --- a/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h +++ b/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h @@ -39,7 +39,8 @@ class SpreadVolatileSemantics : public Pass { // have an execution model. bool HasNoExecutionModel() { return get_module()->entry_points().empty() && - context()->get_feature_mgr()->HasCapability(SpvCapabilityLinkage); + context()->get_feature_mgr()->HasCapability( + spv::Capability::Linkage); } // Iterates interface variables and spreads the Volatile semantics if it has @@ -52,7 +53,7 @@ class SpreadVolatileSemantics : public Pass { // VUID-StandaloneSpirv-VulkanMemoryModel-04678 or // VUID-StandaloneSpirv-VulkanMemoryModel-04679. bool IsTargetForVolatileSemantics(uint32_t var_id, - SpvExecutionModel execution_model); + spv::ExecutionModel execution_model); // Collects interface variables that need the volatile semantics. // |is_vk_memory_model_enabled| is true if VulkanMemoryModel capability is diff --git a/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp b/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp index 22d811044..b8e22908d 100644 --- a/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp @@ -63,10 +63,9 @@ namespace spvtools { namespace opt { - namespace { -const uint32_t kStoreValIdInIdx = 1; -const uint32_t kVariableInitIdInIdx = 1; +constexpr uint32_t kStoreValIdInIdx = 1; +constexpr uint32_t kVariableInitIdInIdx = 1; } // namespace std::string SSARewriter::PhiCandidate::PrettyPrint(const CFG* cfg) const { @@ -300,12 +299,12 @@ void SSARewriter::SealBlock(BasicBlock* bb) { void SSARewriter::ProcessStore(Instruction* inst, BasicBlock* bb) { auto opcode = inst->opcode(); - assert((opcode == SpvOpStore || opcode == SpvOpVariable) && + assert((opcode == spv::Op::OpStore || opcode == spv::Op::OpVariable) && "Expecting a store or a variable definition instruction."); uint32_t var_id = 0; uint32_t val_id = 0; - if (opcode == SpvOpStore) { + if (opcode == spv::Op::OpStore) { (void)pass_->GetPtr(inst, &var_id); val_id = inst->GetSingleWordInOperand(kStoreValIdInIdx); } else if (inst->NumInOperands() >= 2) { @@ -443,9 +442,9 @@ bool SSARewriter::GenerateSSAReplacements(BasicBlock* bb) { for (auto& inst : *bb) { auto opcode = inst.opcode(); - if (opcode == SpvOpStore || opcode == SpvOpVariable) { + if (opcode == spv::Op::OpStore || opcode == spv::Op::OpVariable) { ProcessStore(&inst, bb); - } else if (inst.opcode() == SpvOpLoad) { + } else if (inst.opcode() == spv::Op::OpLoad) { if (!ProcessLoad(&inst, bb)) { return false; } @@ -545,7 +544,7 @@ bool SSARewriter::ApplyReplacements() { // Generate a new OpPhi instruction and insert it in its basic // block. std::unique_ptr phi_inst( - new Instruction(pass_->context(), SpvOpPhi, type_id, + new Instruction(pass_->context(), spv::Op::OpPhi, type_id, phi_candidate->result_id(), phi_operands)); generated_phis.push_back(phi_inst.get()); pass_->get_def_use_mgr()->AnalyzeInstDef(&*phi_inst); @@ -554,7 +553,7 @@ bool SSARewriter::ApplyReplacements() { insert_it = insert_it.InsertBefore(std::move(phi_inst)); pass_->context()->get_decoration_mgr()->CloneDecorations( phi_candidate->var_id(), phi_candidate->result_id(), - {SpvDecorationRelaxedPrecision}); + {spv::Decoration::RelaxedPrecision}); // Add DebugValue for the new OpPhi instruction. insert_it->SetDebugScope(local_var->GetDebugScope()); diff --git a/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp b/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp index ab7c4eb8d..f2e849871 100644 --- a/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp @@ -28,6 +28,8 @@ #include "source/opt/log.h" #include "source/opt/reflect.h" +namespace spvtools { +namespace opt { namespace { // Count the number of trailing zeros in the binary representation of // |constVal|. @@ -53,9 +55,6 @@ bool IsPowerOf2(uint32_t val) { } // namespace -namespace spvtools { -namespace opt { - Pass::Status StrengthReductionPass::Process() { // Initialize the member variables on a per module basis. bool modified = false; @@ -70,7 +69,7 @@ Pass::Status StrengthReductionPass::Process() { bool StrengthReductionPass::ReplaceMultiplyByPowerOf2( BasicBlock::iterator* inst) { - assert((*inst)->opcode() == SpvOp::SpvOpIMul && + assert((*inst)->opcode() == spv::Op::OpIMul && "Only works for multiplication of integers."); bool modified = false; @@ -84,7 +83,7 @@ bool StrengthReductionPass::ReplaceMultiplyByPowerOf2( for (int i = 0; i < 2; i++) { uint32_t opId = (*inst)->GetSingleWordInOperand(i); Instruction* opInst = get_def_use_mgr()->GetDef(opId); - if (opInst->opcode() == SpvOp::SpvOpConstant) { + if (opInst->opcode() == spv::Op::OpConstant) { // We found a constant operand. uint32_t constVal = opInst->GetSingleWordOperand(2); @@ -101,7 +100,7 @@ bool StrengthReductionPass::ReplaceMultiplyByPowerOf2( {shiftConstResultId}); newOperands.push_back(shiftOperand); std::unique_ptr newInstruction( - new Instruction(context(), SpvOp::SpvOpShiftLeftLogical, + new Instruction(context(), spv::Op::OpShiftLeftLogical, (*inst)->type_id(), newResultId, newOperands)); // Insert the new instruction and update the data structures. @@ -133,7 +132,7 @@ void StrengthReductionPass::FindIntTypesAndConstants() { for (auto iter = get_module()->types_values_begin(); iter != get_module()->types_values_end(); ++iter) { switch (iter->opcode()) { - case SpvOp::SpvOpConstant: + case spv::Op::OpConstant: if (iter->type_id() == uint32_type_id_) { uint32_t value = iter->GetSingleWordOperand(2); if (value <= 32) constant_ids_[value] = iter->result_id(); @@ -159,9 +158,8 @@ uint32_t StrengthReductionPass::GetConstantId(uint32_t val) { uint32_t resultId = TakeNextId(); Operand constant(spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {val}); - std::unique_ptr newConstant( - new Instruction(context(), SpvOp::SpvOpConstant, uint32_type_id_, - resultId, {constant})); + std::unique_ptr newConstant(new Instruction( + context(), spv::Op::OpConstant, uint32_type_id_, resultId, {constant})); get_module()->AddGlobalValue(std::move(newConstant)); // Notify the DefUseManager about this constant. @@ -184,7 +182,7 @@ bool StrengthReductionPass::ScanFunctions() { for (auto& bb : func) { for (auto inst = bb.begin(); inst != bb.end(); ++inst) { switch (inst->opcode()) { - case SpvOp::SpvOpIMul: + case spv::Op::OpIMul: if (ReplaceMultiplyByPowerOf2(&inst)) modified = true; break; default: diff --git a/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp b/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp index 6a0ebf248..f81bced52 100644 --- a/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp @@ -37,13 +37,13 @@ Pass::Status StripDebugInfoPass::Process() { if (uses_non_semantic_info) { for (auto& inst : context()->module()->debugs1()) { switch (inst.opcode()) { - case SpvOpString: { + case spv::Op::OpString: { analysis::DefUseManager* def_use = context()->get_def_use_mgr(); // see if this string is used anywhere by a non-semantic instruction bool no_nonsemantic_use = def_use->WhileEachUser(&inst, [def_use](Instruction* use) { - if (use->opcode() == SpvOpExtInst) { + if (use->opcode() == spv::Op::OpExtInst) { auto ext_inst_set = def_use->GetDef(use->GetSingleWordInOperand(0u)); const std::string extension_name = @@ -83,7 +83,8 @@ Pass::Status StripDebugInfoPass::Process() { // when that instruction is killed, which will lead to a double kill. std::sort(to_kill.begin(), to_kill.end(), [](Instruction* lhs, Instruction* rhs) -> bool { - if (lhs->opcode() == SpvOpName && rhs->opcode() != SpvOpName) + if (lhs->opcode() == spv::Op::OpName && + rhs->opcode() != spv::Op::OpName) return true; return false; }); diff --git a/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp b/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp index cd1fbb632..889969007 100644 --- a/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp @@ -32,27 +32,31 @@ Pass::Status StripNonSemanticInfoPass::Process() { bool other_uses_for_decorate_string = false; for (auto& inst : context()->module()->annotations()) { switch (inst.opcode()) { - case SpvOpDecorateStringGOOGLE: - if (inst.GetSingleWordInOperand(1) == SpvDecorationHlslSemanticGOOGLE || - inst.GetSingleWordInOperand(1) == SpvDecorationUserTypeGOOGLE) { + case spv::Op::OpDecorateStringGOOGLE: + if (spv::Decoration(inst.GetSingleWordInOperand(1)) == + spv::Decoration::HlslSemanticGOOGLE || + spv::Decoration(inst.GetSingleWordInOperand(1)) == + spv::Decoration::UserTypeGOOGLE) { to_remove.push_back(&inst); } else { other_uses_for_decorate_string = true; } break; - case SpvOpMemberDecorateStringGOOGLE: - if (inst.GetSingleWordInOperand(2) == SpvDecorationHlslSemanticGOOGLE || - inst.GetSingleWordInOperand(2) == SpvDecorationUserTypeGOOGLE) { + case spv::Op::OpMemberDecorateStringGOOGLE: + if (spv::Decoration(inst.GetSingleWordInOperand(2)) == + spv::Decoration::HlslSemanticGOOGLE || + spv::Decoration(inst.GetSingleWordInOperand(2)) == + spv::Decoration::UserTypeGOOGLE) { to_remove.push_back(&inst); } else { other_uses_for_decorate_string = true; } break; - case SpvOpDecorateId: - if (inst.GetSingleWordInOperand(1) == - SpvDecorationHlslCounterBufferGOOGLE) { + case spv::Op::OpDecorateId: + if (spv::Decoration(inst.GetSingleWordInOperand(1)) == + spv::Decoration::HlslCounterBufferGOOGLE) { to_remove.push_back(&inst); } break; @@ -79,7 +83,7 @@ Pass::Status StripNonSemanticInfoPass::Process() { // remove any extended inst imports that are non semantic std::unordered_set non_semantic_sets; for (auto& inst : context()->module()->ext_inst_imports()) { - assert(inst.opcode() == SpvOpExtInstImport && + assert(inst.opcode() == spv::Op::OpExtInstImport && "Expecting an import of an extension's instruction set."); const std::string extension_name = inst.GetInOperand(0).AsString(); if (spvtools::utils::starts_with(extension_name, "NonSemantic.")) { @@ -93,7 +97,7 @@ Pass::Status StripNonSemanticInfoPass::Process() { if (!non_semantic_sets.empty()) { context()->module()->ForEachInst( [&non_semantic_sets, &to_remove](Instruction* inst) { - if (inst->opcode() == SpvOpExtInst) { + if (inst->opcode() == spv::Op::OpExtInst) { if (non_semantic_sets.find(inst->GetSingleWordInOperand(0)) != non_semantic_sets.end()) { to_remove.push_back(inst); diff --git a/3rdparty/spirv-tools/source/opt/struct_cfg_analysis.cpp b/3rdparty/spirv-tools/source/opt/struct_cfg_analysis.cpp index 203db87db..290b4bf45 100644 --- a/3rdparty/spirv-tools/source/opt/struct_cfg_analysis.cpp +++ b/3rdparty/spirv-tools/source/opt/struct_cfg_analysis.cpp @@ -16,18 +16,17 @@ #include "source/opt/ir_context.h" -namespace { -const uint32_t kMergeNodeIndex = 0; -const uint32_t kContinueNodeIndex = 1; -} // namespace - namespace spvtools { namespace opt { +namespace { +constexpr uint32_t kMergeNodeIndex = 0; +constexpr uint32_t kContinueNodeIndex = 1; +} // namespace StructuredCFGAnalysis::StructuredCFGAnalysis(IRContext* ctx) : context_(ctx) { // If this is not a shader, there are no merge instructions, and not // structured CFG to analyze. - if (!context_->get_feature_mgr()->HasCapability(SpvCapabilityShader)) { + if (!context_->get_feature_mgr()->HasCapability(spv::Capability::Shader)) { return; } @@ -82,7 +81,7 @@ void StructuredCFGAnalysis::AddBlocksInFunction(Function* func) { merge_inst->GetSingleWordInOperand(kMergeNodeIndex); new_state.cinfo.containing_construct = block->id(); - if (merge_inst->opcode() == SpvOpLoopMerge) { + if (merge_inst->opcode() == spv::Op::OpLoopMerge) { new_state.cinfo.containing_loop = block->id(); new_state.cinfo.containing_switch = 0; new_state.continue_node = @@ -98,7 +97,7 @@ void StructuredCFGAnalysis::AddBlocksInFunction(Function* func) { new_state.cinfo.in_continue = state.back().cinfo.in_continue; new_state.continue_node = state.back().continue_node; - if (merge_inst->NextNode()->opcode() == SpvOpSwitch) { + if (merge_inst->NextNode()->opcode() == spv::Op::OpSwitch) { new_state.cinfo.containing_switch = block->id(); } else { new_state.cinfo.containing_switch = @@ -226,7 +225,7 @@ StructuredCFGAnalysis::FindFuncsCalledFromContinue() { for (auto& bb : func) { if (IsInContainingLoopsContinueConstruct(bb.id())) { for (const Instruction& inst : bb) { - if (inst.opcode() == SpvOpFunctionCall) { + if (inst.opcode() == spv::Op::OpFunctionCall) { funcs_to_process.push(inst.GetSingleWordInOperand(0)); } } diff --git a/3rdparty/spirv-tools/source/opt/type_manager.cpp b/3rdparty/spirv-tools/source/opt/type_manager.cpp index a0006f558..6e4c054ef 100644 --- a/3rdparty/spirv-tools/source/opt/type_manager.cpp +++ b/3rdparty/spirv-tools/source/opt/type_manager.cpp @@ -29,10 +29,8 @@ namespace spvtools { namespace opt { namespace analysis { namespace { - -const int kSpvTypePointerStorageClass = 1; -const int kSpvTypePointerTypeIdInIdx = 2; - +constexpr int kSpvTypePointerStorageClass = 1; +constexpr int kSpvTypePointerTypeIdInIdx = 2; } // namespace TypeManager::TypeManager(const MessageConsumer& consumer, IRContext* c) @@ -49,7 +47,7 @@ Type* TypeManager::GetType(uint32_t id) const { } std::pair> TypeManager::GetTypeAndPointerType( - uint32_t id, SpvStorageClass sc) const { + uint32_t id, spv::StorageClass sc) const { Type* type = GetType(id); if (type) { return std::make_pair(type, MakeUnique(type, sc)); @@ -220,10 +218,10 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { RegisterType(id, *type); switch (type->kind()) { -#define DefineParameterlessCase(kind) \ - case Type::k##kind: \ - typeInst = MakeUnique(context(), SpvOpType##kind, 0, id, \ - std::initializer_list{}); \ +#define DefineParameterlessCase(kind) \ + case Type::k##kind: \ + typeInst = MakeUnique(context(), spv::Op::OpType##kind, 0, \ + id, std::initializer_list{}); \ break DefineParameterlessCase(Void); DefineParameterlessCase(Bool); @@ -236,10 +234,11 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { DefineParameterlessCase(NamedBarrier); DefineParameterlessCase(AccelerationStructureNV); DefineParameterlessCase(RayQueryKHR); + DefineParameterlessCase(HitObjectNV); #undef DefineParameterlessCase case Type::kInteger: typeInst = MakeUnique( - context(), SpvOpTypeInt, 0, id, + context(), spv::Op::OpTypeInt, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_LITERAL_INTEGER, {type->AsInteger()->width()}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, @@ -247,7 +246,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { break; case Type::kFloat: typeInst = MakeUnique( - context(), SpvOpTypeFloat, 0, id, + context(), spv::Op::OpTypeFloat, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_LITERAL_INTEGER, {type->AsFloat()->width()}}}); break; @@ -257,7 +256,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = - MakeUnique(context(), SpvOpTypeVector, 0, id, + MakeUnique(context(), spv::Op::OpTypeVector, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {subtype}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, @@ -270,7 +269,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = - MakeUnique(context(), SpvOpTypeMatrix, 0, id, + MakeUnique(context(), spv::Op::OpTypeMatrix, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {subtype}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, @@ -284,7 +283,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = MakeUnique( - context(), SpvOpTypeImage, 0, id, + context(), spv::Op::OpTypeImage, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {subtype}}, {SPV_OPERAND_TYPE_DIMENSIONALITY, @@ -308,7 +307,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = MakeUnique( - context(), SpvOpTypeSampledImage, 0, id, + context(), spv::Op::OpTypeSampledImage, 0, id, std::initializer_list{{SPV_OPERAND_TYPE_ID, {subtype}}}); break; } @@ -318,7 +317,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = MakeUnique( - context(), SpvOpTypeArray, 0, id, + context(), spv::Op::OpTypeArray, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {subtype}}, {SPV_OPERAND_TYPE_ID, {type->AsArray()->LengthId()}}}); @@ -331,7 +330,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = MakeUnique( - context(), SpvOpTypeRuntimeArray, 0, id, + context(), spv::Op::OpTypeRuntimeArray, 0, id, std::initializer_list{{SPV_OPERAND_TYPE_ID, {subtype}}}); break; } @@ -346,7 +345,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { ops.push_back(Operand(SPV_OPERAND_TYPE_ID, {member_type_id})); } typeInst = - MakeUnique(context(), SpvOpTypeStruct, 0, id, ops); + MakeUnique(context(), spv::Op::OpTypeStruct, 0, id, ops); break; } case Type::kOpaque: { @@ -354,7 +353,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { // Convert to null-terminated packed UTF-8 string. std::vector words = spvtools::utils::MakeVector(opaque->name()); typeInst = MakeUnique( - context(), SpvOpTypeOpaque, 0, id, + context(), spv::Op::OpTypeOpaque, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_LITERAL_STRING, words}}); break; @@ -366,7 +365,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = MakeUnique( - context(), SpvOpTypePointer, 0, id, + context(), spv::Op::OpTypePointer, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_STORAGE_CLASS, {static_cast(pointer->storage_class())}}, @@ -388,20 +387,20 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { } ops.push_back(Operand(SPV_OPERAND_TYPE_ID, {paramater_type_id})); } - typeInst = - MakeUnique(context(), SpvOpTypeFunction, 0, id, ops); + typeInst = MakeUnique(context(), spv::Op::OpTypeFunction, 0, + id, ops); break; } case Type::kPipe: typeInst = MakeUnique( - context(), SpvOpTypePipe, 0, id, + context(), spv::Op::OpTypePipe, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_ACCESS_QUALIFIER, {static_cast(type->AsPipe()->access_qualifier())}}}); break; case Type::kForwardPointer: typeInst = MakeUnique( - context(), SpvOpTypeForwardPointer, 0, 0, + context(), spv::Op::OpTypeForwardPointer, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {type->AsForwardPointer()->target_id()}}, {SPV_OPERAND_TYPE_STORAGE_CLASS, @@ -416,7 +415,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { return 0; } typeInst = MakeUnique( - context(), SpvOpTypeCooperativeMatrixNV, 0, id, + context(), spv::Op::OpTypeCooperativeMatrixNV, 0, id, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {component_type}}, {SPV_OPERAND_TYPE_SCOPE_ID, {coop_mat->scope_id()}}, @@ -435,7 +434,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { } uint32_t TypeManager::FindPointerToType(uint32_t type_id, - SpvStorageClass storage_class) { + spv::StorageClass storage_class) { Type* pointeeTy = GetType(type_id); Pointer pointerTy(pointeeTy, storage_class); if (pointeeTy->IsUniqueType(true)) { @@ -447,11 +446,11 @@ uint32_t TypeManager::FindPointerToType(uint32_t type_id, Module::inst_iterator type_itr = context()->module()->types_values_begin(); for (; type_itr != context()->module()->types_values_end(); ++type_itr) { const Instruction* type_inst = &*type_itr; - if (type_inst->opcode() == SpvOpTypePointer && + if (type_inst->opcode() == spv::Op::OpTypePointer && type_inst->GetSingleWordOperand(kSpvTypePointerTypeIdInIdx) == type_id && - type_inst->GetSingleWordOperand(kSpvTypePointerStorageClass) == - storage_class) + spv::StorageClass(type_inst->GetSingleWordOperand( + kSpvTypePointerStorageClass)) == storage_class) return type_inst->result_id(); } @@ -459,7 +458,7 @@ uint32_t TypeManager::FindPointerToType(uint32_t type_id, // TODO(1841): Handle id overflow. uint32_t resultId = context()->TakeNextId(); std::unique_ptr type_inst( - new Instruction(context(), SpvOpTypePointer, 0, resultId, + new Instruction(context(), spv::Op::OpTypePointer, 0, resultId, {{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS, {uint32_t(storage_class)}}, {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_id}}})); @@ -476,7 +475,7 @@ void TypeManager::AttachDecorations(uint32_t id, const Type* type) { for (auto pair : structTy->element_decorations()) { uint32_t element = pair.first; for (auto vec : pair.second) { - CreateDecoration(id, vec, element); + CreateDecoration(id, vec, /* is_member */ true, element); } } } @@ -484,10 +483,10 @@ void TypeManager::AttachDecorations(uint32_t id, const Type* type) { void TypeManager::CreateDecoration(uint32_t target, const std::vector& decoration, - uint32_t element) { + bool is_member, uint32_t element) { std::vector ops; ops.push_back(Operand(SPV_OPERAND_TYPE_ID, {target})); - if (element != 0) { + if (is_member) { ops.push_back(Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {element})); } ops.push_back(Operand(SPV_OPERAND_TYPE_DECORATION, {decoration[0]})); @@ -495,8 +494,8 @@ void TypeManager::CreateDecoration(uint32_t target, ops.push_back(Operand(SPV_OPERAND_TYPE_LITERAL_INTEGER, {decoration[i]})); } context()->AddAnnotationInst(MakeUnique( - context(), (element == 0 ? SpvOpDecorate : SpvOpMemberDecorate), 0, 0, - ops)); + context(), (is_member ? spv::Op::OpMemberDecorate : spv::Op::OpDecorate), + 0, 0, ops)); Instruction* inst = &*--context()->annotation_end(); context()->get_def_use_mgr()->AnalyzeInstUse(inst); } @@ -529,6 +528,7 @@ Type* TypeManager::RebuildType(const Type& type) { DefineNoSubtypeCase(NamedBarrier); DefineNoSubtypeCase(AccelerationStructureNV); DefineNoSubtypeCase(RayQueryKHR); + DefineNoSubtypeCase(HitObjectNV); #undef DefineNoSubtypeCase case Type::kVector: { const Vector* vec_ty = type.AsVector(); @@ -665,46 +665,47 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { Type* type = nullptr; switch (inst.opcode()) { - case SpvOpTypeVoid: + case spv::Op::OpTypeVoid: type = new Void(); break; - case SpvOpTypeBool: + case spv::Op::OpTypeBool: type = new Bool(); break; - case SpvOpTypeInt: + case spv::Op::OpTypeInt: type = new Integer(inst.GetSingleWordInOperand(0), inst.GetSingleWordInOperand(1)); break; - case SpvOpTypeFloat: + case spv::Op::OpTypeFloat: type = new Float(inst.GetSingleWordInOperand(0)); break; - case SpvOpTypeVector: + case spv::Op::OpTypeVector: type = new Vector(GetType(inst.GetSingleWordInOperand(0)), inst.GetSingleWordInOperand(1)); break; - case SpvOpTypeMatrix: + case spv::Op::OpTypeMatrix: type = new Matrix(GetType(inst.GetSingleWordInOperand(0)), inst.GetSingleWordInOperand(1)); break; - case SpvOpTypeImage: { - const SpvAccessQualifier access = - inst.NumInOperands() < 8 - ? SpvAccessQualifierReadOnly - : static_cast(inst.GetSingleWordInOperand(7)); + case spv::Op::OpTypeImage: { + const spv::AccessQualifier access = + inst.NumInOperands() < 8 ? spv::AccessQualifier::ReadOnly + : static_cast( + inst.GetSingleWordInOperand(7)); type = new Image( GetType(inst.GetSingleWordInOperand(0)), - static_cast(inst.GetSingleWordInOperand(1)), + static_cast(inst.GetSingleWordInOperand(1)), inst.GetSingleWordInOperand(2), inst.GetSingleWordInOperand(3) == 1, inst.GetSingleWordInOperand(4) == 1, inst.GetSingleWordInOperand(5), - static_cast(inst.GetSingleWordInOperand(6)), access); + static_cast(inst.GetSingleWordInOperand(6)), + access); } break; - case SpvOpTypeSampler: + case spv::Op::OpTypeSampler: type = new Sampler(); break; - case SpvOpTypeSampledImage: + case spv::Op::OpTypeSampledImage: type = new SampledImage(GetType(inst.GetSingleWordInOperand(0))); break; - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { const uint32_t length_id = inst.GetSingleWordInOperand(1); const Instruction* length_constant_inst = id_to_constant_inst_[length_id]; assert(length_constant_inst); @@ -717,11 +718,11 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { // Only OpSpecConstant has a SpecId. uint32_t spec_id = 0u; bool has_spec_id = false; - if (length_constant_inst->opcode() == SpvOpSpecConstant) { + if (length_constant_inst->opcode() == spv::Op::OpSpecConstant) { context()->get_decoration_mgr()->ForEachDecoration( - length_id, SpvDecorationSpecId, + length_id, uint32_t(spv::Decoration::SpecId), [&spec_id, &has_spec_id](const Instruction& decoration) { - assert(decoration.opcode() == SpvOpDecorate); + assert(decoration.opcode() == spv::Op::OpDecorate); spec_id = decoration.GetSingleWordOperand(2u); has_spec_id = true; }); @@ -730,7 +731,8 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { if (has_spec_id) { extra_words.push_back(spec_id); } - if ((opcode == SpvOpConstant) || (opcode == SpvOpSpecConstant)) { + if ((opcode == spv::Op::OpConstant) || + (opcode == spv::Op::OpSpecConstant)) { // Always include the literal constant words. In the spec constant // case, the constant might not be overridden, so it's still // significant. @@ -754,7 +756,7 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { return type; } } break; - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeRuntimeArray: type = new RuntimeArray(GetType(inst.GetSingleWordInOperand(0))); if (id_to_incomplete_type_.count(inst.GetSingleWordInOperand(0))) { incomplete_types_.emplace_back(inst.result_id(), type); @@ -762,7 +764,7 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { return type; } break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { std::vector element_types; bool incomplete_type = false; for (uint32_t i = 0; i < inst.NumInOperands(); ++i) { @@ -780,14 +782,14 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { return type; } } break; - case SpvOpTypeOpaque: { + case spv::Op::OpTypeOpaque: { type = new Opaque(inst.GetInOperand(0).AsString()); } break; - case SpvOpTypePointer: { + case spv::Op::OpTypePointer: { uint32_t pointee_type_id = inst.GetSingleWordInOperand(1); type = new Pointer( GetType(pointee_type_id), - static_cast(inst.GetSingleWordInOperand(0))); + static_cast(inst.GetSingleWordInOperand(0))); if (id_to_incomplete_type_.count(pointee_type_id)) { incomplete_types_.emplace_back(inst.result_id(), type); @@ -797,7 +799,7 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { id_to_incomplete_type_.erase(inst.result_id()); } break; - case SpvOpTypeFunction: { + case spv::Op::OpTypeFunction: { bool incomplete_type = false; uint32_t return_type_id = inst.GetSingleWordInOperand(0); if (id_to_incomplete_type_.count(return_type_id)) { @@ -821,49 +823,52 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { return type; } } break; - case SpvOpTypeEvent: + case spv::Op::OpTypeEvent: type = new Event(); break; - case SpvOpTypeDeviceEvent: + case spv::Op::OpTypeDeviceEvent: type = new DeviceEvent(); break; - case SpvOpTypeReserveId: + case spv::Op::OpTypeReserveId: type = new ReserveId(); break; - case SpvOpTypeQueue: + case spv::Op::OpTypeQueue: type = new Queue(); break; - case SpvOpTypePipe: + case spv::Op::OpTypePipe: type = new Pipe( - static_cast(inst.GetSingleWordInOperand(0))); + static_cast(inst.GetSingleWordInOperand(0))); break; - case SpvOpTypeForwardPointer: { + case spv::Op::OpTypeForwardPointer: { // Handling of forward pointers is different from the other types. uint32_t target_id = inst.GetSingleWordInOperand(0); - type = new ForwardPointer(target_id, static_cast( + type = new ForwardPointer(target_id, static_cast( inst.GetSingleWordInOperand(1))); incomplete_types_.emplace_back(target_id, type); id_to_incomplete_type_[target_id] = type; return type; } - case SpvOpTypePipeStorage: + case spv::Op::OpTypePipeStorage: type = new PipeStorage(); break; - case SpvOpTypeNamedBarrier: + case spv::Op::OpTypeNamedBarrier: type = new NamedBarrier(); break; - case SpvOpTypeAccelerationStructureNV: + case spv::Op::OpTypeAccelerationStructureNV: type = new AccelerationStructureNV(); break; - case SpvOpTypeCooperativeMatrixNV: + case spv::Op::OpTypeCooperativeMatrixNV: type = new CooperativeMatrixNV(GetType(inst.GetSingleWordInOperand(0)), inst.GetSingleWordInOperand(1), inst.GetSingleWordInOperand(2), inst.GetSingleWordInOperand(3)); break; - case SpvOpTypeRayQueryKHR: + case spv::Op::OpTypeRayQueryKHR: type = new RayQueryKHR(); break; + case spv::Op::OpTypeHitObjectNV: + type = new HitObjectNV(); + break; default: SPIRV_UNIMPLEMENTED(consumer_, "unhandled type"); break; @@ -886,11 +891,11 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { } void TypeManager::AttachDecoration(const Instruction& inst, Type* type) { - const SpvOp opcode = inst.opcode(); + const spv::Op opcode = inst.opcode(); if (!IsAnnotationInst(opcode)) return; switch (opcode) { - case SpvOpDecorate: { + case spv::Op::OpDecorate: { const auto count = inst.NumOperands(); std::vector data; for (uint32_t i = 1; i < count; ++i) { @@ -898,7 +903,7 @@ void TypeManager::AttachDecoration(const Instruction& inst, Type* type) { } type->AddDecoration(std::move(data)); } break; - case SpvOpMemberDecorate: { + case spv::Op::OpMemberDecorate: { const auto count = inst.NumOperands(); const uint32_t index = inst.GetSingleWordOperand(1); std::vector data; diff --git a/3rdparty/spirv-tools/source/opt/type_manager.h b/3rdparty/spirv-tools/source/opt/type_manager.h index 72e37f487..c49e19322 100644 --- a/3rdparty/spirv-tools/source/opt/type_manager.h +++ b/3rdparty/spirv-tools/source/opt/type_manager.h @@ -99,7 +99,7 @@ class TypeManager { // // |id| must be a registered type. std::pair> GetTypeAndPointerType( - uint32_t id, SpvStorageClass sc) const; + uint32_t id, spv::StorageClass sc) const; // Returns an id for a declaration representing |type|. Returns 0 if the type // does not exists, and could not be generated. @@ -112,7 +112,7 @@ class TypeManager { // Find pointer to type and storage in module, return its resultId. If it is // not found, a new type is created, and its id is returned. Returns 0 if the // type could not be created. - uint32_t FindPointerToType(uint32_t type_id, SpvStorageClass storage_class); + uint32_t FindPointerToType(uint32_t type_id, spv::StorageClass storage_class); // Registers |id| to |type|. // @@ -139,6 +139,11 @@ class TypeManager { const Type* GetMemberType(const Type* parent_type, const std::vector& access_chain); + // Attaches the decoration encoded in |inst| to |type|. Does nothing if the + // given instruction is not a decoration instruction. Assumes the target is + // |type| (e.g. should be called in loop of |type|'s decorations). + void AttachDecoration(const Instruction& inst, Type* type); + Type* GetUIntType() { Integer int_type(32, false); return GetRegisteredType(&int_type); @@ -243,19 +248,15 @@ class TypeManager { // Create the annotation instruction. // - // If |element| is zero, an OpDecorate is created, other an OpMemberDecorate - // is created. The annotation is registered with the DefUseManager and the - // DecorationManager. + // If |is_member| is false, an OpDecorate of |decoration| on |id| is created, + // otherwise an OpMemberDecorate is created at |element|. The annotation is + // registered with the DefUseManager and the DecorationManager. void CreateDecoration(uint32_t id, const std::vector& decoration, - uint32_t element = 0); + bool is_member = false, uint32_t element = 0); // Creates and returns a type from the given SPIR-V |inst|. Returns nullptr if // the given instruction is not for defining a type. Type* RecordIfTypeDefinition(const Instruction& inst); - // Attaches the decoration encoded in |inst| to |type|. Does nothing if the - // given instruction is not a decoration instruction. Assumes the target is - // |type| (e.g. should be called in loop of |type|'s decorations). - void AttachDecoration(const Instruction& inst, Type* type); // Returns an equivalent pointer to |type| built in terms of pointers owned by // |type_pool_|. For example, if |type| is a vec3 of bool, it will be rebuilt diff --git a/3rdparty/spirv-tools/source/opt/types.cpp b/3rdparty/spirv-tools/source/opt/types.cpp index 056acebb6..ab95906b6 100644 --- a/3rdparty/spirv-tools/source/opt/types.cpp +++ b/3rdparty/spirv-tools/source/opt/types.cpp @@ -24,7 +24,6 @@ #include "source/util/hash_combine.h" #include "source/util/make_unique.h" -#include "spirv/unified1/spirv.h" namespace spvtools { namespace opt { @@ -65,7 +64,7 @@ bool CompareTwoVectors(const U32VecVec a, const U32VecVec b) { return true; } -} // anonymous namespace +} // namespace std::string Type::GetDecorationStr() const { std::ostringstream oss; @@ -132,6 +131,7 @@ std::unique_ptr Type::Clone() const { DeclareKindCase(AccelerationStructureNV); DeclareKindCase(CooperativeMatrixNV); DeclareKindCase(RayQueryKHR); + DeclareKindCase(HitObjectNV); #undef DeclareKindCase default: assert(false && "Unhandled type"); @@ -178,6 +178,7 @@ bool Type::operator==(const Type& other) const { DeclareKindCase(AccelerationStructureNV); DeclareKindCase(CooperativeMatrixNV); DeclareKindCase(RayQueryKHR); + DeclareKindCase(HitObjectNV); #undef DeclareKindCase default: assert(false && "Unhandled type"); @@ -232,6 +233,7 @@ size_t Type::ComputeHashValue(size_t hash, SeenTypes* seen) const { DeclareKindCase(AccelerationStructureNV); DeclareKindCase(CooperativeMatrixNV); DeclareKindCase(RayQueryKHR); + DeclareKindCase(HitObjectNV); #undef DeclareKindCase default: assert(false && "Unhandled type"); @@ -357,8 +359,9 @@ size_t Matrix::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const { return element_type_->ComputeHashValue(hash, seen); } -Image::Image(Type* type, SpvDim dimen, uint32_t d, bool array, bool multisample, - uint32_t sampling, SpvImageFormat f, SpvAccessQualifier qualifier) +Image::Image(Type* type, spv::Dim dimen, uint32_t d, bool array, + bool multisample, uint32_t sampling, spv::ImageFormat f, + spv::AccessQualifier qualifier) : Type(kImage), sampled_type_(type), dim_(dimen), @@ -383,9 +386,9 @@ bool Image::IsSameImpl(const Type* that, IsSameCache* seen) const { std::string Image::str() const { std::ostringstream oss; - oss << "image(" << sampled_type_->str() << ", " << dim_ << ", " << depth_ - << ", " << arrayed_ << ", " << ms_ << ", " << sampled_ << ", " << format_ - << ", " << access_qualifier_ << ")"; + oss << "image(" << sampled_type_->str() << ", " << uint32_t(dim_) << ", " + << depth_ << ", " << arrayed_ << ", " << ms_ << ", " << sampled_ << ", " + << uint32_t(format_) << ", " << uint32_t(access_qualifier_) << ")"; return oss.str(); } @@ -557,7 +560,7 @@ size_t Opaque::ComputeExtraStateHash(size_t hash, SeenTypes*) const { return hash_combine(hash, name_); } -Pointer::Pointer(const Type* type, SpvStorageClass sc) +Pointer::Pointer(const Type* type, spv::StorageClass sc) : Type(kPointer), pointee_type_(type), storage_class_(sc) {} bool Pointer::IsSameImpl(const Type* that, IsSameCache* seen) const { @@ -636,7 +639,7 @@ bool Pipe::IsSameImpl(const Type* that, IsSameCache*) const { std::string Pipe::str() const { std::ostringstream oss; - oss << "pipe(" << access_qualifier_ << ")"; + oss << "pipe(" << uint32_t(access_qualifier_) << ")"; return oss.str(); } diff --git a/3rdparty/spirv-tools/source/opt/types.h b/3rdparty/spirv-tools/source/opt/types.h index a92669e9f..1f329373b 100644 --- a/3rdparty/spirv-tools/source/opt/types.h +++ b/3rdparty/spirv-tools/source/opt/types.h @@ -61,6 +61,7 @@ class NamedBarrier; class AccelerationStructureNV; class CooperativeMatrixNV; class RayQueryKHR; +class HitObjectNV; // Abstract class for a SPIR-V type. It has a bunch of As() methods, // which is used as a way to probe the actual . @@ -100,6 +101,7 @@ class Type { kAccelerationStructureNV, kCooperativeMatrixNV, kRayQueryKHR, + kHitObjectNV, kLast }; @@ -196,6 +198,7 @@ class Type { DeclareCastMethod(AccelerationStructureNV) DeclareCastMethod(CooperativeMatrixNV) DeclareCastMethod(RayQueryKHR) + DeclareCastMethod(HitObjectNV) #undef DeclareCastMethod protected: @@ -302,9 +305,9 @@ class Matrix : public Type { class Image : public Type { public: - Image(Type* type, SpvDim dimen, uint32_t d, bool array, bool multisample, - uint32_t sampling, SpvImageFormat f, - SpvAccessQualifier qualifier = SpvAccessQualifierReadOnly); + Image(Type* type, spv::Dim dimen, uint32_t d, bool array, bool multisample, + uint32_t sampling, spv::ImageFormat f, + spv::AccessQualifier qualifier = spv::AccessQualifier::ReadOnly); Image(const Image&) = default; std::string str() const override; @@ -313,13 +316,13 @@ class Image : public Type { const Image* AsImage() const override { return this; } const Type* sampled_type() const { return sampled_type_; } - SpvDim dim() const { return dim_; } + spv::Dim dim() const { return dim_; } uint32_t depth() const { return depth_; } bool is_arrayed() const { return arrayed_; } bool is_multisampled() const { return ms_; } uint32_t sampled() const { return sampled_; } - SpvImageFormat format() const { return format_; } - SpvAccessQualifier access_qualifier() const { return access_qualifier_; } + spv::ImageFormat format() const { return format_; } + spv::AccessQualifier access_qualifier() const { return access_qualifier_; } size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override; @@ -327,13 +330,13 @@ class Image : public Type { bool IsSameImpl(const Type* that, IsSameCache*) const override; Type* sampled_type_; - SpvDim dim_; + spv::Dim dim_; uint32_t depth_; bool arrayed_; bool ms_; uint32_t sampled_; - SpvImageFormat format_; - SpvAccessQualifier access_qualifier_; + spv::ImageFormat format_; + spv::AccessQualifier access_qualifier_; }; class SampledImage : public Type { @@ -491,12 +494,12 @@ class Opaque : public Type { class Pointer : public Type { public: - Pointer(const Type* pointee, SpvStorageClass sc); + Pointer(const Type* pointee, spv::StorageClass sc); Pointer(const Pointer&) = default; std::string str() const override; const Type* pointee_type() const { return pointee_type_; } - SpvStorageClass storage_class() const { return storage_class_; } + spv::StorageClass storage_class() const { return storage_class_; } Pointer* AsPointer() override { return this; } const Pointer* AsPointer() const override { return this; } @@ -509,7 +512,7 @@ class Pointer : public Type { bool IsSameImpl(const Type* that, IsSameCache*) const override; const Type* pointee_type_; - SpvStorageClass storage_class_; + spv::StorageClass storage_class_; }; class Function : public Type { @@ -540,7 +543,7 @@ class Function : public Type { class Pipe : public Type { public: - Pipe(SpvAccessQualifier qualifier) + Pipe(spv::AccessQualifier qualifier) : Type(kPipe), access_qualifier_(qualifier) {} Pipe(const Pipe&) = default; @@ -549,19 +552,19 @@ class Pipe : public Type { Pipe* AsPipe() override { return this; } const Pipe* AsPipe() const override { return this; } - SpvAccessQualifier access_qualifier() const { return access_qualifier_; } + spv::AccessQualifier access_qualifier() const { return access_qualifier_; } size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override; private: bool IsSameImpl(const Type* that, IsSameCache*) const override; - SpvAccessQualifier access_qualifier_; + spv::AccessQualifier access_qualifier_; }; class ForwardPointer : public Type { public: - ForwardPointer(uint32_t id, SpvStorageClass sc) + ForwardPointer(uint32_t id, spv::StorageClass sc) : Type(kForwardPointer), target_id_(id), storage_class_(sc), @@ -570,7 +573,7 @@ class ForwardPointer : public Type { uint32_t target_id() const { return target_id_; } void SetTargetPointer(const Pointer* pointer) { pointer_ = pointer; } - SpvStorageClass storage_class() const { return storage_class_; } + spv::StorageClass storage_class() const { return storage_class_; } const Pointer* target_pointer() const { return pointer_; } std::string str() const override; @@ -584,7 +587,7 @@ class ForwardPointer : public Type { bool IsSameImpl(const Type* that, IsSameCache*) const override; uint32_t target_id_; - SpvStorageClass storage_class_; + spv::StorageClass storage_class_; const Pointer* pointer_; }; @@ -648,6 +651,7 @@ DefineParameterlessType(PipeStorage, pipe_storage); DefineParameterlessType(NamedBarrier, named_barrier); DefineParameterlessType(AccelerationStructureNV, accelerationStructureNV); DefineParameterlessType(RayQueryKHR, rayQueryKHR); +DefineParameterlessType(HitObjectNV, hitObjectNV); #undef DefineParameterlessType } // namespace analysis diff --git a/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp b/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp index 6bfa11a5b..f774aa6b6 100644 --- a/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp @@ -25,7 +25,6 @@ namespace spvtools { namespace opt { - namespace { // The trie that stores a bunch of result ids and, for a given instruction, @@ -103,7 +102,7 @@ class ResultIdTrie { std::unique_ptr root_; // The root node of the trie. }; -} // anonymous namespace +} // namespace Pass::Status UnifyConstantPass::Process() { bool modified = false; @@ -139,12 +138,12 @@ Pass::Status UnifyConstantPass::Process() { // processing is up to a descendant. This makes comparing the key array // always valid for judging duplication. switch (inst->opcode()) { - case SpvOp::SpvOpConstantTrue: - case SpvOp::SpvOpConstantFalse: - case SpvOp::SpvOpConstant: - case SpvOp::SpvOpConstantNull: - case SpvOp::SpvOpConstantSampler: - case SpvOp::SpvOpConstantComposite: + case spv::Op::OpConstantTrue: + case spv::Op::OpConstantFalse: + case spv::Op::OpConstant: + case spv::Op::OpConstantNull: + case spv::Op::OpConstantSampler: + case spv::Op::OpConstantComposite: // Only spec constants defined with OpSpecConstantOp and // OpSpecConstantComposite should be processed in this pass. Spec // constants defined with OpSpecConstant{|True|False} are decorated with @@ -154,8 +153,8 @@ Pass::Status UnifyConstantPass::Process() { // unique. When all the operands/components are the same between two // OpSpecConstant{Op|Composite} results, their result values must be the // same so are unifiable. - case SpvOp::SpvOpSpecConstantOp: - case SpvOp::SpvOpSpecConstantComposite: { + case spv::Op::OpSpecConstantOp: + case spv::Op::OpSpecConstantComposite: { uint32_t id = defined_constants.LookupEquivalentResultFor(*inst); if (id != inst->result_id()) { // The constant is a duplicated one, use the cached constant to diff --git a/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp b/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp index 9d6a5bceb..1b439a6ef 100644 --- a/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp +++ b/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp @@ -28,14 +28,16 @@ namespace opt { Pass::Status UpgradeMemoryModel::Process() { // TODO: This pass needs changes to support cooperative matrices. if (context()->get_feature_mgr()->HasCapability( - SpvCapabilityCooperativeMatrixNV)) { + spv::Capability::CooperativeMatrixNV)) { return Pass::Status::SuccessWithoutChange; } // Only update Logical GLSL450 to Logical VulkanKHR. Instruction* memory_model = get_module()->GetMemoryModel(); - if (memory_model->GetSingleWordInOperand(0u) != SpvAddressingModelLogical || - memory_model->GetSingleWordInOperand(1u) != SpvMemoryModelGLSL450) { + if (memory_model->GetSingleWordInOperand(0u) != + uint32_t(spv::AddressingModel::Logical) || + memory_model->GetSingleWordInOperand(1u) != + uint32_t(spv::MemoryModel::GLSL450)) { return Pass::Status::SuccessWithoutChange; } @@ -55,16 +57,17 @@ void UpgradeMemoryModel::UpgradeMemoryModelInstruction() { // 3. Modify the memory model. Instruction* memory_model = get_module()->GetMemoryModel(); context()->AddCapability(MakeUnique( - context(), SpvOpCapability, 0, 0, + context(), spv::Op::OpCapability, 0, 0, std::initializer_list{ - {SPV_OPERAND_TYPE_CAPABILITY, {SpvCapabilityVulkanMemoryModelKHR}}})); + {SPV_OPERAND_TYPE_CAPABILITY, + {uint32_t(spv::Capability::VulkanMemoryModelKHR)}}})); const std::string extension = "SPV_KHR_vulkan_memory_model"; std::vector words = spvtools::utils::MakeVector(extension); context()->AddExtension( - MakeUnique(context(), SpvOpExtension, 0, 0, + MakeUnique(context(), spv::Op::OpExtension, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_LITERAL_STRING, words}})); - memory_model->SetInOperand(1u, {SpvMemoryModelVulkanKHR}); + memory_model->SetInOperand(1u, {uint32_t(spv::MemoryModel::VulkanKHR)}); } void UpgradeMemoryModel::UpgradeInstructions() { @@ -79,7 +82,7 @@ void UpgradeMemoryModel::UpgradeInstructions() { // In SPIR-V 1.4 or later, normalize OpCopyMemory* access operands. for (auto& func : *get_module()) { func.ForEachInst([this](Instruction* inst) { - if (inst->opcode() == SpvOpExtInst) { + if (inst->opcode() == spv::Op::OpExtInst) { auto ext_inst = inst->GetSingleWordInOperand(1u); if (ext_inst == GLSLstd450Modf || ext_inst == GLSLstd450Frexp) { auto import = @@ -89,9 +92,10 @@ void UpgradeMemoryModel::UpgradeInstructions() { } } } else if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { - if (inst->opcode() == SpvOpCopyMemory || - inst->opcode() == SpvOpCopyMemorySized) { - uint32_t start_operand = inst->opcode() == SpvOpCopyMemory ? 2u : 3u; + if (inst->opcode() == spv::Op::OpCopyMemory || + inst->opcode() == spv::Op::OpCopyMemorySized) { + uint32_t start_operand = + inst->opcode() == spv::Op::OpCopyMemory ? 2u : 3u; if (inst->NumInOperands() > start_operand) { auto num_access_words = MemoryAccessNumWords( inst->GetSingleWordInOperand(start_operand)); @@ -105,10 +109,10 @@ void UpgradeMemoryModel::UpgradeInstructions() { } } else { // Add two memory access operands. - inst->AddOperand( - {SPV_OPERAND_TYPE_MEMORY_ACCESS, {SpvMemoryAccessMaskNone}}); - inst->AddOperand( - {SPV_OPERAND_TYPE_MEMORY_ACCESS, {SpvMemoryAccessMaskNone}}); + inst->AddOperand({SPV_OPERAND_TYPE_MEMORY_ACCESS, + {uint32_t(spv::MemoryAccessMask::MaskNone)}}); + inst->AddOperand({SPV_OPERAND_TYPE_MEMORY_ACCESS, + {uint32_t(spv::MemoryAccessMask::MaskNone)}}); } } } @@ -129,23 +133,23 @@ void UpgradeMemoryModel::UpgradeMemoryAndImages() { bool dst_coherent = false; bool dst_volatile = false; uint32_t start_operand = 0u; - SpvScope scope = SpvScopeQueueFamilyKHR; - SpvScope src_scope = SpvScopeQueueFamilyKHR; - SpvScope dst_scope = SpvScopeQueueFamilyKHR; + spv::Scope scope = spv::Scope::QueueFamilyKHR; + spv::Scope src_scope = spv::Scope::QueueFamilyKHR; + spv::Scope dst_scope = spv::Scope::QueueFamilyKHR; switch (inst->opcode()) { - case SpvOpLoad: - case SpvOpStore: + case spv::Op::OpLoad: + case spv::Op::OpStore: std::tie(is_coherent, is_volatile, scope) = GetInstructionAttributes(inst->GetSingleWordInOperand(0u)); break; - case SpvOpImageRead: - case SpvOpImageSparseRead: - case SpvOpImageWrite: + case spv::Op::OpImageRead: + case spv::Op::OpImageSparseRead: + case spv::Op::OpImageWrite: std::tie(is_coherent, is_volatile, scope) = GetInstructionAttributes(inst->GetSingleWordInOperand(0u)); break; - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: std::tie(dst_coherent, dst_volatile, dst_scope) = GetInstructionAttributes(inst->GetSingleWordInOperand(0u)); std::tie(src_coherent, src_volatile, src_scope) = @@ -156,17 +160,17 @@ void UpgradeMemoryModel::UpgradeMemoryAndImages() { } switch (inst->opcode()) { - case SpvOpLoad: + case spv::Op::OpLoad: UpgradeFlags(inst, 1u, is_coherent, is_volatile, kVisibility, kMemory); break; - case SpvOpStore: + case spv::Op::OpStore: UpgradeFlags(inst, 2u, is_coherent, is_volatile, kAvailability, kMemory); break; - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: - start_operand = inst->opcode() == SpvOpCopyMemory ? 2u : 3u; + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: + start_operand = inst->opcode() == spv::Op::OpCopyMemory ? 2u : 3u; if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { // There are guaranteed to be two memory access operands at this // point so treat source and target separately. @@ -183,11 +187,11 @@ void UpgradeMemoryModel::UpgradeMemoryAndImages() { kVisibility, kMemory); } break; - case SpvOpImageRead: - case SpvOpImageSparseRead: + case spv::Op::OpImageRead: + case spv::Op::OpImageSparseRead: UpgradeFlags(inst, 2u, is_coherent, is_volatile, kVisibility, kImage); break; - case SpvOpImageWrite: + case spv::Op::OpImageWrite: UpgradeFlags(inst, 3u, is_coherent, is_volatile, kAvailability, kImage); break; @@ -205,7 +209,7 @@ void UpgradeMemoryModel::UpgradeMemoryAndImages() { // There are two memory access operands. The first is for the target and // the second is for the source. if (dst_coherent || src_coherent) { - start_operand = inst->opcode() == SpvOpCopyMemory ? 2u : 3u; + start_operand = inst->opcode() == spv::Op::OpCopyMemory ? 2u : 3u; std::vector new_operands; uint32_t num_access_words = MemoryAccessNumWords(inst->GetSingleWordInOperand(start_operand)); @@ -255,13 +259,13 @@ void UpgradeMemoryModel::UpgradeAtomics() { if (spvOpcodeIsAtomicOp(inst->opcode())) { bool unused_coherent = false; bool is_volatile = false; - SpvScope unused_scope = SpvScopeQueueFamilyKHR; + spv::Scope unused_scope = spv::Scope::QueueFamilyKHR; std::tie(unused_coherent, is_volatile, unused_scope) = GetInstructionAttributes(inst->GetSingleWordInOperand(0)); UpgradeSemantics(inst, 2u, is_volatile); - if (inst->opcode() == SpvOpAtomicCompareExchange || - inst->opcode() == SpvOpAtomicCompareExchangeWeak) { + if (inst->opcode() == spv::Op::OpAtomicCompareExchange || + inst->opcode() == spv::Op::OpAtomicCompareExchangeWeak) { UpgradeSemantics(inst, 3u, is_volatile); } } @@ -286,14 +290,14 @@ void UpgradeMemoryModel::UpgradeSemantics(Instruction* inst, value = constant->GetU32(); } - value |= SpvMemorySemanticsVolatileMask; + value |= uint32_t(spv::MemorySemanticsMask::Volatile); auto new_constant = context()->get_constant_mgr()->GetConstant(type, {value}); auto new_semantics = context()->get_constant_mgr()->GetDefiningInstruction(new_constant); inst->SetInOperand(in_operand, {new_semantics->result_id()}); } -std::tuple UpgradeMemoryModel::GetInstructionAttributes( +std::tuple UpgradeMemoryModel::GetInstructionAttributes( uint32_t id) { // |id| is a pointer used in a memory/image instruction. Need to determine if // that pointer points to volatile or coherent memory. Workgroup storage @@ -302,8 +306,8 @@ std::tuple UpgradeMemoryModel::GetInstructionAttributes( Instruction* inst = context()->get_def_use_mgr()->GetDef(id); analysis::Type* type = context()->get_type_mgr()->GetType(inst->type_id()); if (type->AsPointer() && - type->AsPointer()->storage_class() == SpvStorageClassWorkgroup) { - return std::make_tuple(true, false, SpvScopeWorkgroup); + type->AsPointer()->storage_class() == spv::StorageClass::Workgroup) { + return std::make_tuple(true, false, spv::Scope::Workgroup); } bool is_coherent = false; @@ -313,7 +317,7 @@ std::tuple UpgradeMemoryModel::GetInstructionAttributes( TraceInstruction(context()->get_def_use_mgr()->GetDef(id), std::vector(), &visited); - return std::make_tuple(is_coherent, is_volatile, SpvScopeQueueFamilyKHR); + return std::make_tuple(is_coherent, is_volatile, spv::Scope::QueueFamilyKHR); } std::pair UpgradeMemoryModel::TraceInstruction( @@ -336,10 +340,10 @@ std::pair UpgradeMemoryModel::TraceInstruction( bool is_coherent = false; bool is_volatile = false; switch (inst->opcode()) { - case SpvOpVariable: - case SpvOpFunctionParameter: - is_coherent |= HasDecoration(inst, 0, SpvDecorationCoherent); - is_volatile |= HasDecoration(inst, 0, SpvDecorationVolatile); + case spv::Op::OpVariable: + case spv::Op::OpFunctionParameter: + is_coherent |= HasDecoration(inst, 0, spv::Decoration::Coherent); + is_volatile |= HasDecoration(inst, 0, spv::Decoration::Volatile); if (!is_coherent || !is_volatile) { bool type_coherent = false; bool type_volatile = false; @@ -349,14 +353,14 @@ std::pair UpgradeMemoryModel::TraceInstruction( is_volatile |= type_volatile; } break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: // Store indices in reverse order. for (uint32_t i = inst->NumInOperands() - 1; i > 0; --i) { indices.push_back(inst->GetSingleWordInOperand(i)); } break; - case SpvOpPtrAccessChain: + case spv::Op::OpPtrAccessChain: // Store indices in reverse order. Skip the |Element| operand. for (uint32_t i = inst->NumInOperands() - 1; i > 1; --i) { indices.push_back(inst->GetSingleWordInOperand(i)); @@ -375,8 +379,8 @@ std::pair UpgradeMemoryModel::TraceInstruction( // Variables and function parameters are sources. Continue searching until we // reach them. - if (inst->opcode() != SpvOpVariable && - inst->opcode() != SpvOpFunctionParameter) { + if (inst->opcode() != spv::Op::OpVariable && + inst->opcode() != spv::Op::OpFunctionParameter) { inst->ForEachInId([this, &is_coherent, &is_volatile, &indices, &visited](const uint32_t* id_ptr) { Instruction* op_inst = context()->get_def_use_mgr()->GetDef(*id_ptr); @@ -404,24 +408,24 @@ std::pair UpgradeMemoryModel::CheckType( bool is_coherent = false; bool is_volatile = false; Instruction* type_inst = context()->get_def_use_mgr()->GetDef(type_id); - assert(type_inst->opcode() == SpvOpTypePointer); + assert(type_inst->opcode() == spv::Op::OpTypePointer); Instruction* element_inst = context()->get_def_use_mgr()->GetDef( type_inst->GetSingleWordInOperand(1u)); for (int i = (int)indices.size() - 1; i >= 0; --i) { if (is_coherent && is_volatile) break; - if (element_inst->opcode() == SpvOpTypePointer) { + if (element_inst->opcode() == spv::Op::OpTypePointer) { element_inst = context()->get_def_use_mgr()->GetDef( element_inst->GetSingleWordInOperand(1u)); - } else if (element_inst->opcode() == SpvOpTypeStruct) { + } else if (element_inst->opcode() == spv::Op::OpTypeStruct) { uint32_t index = indices.at(i); Instruction* index_inst = context()->get_def_use_mgr()->GetDef(index); - assert(index_inst->opcode() == SpvOpConstant); + assert(index_inst->opcode() == spv::Op::OpConstant); uint64_t value = GetIndexValue(index_inst); is_coherent |= HasDecoration(element_inst, static_cast(value), - SpvDecorationCoherent); + spv::Decoration::Coherent); is_volatile |= HasDecoration(element_inst, static_cast(value), - SpvDecorationVolatile); + spv::Decoration::Volatile); element_inst = context()->get_def_use_mgr()->GetDef( element_inst->GetSingleWordInOperand(static_cast(value))); } else { @@ -457,13 +461,13 @@ std::pair UpgradeMemoryModel::CheckAllTypes( if (!visited.insert(def).second) continue; - if (def->opcode() == SpvOpTypeStruct) { + if (def->opcode() == spv::Op::OpTypeStruct) { // Any member decorated with coherent and/or volatile is enough to have // the related operation be flagged as coherent and/or volatile. is_coherent |= HasDecoration(def, std::numeric_limits::max(), - SpvDecorationCoherent); + spv::Decoration::Coherent); is_volatile |= HasDecoration(def, std::numeric_limits::max(), - SpvDecorationVolatile); + spv::Decoration::Volatile); if (is_coherent && is_volatile) return std::make_pair(is_coherent, is_volatile); @@ -475,7 +479,7 @@ std::pair UpgradeMemoryModel::CheckAllTypes( } else if (spvOpcodeIsComposite(def->opcode())) { stack.push_back(context()->get_def_use_mgr()->GetDef( def->GetSingleWordInOperand(0u))); - } else if (def->opcode() == SpvOpTypePointer) { + } else if (def->opcode() == spv::Op::OpTypePointer) { stack.push_back(context()->get_def_use_mgr()->GetDef( def->GetSingleWordInOperand(1u))); } @@ -504,14 +508,15 @@ uint64_t UpgradeMemoryModel::GetIndexValue(Instruction* index_inst) { } bool UpgradeMemoryModel::HasDecoration(const Instruction* inst, uint32_t value, - SpvDecoration decoration) { + spv::Decoration decoration) { // If the iteration was terminated early then an appropriate decoration was // found. return !context()->get_decoration_mgr()->WhileEachDecoration( - inst->result_id(), decoration, [value](const Instruction& i) { - if (i.opcode() == SpvOpDecorate || i.opcode() == SpvOpDecorateId) { + inst->result_id(), (uint32_t)decoration, [value](const Instruction& i) { + if (i.opcode() == spv::Op::OpDecorate || + i.opcode() == spv::Op::OpDecorateId) { return false; - } else if (i.opcode() == SpvOpMemberDecorate) { + } else if (i.opcode() == spv::Op::OpMemberDecorate) { if (value == i.GetSingleWordInOperand(1u) || value == std::numeric_limits::max()) return false; @@ -533,27 +538,27 @@ void UpgradeMemoryModel::UpgradeFlags(Instruction* inst, uint32_t in_operand, } if (is_coherent) { if (inst_type == kMemory) { - flags |= SpvMemoryAccessNonPrivatePointerKHRMask; + flags |= uint32_t(spv::MemoryAccessMask::NonPrivatePointerKHR); if (operation_type == kVisibility) { - flags |= SpvMemoryAccessMakePointerVisibleKHRMask; + flags |= uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR); } else { - flags |= SpvMemoryAccessMakePointerAvailableKHRMask; + flags |= uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR); } } else { - flags |= SpvImageOperandsNonPrivateTexelKHRMask; + flags |= uint32_t(spv::ImageOperandsMask::NonPrivateTexelKHR); if (operation_type == kVisibility) { - flags |= SpvImageOperandsMakeTexelVisibleKHRMask; + flags |= uint32_t(spv::ImageOperandsMask::MakeTexelVisibleKHR); } else { - flags |= SpvImageOperandsMakeTexelAvailableKHRMask; + flags |= uint32_t(spv::ImageOperandsMask::MakeTexelAvailableKHR); } } } if (is_volatile) { if (inst_type == kMemory) { - flags |= SpvMemoryAccessVolatileMask; + flags |= uint32_t(spv::MemoryAccessMask::Volatile); } else { - flags |= SpvImageOperandsVolatileTexelKHRMask; + flags |= uint32_t(spv::ImageOperandsMask::VolatileTexelKHR); } } @@ -566,7 +571,7 @@ void UpgradeMemoryModel::UpgradeFlags(Instruction* inst, uint32_t in_operand, } } -uint32_t UpgradeMemoryModel::GetScopeConstant(SpvScope scope) { +uint32_t UpgradeMemoryModel::GetScopeConstant(spv::Scope scope) { analysis::Integer int_ty(32, false); uint32_t int_id = context()->get_type_mgr()->GetTypeInstruction(&int_ty); const analysis::Constant* constant = @@ -587,15 +592,19 @@ void UpgradeMemoryModel::CleanupDecorations() { context()->get_decoration_mgr()->RemoveDecorationsFrom( inst->result_id(), [](const Instruction& dec) { switch (dec.opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: - if (dec.GetSingleWordInOperand(1u) == SpvDecorationCoherent || - dec.GetSingleWordInOperand(1u) == SpvDecorationVolatile) + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: + if (spv::Decoration(dec.GetSingleWordInOperand(1u)) == + spv::Decoration::Coherent || + spv::Decoration(dec.GetSingleWordInOperand(1u)) == + spv::Decoration::Volatile) return true; break; - case SpvOpMemberDecorate: - if (dec.GetSingleWordInOperand(2u) == SpvDecorationCoherent || - dec.GetSingleWordInOperand(2u) == SpvDecorationVolatile) + case spv::Op::OpMemberDecorate: + if (spv::Decoration(dec.GetSingleWordInOperand(2u)) == + spv::Decoration::Coherent || + spv::Decoration(dec.GetSingleWordInOperand(2u)) == + spv::Decoration::Volatile) return true; break; default: @@ -616,7 +625,7 @@ void UpgradeMemoryModel::UpgradeBarriers() { for (auto& block : *function) { block.ForEachInst([this, &barriers, &operates_on_output](Instruction* inst) { - if (inst->opcode() == SpvOpControlBarrier) { + if (inst->opcode() == spv::Op::OpControlBarrier) { barriers.push_back(inst); } else if (!operates_on_output) { // This instruction operates on output storage class if it is a @@ -625,7 +634,7 @@ void UpgradeMemoryModel::UpgradeBarriers() { analysis::Type* type = context()->get_type_mgr()->GetType(inst->type_id()); if (type && type->AsPointer() && - type->AsPointer()->storage_class() == SpvStorageClassOutput) { + type->AsPointer()->storage_class() == spv::StorageClass::Output) { operates_on_output = true; return; } @@ -635,7 +644,8 @@ void UpgradeMemoryModel::UpgradeBarriers() { analysis::Type* op_type = context()->get_type_mgr()->GetType(op_inst->type_id()); if (op_type && op_type->AsPointer() && - op_type->AsPointer()->storage_class() == SpvStorageClassOutput) + op_type->AsPointer()->storage_class() == + spv::StorageClass::Output) operates_on_output = true; }); } @@ -646,7 +656,8 @@ void UpgradeMemoryModel::UpgradeBarriers() { std::queue roots; for (auto& e : get_module()->entry_points()) - if (e.GetSingleWordInOperand(0u) == SpvExecutionModelTessellationControl) { + if (spv::ExecutionModel(e.GetSingleWordInOperand(0u)) == + spv::ExecutionModel::TessellationControl) { roots.push(e.GetSingleWordInOperand(1u)); if (context()->ProcessCallTreeFromRoots(CollectBarriers, &roots)) { for (auto barrier : barriers) { @@ -659,8 +670,9 @@ void UpgradeMemoryModel::UpgradeBarriers() { uint64_t semantics_value = GetIndexValue(semantics_inst); const analysis::Constant* constant = context()->get_constant_mgr()->GetConstant( - semantics_type, {static_cast(semantics_value) | - SpvMemorySemanticsOutputMemoryKHRMask}); + semantics_type, + {static_cast(semantics_value) | + uint32_t(spv::MemorySemanticsMask::OutputMemoryKHR)}); barrier->SetInOperand(2u, {context() ->get_constant_mgr() ->GetDefiningInstruction(constant) @@ -680,15 +692,15 @@ void UpgradeMemoryModel::UpgradeMemoryScope() { // * Workgroup ops (e.g. async_copy) have at most workgroup scope. if (spvOpcodeIsAtomicOp(inst->opcode())) { if (IsDeviceScope(inst->GetSingleWordInOperand(1))) { - inst->SetInOperand(1, {GetScopeConstant(SpvScopeQueueFamilyKHR)}); + inst->SetInOperand(1, {GetScopeConstant(spv::Scope::QueueFamilyKHR)}); } - } else if (inst->opcode() == SpvOpControlBarrier) { + } else if (inst->opcode() == spv::Op::OpControlBarrier) { if (IsDeviceScope(inst->GetSingleWordInOperand(1))) { - inst->SetInOperand(1, {GetScopeConstant(SpvScopeQueueFamilyKHR)}); + inst->SetInOperand(1, {GetScopeConstant(spv::Scope::QueueFamilyKHR)}); } - } else if (inst->opcode() == SpvOpMemoryBarrier) { + } else if (inst->opcode() == spv::Op::OpMemoryBarrier) { if (IsDeviceScope(inst->GetSingleWordInOperand(0))) { - inst->SetInOperand(0, {GetScopeConstant(SpvScopeQueueFamilyKHR)}); + inst->SetInOperand(0, {GetScopeConstant(spv::Scope::QueueFamilyKHR)}); } } }); @@ -704,14 +716,14 @@ bool UpgradeMemoryModel::IsDeviceScope(uint32_t scope_id) { assert(type->width() == 32 || type->width() == 64); if (type->width() == 32) { if (type->IsSigned()) - return static_cast(constant->GetS32()) == SpvScopeDevice; + return static_cast(constant->GetS32()) == spv::Scope::Device; else - return static_cast(constant->GetU32()) == SpvScopeDevice; + return static_cast(constant->GetU32()) == spv::Scope::Device; } else { if (type->IsSigned()) - return static_cast(constant->GetS64()) == SpvScopeDevice; + return static_cast(constant->GetS64()) == spv::Scope::Device; else - return static_cast(constant->GetU64()) == SpvScopeDevice; + return static_cast(constant->GetU64()) == spv::Scope::Device; } assert(false); @@ -758,9 +770,9 @@ void UpgradeMemoryModel::UpgradeExtInst(Instruction* ext_inst) { uint32_t UpgradeMemoryModel::MemoryAccessNumWords(uint32_t mask) { uint32_t result = 1; - if (mask & SpvMemoryAccessAlignedMask) ++result; - if (mask & SpvMemoryAccessMakePointerAvailableKHRMask) ++result; - if (mask & SpvMemoryAccessMakePointerVisibleKHRMask) ++result; + if (mask & uint32_t(spv::MemoryAccessMask::Aligned)) ++result; + if (mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR)) ++result; + if (mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)) ++result; return result; } diff --git a/3rdparty/spirv-tools/source/opt/upgrade_memory_model.h b/3rdparty/spirv-tools/source/opt/upgrade_memory_model.h index f75304ed0..489436b6d 100644 --- a/3rdparty/spirv-tools/source/opt/upgrade_memory_model.h +++ b/3rdparty/spirv-tools/source/opt/upgrade_memory_model.h @@ -71,7 +71,7 @@ class UpgradeMemoryModel : public Pass { void UpgradeAtomics(); // Returns whether |id| is coherent and/or volatile. - std::tuple GetInstructionAttributes(uint32_t id); + std::tuple GetInstructionAttributes(uint32_t id); // Traces |inst| to determine if it is coherent and/or volatile. // |indices| tracks the access chain indices seen so far. @@ -84,7 +84,7 @@ class UpgradeMemoryModel : public Pass { // match the index or |value| must be a maximum allowable value. The max // value allows any element to match. bool HasDecoration(const Instruction* inst, uint32_t value, - SpvDecoration decoration); + spv::Decoration decoration); // Returns whether |type_id| indexed via |indices| is coherent and/or // volatile. @@ -108,7 +108,7 @@ class UpgradeMemoryModel : public Pass { bool is_volatile); // Returns the result id for a constant for |scope|. - uint32_t GetScopeConstant(SpvScope scope); + uint32_t GetScopeConstant(spv::Scope scope); // Returns the value of |index_inst|. |index_inst| must be an OpConstant of // integer type.g @@ -127,7 +127,7 @@ class UpgradeMemoryModel : public Pass { // scope. void UpgradeMemoryScope(); - // Returns true if |scope_id| is SpvScopeDevice. + // Returns true if |scope_id| is spv::Scope::Device. bool IsDeviceScope(uint32_t scope_id); // Upgrades GLSL.std.450 modf and frexp. Both instructions are replaced with diff --git a/3rdparty/spirv-tools/source/opt/value_number_table.cpp b/3rdparty/spirv-tools/source/opt/value_number_table.cpp index 5271e3fe9..743dc52bb 100644 --- a/3rdparty/spirv-tools/source/opt/value_number_table.cpp +++ b/3rdparty/spirv-tools/source/opt/value_number_table.cpp @@ -57,9 +57,9 @@ uint32_t ValueNumberTable::AssignValueNumber(Instruction* inst) { } switch (inst->opcode()) { - case SpvOpSampledImage: - case SpvOpImage: - case SpvOpVariable: + case spv::Op::OpSampledImage: + case spv::Op::OpImage: + case spv::Op::OpVariable: value = TakeNextValueNumber(); id_to_value_[inst->result_id()] = value; return value; @@ -82,7 +82,7 @@ uint32_t ValueNumberTable::AssignValueNumber(Instruction* inst) { analysis::DecorationManager* dec_mgr = context()->get_decoration_mgr(); // When we copy an object, the value numbers should be the same. - if (inst->opcode() == SpvOpCopyObject && + if (inst->opcode() == spv::Op::OpCopyObject && dec_mgr->HaveTheSameDecorations(inst->result_id(), inst->GetSingleWordInOperand(0))) { value = GetValueNumber(inst->GetSingleWordInOperand(0)); @@ -94,7 +94,7 @@ uint32_t ValueNumberTable::AssignValueNumber(Instruction* inst) { // Phi nodes are a type of copy. If all of the inputs have the same value // number, then we can assign the result of the phi the same value number. - if (inst->opcode() == SpvOpPhi && inst->NumInOperands() > 0 && + if (inst->opcode() == spv::Op::OpPhi && inst->NumInOperands() > 0 && dec_mgr->HaveTheSameDecorations(inst->result_id(), inst->GetSingleWordInOperand(0))) { value = GetValueNumber(inst->GetSingleWordInOperand(0)); @@ -226,7 +226,7 @@ std::size_t ValueTableHash::operator()(const Instruction& inst) const { // instructions that are the same except for the result to hash to the // same value. std::u32string h; - h.push_back(inst.opcode()); + h.push_back(uint32_t(inst.opcode())); h.push_back(inst.type_id()); for (uint32_t i = 0; i < inst.NumInOperands(); ++i) { const auto& opnd = inst.GetInOperand(i); diff --git a/3rdparty/spirv-tools/source/opt/vector_dce.cpp b/3rdparty/spirv-tools/source/opt/vector_dce.cpp index 28d94a076..1e8d255dd 100644 --- a/3rdparty/spirv-tools/source/opt/vector_dce.cpp +++ b/3rdparty/spirv-tools/source/opt/vector_dce.cpp @@ -19,11 +19,9 @@ namespace spvtools { namespace opt { namespace { - -const uint32_t kExtractCompositeIdInIdx = 0; -const uint32_t kInsertObjectIdInIdx = 0; -const uint32_t kInsertCompositeIdInIdx = 1; - +constexpr uint32_t kExtractCompositeIdInIdx = 0; +constexpr uint32_t kInsertObjectIdInIdx = 0; +constexpr uint32_t kInsertCompositeIdInIdx = 1; } // namespace Pass::Status VectorDCE::Process() { @@ -68,17 +66,17 @@ void VectorDCE::FindLiveComponents(Function* function, Instruction* current_inst = current_item.instruction; switch (current_inst->opcode()) { - case SpvOpCompositeExtract: + case spv::Op::OpCompositeExtract: MarkExtractUseAsLive(current_inst, current_item.components, live_components, &work_list); break; - case SpvOpCompositeInsert: + case spv::Op::OpCompositeInsert: MarkInsertUsesAsLive(current_item, live_components, &work_list); break; - case SpvOpVectorShuffle: + case spv::Op::OpVectorShuffle: MarkVectorShuffleUsesAsLive(current_item, live_components, &work_list); break; - case SpvOpCompositeConstruct: + case spv::Op::OpCompositeConstruct: MarkCompositeContructUsesAsLive(current_item, live_components, &work_list); break; @@ -347,11 +345,11 @@ bool VectorDCE::RewriteInstructions( } switch (current_inst->opcode()) { - case SpvOpCompositeInsert: + case spv::Op::OpCompositeInsert: modified |= RewriteInsertInstruction( current_inst, live_component->second, &dead_dbg_value); break; - case SpvOpCompositeConstruct: + case spv::Op::OpCompositeConstruct: // TODO: The members that are not live can be replaced by an undef // or constant. This will remove uses of those values, and possibly // create opportunities for ADCE. diff --git a/3rdparty/spirv-tools/source/opt/workaround1209.cpp b/3rdparty/spirv-tools/source/opt/workaround1209.cpp index d6e9d2cf7..0cf954afd 100644 --- a/3rdparty/spirv-tools/source/opt/workaround1209.cpp +++ b/3rdparty/spirv-tools/source/opt/workaround1209.cpp @@ -43,13 +43,13 @@ bool Workaround1209::RemoveOpUnreachableInLoops() { loop_merges.pop(); } - if (bb->tail()->opcode() == SpvOpUnreachable) { + if (bb->tail()->opcode() == spv::Op::OpUnreachable) { if (!loop_merges.empty()) { // We found an OpUnreachable inside a loop. // Replace it with an unconditional branch to the loop merge. context()->KillInst(&*bb->tail()); std::unique_ptr new_branch( - new Instruction(context(), SpvOpBranch, 0, 0, + new Instruction(context(), spv::Op::OpBranch, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {loop_merges.top()}}})); context()->AnalyzeDefUse(&*new_branch); diff --git a/3rdparty/spirv-tools/source/opt/wrap_opkill.cpp b/3rdparty/spirv-tools/source/opt/wrap_opkill.cpp index 51432a73b..c0c6d6221 100644 --- a/3rdparty/spirv-tools/source/opt/wrap_opkill.cpp +++ b/3rdparty/spirv-tools/source/opt/wrap_opkill.cpp @@ -28,7 +28,8 @@ Pass::Status WrapOpKill::Process() { Function* func = context()->GetFunction(func_id); bool successful = func->WhileEachInst([this, &modified](Instruction* inst) { const auto opcode = inst->opcode(); - if ((opcode == SpvOpKill) || (opcode == SpvOpTerminateInvocation)) { + if ((opcode == spv::Op::OpKill) || + (opcode == spv::Op::OpTerminateInvocation)) { modified = true; if (!ReplaceWithFunctionCall(inst)) { return false; @@ -56,8 +57,8 @@ Pass::Status WrapOpKill::Process() { } bool WrapOpKill::ReplaceWithFunctionCall(Instruction* inst) { - assert((inst->opcode() == SpvOpKill || - inst->opcode() == SpvOpTerminateInvocation) && + assert((inst->opcode() == spv::Op::OpKill || + inst->opcode() == spv::Op::OpTerminateInvocation) && "|inst| must be an OpKill or OpTerminateInvocation instruction."); InstructionBuilder ir_builder( context(), inst, @@ -76,14 +77,15 @@ bool WrapOpKill::ReplaceWithFunctionCall(Instruction* inst) { Instruction* return_inst = nullptr; uint32_t return_type_id = GetOwningFunctionsReturnType(inst); if (return_type_id != GetVoidTypeId()) { - Instruction* undef = ir_builder.AddNullaryOp(return_type_id, SpvOpUndef); + Instruction* undef = + ir_builder.AddNullaryOp(return_type_id, spv::Op::OpUndef); if (undef == nullptr) { return false; } return_inst = - ir_builder.AddUnaryOp(0, SpvOpReturnValue, undef->result_id()); + ir_builder.AddUnaryOp(0, spv::Op::OpReturnValue, undef->result_id()); } else { - return_inst = ir_builder.AddNullaryOp(0, SpvOpReturn); + return_inst = ir_builder.AddNullaryOp(0, spv::Op::OpReturn); } if (return_inst == nullptr) { @@ -115,13 +117,13 @@ uint32_t WrapOpKill::GetVoidFunctionTypeId() { return type_mgr->GetTypeInstruction(&func_type); } -uint32_t WrapOpKill::GetKillingFuncId(SpvOp opcode) { +uint32_t WrapOpKill::GetKillingFuncId(spv::Op opcode) { // Parameterize by opcode - assert(opcode == SpvOpKill || opcode == SpvOpTerminateInvocation); + assert(opcode == spv::Op::OpKill || opcode == spv::Op::OpTerminateInvocation); std::unique_ptr* const killing_func = - (opcode == SpvOpKill) ? &opkill_function_ - : &opterminateinvocation_function_; + (opcode == spv::Op::OpKill) ? &opkill_function_ + : &opterminateinvocation_function_; if (*killing_func != nullptr) { return (*killing_func)->result_id(); @@ -139,14 +141,14 @@ uint32_t WrapOpKill::GetKillingFuncId(SpvOp opcode) { // Generate the function start instruction std::unique_ptr func_start(new Instruction( - context(), SpvOpFunction, void_type_id, killing_func_id, {})); + context(), spv::Op::OpFunction, void_type_id, killing_func_id, {})); func_start->AddOperand({SPV_OPERAND_TYPE_FUNCTION_CONTROL, {0}}); func_start->AddOperand({SPV_OPERAND_TYPE_ID, {GetVoidFunctionTypeId()}}); (*killing_func).reset(new Function(std::move(func_start))); // Generate the function end instruction std::unique_ptr func_end( - new Instruction(context(), SpvOpFunctionEnd, 0, 0, {})); + new Instruction(context(), spv::Op::OpFunctionEnd, 0, 0, {})); (*killing_func)->SetFunctionEnd(std::move(func_end)); // Create the one basic block for the function. @@ -155,7 +157,7 @@ uint32_t WrapOpKill::GetKillingFuncId(SpvOp opcode) { return 0; } std::unique_ptr label_inst( - new Instruction(context(), SpvOpLabel, 0, lab_id, {})); + new Instruction(context(), spv::Op::OpLabel, 0, lab_id, {})); std::unique_ptr bb(new BasicBlock(std::move(label_inst))); // Add the OpKill to the basic block diff --git a/3rdparty/spirv-tools/source/opt/wrap_opkill.h b/3rdparty/spirv-tools/source/opt/wrap_opkill.h index 7e43ca6cd..c9eb88877 100644 --- a/3rdparty/spirv-tools/source/opt/wrap_opkill.h +++ b/3rdparty/spirv-tools/source/opt/wrap_opkill.h @@ -53,7 +53,7 @@ class WrapOpKill : public Pass { // Return the id of a function that has return type void, has no parameters, // and contains a single instruction, which is |opcode|, either OpKill or // OpTerminateInvocation. Returns 0 if the function could not be generated. - uint32_t GetKillingFuncId(SpvOp opcode); + uint32_t GetKillingFuncId(spv::Op opcode); // Returns the id of the return type for the function that contains |inst|. // Returns 0 if |inst| is not in a function. diff --git a/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp b/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp index 2cd779a26..93b51a11f 100644 --- a/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp +++ b/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp @@ -36,9 +36,9 @@ ConditionalBranchToSimpleConditionalBranchOpportunityFinder:: for (auto* function : GetTargetFunctions(context, target_function)) { // Consider every block in the function. for (auto& block : *function) { - // The terminator must be SpvOpBranchConditional. + // The terminator must be spv::Op::OpBranchConditional. opt::Instruction* terminator = block.terminator(); - if (terminator->opcode() != SpvOpBranchConditional) { + if (terminator->opcode() != spv::Op::OpBranchConditional) { continue; } diff --git a/3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.cpp b/3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.cpp index a2c3b40a0..e626d60ba 100644 --- a/3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.cpp +++ b/3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.cpp @@ -23,7 +23,7 @@ namespace reduce { MergeBlocksReductionOpportunity::MergeBlocksReductionOpportunity( opt::IRContext* context, opt::Function* function, opt::BasicBlock* block) { // Precondition: the terminator has to be OpBranch. - assert(block->terminator()->opcode() == SpvOpBranch); + assert(block->terminator()->opcode() == spv::Op::OpBranch); context_ = context; function_ = function; // Get the successor block associated with the OpBranch. diff --git a/3rdparty/spirv-tools/source/reduce/operand_to_const_reduction_opportunity_finder.cpp b/3rdparty/spirv-tools/source/reduce/operand_to_const_reduction_opportunity_finder.cpp index eb7498ad1..c6196f367 100644 --- a/3rdparty/spirv-tools/source/reduce/operand_to_const_reduction_opportunity_finder.cpp +++ b/3rdparty/spirv-tools/source/reduce/operand_to_const_reduction_opportunity_finder.cpp @@ -50,7 +50,7 @@ OperandToConstReductionOpportunityFinder::GetAvailableOpportunities( // The argument is already a constant. continue; } - if (def->opcode() == SpvOpFunction) { + if (def->opcode() == spv::Op::OpFunction) { // The argument refers to a function, e.g. the function called // by OpFunctionCall; avoid replacing this with a constant of // the function's return type. diff --git a/3rdparty/spirv-tools/source/reduce/operand_to_undef_reduction_opportunity_finder.cpp b/3rdparty/spirv-tools/source/reduce/operand_to_undef_reduction_opportunity_finder.cpp index 06bf9550a..c7bc12135 100644 --- a/3rdparty/spirv-tools/source/reduce/operand_to_undef_reduction_opportunity_finder.cpp +++ b/3rdparty/spirv-tools/source/reduce/operand_to_undef_reduction_opportunity_finder.cpp @@ -32,7 +32,7 @@ OperandToUndefReductionOpportunityFinder::GetAvailableOpportunities( auto type_id = inst.type_id(); if (type_id) { auto type_id_def = context->get_def_use_mgr()->GetDef(type_id); - if (type_id_def->opcode() == SpvOpTypePointer) { + if (type_id_def->opcode() == spv::Op::OpTypePointer) { continue; } } @@ -57,7 +57,7 @@ OperandToUndefReductionOpportunityFinder::GetAvailableOpportunities( } // Don't replace function operands with undef. - if (operand_id_def->opcode() == SpvOpFunction) { + if (operand_id_def->opcode() == spv::Op::OpFunction) { continue; } @@ -68,7 +68,7 @@ OperandToUndefReductionOpportunityFinder::GetAvailableOpportunities( context->get_def_use_mgr()->GetDef(operand_type_id); // Skip pointer operands. - if (operand_type_id_def->opcode() == SpvOpTypePointer) { + if (operand_type_id_def->opcode() == spv::Op::OpTypePointer) { continue; } diff --git a/3rdparty/spirv-tools/source/reduce/reduction_util.cpp b/3rdparty/spirv-tools/source/reduce/reduction_util.cpp index 511f43236..c9882d5e9 100644 --- a/3rdparty/spirv-tools/source/reduce/reduction_util.cpp +++ b/3rdparty/spirv-tools/source/reduce/reduction_util.cpp @@ -26,7 +26,7 @@ const uint32_t kFalseBranchOperandIndex = 2; uint32_t FindOrCreateGlobalVariable(opt::IRContext* context, uint32_t pointer_type_id) { for (auto& inst : context->module()->types_values()) { - if (inst.opcode() != SpvOpVariable) { + if (inst.opcode() != spv::Op::OpVariable) { continue; } if (inst.type_id() == pointer_type_id) { @@ -35,7 +35,7 @@ uint32_t FindOrCreateGlobalVariable(opt::IRContext* context, } const uint32_t variable_id = context->TakeNextId(); auto variable_inst = MakeUnique( - context, SpvOpVariable, pointer_type_id, variable_id, + context, spv::Op::OpVariable, pointer_type_id, variable_id, opt::Instruction::OperandList( {{SPV_OPERAND_TYPE_STORAGE_CLASS, {static_cast(context->get_type_mgr() @@ -53,7 +53,7 @@ uint32_t FindOrCreateFunctionVariable(opt::IRContext* context, assert(context->get_type_mgr() ->GetType(pointer_type_id) ->AsPointer() - ->storage_class() == SpvStorageClassFunction); + ->storage_class() == spv::StorageClass::Function); // Go through the instructions in the function's first block until we find a // suitable variable, or go past all the variables. @@ -62,7 +62,7 @@ uint32_t FindOrCreateFunctionVariable(opt::IRContext* context, // We will either find a suitable variable, or find a non-variable // instruction; we won't exhaust all instructions. assert(iter != function->begin()->end()); - if (iter->opcode() != SpvOpVariable) { + if (iter->opcode() != spv::Op::OpVariable) { // If we see a non-variable, we have gone through all the variables. break; } @@ -74,16 +74,17 @@ uint32_t FindOrCreateFunctionVariable(opt::IRContext* context, // function's entry block. const uint32_t variable_id = context->TakeNextId(); auto variable_inst = MakeUnique( - context, SpvOpVariable, pointer_type_id, variable_id, + context, spv::Op::OpVariable, pointer_type_id, variable_id, opt::Instruction::OperandList( - {{SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}}})); + {{SPV_OPERAND_TYPE_STORAGE_CLASS, + {uint32_t(spv::StorageClass::Function)}}})); iter->InsertBefore(std::move(variable_inst)); return variable_id; } uint32_t FindOrCreateGlobalUndef(opt::IRContext* context, uint32_t type_id) { for (auto& inst : context->module()->types_values()) { - if (inst.opcode() != SpvOpUndef) { + if (inst.opcode() != spv::Op::OpUndef) { continue; } if (inst.type_id() == type_id) { @@ -91,8 +92,9 @@ uint32_t FindOrCreateGlobalUndef(opt::IRContext* context, uint32_t type_id) { } } const uint32_t undef_id = context->TakeNextId(); - auto undef_inst = MakeUnique( - context, SpvOpUndef, type_id, undef_id, opt::Instruction::OperandList()); + auto undef_inst = + MakeUnique(context, spv::Op::OpUndef, type_id, undef_id, + opt::Instruction::OperandList()); assert(undef_id == undef_inst->result_id()); context->module()->AddGlobalValue(std::move(undef_inst)); return undef_id; diff --git a/3rdparty/spirv-tools/source/reduce/remove_selection_reduction_opportunity_finder.cpp b/3rdparty/spirv-tools/source/reduce/remove_selection_reduction_opportunity_finder.cpp index 74df1b8db..6abadf2a8 100644 --- a/3rdparty/spirv-tools/source/reduce/remove_selection_reduction_opportunity_finder.cpp +++ b/3rdparty/spirv-tools/source/reduce/remove_selection_reduction_opportunity_finder.cpp @@ -36,7 +36,7 @@ RemoveSelectionReductionOpportunityFinder::GetAvailableOpportunities( for (auto* function : GetTargetFunctions(context, target_function)) { for (auto& block : *function) { if (auto merge_instruction = block.GetMergeInst()) { - if (merge_instruction->opcode() == SpvOpLoopMerge) { + if (merge_instruction->opcode() == spv::Op::OpLoopMerge) { uint32_t merge_block_id = merge_instruction->GetSingleWordOperand(kMergeNodeIndex); uint32_t continue_block_id = @@ -54,7 +54,7 @@ RemoveSelectionReductionOpportunityFinder::GetAvailableOpportunities( for (auto& function : *context->module()) { for (auto& block : function) { if (auto merge_instruction = block.GetMergeInst()) { - if (merge_instruction->opcode() == SpvOpSelectionMerge) { + if (merge_instruction->opcode() == spv::Op::OpSelectionMerge) { if (CanOpSelectionMergeBeRemoved( context, block, merge_instruction, merge_and_continue_blocks_from_loops)) { diff --git a/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp b/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp index e72ed3514..3309fd099 100644 --- a/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp +++ b/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp @@ -36,14 +36,14 @@ void RemoveStructMemberReductionOpportunity::Apply() { struct_type_, [this, &decorations_to_kill](opt::Instruction* user, uint32_t /*operand_index*/) { switch (user->opcode()) { - case SpvOpCompositeConstruct: - case SpvOpConstantComposite: + case spv::Op::OpCompositeConstruct: + case spv::Op::OpConstantComposite: // This use is constructing a composite of the struct type, so we // must remove the id that was provided for the member we are // removing. user->RemoveInOperand(member_index_); break; - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: // This use is decorating a member of the struct. if (user->GetSingleWordInOperand(1) == member_index_) { // The member we are removing is being decorated, so we record @@ -78,8 +78,8 @@ void RemoveStructMemberReductionOpportunity::Apply() { for (auto& block : function) { for (auto& inst : block) { switch (inst.opcode()) { - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: { + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: { // These access chain instructions take sequences of ids for // indexing, starting from input operand 1. auto composite_type_id = @@ -90,8 +90,8 @@ void RemoveStructMemberReductionOpportunity::Apply() { ->GetSingleWordInOperand(1); AdjustAccessedIndices(composite_type_id, 1, false, context, &inst); } break; - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: { + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: { // These access chain instructions take sequences of ids for // indexing, starting from input operand 2. auto composite_type_id = @@ -102,7 +102,7 @@ void RemoveStructMemberReductionOpportunity::Apply() { ->GetSingleWordInOperand(1); AdjustAccessedIndices(composite_type_id, 2, false, context, &inst); } break; - case SpvOpCompositeExtract: { + case spv::Op::OpCompositeExtract: { // OpCompositeExtract uses literals for indexing, starting at input // operand 1. auto composite_type_id = @@ -111,7 +111,7 @@ void RemoveStructMemberReductionOpportunity::Apply() { ->type_id(); AdjustAccessedIndices(composite_type_id, 1, true, context, &inst); } break; - case SpvOpCompositeInsert: { + case spv::Op::OpCompositeInsert: { // OpCompositeInsert uses literals for indexing, starting at input // operand 2. auto composite_type_id = @@ -146,13 +146,13 @@ void RemoveStructMemberReductionOpportunity::AdjustAccessedIndices( i < composite_access_instruction->NumInOperands(); i++) { auto type_inst = context->get_def_use_mgr()->GetDef(next_type); switch (type_inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeMatrix: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: next_type = type_inst->GetSingleWordInOperand(0); break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { // Struct types are special because (a) we may need to adjust the index // being used, if the struct type is the one from which we are removing // a member, and (b) the type encountered by following the current index diff --git a/3rdparty/spirv-tools/source/reduce/remove_unused_instruction_reduction_opportunity_finder.cpp b/3rdparty/spirv-tools/source/reduce/remove_unused_instruction_reduction_opportunity_finder.cpp index d7bb3a82e..fbbeb3462 100644 --- a/3rdparty/spirv-tools/source/reduce/remove_unused_instruction_reduction_opportunity_finder.cpp +++ b/3rdparty/spirv-tools/source/reduce/remove_unused_instruction_reduction_opportunity_finder.cpp @@ -103,8 +103,8 @@ RemoveUnusedInstructionReductionOpportunityFinder::GetAvailableOpportunities( continue; } if (spvOpcodeIsBlockTerminator(inst.opcode()) || - inst.opcode() == SpvOpSelectionMerge || - inst.opcode() == SpvOpLoopMerge) { + inst.opcode() == spv::Op::OpSelectionMerge || + inst.opcode() == spv::Op::OpLoopMerge) { // In this reduction pass we do not want to affect static // control flow. continue; @@ -133,7 +133,7 @@ bool RemoveUnusedInstructionReductionOpportunityFinder:: &inst, [this](opt::Instruction* user, uint32_t use_index) -> bool { return (user->IsDecoration() && !IsIndependentlyRemovableDecoration(*user)) || - (user->opcode() == SpvOpEntryPoint && use_index > 2); + (user->opcode() == spv::Op::OpEntryPoint && use_index > 2); }); } @@ -141,13 +141,13 @@ bool RemoveUnusedInstructionReductionOpportunityFinder:: IsIndependentlyRemovableDecoration(const opt::Instruction& inst) const { uint32_t decoration; switch (inst.opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpDecorateString: + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpDecorateString: decoration = inst.GetSingleWordInOperand(1u); break; - case SpvOpMemberDecorate: - case SpvOpMemberDecorateString: + case spv::Op::OpMemberDecorate: + case spv::Op::OpMemberDecorateString: decoration = inst.GetSingleWordInOperand(2u); break; default: @@ -160,12 +160,12 @@ bool RemoveUnusedInstructionReductionOpportunityFinder:: // not change the shader interface, will not make the shader invalid, will // actually be found in practice, etc. - switch (decoration) { - case SpvDecorationRelaxedPrecision: - case SpvDecorationNoSignedWrap: - case SpvDecorationNoContraction: - case SpvDecorationNoUnsignedWrap: - case SpvDecorationUserSemantic: + switch (spv::Decoration(decoration)) { + case spv::Decoration::RelaxedPrecision: + case spv::Decoration::NoSignedWrap: + case spv::Decoration::NoContraction: + case spv::Decoration::NoUnsignedWrap: + case spv::Decoration::UserSemantic: return true; default: return false; diff --git a/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp b/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp index cd0c4e4d7..db381e0f0 100644 --- a/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp +++ b/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp @@ -43,7 +43,7 @@ RemoveUnusedStructMemberReductionOpportunityFinder::GetAvailableOpportunities( // Consider every struct type in the module. for (auto& type_or_value : context->types_values()) { - if (type_or_value.opcode() != SpvOpTypeStruct) { + if (type_or_value.opcode() != spv::Op::OpTypeStruct) { continue; } @@ -60,7 +60,7 @@ RemoveUnusedStructMemberReductionOpportunityFinder::GetAvailableOpportunities( &type_or_value, [&unused_members](opt::Instruction* user, uint32_t /*operand_index*/) { switch (user->opcode()) { - case SpvOpMemberName: + case spv::Op::OpMemberName: unused_members.erase(user->GetSingleWordInOperand(1)); break; default: @@ -91,8 +91,8 @@ RemoveUnusedStructMemberReductionOpportunityFinder::GetAvailableOpportunities( // The way the helper is invoked depends on whether the instruction // uses literal or id indices, and the offset into the instruction's // input operands from which index operands are provided. - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: { + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: { auto composite_type_id = context->get_def_use_mgr() ->GetDef(context->get_def_use_mgr() @@ -102,8 +102,8 @@ RemoveUnusedStructMemberReductionOpportunityFinder::GetAvailableOpportunities( MarkAccessedMembersAsUsed(context, composite_type_id, 1, false, inst, &unused_member_to_structs); } break; - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: { + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: { auto composite_type_id = context->get_def_use_mgr() ->GetDef(context->get_def_use_mgr() @@ -113,7 +113,7 @@ RemoveUnusedStructMemberReductionOpportunityFinder::GetAvailableOpportunities( MarkAccessedMembersAsUsed(context, composite_type_id, 2, false, inst, &unused_member_to_structs); } break; - case SpvOpCompositeExtract: { + case spv::Op::OpCompositeExtract: { auto composite_type_id = context->get_def_use_mgr() ->GetDef(inst.GetSingleWordInOperand(0)) @@ -121,7 +121,7 @@ RemoveUnusedStructMemberReductionOpportunityFinder::GetAvailableOpportunities( MarkAccessedMembersAsUsed(context, composite_type_id, 1, true, inst, &unused_member_to_structs); } break; - case SpvOpCompositeInsert: { + case spv::Op::OpCompositeInsert: { auto composite_type_id = context->get_def_use_mgr() ->GetDef(inst.GetSingleWordInOperand(1)) @@ -163,13 +163,13 @@ void RemoveUnusedStructMemberReductionOpportunityFinder:: i < composite_access_instruction.NumInOperands(); i++) { auto type_inst = context->get_def_use_mgr()->GetDef(next_type); switch (type_inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeMatrix: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: next_type = type_inst->GetSingleWordInOperand(0); break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { uint32_t index_operand = composite_access_instruction.GetSingleWordInOperand(i); uint32_t member = literal_indices ? index_operand diff --git a/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp b/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp index d867c3ad9..9637f0f16 100644 --- a/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp +++ b/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp @@ -29,15 +29,15 @@ SimpleConditionalBranchToBranchOpportunityFinder::GetAvailableOpportunities( for (auto* function : GetTargetFunctions(context, target_function)) { // Consider every block in the function. for (auto& block : *function) { - // The terminator must be SpvOpBranchConditional. + // The terminator must be spv::Op::OpBranchConditional. opt::Instruction* terminator = block.terminator(); - if (terminator->opcode() != SpvOpBranchConditional) { + if (terminator->opcode() != spv::Op::OpBranchConditional) { continue; } // It must not be a selection header, as these cannot be followed by // OpBranch. if (block.GetMergeInst() && - block.GetMergeInst()->opcode() == SpvOpSelectionMerge) { + block.GetMergeInst()->opcode() == spv::Op::OpSelectionMerge) { continue; } // The conditional branch must be simplified. diff --git a/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp b/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp index a2be0c4d9..6d772b594 100644 --- a/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp +++ b/3rdparty/spirv-tools/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp @@ -31,7 +31,8 @@ bool SimpleConditionalBranchToBranchReductionOpportunity::PreconditionHolds() { } void SimpleConditionalBranchToBranchReductionOpportunity::Apply() { - assert(conditional_branch_instruction_->opcode() == SpvOpBranchConditional && + assert(conditional_branch_instruction_->opcode() == + spv::Op::OpBranchConditional && "SimpleConditionalBranchToBranchReductionOpportunity: branch was not " "a conditional branch"); @@ -46,7 +47,7 @@ void SimpleConditionalBranchToBranchReductionOpportunity::Apply() { // -> // OpBranch %block_id - conditional_branch_instruction_->SetOpcode(SpvOpBranch); + conditional_branch_instruction_->SetOpcode(spv::Op::OpBranch); conditional_branch_instruction_->ReplaceOperands( {{SPV_OPERAND_TYPE_ID, {conditional_branch_instruction_->GetSingleWordInOperand( diff --git a/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.cpp b/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.cpp index ed738411a..cc5ffe3ca 100644 --- a/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.cpp +++ b/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.cpp @@ -55,7 +55,7 @@ void StructuredConstructToBlockReductionOpportunity::Apply() { // The terminator for the header block is changed to be an unconditional // branch to the merge block. - header_block->terminator()->SetOpcode(SpvOpBranch); + header_block->terminator()->SetOpcode(spv::Op::OpBranch); header_block->terminator()->SetInOperands( {{SPV_OPERAND_TYPE_ID, {merge_block->id()}}}); diff --git a/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp b/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp index 850af4566..45b95285e 100644 --- a/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp +++ b/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp @@ -129,12 +129,12 @@ void StructuredLoopToSelectionReductionOpportunity::RedirectEdge( // Figure out which operands of the terminator need to be considered for // redirection. std::vector operand_indices; - if (terminator->opcode() == SpvOpBranch) { + if (terminator->opcode() == spv::Op::OpBranch) { operand_indices = {0}; - } else if (terminator->opcode() == SpvOpBranchConditional) { + } else if (terminator->opcode() == spv::Op::OpBranchConditional) { operand_indices = {1, 2}; } else { - assert(terminator->opcode() == SpvOpSwitch); + assert(terminator->opcode() == spv::Op::OpSwitch); for (uint32_t label_index = 1; label_index < terminator->NumOperands(); label_index += 2) { operand_indices.push_back(label_index); @@ -179,18 +179,19 @@ void StructuredLoopToSelectionReductionOpportunity::ChangeLoopToSelection() { auto loop_merge_inst = loop_construct_header_->GetLoopMergeInst(); auto const loop_merge_block_id = loop_merge_inst->GetSingleWordOperand(kMergeNodeIndex); - loop_merge_inst->SetOpcode(SpvOpSelectionMerge); + loop_merge_inst->SetOpcode(spv::Op::OpSelectionMerge); loop_merge_inst->ReplaceOperands( {{loop_merge_inst->GetOperand(kMergeNodeIndex).type, {loop_merge_block_id}}, - {SPV_OPERAND_TYPE_SELECTION_CONTROL, {SpvSelectionControlMaskNone}}}); + {SPV_OPERAND_TYPE_SELECTION_CONTROL, + {uint32_t(spv::SelectionControlMask::MaskNone)}}}); // The loop header either finishes with OpBranch or OpBranchConditional. // The latter is fine for a selection. In the former case we need to turn // it into OpBranchConditional. We use "true" as the condition, and make // the "else" branch be the merge block. auto terminator = loop_construct_header_->terminator(); - if (terminator->opcode() == SpvOpBranch) { + if (terminator->opcode() == spv::Op::OpBranch) { opt::analysis::Bool temp; const opt::analysis::Bool* bool_type = context_->get_type_mgr()->GetRegisteredType(&temp)->AsBool(); @@ -199,7 +200,7 @@ void StructuredLoopToSelectionReductionOpportunity::ChangeLoopToSelection() { auto true_const_result_id = const_mgr->GetDefiningInstruction(true_const)->result_id(); auto original_branch_id = terminator->GetSingleWordOperand(0); - terminator->SetOpcode(SpvOpBranchConditional); + terminator->SetOpcode(spv::Op::OpBranchConditional); terminator->ReplaceOperands({{SPV_OPERAND_TYPE_ID, {true_const_result_id}}, {SPV_OPERAND_TYPE_ID, {original_branch_id}}, {SPV_OPERAND_TYPE_ID, {loop_merge_block_id}}}); @@ -215,7 +216,7 @@ void StructuredLoopToSelectionReductionOpportunity::FixNonDominatedIdUses() { // Consider each instruction in the function. for (auto& block : *loop_construct_header_->GetParent()) { for (auto& def : block) { - if (def.opcode() == SpvOpVariable) { + if (def.opcode() == spv::Op::OpVariable) { // Variables are defined at the start of the function, and can be // accessed by all blocks, even by unreachable blocks that have no // dominators, so we do not need to worry about them. @@ -233,11 +234,11 @@ void StructuredLoopToSelectionReductionOpportunity::FixNonDominatedIdUses() { // access chain, in which case replace it with some (possibly fresh) // variable (as we cannot load from / store to OpUndef). if (!DefinitionSufficientlyDominatesUse(&def, use, index, block)) { - if (def.opcode() == SpvOpAccessChain) { + if (def.opcode() == spv::Op::OpAccessChain) { auto pointer_type = context_->get_type_mgr()->GetType(def.type_id())->AsPointer(); switch (pointer_type->storage_class()) { - case SpvStorageClassFunction: + case spv::StorageClass::Function: use->SetOperand( index, {FindOrCreateFunctionVariable( context_, loop_construct_header_->GetParent(), @@ -270,7 +271,7 @@ bool StructuredLoopToSelectionReductionOpportunity:: opt::Instruction* use, uint32_t use_index, opt::BasicBlock& def_block) { - if (use->opcode() == SpvOpPhi) { + if (use->opcode() == spv::Op::OpPhi) { // A use in a phi doesn't need to be dominated by its definition, but the // associated parent block does need to be dominated by the definition. return context_->GetDominatorAnalysis(loop_construct_header_->GetParent()) diff --git a/3rdparty/spirv-tools/source/table.h b/3rdparty/spirv-tools/source/table.h index 5adf04a4c..8097f13f7 100644 --- a/3rdparty/spirv-tools/source/table.h +++ b/3rdparty/spirv-tools/source/table.h @@ -21,9 +21,9 @@ typedef struct spv_opcode_desc_t { const char* name; - const SpvOp opcode; + const spv::Op opcode; const uint32_t numCapabilities; - const SpvCapability* capabilities; + const spv::Capability* capabilities; // operandTypes[0..numTypes-1] describe logical operands for the instruction. // The operand types include result id and result-type id, followed by // the types of arguments. @@ -48,7 +48,7 @@ typedef struct spv_operand_desc_t { const char* name; const uint32_t value; const uint32_t numCapabilities; - const SpvCapability* capabilities; + const spv::Capability* capabilities; // A set of extensions that enable this feature. If empty then this operand // value is in core and its availability is subject to minVersion. The // assembler, binary parser, and disassembler ignore this rule, so you can @@ -73,7 +73,7 @@ typedef struct spv_ext_inst_desc_t { const char* name; const uint32_t ext_inst; const uint32_t numCapabilities; - const SpvCapability* capabilities; + const spv::Capability* capabilities; const spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger? } spv_ext_inst_desc_t; diff --git a/3rdparty/spirv-tools/source/text.cpp b/3rdparty/spirv-tools/source/text.cpp index 90f69c525..8f77d624a 100644 --- a/3rdparty/spirv-tools/source/text.cpp +++ b/3rdparty/spirv-tools/source/text.cpp @@ -227,7 +227,8 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar, // Set the extended instruction type. // The import set id is the 3rd operand of OpExtInst. - if (pInst->opcode == SpvOpExtInst && pInst->words.size() == 4) { + if (spv::Op(pInst->opcode) == spv::Op::OpExtInst && + pInst->words.size() == 4) { auto ext_inst_type = context->getExtInstTypeForId(pInst->words[3]); if (ext_inst_type == SPV_EXT_INST_TYPE_NONE) { return context->diagnostic() @@ -279,7 +280,7 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar, // The assembler accepts the symbolic name for the opcode, but without // the "Op" prefix. For example, "IAdd" is accepted. The number // of the opcode is emitted. - SpvOp opcode; + spv::Op opcode; if (grammar.lookupSpecConstantOpcode(textValue, &opcode)) { return context->diagnostic() << "Invalid " << spvOperandTypeStr(type) << " '" << textValue << "'."; @@ -327,8 +328,8 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar, // The encoding for OpConstant, OpSpecConstant and OpSwitch all // depend on either their own result-id or the result-id of // one of their parameters. - if (SpvOpConstant == pInst->opcode || - SpvOpSpecConstant == pInst->opcode) { + if (spv::Op::OpConstant == pInst->opcode || + spv::Op::OpSpecConstant == pInst->opcode) { // The type of the literal is determined by the type Id of the // instruction. expected_type = @@ -344,7 +345,7 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar, << "Type for " << opcode_name << " must be a scalar floating point or integer type"; } - } else if (pInst->opcode == SpvOpSwitch) { + } else if (pInst->opcode == spv::Op::OpSwitch) { // The type of the literal is the same as the type of the selector. expected_type = context->getTypeOfValueInstruction(pInst->words[1]); if (!spvtools::isScalarIntegral(expected_type)) { @@ -375,7 +376,7 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar, } // NOTE: Special case for extended instruction library import - if (SpvOpExtInstImport == pInst->opcode) { + if (spv::Op::OpExtInstImport == pInst->opcode) { const spv_ext_inst_type_t ext_inst_type = spvExtInstImportTypeGet(literal.str.c_str()); if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) { @@ -688,7 +689,7 @@ spv_result_t SetHeader(spv_target_env env, const uint32_t bound, uint32_t* header) { if (!header) return SPV_ERROR_INVALID_BINARY; - header[SPV_INDEX_MAGIC_NUMBER] = SpvMagicNumber; + header[SPV_INDEX_MAGIC_NUMBER] = spv::MagicNumber; header[SPV_INDEX_VERSION_NUMBER] = spvVersionForTargetEnv(env); header[SPV_INDEX_GENERATOR_NUMBER] = SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_ASSEMBLER, kAssemblerVersion); @@ -722,7 +723,7 @@ spv_result_t GetNumericIds(const spvtools::AssemblyGrammar& grammar, // being parsed. A malformed input might feature such an operand *before* // the opcode is known. To guard against accessing an uninitialized opcode, // the instruction's opcode is initialized to a default value. - inst.opcode = SpvOpMax; + inst.opcode = spv::Op::Max; if (spvTextEncodeOpcode(grammar, &context, &inst)) { return SPV_ERROR_INVALID_TEXT; diff --git a/3rdparty/spirv-tools/source/text_handler.cpp b/3rdparty/spirv-tools/source/text_handler.cpp index 15c1741f6..35c4b83c1 100644 --- a/3rdparty/spirv-tools/source/text_handler.cpp +++ b/3rdparty/spirv-tools/source/text_handler.cpp @@ -323,12 +323,12 @@ spv_result_t AssemblyContext::recordTypeDefinition( << " has already been used to generate a type"; } - if (pInst->opcode == SpvOpTypeInt) { + if (pInst->opcode == spv::Op::OpTypeInt) { if (pInst->words.size() != 4) return diagnostic() << "Invalid OpTypeInt instruction"; types_[value] = {pInst->words[2], pInst->words[3] != 0, IdTypeClass::kScalarIntegerType}; - } else if (pInst->opcode == SpvOpTypeFloat) { + } else if (pInst->opcode == spv::Op::OpTypeFloat) { if (pInst->words.size() != 3) return diagnostic() << "Invalid OpTypeFloat instruction"; types_[value] = {pInst->words[2], false, IdTypeClass::kScalarFloatType}; diff --git a/3rdparty/spirv-tools/source/util/hex_float.h b/3rdparty/spirv-tools/source/util/hex_float.h index 06e3c5757..98353a4ad 100644 --- a/3rdparty/spirv-tools/source/util/hex_float.h +++ b/3rdparty/spirv-tools/source/util/hex_float.h @@ -896,6 +896,47 @@ ParseNormalFloat, HexFloatTraits>>( return is; } +namespace detail { + +// Returns a new value formed from 'value' by setting 'bit' that is the +// 'n'th most significant bit (where 0 is the most significant bit). +// If 'bit' is zero or 'n' is more than the number of bits in the integer +// type, then return the original value. +template +UINT_TYPE set_nth_most_significant_bit(UINT_TYPE value, UINT_TYPE bit, + UINT_TYPE n) { + constexpr UINT_TYPE max_position = std::numeric_limits::digits - 1; + if ((bit != 0) && (n <= max_position)) { + return static_cast(value | (bit << (max_position - n))); + } + return value; +} + +// Attempts to increment the argument. +// If it does not overflow, then increments the argument and returns true. +// If it would overflow, returns false. +template +bool saturated_inc(INT_TYPE& value) { + if (value == std::numeric_limits::max()) { + return false; + } + value++; + return true; +} + +// Attempts to decrement the argument. +// If it does not underflow, then decrements the argument and returns true. +// If it would overflow, returns false. +template +bool saturated_dec(INT_TYPE& value) { + if (value == std::numeric_limits::min()) { + return false; + } + value--; + return true; +} +} // namespace detail + // Reads a HexFloat from the given stream. // If the float is not encoded as a hex-float then it will be parsed // as a regular float. @@ -997,13 +1038,16 @@ std::istream& operator>>(std::istream& is, HexFloat& value) { if (bits_written) { // If we are here the bits represented belong in the fractional // part of the float, and we have to adjust the exponent accordingly. - fraction = static_cast( - fraction | - static_cast( - write_bit << (HF::top_bit_left_shift - fraction_index++))); - // TODO(dneto): Avoid overflow. Testing would require - // parameterization. - exponent = static_cast(exponent + 1); + fraction = detail::set_nth_most_significant_bit(fraction, write_bit, + fraction_index); + // Increment the fraction index. If the input has bizarrely many + // significant digits, then silently drop them. + detail::saturated_inc(fraction_index); + if (!detail::saturated_inc(exponent)) { + // Overflow failure + is.setstate(std::ios::failbit); + return is; + } } // Since this updated after setting fraction bits, this effectively // drops the leading 1 bit. @@ -1034,14 +1078,17 @@ std::istream& operator>>(std::istream& is, HexFloat& value) { // Handle modifying the exponent here this way we can handle // an arbitrary number of hex values without overflowing our // integer. - // TODO(dneto): Handle underflow. Testing would require extra - // parameterization. - exponent = static_cast(exponent - 1); + if (!detail::saturated_dec(exponent)) { + // Overflow failure + is.setstate(std::ios::failbit); + return is; + } } else { - fraction = static_cast( - fraction | - static_cast( - write_bit << (HF::top_bit_left_shift - fraction_index++))); + fraction = detail::set_nth_most_significant_bit(fraction, write_bit, + fraction_index); + // Increment the fraction index. If the input has bizarrely many + // significant digits, then silently drop them. + detail::saturated_inc(fraction_index); } } } else { diff --git a/3rdparty/spirv-tools/source/val/construct.cpp b/3rdparty/spirv-tools/source/val/construct.cpp index 52e61d555..1ca81d416 100644 --- a/3rdparty/spirv-tools/source/val/construct.cpp +++ b/3rdparty/spirv-tools/source/val/construct.cpp @@ -164,10 +164,12 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const { // ii. The immediate dominator of |block|. auto NextBlock = [](const BasicBlock* block) -> const BasicBlock* { for (auto& use : block->label()->uses()) { - if ((use.first->opcode() == SpvOpLoopMerge || - use.first->opcode() == SpvOpSelectionMerge) && + if ((use.first->opcode() == spv::Op::OpLoopMerge || + use.first->opcode() == spv::Op::OpSelectionMerge) && use.second == 1 && - use.first->block()->structurally_dominates(*block)) { + use.first->block()->structurally_dominates(*block) && + // A header likely declared itself as its merge. + use.first->block() != block) { return use.first->block(); } } @@ -181,10 +183,10 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const { auto terminator = block->terminator(); auto index = terminator - &_.ordered_instructions()[0]; auto merge_inst = &_.ordered_instructions()[index - 1]; - if (merge_inst->opcode() == SpvOpLoopMerge || - (header->terminator()->opcode() != SpvOpSwitch && - merge_inst->opcode() == SpvOpSelectionMerge && - terminator->opcode() == SpvOpSwitch)) { + if (merge_inst->opcode() == spv::Op::OpLoopMerge || + (header->terminator()->opcode() != spv::Op::OpSwitch && + merge_inst->opcode() == spv::Op::OpSelectionMerge && + terminator->opcode() == spv::Op::OpSwitch)) { auto merge_target = merge_inst->GetOperandAs(0u); auto merge_block = merge_inst->function()->GetBlock(merge_target).first; if (merge_block->structurally_dominates(*header)) { @@ -192,22 +194,22 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const { continue; } - if ((!seen_switch || merge_inst->opcode() == SpvOpLoopMerge) && + if ((!seen_switch || merge_inst->opcode() == spv::Op::OpLoopMerge) && dest->id() == merge_target) { return true; - } else if (merge_inst->opcode() == SpvOpLoopMerge) { + } else if (merge_inst->opcode() == spv::Op::OpLoopMerge) { auto continue_target = merge_inst->GetOperandAs(1u); if (dest->id() == continue_target) { return true; } } - if (terminator->opcode() == SpvOpSwitch) { + if (terminator->opcode() == spv::Op::OpSwitch) { seen_switch = true; } // Hit an enclosing loop and didn't break or continue. - if (merge_inst->opcode() == SpvOpLoopMerge) return false; + if (merge_inst->opcode() == spv::Op::OpLoopMerge) return false; } block = NextBlock(block); diff --git a/3rdparty/spirv-tools/source/val/decoration.h b/3rdparty/spirv-tools/source/val/decoration.h index 4f53f2075..384cc5755 100644 --- a/3rdparty/spirv-tools/source/val/decoration.h +++ b/3rdparty/spirv-tools/source/val/decoration.h @@ -39,33 +39,33 @@ namespace val { // // Example 1: Decoration for an object with no parameters: // OpDecorate %obj Flat -// dec_type_ = SpvDecorationFlat +// dec_type_ = spv::Decoration::Flat // params_ = empty vector // struct_member_index_ = kInvalidMember // // Example 2: Decoration for an object with two parameters: // OpDecorate %obj LinkageAttributes "link" Import -// dec_type_ = SpvDecorationLinkageAttributes +// dec_type_ = spv::Decoration::LinkageAttributes // params_ = vector { link, Import } // struct_member_index_ = kInvalidMember // // Example 3: Decoration for a member of a structure with one parameter: // OpMemberDecorate %struct 2 Offset 2 -// dec_type_ = SpvDecorationOffset +// dec_type_ = spv::Decoration::Offset // params_ = vector { 2 } // struct_member_index_ = 2 // class Decoration { public: enum { kInvalidMember = -1 }; - Decoration(SpvDecoration t, + Decoration(spv::Decoration t, const std::vector& parameters = std::vector(), uint32_t member_index = kInvalidMember) : dec_type_(t), params_(parameters), struct_member_index_(member_index) {} void set_struct_member_index(uint32_t index) { struct_member_index_ = index; } int struct_member_index() const { return struct_member_index_; } - SpvDecoration dec_type() const { return dec_type_; } + spv::Decoration dec_type() const { return dec_type_; } std::vector& params() { return params_; } const std::vector& params() const { return params_; } @@ -84,7 +84,7 @@ class Decoration { } private: - SpvDecoration dec_type_; + spv::Decoration dec_type_; std::vector params_; // If the decoration applies to a member of a structure type, then the index diff --git a/3rdparty/spirv-tools/source/val/function.cpp b/3rdparty/spirv-tools/source/val/function.cpp index fc7ccd062..8b4423a1f 100644 --- a/3rdparty/spirv-tools/source/val/function.cpp +++ b/3rdparty/spirv-tools/source/val/function.cpp @@ -33,7 +33,7 @@ namespace val { static const uint32_t kInvalidId = 0x400000; Function::Function(uint32_t function_id, uint32_t result_type_id, - SpvFunctionControlMask function_control, + spv::FunctionControlMask function_control, uint32_t function_type_id) : id_(function_id), function_type_id_(function_type_id), @@ -371,10 +371,10 @@ int Function::GetBlockDepth(BasicBlock* bb) { return block_depth_[bb]; } -void Function::RegisterExecutionModelLimitation(SpvExecutionModel model, +void Function::RegisterExecutionModelLimitation(spv::ExecutionModel model, const std::string& message) { execution_model_limitations_.push_back( - [model, message](SpvExecutionModel in_model, std::string* out_message) { + [model, message](spv::ExecutionModel in_model, std::string* out_message) { if (model != in_model) { if (out_message) { *out_message = message; @@ -385,7 +385,7 @@ void Function::RegisterExecutionModelLimitation(SpvExecutionModel model, }); } -bool Function::IsCompatibleWithExecutionModel(SpvExecutionModel model, +bool Function::IsCompatibleWithExecutionModel(spv::ExecutionModel model, std::string* reason) const { bool return_value = true; std::stringstream ss_reason; diff --git a/3rdparty/spirv-tools/source/val/function.h b/3rdparty/spirv-tools/source/val/function.h index 126b1dc77..481179442 100644 --- a/3rdparty/spirv-tools/source/val/function.h +++ b/3rdparty/spirv-tools/source/val/function.h @@ -55,7 +55,8 @@ enum class FunctionDecl { class Function { public: Function(uint32_t id, uint32_t result_type_id, - SpvFunctionControlMask function_control, uint32_t function_type_id); + spv::FunctionControlMask function_control, + uint32_t function_type_id); /// Registers a function parameter in the current function /// @return Returns SPV_SUCCESS if the call was successful @@ -80,7 +81,8 @@ class Function { /// /// @return Returns SPV_SUCCESS if the call was successful spv_result_t RegisterBlockVariable(uint32_t type_id, uint32_t id, - SpvStorageClass storage, uint32_t init_id); + spv::StorageClass storage, + uint32_t init_id); /// Registers a loop merge construct in the function /// @@ -205,12 +207,12 @@ class Function { /// Registers execution model limitation such as "Feature X is only available /// with Execution Model Y". - void RegisterExecutionModelLimitation(SpvExecutionModel model, + void RegisterExecutionModelLimitation(spv::ExecutionModel model, const std::string& message); /// Registers execution model limitation with an |is_compatible| functor. void RegisterExecutionModelLimitation( - std::function is_compatible) { + std::function is_compatible) { execution_model_limitations_.push_back(is_compatible); } @@ -227,7 +229,7 @@ class Function { /// Returns true if the given execution model passes the limitations stored in /// execution_model_limitations_. Returns false otherwise and fills optional /// |reason| parameter. - bool IsCompatibleWithExecutionModel(SpvExecutionModel model, + bool IsCompatibleWithExecutionModel(spv::ExecutionModel model, std::string* reason = nullptr) const; // Inserts id to the set of functions called from this function. @@ -286,7 +288,7 @@ class Function { uint32_t result_type_id_; /// The control fo the function - SpvFunctionControlMask function_control_; + spv::FunctionControlMask function_control_; /// The type of declaration of each function FunctionDecl declaration_type_; @@ -381,7 +383,7 @@ class Function { /// function. The functor stored in the list return true if execution model /// is compatible, false otherwise. If the functor returns false, it can also /// optionally fill the string parameter with the reason for incompatibility. - std::list> + std::list> execution_model_limitations_; /// Stores limitations imposed by instructions used within the function. diff --git a/3rdparty/spirv-tools/source/val/instruction.h b/3rdparty/spirv-tools/source/val/instruction.h index 6d1f9f4f1..c524bd375 100644 --- a/3rdparty/spirv-tools/source/val/instruction.h +++ b/3rdparty/spirv-tools/source/val/instruction.h @@ -42,7 +42,7 @@ class Instruction { uint32_t id() const { return inst_.result_id; } uint32_t type_id() const { return inst_.type_id; } - SpvOp opcode() const { return static_cast(inst_.opcode); } + spv::Op opcode() const { return static_cast(inst_.opcode); } /// Returns the Function where the instruction was defined. nullptr if it was /// defined outside of a Function @@ -87,13 +87,13 @@ class Instruction { } bool IsNonSemantic() const { - return opcode() == SpvOp::SpvOpExtInst && + return opcode() == spv::Op::OpExtInst && spvExtInstIsNonSemantic(inst_.ext_inst_type); } /// True if this is an OpExtInst for debug info extension. bool IsDebugInfo() const { - return opcode() == SpvOp::SpvOpExtInst && + return opcode() == spv::Op::OpExtInst && spvExtInstIsDebugInfo(inst_.ext_inst_type); } diff --git a/3rdparty/spirv-tools/source/val/validate.cpp b/3rdparty/spirv-tools/source/val/validate.cpp index efb9225e6..52cb0d8bb 100644 --- a/3rdparty/spirv-tools/source/val/validate.cpp +++ b/3rdparty/spirv-tools/source/val/validate.cpp @@ -66,15 +66,15 @@ void RegisterExtension(ValidationState_t& _, // Parses the beginning of the module searching for OpExtension instructions. // Registers extensions if recognized. Returns SPV_REQUESTED_TERMINATION -// once an instruction which is not SpvOpCapability and SpvOpExtension is -// encountered. According to the SPIR-V spec extensions are declared after -// capabilities and before everything else. +// once an instruction which is not spv::Op::OpCapability and +// spv::Op::OpExtension is encountered. According to the SPIR-V spec extensions +// are declared after capabilities and before everything else. spv_result_t ProcessExtensions(void* user_data, const spv_parsed_instruction_t* inst) { - const SpvOp opcode = static_cast(inst->opcode); - if (opcode == SpvOpCapability) return SPV_SUCCESS; + const spv::Op opcode = static_cast(inst->opcode); + if (opcode == spv::Op::OpCapability) return SPV_SUCCESS; - if (opcode == SpvOpExtension) { + if (opcode == spv::Op::OpExtension) { ValidationState_t& _ = *(reinterpret_cast(user_data)); RegisterExtension(_, inst); return SPV_SUCCESS; @@ -123,7 +123,7 @@ spv_result_t ValidateEntryPoints(ValidationState_t& _) { _.ComputeFunctionToEntryPointMapping(); _.ComputeRecursiveEntryPoints(); - if (_.entry_points().empty() && !_.HasCapability(SpvCapabilityLinkage)) { + if (_.entry_points().empty() && !_.HasCapability(spv::Capability::Linkage)) { return _.diag(SPV_ERROR_INVALID_BINARY, nullptr) << "No OpEntryPoint instruction was found. This is only allowed if " "the Linkage capability is being used."; @@ -218,9 +218,9 @@ spv_result_t ValidateBinaryUsingContextAndValidationState( // able to, briefly, de-const the instruction. Instruction* inst = const_cast(&instruction); - if (inst->opcode() == SpvOpEntryPoint) { + if (inst->opcode() == spv::Op::OpEntryPoint) { const auto entry_point = inst->GetOperandAs(1); - const auto execution_model = inst->GetOperandAs(0); + const auto execution_model = inst->GetOperandAs(0); const std::string desc_name = inst->GetOperandAs(2); ValidationState_t::EntryPointDescription desc; @@ -236,7 +236,7 @@ spv_result_t ValidateBinaryUsingContextAndValidationState( if (visited_entry_points.size() > 0) { for (const Instruction* check_inst : visited_entry_points) { const auto check_execution_model = - check_inst->GetOperandAs(0); + check_inst->GetOperandAs(0); const std::string check_name = check_inst->GetOperandAs(2); @@ -250,12 +250,12 @@ spv_result_t ValidateBinaryUsingContextAndValidationState( } visited_entry_points.push_back(inst); - has_mask_task_nv |= (execution_model == SpvExecutionModelTaskNV || - execution_model == SpvExecutionModelMeshNV); - has_mask_task_ext |= (execution_model == SpvExecutionModelTaskEXT || - execution_model == SpvExecutionModelMeshEXT); + has_mask_task_nv |= (execution_model == spv::ExecutionModel::TaskNV || + execution_model == spv::ExecutionModel::MeshNV); + has_mask_task_ext |= (execution_model == spv::ExecutionModel::TaskEXT || + execution_model == spv::ExecutionModel::MeshEXT); } - if (inst->opcode() == SpvOpFunctionCall) { + if (inst->opcode() == spv::Op::OpFunctionCall) { if (!vstate->in_function_body()) { return vstate->diag(SPV_ERROR_INVALID_LAYOUT, &instruction) << "A FunctionCall must happen within a function body."; @@ -286,7 +286,7 @@ spv_result_t ValidateBinaryUsingContextAndValidationState( { Instruction* inst = const_cast(&instruction); vstate->RegisterInstruction(inst); - if (inst->opcode() == SpvOpTypeForwardPointer) { + if (inst->opcode() == spv::Op::OpTypeForwardPointer) { vstate->RegisterForwardPointer(inst->GetOperandAs(0)); } } @@ -300,7 +300,7 @@ spv_result_t ValidateBinaryUsingContextAndValidationState( return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr) << "Missing OpFunctionEnd at end of module."; - if (vstate->HasCapability(SpvCapabilityBindlessTextureNV) && + if (vstate->HasCapability(spv::Capability::BindlessTextureNV) && !vstate->has_samplerimage_variable_address_mode_specified()) return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr) << "Missing required OpSamplerImageAddressingModeNV instruction."; @@ -365,11 +365,13 @@ spv_result_t ValidateBinaryUsingContextAndValidationState( if (auto error = LiteralsPass(*vstate, &instruction)) return error; if (auto error = RayQueryPass(*vstate, &instruction)) return error; if (auto error = RayTracingPass(*vstate, &instruction)) return error; + if (auto error = RayReorderNVPass(*vstate, &instruction)) return error; if (auto error = MeshShadingPass(*vstate, &instruction)) return error; } - // Validate the preconditions involving adjacent instructions. e.g. SpvOpPhi - // must only be preceded by SpvOpLabel, SpvOpPhi, or SpvOpLine. + // Validate the preconditions involving adjacent instructions. e.g. + // spv::Op::OpPhi must only be preceded by spv::Op::OpLabel, spv::Op::OpPhi, + // or spv::Op::OpLine. if (auto error = ValidateAdjacency(*vstate)) return error; if (auto error = ValidateEntryPoints(*vstate)) return error; diff --git a/3rdparty/spirv-tools/source/val/validate.h b/3rdparty/spirv-tools/source/val/validate.h index 4b953ba31..898743859 100644 --- a/3rdparty/spirv-tools/source/val/validate.h +++ b/3rdparty/spirv-tools/source/val/validate.h @@ -69,8 +69,8 @@ spv_result_t CheckIdDefinitionDominateUse(ValidationState_t& _); /// instructions. /// /// This function will iterate over all instructions and check for any required -/// predecessor and/or successor instructions. e.g. SpvOpPhi must only be -/// preceded by SpvOpLabel, SpvOpPhi, or SpvOpLine. +/// predecessor and/or successor instructions. e.g. spv::Op::OpPhi must only be +/// preceded by spv::Op::OpLabel, spv::Op::OpPhi, or spv::Op::OpLine. /// /// @param[in] _ the validation state of the module /// @@ -203,6 +203,9 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst); /// Validates correctness of ray tracing instructions. spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst); +/// Validates correctness of shader execution reorder instructions. +spv_result_t RayReorderNVPass(ValidationState_t& _, const Instruction* inst); + /// Validates correctness of mesh shading instructions. spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst); diff --git a/3rdparty/spirv-tools/source/val/validate_adjacency.cpp b/3rdparty/spirv-tools/source/val/validate_adjacency.cpp index 8e6c373ea..50c2e92ae 100644 --- a/3rdparty/spirv-tools/source/val/validate_adjacency.cpp +++ b/3rdparty/spirv-tools/source/val/validate_adjacency.cpp @@ -46,15 +46,15 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { for (size_t i = 0; i < instructions.size(); ++i) { const auto& inst = instructions[i]; switch (inst.opcode()) { - case SpvOpFunction: - case SpvOpFunctionParameter: + case spv::Op::OpFunction: + case spv::Op::OpFunctionParameter: adjacency_status = IN_NEW_FUNCTION; break; - case SpvOpLabel: + case spv::Op::OpLabel: adjacency_status = adjacency_status == IN_NEW_FUNCTION ? IN_ENTRY_BLOCK : PHI_VALID; break; - case SpvOpExtInst: + case spv::Op::OpExtInst: // If it is a debug info instruction, we do not change the status to // allow debug info instructions before OpVariable in a function. // TODO(https://gitlab.khronos.org/spirv/SPIR-V/issues/533): We need @@ -67,7 +67,7 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { adjacency_status = PHI_AND_VAR_INVALID; } break; - case SpvOpPhi: + case spv::Op::OpPhi: if (adjacency_status != PHI_VALID) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "OpPhi must appear within a non-entry block before all " @@ -75,15 +75,15 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { << "(except for OpLine, which can be mixed with OpPhi)."; } break; - case SpvOpLine: - case SpvOpNoLine: + case spv::Op::OpLine: + case spv::Op::OpNoLine: break; - case SpvOpLoopMerge: + case spv::Op::OpLoopMerge: adjacency_status = PHI_AND_VAR_INVALID; if (i != (instructions.size() - 1)) { switch (instructions[i + 1].opcode()) { - case SpvOpBranch: - case SpvOpBranchConditional: + case spv::Op::OpBranch: + case spv::Op::OpBranchConditional: break; default: return _.diag(SPV_ERROR_INVALID_DATA, &inst) @@ -94,12 +94,12 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { } } break; - case SpvOpSelectionMerge: + case spv::Op::OpSelectionMerge: adjacency_status = PHI_AND_VAR_INVALID; if (i != (instructions.size() - 1)) { switch (instructions[i + 1].opcode()) { - case SpvOpBranchConditional: - case SpvOpSwitch: + case spv::Op::OpBranchConditional: + case spv::Op::OpSwitch: break; default: return _.diag(SPV_ERROR_INVALID_DATA, &inst) @@ -110,8 +110,9 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) { } } break; - case SpvOpVariable: - if (inst.GetOperandAs(2) == SpvStorageClassFunction && + case spv::Op::OpVariable: + if (inst.GetOperandAs(2) == + spv::StorageClass::Function && adjacency_status != IN_ENTRY_BLOCK) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "All OpVariable instructions in a function must be the " diff --git a/3rdparty/spirv-tools/source/val/validate_annotation.cpp b/3rdparty/spirv-tools/source/val/validate_annotation.cpp index 21f999b09..bef753d9c 100644 --- a/3rdparty/spirv-tools/source/val/validate_annotation.cpp +++ b/3rdparty/spirv-tools/source/val/validate_annotation.cpp @@ -24,12 +24,12 @@ namespace { // Returns true if the decoration takes ID parameters. // TODO(dneto): This can be generated from the grammar. -bool DecorationTakesIdParameters(SpvDecoration type) { +bool DecorationTakesIdParameters(spv::Decoration type) { switch (type) { - case SpvDecorationUniformId: - case SpvDecorationAlignmentId: - case SpvDecorationMaxByteOffsetId: - case SpvDecorationHlslCounterBufferGOOGLE: + case spv::Decoration::UniformId: + case spv::Decoration::AlignmentId: + case spv::Decoration::MaxByteOffsetId: + case spv::Decoration::HlslCounterBufferGOOGLE: return true; default: break; @@ -37,14 +37,14 @@ bool DecorationTakesIdParameters(SpvDecoration type) { return false; } -bool IsMemberDecorationOnly(SpvDecoration dec) { +bool IsMemberDecorationOnly(spv::Decoration dec) { switch (dec) { - case SpvDecorationRowMajor: - case SpvDecorationColMajor: - case SpvDecorationMatrixStride: + case spv::Decoration::RowMajor: + case spv::Decoration::ColMajor: + case spv::Decoration::MatrixStride: // SPIR-V spec bug? Offset is generated on variables when dealing with // transform feedback. - // case SpvDecorationOffset: + // case spv::Decoration::Offset: return true; default: break; @@ -52,42 +52,42 @@ bool IsMemberDecorationOnly(SpvDecoration dec) { return false; } -bool IsNotMemberDecoration(SpvDecoration dec) { +bool IsNotMemberDecoration(spv::Decoration dec) { switch (dec) { - case SpvDecorationSpecId: - case SpvDecorationBlock: - case SpvDecorationBufferBlock: - case SpvDecorationArrayStride: - case SpvDecorationGLSLShared: - case SpvDecorationGLSLPacked: - case SpvDecorationCPacked: + case spv::Decoration::SpecId: + case spv::Decoration::Block: + case spv::Decoration::BufferBlock: + case spv::Decoration::ArrayStride: + case spv::Decoration::GLSLShared: + case spv::Decoration::GLSLPacked: + case spv::Decoration::CPacked: // TODO: https://github.com/KhronosGroup/glslang/issues/703: // glslang applies Restrict to structure members. - // case SpvDecorationRestrict: - case SpvDecorationAliased: - case SpvDecorationConstant: - case SpvDecorationUniform: - case SpvDecorationUniformId: - case SpvDecorationSaturatedConversion: - case SpvDecorationIndex: - case SpvDecorationBinding: - case SpvDecorationDescriptorSet: - case SpvDecorationFuncParamAttr: - case SpvDecorationFPRoundingMode: - case SpvDecorationFPFastMathMode: - case SpvDecorationLinkageAttributes: - case SpvDecorationNoContraction: - case SpvDecorationInputAttachmentIndex: - case SpvDecorationAlignment: - case SpvDecorationMaxByteOffset: - case SpvDecorationAlignmentId: - case SpvDecorationMaxByteOffsetId: - case SpvDecorationNoSignedWrap: - case SpvDecorationNoUnsignedWrap: - case SpvDecorationNonUniform: - case SpvDecorationRestrictPointer: - case SpvDecorationAliasedPointer: - case SpvDecorationCounterBuffer: + // case spv::Decoration::Restrict: + case spv::Decoration::Aliased: + case spv::Decoration::Constant: + case spv::Decoration::Uniform: + case spv::Decoration::UniformId: + case spv::Decoration::SaturatedConversion: + case spv::Decoration::Index: + case spv::Decoration::Binding: + case spv::Decoration::DescriptorSet: + case spv::Decoration::FuncParamAttr: + case spv::Decoration::FPRoundingMode: + case spv::Decoration::FPFastMathMode: + case spv::Decoration::LinkageAttributes: + case spv::Decoration::NoContraction: + case spv::Decoration::InputAttachmentIndex: + case spv::Decoration::Alignment: + case spv::Decoration::MaxByteOffset: + case spv::Decoration::AlignmentId: + case spv::Decoration::MaxByteOffsetId: + case spv::Decoration::NoSignedWrap: + case spv::Decoration::NoUnsignedWrap: + case spv::Decoration::NonUniform: + case spv::Decoration::RestrictPointer: + case spv::Decoration::AliasedPointer: + case spv::Decoration::CounterBuffer: return true; default: break; @@ -95,7 +95,7 @@ bool IsNotMemberDecoration(SpvDecoration dec) { return false; } -spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec, +spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec, const Instruction* inst, const Instruction* target) { auto fail = [&_, dec, inst, target](uint32_t vuid) -> DiagnosticStream { @@ -106,76 +106,76 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec, return ds; }; switch (dec) { - case SpvDecorationSpecId: + case spv::Decoration::SpecId: if (!spvOpcodeIsScalarSpecConstant(target->opcode())) { return fail(0) << "must be a scalar specialization constant"; } break; - case SpvDecorationBlock: - case SpvDecorationBufferBlock: - case SpvDecorationGLSLShared: - case SpvDecorationGLSLPacked: - case SpvDecorationCPacked: - if (target->opcode() != SpvOpTypeStruct) { + case spv::Decoration::Block: + case spv::Decoration::BufferBlock: + case spv::Decoration::GLSLShared: + case spv::Decoration::GLSLPacked: + case spv::Decoration::CPacked: + if (target->opcode() != spv::Op::OpTypeStruct) { return fail(0) << "must be a structure type"; } break; - case SpvDecorationArrayStride: - if (target->opcode() != SpvOpTypeArray && - target->opcode() != SpvOpTypeRuntimeArray && - target->opcode() != SpvOpTypePointer) { + case spv::Decoration::ArrayStride: + if (target->opcode() != spv::Op::OpTypeArray && + target->opcode() != spv::Op::OpTypeRuntimeArray && + target->opcode() != spv::Op::OpTypePointer) { return fail(0) << "must be an array or pointer type"; } break; - case SpvDecorationBuiltIn: - if (target->opcode() != SpvOpVariable && + case spv::Decoration::BuiltIn: + if (target->opcode() != spv::Op::OpVariable && !spvOpcodeIsConstant(target->opcode())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "BuiltIns can only target variables, structure members or " "constants"; } - if (_.HasCapability(SpvCapabilityShader) && - inst->GetOperandAs(2) == SpvBuiltInWorkgroupSize) { + if (_.HasCapability(spv::Capability::Shader) && + inst->GetOperandAs(2) == spv::BuiltIn::WorkgroupSize) { if (!spvOpcodeIsConstant(target->opcode())) { return fail(0) << "must be a constant for WorkgroupSize"; } - } else if (target->opcode() != SpvOpVariable) { + } else if (target->opcode() != spv::Op::OpVariable) { return fail(0) << "must be a variable"; } break; - case SpvDecorationNoPerspective: - case SpvDecorationFlat: - case SpvDecorationPatch: - case SpvDecorationCentroid: - case SpvDecorationSample: - case SpvDecorationRestrict: - case SpvDecorationAliased: - case SpvDecorationVolatile: - case SpvDecorationCoherent: - case SpvDecorationNonWritable: - case SpvDecorationNonReadable: - case SpvDecorationXfbBuffer: - case SpvDecorationXfbStride: - case SpvDecorationComponent: - case SpvDecorationStream: - case SpvDecorationRestrictPointer: - case SpvDecorationAliasedPointer: - if (target->opcode() != SpvOpVariable && - target->opcode() != SpvOpFunctionParameter) { + case spv::Decoration::NoPerspective: + case spv::Decoration::Flat: + case spv::Decoration::Patch: + case spv::Decoration::Centroid: + case spv::Decoration::Sample: + case spv::Decoration::Restrict: + case spv::Decoration::Aliased: + case spv::Decoration::Volatile: + case spv::Decoration::Coherent: + case spv::Decoration::NonWritable: + case spv::Decoration::NonReadable: + case spv::Decoration::XfbBuffer: + case spv::Decoration::XfbStride: + case spv::Decoration::Component: + case spv::Decoration::Stream: + case spv::Decoration::RestrictPointer: + case spv::Decoration::AliasedPointer: + if (target->opcode() != spv::Op::OpVariable && + target->opcode() != spv::Op::OpFunctionParameter) { return fail(0) << "must be a memory object declaration"; } - if (_.GetIdOpcode(target->type_id()) != SpvOpTypePointer) { + if (_.GetIdOpcode(target->type_id()) != spv::Op::OpTypePointer) { return fail(0) << "must be a pointer type"; } break; - case SpvDecorationInvariant: - case SpvDecorationConstant: - case SpvDecorationLocation: - case SpvDecorationIndex: - case SpvDecorationBinding: - case SpvDecorationDescriptorSet: - case SpvDecorationInputAttachmentIndex: - if (target->opcode() != SpvOpVariable) { + case spv::Decoration::Invariant: + case spv::Decoration::Constant: + case spv::Decoration::Location: + case spv::Decoration::Index: + case spv::Decoration::Binding: + case spv::Decoration::DescriptorSet: + case spv::Decoration::InputAttachmentIndex: + if (target->opcode() != spv::Op::OpVariable) { return fail(0) << "must be a variable"; } break; @@ -185,57 +185,58 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec, if (spvIsVulkanEnv(_.context()->target_env)) { // The following were all checked as pointer types above. - SpvStorageClass sc = SpvStorageClassUniform; + spv::StorageClass sc = spv::StorageClass::Uniform; const auto type = _.FindDef(target->type_id()); if (type && type->operands().size() > 2) { - sc = type->GetOperandAs(1); + sc = type->GetOperandAs(1); } switch (dec) { - case SpvDecorationLocation: - case SpvDecorationComponent: + case spv::Decoration::Location: + case spv::Decoration::Component: // Location is used for input, output and ray tracing stages. - if (sc != SpvStorageClassInput && sc != SpvStorageClassOutput && - sc != SpvStorageClassRayPayloadKHR && - sc != SpvStorageClassIncomingRayPayloadKHR && - sc != SpvStorageClassHitAttributeKHR && - sc != SpvStorageClassCallableDataKHR && - sc != SpvStorageClassIncomingCallableDataKHR && - sc != SpvStorageClassShaderRecordBufferKHR) { + if (sc != spv::StorageClass::Input && sc != spv::StorageClass::Output && + sc != spv::StorageClass::RayPayloadKHR && + sc != spv::StorageClass::IncomingRayPayloadKHR && + sc != spv::StorageClass::HitAttributeKHR && + sc != spv::StorageClass::CallableDataKHR && + sc != spv::StorageClass::IncomingCallableDataKHR && + sc != spv::StorageClass::ShaderRecordBufferKHR && + sc != spv::StorageClass::HitObjectAttributeNV) { return _.diag(SPV_ERROR_INVALID_ID, target) << _.VkErrorID(6672) << _.SpvDecorationString(dec) << " decoration must not be applied to this storage class"; } break; - case SpvDecorationIndex: + case spv::Decoration::Index: // Langauge from SPIR-V definition of Index - if (sc != SpvStorageClassOutput) { + if (sc != spv::StorageClass::Output) { return fail(0) << "must be in the Output storage class"; } break; - case SpvDecorationBinding: - case SpvDecorationDescriptorSet: - if (sc != SpvStorageClassStorageBuffer && - sc != SpvStorageClassUniform && - sc != SpvStorageClassUniformConstant) { + case spv::Decoration::Binding: + case spv::Decoration::DescriptorSet: + if (sc != spv::StorageClass::StorageBuffer && + sc != spv::StorageClass::Uniform && + sc != spv::StorageClass::UniformConstant) { return fail(6491) << "must be in the StorageBuffer, Uniform, or " "UniformConstant storage class"; } break; - case SpvDecorationInputAttachmentIndex: - if (sc != SpvStorageClassUniformConstant) { + case spv::Decoration::InputAttachmentIndex: + if (sc != spv::StorageClass::UniformConstant) { return fail(6678) << "must be in the UniformConstant storage class"; } break; - case SpvDecorationFlat: - case SpvDecorationNoPerspective: - case SpvDecorationCentroid: - case SpvDecorationSample: - if (sc != SpvStorageClassInput && sc != SpvStorageClassOutput) { + case spv::Decoration::Flat: + case spv::Decoration::NoPerspective: + case spv::Decoration::Centroid: + case spv::Decoration::Sample: + if (sc != spv::StorageClass::Input && sc != spv::StorageClass::Output) { return fail(4670) << "storage class must be Input or Output"; } break; - case SpvDecorationPerVertexKHR: - if (sc != SpvStorageClassInput) { + case spv::Decoration::PerVertexKHR: + if (sc != spv::StorageClass::Input) { return fail(6777) << "storage class must be Input"; } break; @@ -247,7 +248,7 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec, } spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) { - const auto decoration = inst->GetOperandAs(1); + const auto decoration = inst->GetOperandAs(1); const auto target_id = inst->GetOperandAs(0); const auto target = _.FindDef(target_id); if (!target) { @@ -255,8 +256,8 @@ spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) { } if (spvIsVulkanEnv(_.context()->target_env)) { - if ((decoration == SpvDecorationGLSLShared) || - (decoration == SpvDecorationGLSLPacked)) { + if ((decoration == spv::Decoration::GLSLShared) || + (decoration == spv::Decoration::GLSLPacked)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4669) << "OpDecorate decoration '" << _.SpvDecorationString(decoration) @@ -270,7 +271,7 @@ spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) { "OpDecorateId"; } - if (target->opcode() != SpvOpDecorationGroup) { + if (target->opcode() != spv::Op::OpDecorationGroup) { if (IsMemberDecorationOnly(decoration)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.SpvDecorationString(decoration) @@ -287,7 +288,7 @@ spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) { } spv_result_t ValidateDecorateId(ValidationState_t& _, const Instruction* inst) { - const auto decoration = inst->GetOperandAs(1); + const auto decoration = inst->GetOperandAs(1); if (!DecorationTakesIdParameters(decoration)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Decorations that don't take ID parameters may not be used with " @@ -306,7 +307,7 @@ spv_result_t ValidateMemberDecorate(ValidationState_t& _, const Instruction* inst) { const auto struct_type_id = inst->GetOperandAs(0); const auto struct_type = _.FindDef(struct_type_id); - if (!struct_type || SpvOpTypeStruct != struct_type->opcode()) { + if (!struct_type || spv::Op::OpTypeStruct != struct_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpMemberDecorate Structure type " << _.getIdName(struct_type_id) << " is not a struct type."; @@ -323,7 +324,7 @@ spv_result_t ValidateMemberDecorate(ValidationState_t& _, << " members. Largest valid index is " << member_count - 1 << "."; } - const auto decoration = inst->GetOperandAs(2); + const auto decoration = inst->GetOperandAs(2); if (IsNotMemberDecoration(decoration)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.SpvDecorationString(decoration) @@ -339,10 +340,11 @@ spv_result_t ValidateDecorationGroup(ValidationState_t& _, const auto decoration_group = _.FindDef(decoration_group_id); for (auto pair : decoration_group->uses()) { auto use = pair.first; - if (use->opcode() != SpvOpDecorate && use->opcode() != SpvOpGroupDecorate && - use->opcode() != SpvOpGroupMemberDecorate && - use->opcode() != SpvOpName && use->opcode() != SpvOpDecorateId && - !use->IsNonSemantic()) { + if (use->opcode() != spv::Op::OpDecorate && + use->opcode() != spv::Op::OpGroupDecorate && + use->opcode() != spv::Op::OpGroupMemberDecorate && + use->opcode() != spv::Op::OpName && + use->opcode() != spv::Op::OpDecorateId && !use->IsNonSemantic()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Result id of OpDecorationGroup can only " << "be targeted by OpName, OpGroupDecorate, " @@ -356,7 +358,8 @@ spv_result_t ValidateGroupDecorate(ValidationState_t& _, const Instruction* inst) { const auto decoration_group_id = inst->GetOperandAs(0); auto decoration_group = _.FindDef(decoration_group_id); - if (!decoration_group || SpvOpDecorationGroup != decoration_group->opcode()) { + if (!decoration_group || + spv::Op::OpDecorationGroup != decoration_group->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpGroupDecorate Decoration group " << _.getIdName(decoration_group_id) << " is not a decoration group."; @@ -364,7 +367,7 @@ spv_result_t ValidateGroupDecorate(ValidationState_t& _, for (unsigned i = 1; i < inst->operands().size(); ++i) { auto target_id = inst->GetOperandAs(i); auto target = _.FindDef(target_id); - if (!target || target->opcode() == SpvOpDecorationGroup) { + if (!target || target->opcode() == spv::Op::OpDecorationGroup) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpGroupDecorate may not target OpDecorationGroup " << _.getIdName(target_id); @@ -377,7 +380,8 @@ spv_result_t ValidateGroupMemberDecorate(ValidationState_t& _, const Instruction* inst) { const auto decoration_group_id = inst->GetOperandAs(0); const auto decoration_group = _.FindDef(decoration_group_id); - if (!decoration_group || SpvOpDecorationGroup != decoration_group->opcode()) { + if (!decoration_group || + spv::Op::OpDecorationGroup != decoration_group->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpGroupMemberDecorate Decoration group " << _.getIdName(decoration_group_id) << " is not a decoration group."; @@ -388,7 +392,7 @@ spv_result_t ValidateGroupMemberDecorate(ValidationState_t& _, const uint32_t struct_id = inst->GetOperandAs(i); const uint32_t index = inst->GetOperandAs(i + 1); auto struct_instr = _.FindDef(struct_id); - if (!struct_instr || SpvOpTypeStruct != struct_instr->opcode()) { + if (!struct_instr || spv::Op::OpTypeStruct != struct_instr->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpGroupMemberDecorate Structure type " << _.getIdName(struct_id) << " is not a struct type."; @@ -413,10 +417,11 @@ spv_result_t ValidateGroupMemberDecorate(ValidationState_t& _, spv_result_t RegisterDecorations(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: { + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: { const uint32_t target_id = inst->word(1); - const SpvDecoration dec_type = static_cast(inst->word(2)); + const spv::Decoration dec_type = + static_cast(inst->word(2)); std::vector dec_params; if (inst->words().size() > 3) { dec_params.insert(dec_params.end(), inst->words().begin() + 3, @@ -425,10 +430,11 @@ spv_result_t RegisterDecorations(ValidationState_t& _, _.RegisterDecorationForId(target_id, Decoration(dec_type, dec_params)); break; } - case SpvOpMemberDecorate: { + case spv::Op::OpMemberDecorate: { const uint32_t struct_id = inst->word(1); const uint32_t index = inst->word(2); - const SpvDecoration dec_type = static_cast(inst->word(3)); + const spv::Decoration dec_type = + static_cast(inst->word(3)); std::vector dec_params; if (inst->words().size() > 4) { dec_params.insert(dec_params.end(), inst->words().begin() + 4, @@ -438,12 +444,12 @@ spv_result_t RegisterDecorations(ValidationState_t& _, Decoration(dec_type, dec_params, index)); break; } - case SpvOpDecorationGroup: { + case spv::Op::OpDecorationGroup: { // We don't need to do anything right now. Assigning decorations to groups // will be taken care of via OpGroupDecorate. break; } - case SpvOpGroupDecorate: { + case spv::Op::OpGroupDecorate: { // Word 1 is the group . All subsequent words are target s that // are going to be decorated with the decorations. const uint32_t decoration_group_id = inst->word(1); @@ -456,7 +462,7 @@ spv_result_t RegisterDecorations(ValidationState_t& _, } break; } - case SpvOpGroupMemberDecorate: { + case spv::Op::OpGroupMemberDecorate: { // Word 1 is the Decoration Group followed by (struct,literal) // pairs. All decorations of the group should be applied to all the struct // members that are specified in the instructions. @@ -486,24 +492,24 @@ spv_result_t RegisterDecorations(ValidationState_t& _, spv_result_t AnnotationPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpDecorate: + case spv::Op::OpDecorate: if (auto error = ValidateDecorate(_, inst)) return error; break; - case SpvOpDecorateId: + case spv::Op::OpDecorateId: if (auto error = ValidateDecorateId(_, inst)) return error; break; - // TODO(dneto): SpvOpDecorateStringGOOGLE + // TODO(dneto): spv::Op::OpDecorateStringGOOGLE // See https://github.com/KhronosGroup/SPIRV-Tools/issues/2253 - case SpvOpMemberDecorate: + case spv::Op::OpMemberDecorate: if (auto error = ValidateMemberDecorate(_, inst)) return error; break; - case SpvOpDecorationGroup: + case spv::Op::OpDecorationGroup: if (auto error = ValidateDecorationGroup(_, inst)) return error; break; - case SpvOpGroupDecorate: + case spv::Op::OpGroupDecorate: if (auto error = ValidateGroupDecorate(_, inst)) return error; break; - case SpvOpGroupMemberDecorate: + case spv::Op::OpGroupMemberDecorate: if (auto error = ValidateGroupMemberDecorate(_, inst)) return error; break; default: diff --git a/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp b/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp index bae9b5dca..a082eebc9 100644 --- a/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp +++ b/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp @@ -28,19 +28,20 @@ namespace val { // Validates correctness of arithmetic instructions. spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpFAdd: - case SpvOpFSub: - case SpvOpFMul: - case SpvOpFDiv: - case SpvOpFRem: - case SpvOpFMod: - case SpvOpFNegate: { + case spv::Op::OpFAdd: + case spv::Op::OpFSub: + case spv::Op::OpFMul: + case spv::Op::OpFDiv: + case spv::Op::OpFRem: + case spv::Op::OpFMod: + case spv::Op::OpFNegate: { bool supportsCoopMat = - (opcode != SpvOpFMul && opcode != SpvOpFRem && opcode != SpvOpFMod); + (opcode != spv::Op::OpFMul && opcode != spv::Op::OpFRem && + opcode != spv::Op::OpFMod); if (!_.IsFloatScalarType(result_type) && !_.IsFloatVectorType(result_type) && !(supportsCoopMat && _.IsFloatCooperativeMatrixType(result_type))) @@ -59,9 +60,9 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpUDiv: - case SpvOpUMod: { - bool supportsCoopMat = (opcode == SpvOpUDiv); + case spv::Op::OpUDiv: + case spv::Op::OpUMod: { + bool supportsCoopMat = (opcode == spv::Op::OpUDiv); if (!_.IsUnsignedIntScalarType(result_type) && !_.IsUnsignedIntVectorType(result_type) && !(supportsCoopMat && @@ -81,15 +82,16 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpISub: - case SpvOpIAdd: - case SpvOpIMul: - case SpvOpSDiv: - case SpvOpSMod: - case SpvOpSRem: - case SpvOpSNegate: { + case spv::Op::OpISub: + case spv::Op::OpIAdd: + case spv::Op::OpIMul: + case spv::Op::OpSDiv: + case spv::Op::OpSMod: + case spv::Op::OpSRem: + case spv::Op::OpSNegate: { bool supportsCoopMat = - (opcode != SpvOpIMul && opcode != SpvOpSRem && opcode != SpvOpSMod); + (opcode != spv::Op::OpIMul && opcode != spv::Op::OpSRem && + opcode != spv::Op::OpSMod); if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) && !(supportsCoopMat && _.IsIntCooperativeMatrixType(result_type))) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -125,7 +127,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpDot: { + case spv::Op::OpDot: { if (!_.IsFloatScalarType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected float scalar type as Result Type: " @@ -162,7 +164,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpVectorTimesScalar: { + case spv::Op::OpVectorTimesScalar: { if (!_.IsFloatVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected float vector type as Result Type: " @@ -185,7 +187,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpMatrixTimesScalar: { + case spv::Op::OpMatrixTimesScalar: { if (!_.IsFloatMatrixType(result_type) && !_.IsCooperativeMatrixType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -209,7 +211,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpVectorTimesMatrix: { + case spv::Op::OpVectorTimesMatrix: { const uint32_t vector_type_id = _.GetOperandTypeId(inst, 2); const uint32_t matrix_type_id = _.GetOperandTypeId(inst, 3); @@ -259,7 +261,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpMatrixTimesVector: { + case spv::Op::OpMatrixTimesVector: { const uint32_t matrix_type_id = _.GetOperandTypeId(inst, 2); const uint32_t vector_type_id = _.GetOperandTypeId(inst, 3); @@ -303,7 +305,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpMatrixTimesMatrix: { + case spv::Op::OpMatrixTimesMatrix: { const uint32_t left_type_id = _.GetOperandTypeId(inst, 2); const uint32_t right_type_id = _.GetOperandTypeId(inst, 3); @@ -369,7 +371,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpOuterProduct: { + case spv::Op::OpOuterProduct: { const uint32_t left_type_id = _.GetOperandTypeId(inst, 2); const uint32_t right_type_id = _.GetOperandTypeId(inst, 3); @@ -407,10 +409,10 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpIAddCarry: - case SpvOpISubBorrow: - case SpvOpUMulExtended: - case SpvOpSMulExtended: { + case spv::Op::OpIAddCarry: + case spv::Op::OpISubBorrow: + case spv::Op::OpUMulExtended: + case spv::Op::OpSMulExtended: { std::vector result_types; if (!_.GetStructMemberTypes(result_type, &result_types)) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -422,7 +424,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { << "Expected Result Type struct to have two members: " << spvOpcodeString(opcode); - if (opcode == SpvOpSMulExtended) { + if (opcode == spv::Op::OpSMulExtended) { if (!_.IsIntScalarType(result_types[0]) && !_.IsIntVectorType(result_types[0])) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -453,7 +455,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpCooperativeMatrixMulAddNV: { + case spv::Op::OpCooperativeMatrixMulAddNV: { const uint32_t D_type_id = _.GetOperandTypeId(inst, 1); const uint32_t A_type_id = _.GetOperandTypeId(inst, 2); const uint32_t B_type_id = _.GetOperandTypeId(inst, 3); diff --git a/3rdparty/spirv-tools/source/val/validate_atomics.cpp b/3rdparty/spirv-tools/source/val/validate_atomics.cpp index bf565c310..d6b094c4a 100644 --- a/3rdparty/spirv-tools/source/val/validate_atomics.cpp +++ b/3rdparty/spirv-tools/source/val/validate_atomics.cpp @@ -29,18 +29,18 @@ namespace { -bool IsStorageClassAllowedByUniversalRules(uint32_t storage_class) { +bool IsStorageClassAllowedByUniversalRules(spv::StorageClass storage_class) { switch (storage_class) { - case SpvStorageClassUniform: - case SpvStorageClassStorageBuffer: - case SpvStorageClassWorkgroup: - case SpvStorageClassCrossWorkgroup: - case SpvStorageClassGeneric: - case SpvStorageClassAtomicCounter: - case SpvStorageClassImage: - case SpvStorageClassFunction: - case SpvStorageClassPhysicalStorageBuffer: - case SpvStorageClassTaskPayloadWorkgroupEXT: + case spv::StorageClass::Uniform: + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::Workgroup: + case spv::StorageClass::CrossWorkgroup: + case spv::StorageClass::Generic: + case spv::StorageClass::AtomicCounter: + case spv::StorageClass::Image: + case spv::StorageClass::Function: + case spv::StorageClass::PhysicalStorageBuffer: + case spv::StorageClass::TaskPayloadWorkgroupEXT: return true; break; default: @@ -48,10 +48,10 @@ bool IsStorageClassAllowedByUniversalRules(uint32_t storage_class) { } } -bool HasReturnType(uint32_t opcode) { +bool HasReturnType(spv::Op opcode) { switch (opcode) { - case SpvOpAtomicStore: - case SpvOpAtomicFlagClear: + case spv::Op::OpAtomicStore: + case spv::Op::OpAtomicFlagClear: return false; break; default: @@ -59,11 +59,11 @@ bool HasReturnType(uint32_t opcode) { } } -bool HasOnlyFloatReturnType(uint32_t opcode) { +bool HasOnlyFloatReturnType(spv::Op opcode) { switch (opcode) { - case SpvOpAtomicFAddEXT: - case SpvOpAtomicFMinEXT: - case SpvOpAtomicFMaxEXT: + case spv::Op::OpAtomicFAddEXT: + case spv::Op::OpAtomicFMinEXT: + case spv::Op::OpAtomicFMaxEXT: return true; break; default: @@ -71,21 +71,21 @@ bool HasOnlyFloatReturnType(uint32_t opcode) { } } -bool HasOnlyIntReturnType(uint32_t opcode) { +bool HasOnlyIntReturnType(spv::Op opcode) { switch (opcode) { - case SpvOpAtomicCompareExchange: - case SpvOpAtomicCompareExchangeWeak: - case SpvOpAtomicIIncrement: - case SpvOpAtomicIDecrement: - case SpvOpAtomicIAdd: - case SpvOpAtomicISub: - case SpvOpAtomicSMin: - case SpvOpAtomicUMin: - case SpvOpAtomicSMax: - case SpvOpAtomicUMax: - case SpvOpAtomicAnd: - case SpvOpAtomicOr: - case SpvOpAtomicXor: + case spv::Op::OpAtomicCompareExchange: + case spv::Op::OpAtomicCompareExchangeWeak: + case spv::Op::OpAtomicIIncrement: + case spv::Op::OpAtomicIDecrement: + case spv::Op::OpAtomicIAdd: + case spv::Op::OpAtomicISub: + case spv::Op::OpAtomicSMin: + case spv::Op::OpAtomicUMin: + case spv::Op::OpAtomicSMax: + case spv::Op::OpAtomicUMax: + case spv::Op::OpAtomicAnd: + case spv::Op::OpAtomicOr: + case spv::Op::OpAtomicXor: return true; break; default: @@ -93,10 +93,10 @@ bool HasOnlyIntReturnType(uint32_t opcode) { } } -bool HasIntOrFloatReturnType(uint32_t opcode) { +bool HasIntOrFloatReturnType(spv::Op opcode) { switch (opcode) { - case SpvOpAtomicLoad: - case SpvOpAtomicExchange: + case spv::Op::OpAtomicLoad: + case spv::Op::OpAtomicExchange: return true; break; default: @@ -104,9 +104,9 @@ bool HasIntOrFloatReturnType(uint32_t opcode) { } } -bool HasOnlyBoolReturnType(uint32_t opcode) { +bool HasOnlyBoolReturnType(spv::Op opcode) { switch (opcode) { - case SpvOpAtomicFlagTestAndSet: + case spv::Op::OpAtomicFlagTestAndSet: return true; break; default: @@ -121,29 +121,29 @@ namespace val { // Validates correctness of atomic instructions. spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); switch (opcode) { - case SpvOpAtomicLoad: - case SpvOpAtomicStore: - case SpvOpAtomicExchange: - case SpvOpAtomicFAddEXT: - case SpvOpAtomicCompareExchange: - case SpvOpAtomicCompareExchangeWeak: - case SpvOpAtomicIIncrement: - case SpvOpAtomicIDecrement: - case SpvOpAtomicIAdd: - case SpvOpAtomicISub: - case SpvOpAtomicSMin: - case SpvOpAtomicUMin: - case SpvOpAtomicFMinEXT: - case SpvOpAtomicSMax: - case SpvOpAtomicUMax: - case SpvOpAtomicFMaxEXT: - case SpvOpAtomicAnd: - case SpvOpAtomicOr: - case SpvOpAtomicXor: - case SpvOpAtomicFlagTestAndSet: - case SpvOpAtomicFlagClear: { + case spv::Op::OpAtomicLoad: + case spv::Op::OpAtomicStore: + case spv::Op::OpAtomicExchange: + case spv::Op::OpAtomicFAddEXT: + case spv::Op::OpAtomicCompareExchange: + case spv::Op::OpAtomicCompareExchangeWeak: + case spv::Op::OpAtomicIIncrement: + case spv::Op::OpAtomicIDecrement: + case spv::Op::OpAtomicIAdd: + case spv::Op::OpAtomicISub: + case spv::Op::OpAtomicSMin: + case spv::Op::OpAtomicUMin: + case spv::Op::OpAtomicFMinEXT: + case spv::Op::OpAtomicSMax: + case spv::Op::OpAtomicUMax: + case spv::Op::OpAtomicFMaxEXT: + case spv::Op::OpAtomicAnd: + case spv::Op::OpAtomicOr: + case spv::Op::OpAtomicXor: + case spv::Op::OpAtomicFlagTestAndSet: + case spv::Op::OpAtomicFlagClear: { const uint32_t result_type = inst->type_id(); // All current atomics only are scalar result @@ -177,7 +177,7 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { uint32_t operand_index = HasReturnType(opcode) ? 2 : 0; const uint32_t pointer_type = _.GetOperandTypeId(inst, operand_index++); uint32_t data_type = 0; - uint32_t storage_class = 0; + spv::StorageClass storage_class; if (!_.GetPointerTypeInfo(pointer_type, &data_type, &storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) @@ -185,8 +185,8 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { } // Can't use result_type because OpAtomicStore doesn't have a result - if ( _.IsIntScalarType(data_type) &&_.GetBitWidth(data_type) == 64 && - !_.HasCapability(SpvCapabilityInt64Atomics)) { + if (_.IsIntScalarType(data_type) && _.GetBitWidth(data_type) == 64 && + !_.HasCapability(spv::Capability::Int64Atomics)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": 64-bit atomics require the Int64Atomics capability"; @@ -200,69 +200,69 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { } // Then Shader rules - if (_.HasCapability(SpvCapabilityShader)) { + if (_.HasCapability(spv::Capability::Shader)) { // Vulkan environment rule if (spvIsVulkanEnv(_.context()->target_env)) { - if ((storage_class != SpvStorageClassUniform) && - (storage_class != SpvStorageClassStorageBuffer) && - (storage_class != SpvStorageClassWorkgroup) && - (storage_class != SpvStorageClassImage) && - (storage_class != SpvStorageClassPhysicalStorageBuffer) && - (storage_class != SpvStorageClassTaskPayloadWorkgroupEXT)) { + if ((storage_class != spv::StorageClass::Uniform) && + (storage_class != spv::StorageClass::StorageBuffer) && + (storage_class != spv::StorageClass::Workgroup) && + (storage_class != spv::StorageClass::Image) && + (storage_class != spv::StorageClass::PhysicalStorageBuffer) && + (storage_class != spv::StorageClass::TaskPayloadWorkgroupEXT)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4686) << spvOpcodeString(opcode) << ": Vulkan spec only allows storage classes for atomic to " "be: Uniform, Workgroup, Image, StorageBuffer, " "PhysicalStorageBuffer or TaskPayloadWorkgroupEXT."; } - } else if (storage_class == SpvStorageClassFunction) { + } else if (storage_class == spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Function storage class forbidden when the Shader " "capability is declared."; } - if (opcode == SpvOpAtomicFAddEXT) { + if (opcode == spv::Op::OpAtomicFAddEXT) { // result type being float checked already if ((_.GetBitWidth(result_type) == 16) && - (!_.HasCapability(SpvCapabilityAtomicFloat16AddEXT))) { + (!_.HasCapability(spv::Capability::AtomicFloat16AddEXT))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": float add atomics require the AtomicFloat32AddEXT " "capability"; } if ((_.GetBitWidth(result_type) == 32) && - (!_.HasCapability(SpvCapabilityAtomicFloat32AddEXT))) { + (!_.HasCapability(spv::Capability::AtomicFloat32AddEXT))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": float add atomics require the AtomicFloat32AddEXT " "capability"; } if ((_.GetBitWidth(result_type) == 64) && - (!_.HasCapability(SpvCapabilityAtomicFloat64AddEXT))) { + (!_.HasCapability(spv::Capability::AtomicFloat64AddEXT))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": float add atomics require the AtomicFloat64AddEXT " "capability"; } - } else if (opcode == SpvOpAtomicFMinEXT || - opcode == SpvOpAtomicFMaxEXT) { + } else if (opcode == spv::Op::OpAtomicFMinEXT || + opcode == spv::Op::OpAtomicFMaxEXT) { if ((_.GetBitWidth(result_type) == 16) && - (!_.HasCapability(SpvCapabilityAtomicFloat16MinMaxEXT))) { + (!_.HasCapability(spv::Capability::AtomicFloat16MinMaxEXT))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": float min/max atomics require the " "AtomicFloat16MinMaxEXT capability"; } if ((_.GetBitWidth(result_type) == 32) && - (!_.HasCapability(SpvCapabilityAtomicFloat32MinMaxEXT))) { + (!_.HasCapability(spv::Capability::AtomicFloat32MinMaxEXT))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": float min/max atomics require the " "AtomicFloat32MinMaxEXT capability"; } if ((_.GetBitWidth(result_type) == 64) && - (!_.HasCapability(SpvCapabilityAtomicFloat64MinMaxEXT))) { + (!_.HasCapability(spv::Capability::AtomicFloat64MinMaxEXT))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": float min/max atomics require the " @@ -273,10 +273,10 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { // And finally OpenCL environment rules if (spvIsOpenCLEnv(_.context()->target_env)) { - if ((storage_class != SpvStorageClassFunction) && - (storage_class != SpvStorageClassWorkgroup) && - (storage_class != SpvStorageClassCrossWorkgroup) && - (storage_class != SpvStorageClassGeneric)) { + if ((storage_class != spv::StorageClass::Function) && + (storage_class != spv::StorageClass::Workgroup) && + (storage_class != spv::StorageClass::CrossWorkgroup) && + (storage_class != spv::StorageClass::Generic)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": storage class must be Function, Workgroup, " @@ -284,7 +284,7 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { } if (_.context()->target_env == SPV_ENV_OPENCL_1_2) { - if (storage_class == SpvStorageClassGeneric) { + if (storage_class == spv::StorageClass::Generic) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Storage class cannot be Generic in OpenCL 1.2 " "environment"; @@ -293,15 +293,15 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { } // If result and pointer type are different, need to do special check here - if (opcode == SpvOpAtomicFlagTestAndSet || - opcode == SpvOpAtomicFlagClear) { + if (opcode == spv::Op::OpAtomicFlagTestAndSet || + opcode == spv::Op::OpAtomicFlagClear) { if (!_.IsIntScalarType(data_type) || _.GetBitWidth(data_type) != 32) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": expected Pointer to point to a value of 32-bit integer " "type"; } - } else if (opcode == SpvOpAtomicStore) { + } else if (opcode == spv::Op::OpAtomicStore) { if (!_.IsFloatScalarType(data_type) && !_.IsIntScalarType(data_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) @@ -325,8 +325,8 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { memory_scope)) return error; - if (opcode == SpvOpAtomicCompareExchange || - opcode == SpvOpAtomicCompareExchangeWeak) { + if (opcode == spv::Op::OpAtomicCompareExchange || + opcode == spv::Op::OpAtomicCompareExchangeWeak) { const auto unequal_semantics_index = operand_index++; if (auto error = ValidateMemorySemantics( _, inst, unequal_semantics_index, memory_scope)) @@ -346,15 +346,15 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { _.EvalInt32IfConst( inst->GetOperandAs(unequal_semantics_index)); if (is_equal_const && is_unequal_const && - ((equal_value & SpvMemorySemanticsVolatileMask) ^ - (unequal_value & SpvMemorySemanticsVolatileMask))) { + ((equal_value & uint32_t(spv::MemorySemanticsMask::Volatile)) ^ + (unequal_value & uint32_t(spv::MemorySemanticsMask::Volatile)))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Volatile mask setting must match for Equal and Unequal " "memory semantics"; } } - if (opcode == SpvOpAtomicStore) { + if (opcode == spv::Op::OpAtomicStore) { const uint32_t value_type = _.GetOperandTypeId(inst, 3); if (value_type != data_type) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -362,10 +362,11 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { << ": expected Value type and the type pointed to by " "Pointer to be the same"; } - } else if (opcode != SpvOpAtomicLoad && opcode != SpvOpAtomicIIncrement && - opcode != SpvOpAtomicIDecrement && - opcode != SpvOpAtomicFlagTestAndSet && - opcode != SpvOpAtomicFlagClear) { + } else if (opcode != spv::Op::OpAtomicLoad && + opcode != spv::Op::OpAtomicIIncrement && + opcode != spv::Op::OpAtomicIDecrement && + opcode != spv::Op::OpAtomicFlagTestAndSet && + opcode != spv::Op::OpAtomicFlagClear) { const uint32_t value_type = _.GetOperandTypeId(inst, operand_index++); if (value_type != result_type) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -374,8 +375,8 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) { } } - if (opcode == SpvOpAtomicCompareExchange || - opcode == SpvOpAtomicCompareExchangeWeak) { + if (opcode == spv::Op::OpAtomicCompareExchange || + opcode == spv::Op::OpAtomicCompareExchangeWeak) { const uint32_t comparator_type = _.GetOperandTypeId(inst, operand_index++); if (comparator_type != result_type) { diff --git a/3rdparty/spirv-tools/source/val/validate_barriers.cpp b/3rdparty/spirv-tools/source/val/validate_barriers.cpp index 03225d86a..59d886a11 100644 --- a/3rdparty/spirv-tools/source/val/validate_barriers.cpp +++ b/3rdparty/spirv-tools/source/val/validate_barriers.cpp @@ -32,20 +32,20 @@ namespace val { // Validates correctness of barrier instructions. spv_result_t BarriersPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpControlBarrier: { + case spv::Op::OpControlBarrier: { if (_.version() < SPV_SPIRV_VERSION_WORD(1, 3)) { _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelTessellationControl && - model != SpvExecutionModelGLCompute && - model != SpvExecutionModelKernel && - model != SpvExecutionModelTaskNV && - model != SpvExecutionModelMeshNV) { + [](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::TessellationControl && + model != spv::ExecutionModel::GLCompute && + model != spv::ExecutionModel::Kernel && + model != spv::ExecutionModel::TaskNV && + model != spv::ExecutionModel::MeshNV) { if (message) { *message = "OpControlBarrier requires one of the following " @@ -76,7 +76,7 @@ spv_result_t BarriersPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpMemoryBarrier: { + case spv::Op::OpMemoryBarrier: { const uint32_t memory_scope = inst->word(1); if (auto error = ValidateMemoryScope(_, inst, memory_scope)) { @@ -89,8 +89,8 @@ spv_result_t BarriersPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpNamedBarrierInitialize: { - if (_.GetIdOpcode(result_type) != SpvOpTypeNamedBarrier) { + case spv::Op::OpNamedBarrierInitialize: { + if (_.GetIdOpcode(result_type) != spv::Op::OpTypeNamedBarrier) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": expected Result Type to be OpTypeNamedBarrier"; @@ -106,9 +106,9 @@ spv_result_t BarriersPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpMemoryNamedBarrier: { + case spv::Op::OpMemoryNamedBarrier: { const uint32_t named_barrier_type = _.GetOperandTypeId(inst, 0); - if (_.GetIdOpcode(named_barrier_type) != SpvOpTypeNamedBarrier) { + if (_.GetIdOpcode(named_barrier_type) != spv::Op::OpTypeNamedBarrier) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": expected Named Barrier to be of type OpTypeNamedBarrier"; diff --git a/3rdparty/spirv-tools/source/val/validate_bitwise.cpp b/3rdparty/spirv-tools/source/val/validate_bitwise.cpp index e6e97c4a5..87c955630 100644 --- a/3rdparty/spirv-tools/source/val/validate_bitwise.cpp +++ b/3rdparty/spirv-tools/source/val/validate_bitwise.cpp @@ -27,7 +27,7 @@ namespace val { // Validates when base and result need to be the same type spv_result_t ValidateBaseType(ValidationState_t& _, const Instruction* inst, const uint32_t base_type) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); if (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -47,7 +47,7 @@ spv_result_t ValidateBaseType(ValidationState_t& _, const Instruction* inst, } // OpBitCount just needs same number of components - if (base_type != inst->type_id() && opcode != SpvOpBitCount) { + if (base_type != inst->type_id() && opcode != spv::Op::OpBitCount) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Base Type to be equal to Result Type: " << spvOpcodeString(opcode); @@ -58,13 +58,13 @@ spv_result_t ValidateBaseType(ValidationState_t& _, const Instruction* inst, // Validates correctness of bitwise instructions. spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpShiftRightLogical: - case SpvOpShiftRightArithmetic: - case SpvOpShiftLeftLogical: { + case spv::Op::OpShiftRightLogical: + case spv::Op::OpShiftRightArithmetic: + case spv::Op::OpShiftLeftLogical: { if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected int scalar or vector type as Result Type: " @@ -103,10 +103,10 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpBitwiseOr: - case SpvOpBitwiseXor: - case SpvOpBitwiseAnd: - case SpvOpNot: { + case spv::Op::OpBitwiseOr: + case spv::Op::OpBitwiseXor: + case spv::Op::OpBitwiseAnd: + case spv::Op::OpNot: { if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected int scalar or vector type as Result Type: " @@ -140,7 +140,7 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpBitFieldInsert: { + case spv::Op::OpBitFieldInsert: { const uint32_t base_type = _.GetOperandTypeId(inst, 2); const uint32_t insert_type = _.GetOperandTypeId(inst, 3); const uint32_t offset_type = _.GetOperandTypeId(inst, 4); @@ -167,8 +167,8 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpBitFieldSExtract: - case SpvOpBitFieldUExtract: { + case spv::Op::OpBitFieldSExtract: + case spv::Op::OpBitFieldUExtract: { const uint32_t base_type = _.GetOperandTypeId(inst, 2); const uint32_t offset_type = _.GetOperandTypeId(inst, 3); const uint32_t count_type = _.GetOperandTypeId(inst, 4); @@ -189,7 +189,7 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpBitReverse: { + case spv::Op::OpBitReverse: { const uint32_t base_type = _.GetOperandTypeId(inst, 2); if (spv_result_t error = ValidateBaseType(_, inst, base_type)) { @@ -199,7 +199,7 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpBitCount: { + case spv::Op::OpBitCount: { if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected int scalar or vector type as Result Type: " diff --git a/3rdparty/spirv-tools/source/val/validate_builtins.cpp b/3rdparty/spirv-tools/source/val/validate_builtins.cpp index 6f4b0f9c3..c07dcaddd 100644 --- a/3rdparty/spirv-tools/source/val/validate_builtins.cpp +++ b/3rdparty/spirv-tools/source/val/validate_builtins.cpp @@ -62,7 +62,7 @@ spv_result_t GetUnderlyingType(ValidationState_t& _, const Instruction& inst, uint32_t* underlying_type) { if (decoration.struct_member_index() != Decoration::kInvalidMember) { - if (inst.opcode() != SpvOpTypeStruct) { + if (inst.opcode() != spv::Op::OpTypeStruct) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << GetIdDesc(inst) << "Attempted to get underlying data type via member index for " @@ -72,7 +72,7 @@ spv_result_t GetUnderlyingType(ValidationState_t& _, return SPV_SUCCESS; } - if (inst.opcode() == SpvOpTypeStruct) { + if (inst.opcode() == spv::Op::OpTypeStruct) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << GetIdDesc(inst) << " did not find an member index to get underlying data type for " @@ -84,7 +84,7 @@ spv_result_t GetUnderlyingType(ValidationState_t& _, return SPV_SUCCESS; } - uint32_t storage_class = 0; + spv::StorageClass storage_class; if (!_.GetPointerTypeInfo(inst.type_id(), underlying_type, &storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << GetIdDesc(inst) @@ -95,22 +95,22 @@ spv_result_t GetUnderlyingType(ValidationState_t& _, } // Returns Storage Class used by the instruction if applicable. -// Returns SpvStorageClassMax if not. -SpvStorageClass GetStorageClass(const Instruction& inst) { +// Returns spv::StorageClass::Max if not. +spv::StorageClass GetStorageClass(const Instruction& inst) { switch (inst.opcode()) { - case SpvOpTypePointer: - case SpvOpTypeForwardPointer: { - return SpvStorageClass(inst.word(2)); + case spv::Op::OpTypePointer: + case spv::Op::OpTypeForwardPointer: { + return spv::StorageClass(inst.word(2)); } - case SpvOpVariable: { - return SpvStorageClass(inst.word(3)); + case spv::Op::OpVariable: { + return spv::StorageClass(inst.word(3)); } - case SpvOpGenericCastToPtrExplicit: { - return SpvStorageClass(inst.word(4)); + case spv::Op::OpGenericCastToPtrExplicit: { + return spv::StorageClass(inst.word(4)); } default: { break; } } - return SpvStorageClassMax; + return spv::StorageClass::Max; } typedef enum VUIDError_ { @@ -123,52 +123,52 @@ typedef enum VUIDError_ { const static uint32_t NumVUIDBuiltins = 36; typedef struct { - SpvBuiltIn builtIn; + spv::BuiltIn builtIn; uint32_t vuid[VUIDErrorMax]; // execution mode, storage class, type VUIDs } BuiltinVUIDMapping; std::array builtinVUIDInfo = {{ // clang-format off - {SpvBuiltInSubgroupEqMask, {0, 4370, 4371}}, - {SpvBuiltInSubgroupGeMask, {0, 4372, 4373}}, - {SpvBuiltInSubgroupGtMask, {0, 4374, 4375}}, - {SpvBuiltInSubgroupLeMask, {0, 4376, 4377}}, - {SpvBuiltInSubgroupLtMask, {0, 4378, 4379}}, - {SpvBuiltInSubgroupLocalInvocationId, {0, 4380, 4381}}, - {SpvBuiltInSubgroupSize, {0, 4382, 4383}}, - {SpvBuiltInGlobalInvocationId, {4236, 4237, 4238}}, - {SpvBuiltInLocalInvocationId, {4281, 4282, 4283}}, - {SpvBuiltInNumWorkgroups, {4296, 4297, 4298}}, - {SpvBuiltInNumSubgroups, {4293, 4294, 4295}}, - {SpvBuiltInSubgroupId, {4367, 4368, 4369}}, - {SpvBuiltInWorkgroupId, {4422, 4423, 4424}}, - {SpvBuiltInHitKindKHR, {4242, 4243, 4244}}, - {SpvBuiltInHitTNV, {4245, 4246, 4247}}, - {SpvBuiltInInstanceCustomIndexKHR, {4251, 4252, 4253}}, - {SpvBuiltInInstanceId, {4254, 4255, 4256}}, - {SpvBuiltInRayGeometryIndexKHR, {4345, 4346, 4347}}, - {SpvBuiltInObjectRayDirectionKHR, {4299, 4300, 4301}}, - {SpvBuiltInObjectRayOriginKHR, {4302, 4303, 4304}}, - {SpvBuiltInObjectToWorldKHR, {4305, 4306, 4307}}, - {SpvBuiltInWorldToObjectKHR, {4434, 4435, 4436}}, - {SpvBuiltInIncomingRayFlagsKHR, {4248, 4249, 4250}}, - {SpvBuiltInRayTminKHR, {4351, 4352, 4353}}, - {SpvBuiltInRayTmaxKHR, {4348, 4349, 4350}}, - {SpvBuiltInWorldRayDirectionKHR, {4428, 4429, 4430}}, - {SpvBuiltInWorldRayOriginKHR, {4431, 4432, 4433}}, - {SpvBuiltInLaunchIdKHR, {4266, 4267, 4268}}, - {SpvBuiltInLaunchSizeKHR, {4269, 4270, 4271}}, - {SpvBuiltInFragInvocationCountEXT, {4217, 4218, 4219}}, - {SpvBuiltInFragSizeEXT, {4220, 4221, 4222}}, - {SpvBuiltInFragStencilRefEXT, {4223, 4224, 4225}}, - {SpvBuiltInFullyCoveredEXT, {4232, 4233, 4234}}, - {SpvBuiltInCullMaskKHR, {6735, 6736, 6737}}, - {SpvBuiltInBaryCoordKHR, {4154, 4155, 4156}}, - {SpvBuiltInBaryCoordNoPerspKHR, {4160, 4161, 4162}}, + {spv::BuiltIn::SubgroupEqMask, {0, 4370, 4371}}, + {spv::BuiltIn::SubgroupGeMask, {0, 4372, 4373}}, + {spv::BuiltIn::SubgroupGtMask, {0, 4374, 4375}}, + {spv::BuiltIn::SubgroupLeMask, {0, 4376, 4377}}, + {spv::BuiltIn::SubgroupLtMask, {0, 4378, 4379}}, + {spv::BuiltIn::SubgroupLocalInvocationId, {0, 4380, 4381}}, + {spv::BuiltIn::SubgroupSize, {0, 4382, 4383}}, + {spv::BuiltIn::GlobalInvocationId, {4236, 4237, 4238}}, + {spv::BuiltIn::LocalInvocationId, {4281, 4282, 4283}}, + {spv::BuiltIn::NumWorkgroups, {4296, 4297, 4298}}, + {spv::BuiltIn::NumSubgroups, {4293, 4294, 4295}}, + {spv::BuiltIn::SubgroupId, {4367, 4368, 4369}}, + {spv::BuiltIn::WorkgroupId, {4422, 4423, 4424}}, + {spv::BuiltIn::HitKindKHR, {4242, 4243, 4244}}, + {spv::BuiltIn::HitTNV, {4245, 4246, 4247}}, + {spv::BuiltIn::InstanceCustomIndexKHR, {4251, 4252, 4253}}, + {spv::BuiltIn::InstanceId, {4254, 4255, 4256}}, + {spv::BuiltIn::RayGeometryIndexKHR, {4345, 4346, 4347}}, + {spv::BuiltIn::ObjectRayDirectionKHR, {4299, 4300, 4301}}, + {spv::BuiltIn::ObjectRayOriginKHR, {4302, 4303, 4304}}, + {spv::BuiltIn::ObjectToWorldKHR, {4305, 4306, 4307}}, + {spv::BuiltIn::WorldToObjectKHR, {4434, 4435, 4436}}, + {spv::BuiltIn::IncomingRayFlagsKHR, {4248, 4249, 4250}}, + {spv::BuiltIn::RayTminKHR, {4351, 4352, 4353}}, + {spv::BuiltIn::RayTmaxKHR, {4348, 4349, 4350}}, + {spv::BuiltIn::WorldRayDirectionKHR, {4428, 4429, 4430}}, + {spv::BuiltIn::WorldRayOriginKHR, {4431, 4432, 4433}}, + {spv::BuiltIn::LaunchIdKHR, {4266, 4267, 4268}}, + {spv::BuiltIn::LaunchSizeKHR, {4269, 4270, 4271}}, + {spv::BuiltIn::FragInvocationCountEXT, {4217, 4218, 4219}}, + {spv::BuiltIn::FragSizeEXT, {4220, 4221, 4222}}, + {spv::BuiltIn::FragStencilRefEXT, {4223, 4224, 4225}}, + {spv::BuiltIn::FullyCoveredEXT, {4232, 4233, 4234}}, + {spv::BuiltIn::CullMaskKHR, {6735, 6736, 6737}}, + {spv::BuiltIn::BaryCoordKHR, {4154, 4155, 4156}}, + {spv::BuiltIn::BaryCoordNoPerspKHR, {4160, 4161, 4162}}, // clang-format off } }; -uint32_t GetVUIDForBuiltin(SpvBuiltIn builtIn, VUIDError type) { +uint32_t GetVUIDForBuiltin(spv::BuiltIn builtIn, VUIDError type) { uint32_t vuid = 0; for (const auto& iter: builtinVUIDInfo) { if (iter.builtIn == builtIn) { @@ -180,57 +180,57 @@ uint32_t GetVUIDForBuiltin(SpvBuiltIn builtIn, VUIDError type) { return vuid; } -bool IsExecutionModelValidForRtBuiltIn(SpvBuiltIn builtin, - SpvExecutionModel stage) { +bool IsExecutionModelValidForRtBuiltIn(spv::BuiltIn builtin, + spv::ExecutionModel stage) { switch (builtin) { - case SpvBuiltInHitKindKHR: - case SpvBuiltInHitTNV: - if (stage == SpvExecutionModelAnyHitKHR || - stage == SpvExecutionModelClosestHitKHR) { + case spv::BuiltIn::HitKindKHR: + case spv::BuiltIn::HitTNV: + if (stage == spv::ExecutionModel::AnyHitKHR || + stage == spv::ExecutionModel::ClosestHitKHR) { return true; } break; - case SpvBuiltInInstanceCustomIndexKHR: - case SpvBuiltInInstanceId: - case SpvBuiltInRayGeometryIndexKHR: - case SpvBuiltInObjectRayDirectionKHR: - case SpvBuiltInObjectRayOriginKHR: - case SpvBuiltInObjectToWorldKHR: - case SpvBuiltInWorldToObjectKHR: + case spv::BuiltIn::InstanceCustomIndexKHR: + case spv::BuiltIn::InstanceId: + case spv::BuiltIn::RayGeometryIndexKHR: + case spv::BuiltIn::ObjectRayDirectionKHR: + case spv::BuiltIn::ObjectRayOriginKHR: + case spv::BuiltIn::ObjectToWorldKHR: + case spv::BuiltIn::WorldToObjectKHR: switch (stage) { - case SpvExecutionModelIntersectionKHR: - case SpvExecutionModelAnyHitKHR: - case SpvExecutionModelClosestHitKHR: + case spv::ExecutionModel::IntersectionKHR: + case spv::ExecutionModel::AnyHitKHR: + case spv::ExecutionModel::ClosestHitKHR: return true; default: return false; } break; - case SpvBuiltInIncomingRayFlagsKHR: - case SpvBuiltInRayTminKHR: - case SpvBuiltInRayTmaxKHR: - case SpvBuiltInWorldRayDirectionKHR: - case SpvBuiltInWorldRayOriginKHR: - case SpvBuiltInCullMaskKHR: + case spv::BuiltIn::IncomingRayFlagsKHR: + case spv::BuiltIn::RayTminKHR: + case spv::BuiltIn::RayTmaxKHR: + case spv::BuiltIn::WorldRayDirectionKHR: + case spv::BuiltIn::WorldRayOriginKHR: + case spv::BuiltIn::CullMaskKHR: switch (stage) { - case SpvExecutionModelIntersectionKHR: - case SpvExecutionModelAnyHitKHR: - case SpvExecutionModelClosestHitKHR: - case SpvExecutionModelMissKHR: + case spv::ExecutionModel::IntersectionKHR: + case spv::ExecutionModel::AnyHitKHR: + case spv::ExecutionModel::ClosestHitKHR: + case spv::ExecutionModel::MissKHR: return true; default: return false; } break; - case SpvBuiltInLaunchIdKHR: - case SpvBuiltInLaunchSizeKHR: + case spv::BuiltIn::LaunchIdKHR: + case spv::BuiltIn::LaunchSizeKHR: switch (stage) { - case SpvExecutionModelRayGenerationKHR: - case SpvExecutionModelIntersectionKHR: - case SpvExecutionModelAnyHitKHR: - case SpvExecutionModelClosestHitKHR: - case SpvExecutionModelMissKHR: - case SpvExecutionModelCallableKHR: + case spv::ExecutionModel::RayGenerationKHR: + case spv::ExecutionModel::IntersectionKHR: + case spv::ExecutionModel::AnyHitKHR: + case spv::ExecutionModel::ClosestHitKHR: + case spv::ExecutionModel::MissKHR: + case spv::ExecutionModel::CallableKHR: return true; default: return false; @@ -559,7 +559,7 @@ class BuiltInsValidator { // |referenced_from_inst| - instruction which references id defined by // |referenced_inst| from within a function. spv_result_t ValidateNotCalledWithExecutionModel( - int vuid, const char* comment, SpvExecutionModel execution_model, + int vuid, const char* comment, spv::ExecutionModel execution_model, const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst); @@ -642,7 +642,7 @@ class BuiltInsValidator { const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst, - SpvExecutionModel execution_model = SpvExecutionModelMax) const; + spv::ExecutionModel execution_model = spv::ExecutionModel::Max) const; // Generates strings like "ID <51> (OpTypePointer) uses storage class // UniformConstant". @@ -671,12 +671,12 @@ class BuiltInsValidator { const std::vector* entry_points_ = &no_entry_points; // Execution models with which the current function can be called. - std::set execution_models_; + std::set execution_models_; }; void BuiltInsValidator::Update(const Instruction& inst) { - const SpvOp opcode = inst.opcode(); - if (opcode == SpvOpFunction) { + const spv::Op opcode = inst.opcode(); + if (opcode == spv::Op::OpFunction) { // Entering a function. assert(function_id_ == 0); function_id_ = inst.id(); @@ -691,7 +691,7 @@ void BuiltInsValidator::Update(const Instruction& inst) { } } - if (opcode == SpvOpFunctionEnd) { + if (opcode == spv::Op::OpFunctionEnd) { // Exiting a function. assert(function_id_ != 0); function_id_ = 0; @@ -704,7 +704,7 @@ std::string BuiltInsValidator::GetDefinitionDesc( const Decoration& decoration, const Instruction& inst) const { std::ostringstream ss; if (decoration.struct_member_index() != Decoration::kInvalidMember) { - assert(inst.opcode() == SpvOpTypeStruct); + assert(inst.opcode() == spv::Op::OpTypeStruct); ss << "Member #" << decoration.struct_member_index(); ss << " of struct ID <" << inst.id() << ">"; } else { @@ -716,7 +716,7 @@ std::string BuiltInsValidator::GetDefinitionDesc( std::string BuiltInsValidator::GetReferenceDesc( const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst, - SpvExecutionModel execution_model) const { + spv::ExecutionModel execution_model) const { std::ostringstream ss; ss << GetIdDesc(referenced_from_inst) << " is referencing " << GetIdDesc(referenced_inst); @@ -729,10 +729,10 @@ std::string BuiltInsValidator::GetReferenceDesc( decoration.params()[0]); if (function_id_) { ss << " in function <" << function_id_ << ">"; - if (execution_model != SpvExecutionModelMax) { + if (execution_model != spv::ExecutionModel::Max) { ss << " called with execution model "; ss << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_EXECUTION_MODEL, - execution_model); + uint32_t(execution_model)); } } ss << "."; @@ -744,7 +744,7 @@ std::string BuiltInsValidator::GetStorageClassDesc( std::ostringstream ss; ss << GetIdDesc(inst) << " uses storage class "; ss << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_STORAGE_CLASS, - GetStorageClass(inst)); + uint32_t(GetStorageClass(inst))); ss << "."; return ss.str(); } @@ -803,7 +803,7 @@ spv_result_t BuiltInsValidator::ValidateOptionalArrayedI32( } // Strip the array, if present. - if (_.GetIdOpcode(underlying_type) == SpvOpTypeArray) { + if (_.GetIdOpcode(underlying_type) == spv::Op::OpTypeArray) { underlying_type = _.FindDef(underlying_type)->word(2u); } @@ -839,7 +839,7 @@ spv_result_t BuiltInsValidator::ValidateOptionalArrayedF32( } // Strip the array, if present. - if (_.GetIdOpcode(underlying_type) == SpvOpTypeArray) { + if (_.GetIdOpcode(underlying_type) == spv::Op::OpTypeArray) { underlying_type = _.FindDef(underlying_type)->word(2u); } @@ -922,7 +922,7 @@ spv_result_t BuiltInsValidator::ValidateOptionalArrayedF32Vec( } // Strip the array, if present. - if (_.GetIdOpcode(underlying_type) == SpvOpTypeArray) { + if (_.GetIdOpcode(underlying_type) == spv::Op::OpTypeArray) { underlying_type = _.FindDef(underlying_type)->word(2u); } @@ -983,7 +983,7 @@ spv_result_t BuiltInsValidator::ValidateI32Arr( } const Instruction* const type_inst = _.FindDef(underlying_type); - if (type_inst->opcode() != SpvOpTypeArray) { + if (type_inst->opcode() != spv::Op::OpTypeArray) { return diag(GetDefinitionDesc(decoration, inst) + " is not an array."); } @@ -1029,9 +1029,9 @@ spv_result_t BuiltInsValidator::ValidateOptionalArrayedF32Arr( } // Strip an extra layer of arraying if present. - if (_.GetIdOpcode(underlying_type) == SpvOpTypeArray) { + if (_.GetIdOpcode(underlying_type) == spv::Op::OpTypeArray) { uint32_t subtype = _.FindDef(underlying_type)->word(2u); - if (_.GetIdOpcode(subtype) == SpvOpTypeArray) { + if (_.GetIdOpcode(subtype) == spv::Op::OpTypeArray) { underlying_type = subtype; } } @@ -1046,7 +1046,7 @@ spv_result_t BuiltInsValidator::ValidateF32ArrHelper( const std::function& diag, uint32_t underlying_type) { const Instruction* const type_inst = _.FindDef(underlying_type); - if (type_inst->opcode() != SpvOpTypeArray) { + if (type_inst->opcode() != spv::Op::OpTypeArray) { return diag(GetDefinitionDesc(decoration, inst) + " is not an array."); } @@ -1107,14 +1107,14 @@ spv_result_t BuiltInsValidator::ValidateF32Mat( } spv_result_t BuiltInsValidator::ValidateNotCalledWithExecutionModel( - int vuid, const char* comment, SpvExecutionModel execution_model, + int vuid, const char* comment, spv::ExecutionModel execution_model, const Decoration& decoration, const Instruction& built_in_inst, const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (function_id_) { if (execution_models_.count(execution_model)) { const char* execution_model_str = _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_EXECUTION_MODEL, execution_model); + SPV_OPERAND_TYPE_EXECUTION_MODEL, uint32_t(execution_model)); const char* built_in_str = _.grammar().lookupOperandName( SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0]); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) @@ -1149,11 +1149,11 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( const Instruction& referenced_from_inst) { uint32_t operand = decoration.params()[0]; if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { - uint32_t vuid = (decoration.params()[0] == SpvBuiltInClipDistance) ? 4190 : 4199; + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { + uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4190 : 4199; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -1165,54 +1165,54 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - if (storage_class == SpvStorageClassInput) { + if (storage_class == spv::StorageClass::Input) { assert(function_id_ == 0); - uint32_t vuid = (decoration.params()[0] == SpvBuiltInClipDistance) ? 4188 : 4197; + uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4188 : 4197; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " "used for variables with Input storage class if execution model is " "Vertex.", - SpvExecutionModelVertex, decoration, built_in_inst, + spv::ExecutionModel::Vertex, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " "used for variables with Input storage class if execution model is " "MeshNV.", - SpvExecutionModelMeshNV, decoration, built_in_inst, + spv::ExecutionModel::MeshNV, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " "used for variables with Input storage class if execution model is " "MeshEXT.", - SpvExecutionModelMeshEXT, decoration, built_in_inst, + spv::ExecutionModel::MeshEXT, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - if (storage_class == SpvStorageClassOutput) { + if (storage_class == spv::StorageClass::Output) { assert(function_id_ == 0); - uint32_t vuid = (decoration.params()[0] == SpvBuiltInClipDistance) ? 4189 : 4198; + uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4189 : 4198; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be " "used for variables with Output storage class if execution model is " "Fragment.", - SpvExecutionModelFragment, decoration, built_in_inst, + spv::ExecutionModel::Fragment, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { switch (execution_model) { - case SpvExecutionModelFragment: - case SpvExecutionModelVertex: { + case spv::ExecutionModel::Fragment: + case spv::ExecutionModel::Vertex: { if (spv_result_t error = ValidateF32Arr( decoration, built_in_inst, /* Any number of components */ 0, [this, &decoration, &referenced_from_inst]( const std::string& message) -> spv_result_t { uint32_t vuid = - (decoration.params()[0] == SpvBuiltInClipDistance) + (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4191 : 4200; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) @@ -1228,11 +1228,11 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( } break; } - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: - case SpvExecutionModelGeometry: - case SpvExecutionModelMeshNV: - case SpvExecutionModelMeshEXT: { + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::MeshNV: + case spv::ExecutionModel::MeshEXT: { if (decoration.struct_member_index() != Decoration::kInvalidMember) { // The outer level of array is applied on the variable. if (spv_result_t error = ValidateF32Arr( @@ -1240,7 +1240,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( [this, &decoration, &referenced_from_inst]( const std::string& message) -> spv_result_t { uint32_t vuid = - (decoration.params()[0] == SpvBuiltInClipDistance) + (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4191 : 4200; return _.diag(SPV_ERROR_INVALID_DATA, @@ -1261,7 +1261,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( [this, &decoration, &referenced_from_inst]( const std::string& message) -> spv_result_t { uint32_t vuid = - (decoration.params()[0] == SpvBuiltInClipDistance) + (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4191 : 4200; return _.diag(SPV_ERROR_INVALID_DATA, @@ -1282,7 +1282,7 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference( default: { uint32_t vuid = - (decoration.params()[0] == SpvBuiltInClipDistance) ? 4187 : 4196; + (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4187 : 4196; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -1335,9 +1335,9 @@ spv_result_t BuiltInsValidator::ValidateFragCoordAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4211) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn FragCoord to be only used for " @@ -1347,8 +1347,8 @@ spv_result_t BuiltInsValidator::ValidateFragCoordAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4210) << spvLogStringForEnv(_.context()->target_env) @@ -1396,9 +1396,9 @@ spv_result_t BuiltInsValidator::ValidateFragDepthAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4214) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn FragDepth to be only used for " @@ -1408,8 +1408,8 @@ spv_result_t BuiltInsValidator::ValidateFragDepthAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4213) << spvLogStringForEnv(_.context()->target_env) @@ -1424,7 +1424,7 @@ spv_result_t BuiltInsValidator::ValidateFragDepthAtReference( // Every entry point from which this function is called needs to have // Execution Mode DepthReplacing. const auto* modes = _.GetExecutionModes(entry_point); - if (!modes || !modes->count(SpvExecutionModeDepthReplacing)) { + if (!modes || !modes->count(spv::ExecutionMode::DepthReplacing)) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4216) << spvLogStringForEnv(_.context()->target_env) @@ -1472,9 +1472,9 @@ spv_result_t BuiltInsValidator::ValidateFrontFacingAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4230) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn FrontFacing to be only used for " @@ -1484,8 +1484,8 @@ spv_result_t BuiltInsValidator::ValidateFrontFacingAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4229) << spvLogStringForEnv(_.context()->target_env) @@ -1532,9 +1532,9 @@ spv_result_t BuiltInsValidator::ValidateHelperInvocationAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4240) << "Vulkan spec allows BuiltIn HelperInvocation to be only used " @@ -1544,8 +1544,8 @@ spv_result_t BuiltInsValidator::ValidateHelperInvocationAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4239) << "Vulkan spec allows BuiltIn HelperInvocation to be used only " @@ -1592,9 +1592,9 @@ spv_result_t BuiltInsValidator::ValidateInvocationIdAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4258) << "Vulkan spec allows BuiltIn InvocationId to be only used for " @@ -1604,9 +1604,9 @@ spv_result_t BuiltInsValidator::ValidateInvocationIdAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelTessellationControl && - execution_model != SpvExecutionModelGeometry) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::TessellationControl && + execution_model != spv::ExecutionModel::Geometry) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4257) << "Vulkan spec allows BuiltIn InvocationId to be used only " @@ -1653,9 +1653,9 @@ spv_result_t BuiltInsValidator::ValidateInstanceIndexAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4264) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn InstanceIndex to be only used for " @@ -1665,8 +1665,8 @@ spv_result_t BuiltInsValidator::ValidateInstanceIndexAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelVertex) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Vertex) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4263) << spvLogStringForEnv(_.context()->target_env) @@ -1713,9 +1713,9 @@ spv_result_t BuiltInsValidator::ValidatePatchVerticesAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4309) << "Vulkan spec allows BuiltIn PatchVertices to be only used for " @@ -1725,9 +1725,9 @@ spv_result_t BuiltInsValidator::ValidatePatchVerticesAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelTessellationControl && - execution_model != SpvExecutionModelTessellationEvaluation) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::TessellationControl && + execution_model != spv::ExecutionModel::TessellationEvaluation) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4308) << "Vulkan spec allows BuiltIn PatchVertices to be used only " @@ -1775,9 +1775,9 @@ spv_result_t BuiltInsValidator::ValidatePointCoordAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4312) << "Vulkan spec allows BuiltIn PointCoord to be only used for " @@ -1787,8 +1787,8 @@ spv_result_t BuiltInsValidator::ValidatePointCoordAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4311) << "Vulkan spec allows BuiltIn PointCoord to be used only with " @@ -1820,10 +1820,10 @@ spv_result_t BuiltInsValidator::ValidatePointSizeAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4316) << "Vulkan spec allows BuiltIn PointSize to be only used for " @@ -1833,20 +1833,20 @@ spv_result_t BuiltInsValidator::ValidatePointSizeAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - if (storage_class == SpvStorageClassInput) { + if (storage_class == spv::StorageClass::Input) { assert(function_id_ == 0); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4315, "Vulkan spec doesn't allow BuiltIn PointSize to be used for " "variables with Input storage class if execution model is " "Vertex.", - SpvExecutionModelVertex, decoration, built_in_inst, + spv::ExecutionModel::Vertex, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { switch (execution_model) { - case SpvExecutionModelVertex: { + case spv::ExecutionModel::Vertex: { if (spv_result_t error = ValidateF32( decoration, built_in_inst, [this, &referenced_from_inst]( @@ -1861,11 +1861,11 @@ spv_result_t BuiltInsValidator::ValidatePointSizeAtReference( } break; } - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: - case SpvExecutionModelGeometry: - case SpvExecutionModelMeshNV: - case SpvExecutionModelMeshEXT: { + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::MeshNV: + case spv::ExecutionModel::MeshEXT: { // PointSize can be a per-vertex variable for tessellation control, // tessellation evaluation and geometry shader stages. In such cases // variables will have an array of 32-bit floats. @@ -1938,10 +1938,10 @@ spv_result_t BuiltInsValidator::ValidatePositionAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4320) << "Vulkan spec allows BuiltIn Position to be only used for " "variables with Input or Output storage class. " @@ -1950,34 +1950,34 @@ spv_result_t BuiltInsValidator::ValidatePositionAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - if (storage_class == SpvStorageClassInput) { + if (storage_class == spv::StorageClass::Input) { assert(function_id_ == 0); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4319, "Vulkan spec doesn't allow BuiltIn Position to be used " "for variables " "with Input storage class if execution model is Vertex.", - SpvExecutionModelVertex, decoration, built_in_inst, + spv::ExecutionModel::Vertex, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4319, "Vulkan spec doesn't allow BuiltIn Position to be used " "for variables " "with Input storage class if execution model is MeshNV.", - SpvExecutionModelMeshNV, decoration, built_in_inst, + spv::ExecutionModel::MeshNV, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4319, "Vulkan spec doesn't allow BuiltIn Position to be used " "for variables " "with Input storage class if execution model is MeshEXT.", - SpvExecutionModelMeshEXT, decoration, built_in_inst, + spv::ExecutionModel::MeshEXT, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { switch (execution_model) { - case SpvExecutionModelVertex: { + case spv::ExecutionModel::Vertex: { if (spv_result_t error = ValidateF32Vec( decoration, built_in_inst, 4, [this, &referenced_from_inst]( @@ -1993,11 +1993,11 @@ spv_result_t BuiltInsValidator::ValidatePositionAtReference( } break; } - case SpvExecutionModelGeometry: - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: - case SpvExecutionModelMeshNV: - case SpvExecutionModelMeshEXT: { + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: + case spv::ExecutionModel::MeshNV: + case spv::ExecutionModel::MeshEXT: { // Position can be a per-vertex variable for tessellation control, // tessellation evaluation, geometry and mesh shader stages. In such // cases variables will have an array of 4-component 32-bit float @@ -2103,10 +2103,10 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveIdAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << "Vulkan spec allows BuiltIn PrimitiveId to be only used for " "variables with Input or Output storage class. " @@ -2115,63 +2115,63 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveIdAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - if (storage_class == SpvStorageClassOutput) { + if (storage_class == spv::StorageClass::Output) { assert(function_id_ == 0); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4334, "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " "variables with Output storage class if execution model is " "TessellationControl.", - SpvExecutionModelTessellationControl, decoration, built_in_inst, + spv::ExecutionModel::TessellationControl, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4334, "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " "variables with Output storage class if execution model is " "TessellationEvaluation.", - SpvExecutionModelTessellationEvaluation, decoration, built_in_inst, + spv::ExecutionModel::TessellationEvaluation, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4334, "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " "variables with Output storage class if execution model is " "Fragment.", - SpvExecutionModelFragment, decoration, built_in_inst, + spv::ExecutionModel::Fragment, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4334, "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " "variables with Output storage class if execution model is " "IntersectionKHR.", - SpvExecutionModelIntersectionKHR, decoration, built_in_inst, + spv::ExecutionModel::IntersectionKHR, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4334, "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " "variables with Output storage class if execution model is " "AnyHitKHR.", - SpvExecutionModelAnyHitKHR, decoration, built_in_inst, + spv::ExecutionModel::AnyHitKHR, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4334, "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for " "variables with Output storage class if execution model is " "ClosestHitKHR.", - SpvExecutionModelClosestHitKHR, decoration, built_in_inst, + spv::ExecutionModel::ClosestHitKHR, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { switch (execution_model) { - case SpvExecutionModelFragment: - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: - case SpvExecutionModelGeometry: - case SpvExecutionModelMeshNV: - case SpvExecutionModelMeshEXT: - case SpvExecutionModelIntersectionKHR: - case SpvExecutionModelAnyHitKHR: - case SpvExecutionModelClosestHitKHR: { + case spv::ExecutionModel::Fragment: + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::MeshNV: + case spv::ExecutionModel::MeshEXT: + case spv::ExecutionModel::IntersectionKHR: + case spv::ExecutionModel::AnyHitKHR: + case spv::ExecutionModel::ClosestHitKHR: { // Ok. break; } @@ -2225,9 +2225,9 @@ spv_result_t BuiltInsValidator::ValidateSampleIdAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4355) << "Vulkan spec allows BuiltIn SampleId to be only used for " @@ -2237,8 +2237,8 @@ spv_result_t BuiltInsValidator::ValidateSampleIdAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4354) << "Vulkan spec allows BuiltIn SampleId to be used only with " @@ -2284,10 +2284,10 @@ spv_result_t BuiltInsValidator::ValidateSampleMaskAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4358) << "Vulkan spec allows BuiltIn SampleMask to be only used for " @@ -2297,8 +2297,8 @@ spv_result_t BuiltInsValidator::ValidateSampleMaskAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4357) << "Vulkan spec allows BuiltIn SampleMask to be used only " @@ -2346,9 +2346,9 @@ spv_result_t BuiltInsValidator::ValidateSamplePositionAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4361) << "Vulkan spec allows BuiltIn SamplePosition to be only used " @@ -2359,8 +2359,8 @@ spv_result_t BuiltInsValidator::ValidateSamplePositionAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4360) << "Vulkan spec allows BuiltIn SamplePosition to be used only " @@ -2408,9 +2408,9 @@ spv_result_t BuiltInsValidator::ValidateTessCoordAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4388) << "Vulkan spec allows BuiltIn TessCoord to be only used for " @@ -2420,8 +2420,8 @@ spv_result_t BuiltInsValidator::ValidateTessCoordAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelTessellationEvaluation) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::TessellationEvaluation) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4387) << "Vulkan spec allows BuiltIn TessCoord to be used only with " @@ -2490,10 +2490,10 @@ spv_result_t BuiltInsValidator::ValidateTessLevelAtReference( const Instruction& referenced_from_inst) { uint32_t operand = decoration.params()[0]; if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -2505,42 +2505,42 @@ spv_result_t BuiltInsValidator::ValidateTessLevelAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - if (storage_class == SpvStorageClassInput) { + if (storage_class == spv::StorageClass::Input) { assert(function_id_ == 0); - uint32_t vuid = (decoration.params()[0] == SpvBuiltInTessLevelOuter) ? 4391 : 4395; + uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::TessLevelOuter) ? 4391 : 4395; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " "used " "for variables with Input storage class if execution model is " "TessellationControl.", - SpvExecutionModelTessellationControl, decoration, built_in_inst, + spv::ExecutionModel::TessellationControl, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - if (storage_class == SpvStorageClassOutput) { + if (storage_class == spv::StorageClass::Output) { assert(function_id_ == 0); - uint32_t vuid = (decoration.params()[0] == SpvBuiltInTessLevelOuter) ? 4392 : 4396; + uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::TessLevelOuter) ? 4392 : 4396; id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind( &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid, "Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be " "used " "for variables with Output storage class if execution model is " "TessellationEvaluation.", - SpvExecutionModelTessellationEvaluation, decoration, built_in_inst, + spv::ExecutionModel::TessellationEvaluation, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { switch (execution_model) { - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: { + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: { // Ok. break; } default: { - uint32_t vuid = (operand == SpvBuiltInTessLevelOuter) ? 4390 : 4394; + uint32_t vuid = (spv::BuiltIn(operand) == spv::BuiltIn::TessLevelOuter) ? 4390 : 4394; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -2623,9 +2623,9 @@ spv_result_t BuiltInsValidator::ValidateVertexIndexAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4399) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn VertexIndex to be only used for " @@ -2635,8 +2635,8 @@ spv_result_t BuiltInsValidator::ValidateVertexIndexAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelVertex) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Vertex) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4398) << spvLogStringForEnv(_.context()->target_env) @@ -2670,7 +2670,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtDefinition( [this, &decoration, &inst](const std::string& message) -> spv_result_t { uint32_t vuid = - (decoration.params()[0] == SpvBuiltInLayer) ? 4276 : 4408; + (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::Layer) ? 4276 : 4408; return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " @@ -2687,7 +2687,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtDefinition( [this, &decoration, &inst](const std::string& message) -> spv_result_t { uint32_t vuid = - (decoration.params()[0] == SpvBuiltInLayer) ? 4276 : 4408; + (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::Layer) ? 4276 : 4408; return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " @@ -2711,10 +2711,10 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( const Instruction& referenced_from_inst) { uint32_t operand = decoration.params()[0]; if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -2726,15 +2726,15 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - if (storage_class == SpvStorageClassInput) { + if (storage_class == spv::StorageClass::Input) { assert(function_id_ == 0); for (const auto em : - {SpvExecutionModelVertex, SpvExecutionModelTessellationEvaluation, - SpvExecutionModelGeometry, SpvExecutionModelMeshNV, - SpvExecutionModelMeshEXT}) { + {spv::ExecutionModel::Vertex, spv::ExecutionModel::TessellationEvaluation, + spv::ExecutionModel::Geometry, spv::ExecutionModel::MeshNV, + spv::ExecutionModel::MeshEXT}) { id_to_at_reference_checks_[referenced_from_inst.id()].push_back( std::bind(&BuiltInsValidator::ValidateNotCalledWithExecutionModel, - this, ((operand == SpvBuiltInLayer) ? 4274 : 4406), + this, ((spv::BuiltIn(operand) == spv::BuiltIn::Layer) ? 4274 : 4406), "Vulkan spec doesn't allow BuiltIn Layer and " "ViewportIndex to be " "used for variables with Input storage class if " @@ -2745,46 +2745,46 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( } } - if (storage_class == SpvStorageClassOutput) { + if (storage_class == spv::StorageClass::Output) { assert(function_id_ == 0); id_to_at_reference_checks_[referenced_from_inst.id()].push_back( std::bind(&BuiltInsValidator::ValidateNotCalledWithExecutionModel, - this, ((operand == SpvBuiltInLayer) ? 4275 : 4407), + this, ((spv::BuiltIn(operand) == spv::BuiltIn::Layer) ? 4275 : 4407), "Vulkan spec doesn't allow BuiltIn Layer and " "ViewportIndex to be " "used for variables with Output storage class if " "execution model is " "Fragment.", - SpvExecutionModelFragment, decoration, built_in_inst, + spv::ExecutionModel::Fragment, decoration, built_in_inst, referenced_from_inst, std::placeholders::_1)); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { switch (execution_model) { - case SpvExecutionModelGeometry: - case SpvExecutionModelFragment: - case SpvExecutionModelMeshNV: - case SpvExecutionModelMeshEXT: + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::Fragment: + case spv::ExecutionModel::MeshNV: + case spv::ExecutionModel::MeshEXT: // Ok. break; - case SpvExecutionModelVertex: - case SpvExecutionModelTessellationEvaluation: { - if (!_.HasCapability(SpvCapabilityShaderViewportIndexLayerEXT)) { - if (operand == SpvBuiltInViewportIndex && - _.HasCapability(SpvCapabilityShaderViewportIndex)) + case spv::ExecutionModel::Vertex: + case spv::ExecutionModel::TessellationEvaluation: { + if (!_.HasCapability(spv::Capability::ShaderViewportIndexLayerEXT)) { + if (spv::BuiltIn(operand) == spv::BuiltIn::ViewportIndex && + _.HasCapability(spv::Capability::ShaderViewportIndex)) break; // Ok - if (operand == SpvBuiltInLayer && - _.HasCapability(SpvCapabilityShaderLayer)) + if (spv::BuiltIn(operand) == spv::BuiltIn::Layer && + _.HasCapability(spv::Capability::ShaderLayer)) break; // Ok const char* capability = "ShaderViewportIndexLayerEXT"; - if (operand == SpvBuiltInViewportIndex) + if (spv::BuiltIn(operand) == spv::BuiltIn::ViewportIndex) capability = "ShaderViewportIndexLayerEXT or ShaderViewportIndex"; - if (operand == SpvBuiltInLayer) + if (spv::BuiltIn(operand) == spv::BuiltIn::Layer) capability = "ShaderViewportIndexLayerEXT or ShaderLayer"; - uint32_t vuid = (operand == SpvBuiltInLayer) ? 4273 : 4405; + uint32_t vuid = (spv::BuiltIn(operand) == spv::BuiltIn::Layer) ? 4273 : 4405; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Using BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -2795,7 +2795,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( break; } default: { - uint32_t vuid = (operand == SpvBuiltInLayer) ? 4272 : 4404; + uint32_t vuid = (spv::BuiltIn(operand) == spv::BuiltIn::Layer) ? 4272 : 4404; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -2823,7 +2823,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference( spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (spv_result_t error = ValidateF32Vec( decoration, inst, 3, [this, &inst, builtin](const std::string& message) -> spv_result_t { @@ -2833,7 +2833,7 @@ spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtDefinition( << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - builtin) + uint32_t(builtin)) << " variable needs to be a 3-component 32-bit float " "vector. " << message; @@ -2853,29 +2853,29 @@ spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be used only with Fragment execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -2897,7 +2897,7 @@ spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference( spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (spv_result_t error = ValidateI32Vec( decoration, inst, 3, [this, &inst, builtin](const std::string& message) -> spv_result_t { @@ -2907,7 +2907,7 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition( << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - builtin) + uint32_t(builtin)) << " variable needs to be a 3-component 32-bit int " "vector. " << message; @@ -2926,27 +2926,27 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - bool has_vulkan_model = execution_model == SpvExecutionModelGLCompute || - execution_model == SpvExecutionModelTaskNV || - execution_model == SpvExecutionModelMeshNV || - execution_model == SpvExecutionModelTaskEXT || - execution_model == SpvExecutionModelMeshEXT; + for (const spv::ExecutionModel execution_model : execution_models_) { + bool has_vulkan_model = execution_model == spv::ExecutionModel::GLCompute || + execution_model == spv::ExecutionModel::TaskNV || + execution_model == spv::ExecutionModel::MeshNV || + execution_model == spv::ExecutionModel::TaskEXT || + execution_model == spv::ExecutionModel::MeshEXT; if (spvIsVulkanEnv(_.context()->target_env) && !has_vulkan_model) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); @@ -2954,7 +2954,7 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference( << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be used only with GLCompute, MeshNV, TaskNV, MeshEXT or" << " TaskEXT execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, @@ -2977,11 +2977,11 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference( spv_result_t BuiltInsValidator::ValidateComputeI32InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (decoration.struct_member_index() != Decoration::kInvalidMember) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " cannot be used as a member decoration "; } if (spv_result_t error = ValidateI32( @@ -2993,7 +2993,7 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtDefinition( << "According to the " << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a 32-bit int " "vector. " << message; @@ -3011,35 +3011,35 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - bool has_vulkan_model = execution_model == SpvExecutionModelGLCompute || - execution_model == SpvExecutionModelTaskNV || - execution_model == SpvExecutionModelMeshNV || - execution_model == SpvExecutionModelTaskEXT || - execution_model == SpvExecutionModelMeshEXT; + for (const spv::ExecutionModel execution_model : execution_models_) { + bool has_vulkan_model = execution_model == spv::ExecutionModel::GLCompute || + execution_model == spv::ExecutionModel::TaskNV || + execution_model == spv::ExecutionModel::MeshNV || + execution_model == spv::ExecutionModel::TaskEXT || + execution_model == spv::ExecutionModel::MeshEXT; if (spvIsVulkanEnv(_.context()->target_env) && !has_vulkan_model) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be used only with GLCompute, MeshNV, TaskNV, MeshEXT or " << "TaskEXT execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, @@ -3062,11 +3062,11 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtReference( spv_result_t BuiltInsValidator::ValidateI32InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (decoration.struct_member_index() != Decoration::kInvalidMember) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " cannot be used as a member decoration "; } if (spv_result_t error = ValidateI32( @@ -3078,21 +3078,21 @@ spv_result_t BuiltInsValidator::ValidateI32InputAtDefinition( << "According to the " << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a 32-bit int. " << message; })) { return error; } - const SpvStorageClass storage_class = GetStorageClass(inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, inst, inst, inst) << " " << GetStorageClassDesc(inst); @@ -3105,11 +3105,11 @@ spv_result_t BuiltInsValidator::ValidateI32InputAtDefinition( spv_result_t BuiltInsValidator::ValidateI32Vec4InputAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (decoration.struct_member_index() != Decoration::kInvalidMember) { return _.diag(SPV_ERROR_INVALID_DATA, &inst) << "BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " cannot be used as a member decoration "; } if (spv_result_t error = ValidateI32Vec( @@ -3121,7 +3121,7 @@ spv_result_t BuiltInsValidator::ValidateI32Vec4InputAtDefinition( << "According to the " << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a 4-component 32-bit int " "vector. " << message; @@ -3129,15 +3129,15 @@ spv_result_t BuiltInsValidator::ValidateI32Vec4InputAtDefinition( return error; } - const SpvStorageClass storage_class = GetStorageClass(inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, inst, inst, inst) << " " << GetStorageClassDesc(inst); @@ -3182,12 +3182,12 @@ spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelGLCompute && - execution_model != SpvExecutionModelTaskNV && - execution_model != SpvExecutionModelMeshNV && - execution_model != SpvExecutionModelTaskEXT && - execution_model != SpvExecutionModelMeshEXT) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::GLCompute && + execution_model != spv::ExecutionModel::TaskNV && + execution_model != spv::ExecutionModel::MeshNV && + execution_model != spv::ExecutionModel::TaskEXT && + execution_model != spv::ExecutionModel::MeshEXT) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4425) << spvLogStringForEnv(_.context()->target_env) @@ -3219,7 +3219,7 @@ spv_result_t BuiltInsValidator::ValidateBaseInstanceOrVertexAtDefinition( decoration, inst, [this, &inst, &decoration](const std::string& message) -> spv_result_t { - uint32_t vuid = (decoration.params()[0] == SpvBuiltInBaseInstance) + uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::BaseInstance) ? 4183 : 4186; return _.diag(SPV_ERROR_INVALID_DATA, &inst) @@ -3243,10 +3243,10 @@ spv_result_t BuiltInsValidator::ValidateBaseInstanceOrVertexAtReference( const Instruction& referenced_from_inst) { uint32_t operand = decoration.params()[0]; if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { - uint32_t vuid = (operand == SpvBuiltInBaseInstance) ? 4182 : 4185; + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { + uint32_t vuid = (spv::BuiltIn(operand) == spv::BuiltIn::BaseInstance) ? 4182 : 4185; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3257,9 +3257,9 @@ spv_result_t BuiltInsValidator::ValidateBaseInstanceOrVertexAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelVertex) { - uint32_t vuid = (operand == SpvBuiltInBaseInstance) ? 4181 : 4184; + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Vertex) { + uint32_t vuid = (spv::BuiltIn(operand) == spv::BuiltIn::BaseInstance) ? 4181 : 4184; return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3310,9 +3310,9 @@ spv_result_t BuiltInsValidator::ValidateDrawIndexAtReference( const Instruction& referenced_from_inst) { uint32_t operand = decoration.params()[0]; if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4208) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3323,12 +3323,12 @@ spv_result_t BuiltInsValidator::ValidateDrawIndexAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelVertex && - execution_model != SpvExecutionModelMeshNV && - execution_model != SpvExecutionModelTaskNV && - execution_model != SpvExecutionModelMeshEXT && - execution_model != SpvExecutionModelTaskEXT) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Vertex && + execution_model != spv::ExecutionModel::MeshNV && + execution_model != spv::ExecutionModel::TaskNV && + execution_model != spv::ExecutionModel::MeshEXT && + execution_model != spv::ExecutionModel::TaskEXT) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4207) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3380,9 +3380,9 @@ spv_result_t BuiltInsValidator::ValidateViewIndexAtReference( const Instruction& referenced_from_inst) { uint32_t operand = decoration.params()[0]; if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4402) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3393,8 +3393,8 @@ spv_result_t BuiltInsValidator::ValidateViewIndexAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model == SpvExecutionModelGLCompute) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model == spv::ExecutionModel::GLCompute) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4401) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3444,9 +3444,9 @@ spv_result_t BuiltInsValidator::ValidateDeviceIndexAtReference( const Instruction& referenced_from_inst) { uint32_t operand = decoration.params()[0]; if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4205) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3472,7 +3472,7 @@ spv_result_t BuiltInsValidator::ValidateFragInvocationCountAtDefinition(const De const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (spv_result_t error = ValidateI32( decoration, inst, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3482,7 +3482,7 @@ spv_result_t BuiltInsValidator::ValidateFragInvocationCountAtDefinition(const De << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - builtin) + uint32_t(builtin)) << " variable needs to be a 32-bit int scalar. " << message; })) { @@ -3499,29 +3499,29 @@ spv_result_t BuiltInsValidator::ValidateFragInvocationCountAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be used only with Fragment execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -3542,7 +3542,7 @@ spv_result_t BuiltInsValidator::ValidateFragInvocationCountAtReference( spv_result_t BuiltInsValidator::ValidateFragSizeAtDefinition(const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (spv_result_t error = ValidateI32Vec( decoration, inst, 2, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3552,7 +3552,7 @@ spv_result_t BuiltInsValidator::ValidateFragSizeAtDefinition(const Decoration& d << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - builtin) + uint32_t(builtin)) << " variable needs to be a 2-component 32-bit int vector. " << message; })) { @@ -3569,29 +3569,29 @@ spv_result_t BuiltInsValidator::ValidateFragSizeAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be used only with Fragment execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -3612,7 +3612,7 @@ spv_result_t BuiltInsValidator::ValidateFragSizeAtReference( spv_result_t BuiltInsValidator::ValidateFragStencilRefAtDefinition(const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (spv_result_t error = ValidateI( decoration, inst, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3622,7 +3622,7 @@ spv_result_t BuiltInsValidator::ValidateFragStencilRefAtDefinition(const Decorat << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - builtin) + uint32_t(builtin)) << " variable needs to be a int scalar. " << message; })) { @@ -3639,29 +3639,29 @@ spv_result_t BuiltInsValidator::ValidateFragStencilRefAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassOutput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Output) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Output storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be used only with Fragment execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -3682,7 +3682,7 @@ spv_result_t BuiltInsValidator::ValidateFragStencilRefAtReference( spv_result_t BuiltInsValidator::ValidateFullyCoveredAtDefinition(const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); if (spv_result_t error = ValidateBool( decoration, inst, [this, &inst, &builtin](const std::string& message) -> spv_result_t { @@ -3692,7 +3692,7 @@ spv_result_t BuiltInsValidator::ValidateFullyCoveredAtDefinition(const Decoratio << spvLogStringForEnv(_.context()->target_env) << " spec BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, - builtin) + uint32_t(builtin)) << " variable needs to be a bool scalar. " << message; })) { @@ -3709,29 +3709,29 @@ spv_result_t BuiltInsValidator::ValidateFullyCoveredAtReference( const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be only used for variables with Input storage class. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst) << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " - << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin) + << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " to be used only with Fragment execution model. " << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -3778,9 +3778,9 @@ spv_result_t BuiltInsValidator::ValidateNVSMOrARMCoreBuiltinsAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << spvLogStringForEnv(_.context()->target_env) << " spec allows BuiltIn " @@ -3832,9 +3832,9 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassOutput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Output) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4485) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3845,12 +3845,12 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { switch (execution_model) { - case SpvExecutionModelVertex: - case SpvExecutionModelGeometry: - case SpvExecutionModelMeshNV: - case SpvExecutionModelMeshEXT: + case spv::ExecutionModel::Vertex: + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::MeshNV: + case spv::ExecutionModel::MeshEXT: break; default: { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) @@ -3905,9 +3905,9 @@ spv_result_t BuiltInsValidator::ValidateShadingRateAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4491) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3918,8 +3918,8 @@ spv_result_t BuiltInsValidator::ValidateShadingRateAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { - if (execution_model != SpvExecutionModelFragment) { + for (const spv::ExecutionModel execution_model : execution_models_) { + if (execution_model != spv::ExecutionModel::Fragment) { return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(4490) << "Vulkan spec allows BuiltIn " << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, @@ -3944,11 +3944,11 @@ spv_result_t BuiltInsValidator::ValidateShadingRateAtReference( spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( const Decoration& decoration, const Instruction& inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); switch (builtin) { - case SpvBuiltInHitTNV: - case SpvBuiltInRayTminKHR: - case SpvBuiltInRayTmaxKHR: + case spv::BuiltIn::HitTNV: + case spv::BuiltIn::RayTminKHR: + case spv::BuiltIn::RayTmaxKHR: // f32 scalar if (spv_result_t error = ValidateF32( decoration, inst, @@ -3959,19 +3959,19 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, builtin) + SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a 32-bit float scalar. " << message; })) { return error; } break; - case SpvBuiltInHitKindKHR: - case SpvBuiltInInstanceCustomIndexKHR: - case SpvBuiltInInstanceId: - case SpvBuiltInRayGeometryIndexKHR: - case SpvBuiltInIncomingRayFlagsKHR: - case SpvBuiltInCullMaskKHR: + case spv::BuiltIn::HitKindKHR: + case spv::BuiltIn::InstanceCustomIndexKHR: + case spv::BuiltIn::InstanceId: + case spv::BuiltIn::RayGeometryIndexKHR: + case spv::BuiltIn::IncomingRayFlagsKHR: + case spv::BuiltIn::CullMaskKHR: // i32 scalar if (spv_result_t error = ValidateI32( decoration, inst, @@ -3982,17 +3982,17 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, builtin) + SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a 32-bit int scalar. " << message; })) { return error; } break; - case SpvBuiltInObjectRayDirectionKHR: - case SpvBuiltInObjectRayOriginKHR: - case SpvBuiltInWorldRayDirectionKHR: - case SpvBuiltInWorldRayOriginKHR: + case spv::BuiltIn::ObjectRayDirectionKHR: + case spv::BuiltIn::ObjectRayOriginKHR: + case spv::BuiltIn::WorldRayDirectionKHR: + case spv::BuiltIn::WorldRayOriginKHR: // f32 vec3 if (spv_result_t error = ValidateF32Vec( decoration, inst, 3, @@ -4003,7 +4003,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, builtin) + SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a 3-component 32-bit float " "vector. " << message; @@ -4011,8 +4011,8 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( return error; } break; - case SpvBuiltInLaunchIdKHR: - case SpvBuiltInLaunchSizeKHR: + case spv::BuiltIn::LaunchIdKHR: + case spv::BuiltIn::LaunchSizeKHR: // i32 vec3 if (spv_result_t error = ValidateI32Vec( decoration, inst, 3, @@ -4023,7 +4023,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, builtin) + SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a 3-component 32-bit int " "vector. " << message; @@ -4031,8 +4031,8 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( return error; } break; - case SpvBuiltInObjectToWorldKHR: - case SpvBuiltInWorldToObjectKHR: + case spv::BuiltIn::ObjectToWorldKHR: + case spv::BuiltIn::WorldToObjectKHR: // f32 mat4x3 if (spv_result_t error = ValidateF32Mat( decoration, inst, 3, 4, @@ -4043,7 +4043,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition( << _.VkErrorID(vuid) << "According to the Vulkan spec BuiltIn " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_BUILT_IN, builtin) + SPV_OPERAND_TYPE_BUILT_IN, uint32_t(builtin)) << " variable needs to be a matrix with" << " 4 columns of 3-component vectors of 32-bit " "floats. " @@ -4067,10 +4067,10 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( const Instruction& referenced_inst, const Instruction& referenced_from_inst) { if (spvIsVulkanEnv(_.context()->target_env)) { - const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]); - const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst); - if (storage_class != SpvStorageClassMax && - storage_class != SpvStorageClassInput) { + const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]); + const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst); + if (storage_class != spv::StorageClass::Max && + storage_class != spv::StorageClass::Input) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) << _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn " @@ -4082,7 +4082,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( << " " << GetStorageClassDesc(referenced_from_inst); } - for (const SpvExecutionModel execution_model : execution_models_) { + for (const spv::ExecutionModel execution_model : execution_models_) { if (!IsExecutionModelValidForRtBuiltIn(builtin, execution_model)) { uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel); return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst) @@ -4091,7 +4091,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( decoration.params()[0]) << " to be used with the execution model " << _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_EXECUTION_MODEL, execution_model) + SPV_OPERAND_TYPE_EXECUTION_MODEL, uint32_t(execution_model)) << ".\n" << GetReferenceDesc(decoration, built_in_inst, referenced_inst, referenced_from_inst, execution_model); @@ -4112,7 +4112,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtReference( spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition( const Decoration& decoration, const Instruction& inst) { - const SpvBuiltIn label = SpvBuiltIn(decoration.params()[0]); + const spv::BuiltIn label = spv::BuiltIn(decoration.params()[0]); if (!spvIsVulkanEnv(_.context()->target_env)) { // Early return. All currently implemented rules are based on Vulkan spec. @@ -4129,166 +4129,166 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition( // If the newly added enum has validation rules associated with it // consider leaving a TODO and/or creating an issue. switch (label) { - case SpvBuiltInClipDistance: - case SpvBuiltInCullDistance: { + case spv::BuiltIn::ClipDistance: + case spv::BuiltIn::CullDistance: { return ValidateClipOrCullDistanceAtDefinition(decoration, inst); } - case SpvBuiltInFragCoord: { + case spv::BuiltIn::FragCoord: { return ValidateFragCoordAtDefinition(decoration, inst); } - case SpvBuiltInFragDepth: { + case spv::BuiltIn::FragDepth: { return ValidateFragDepthAtDefinition(decoration, inst); } - case SpvBuiltInFrontFacing: { + case spv::BuiltIn::FrontFacing: { return ValidateFrontFacingAtDefinition(decoration, inst); } - case SpvBuiltInGlobalInvocationId: - case SpvBuiltInLocalInvocationId: - case SpvBuiltInNumWorkgroups: - case SpvBuiltInWorkgroupId: { + case spv::BuiltIn::GlobalInvocationId: + case spv::BuiltIn::LocalInvocationId: + case spv::BuiltIn::NumWorkgroups: + case spv::BuiltIn::WorkgroupId: { return ValidateComputeShaderI32Vec3InputAtDefinition(decoration, inst); } - case SpvBuiltInBaryCoordKHR: - case SpvBuiltInBaryCoordNoPerspKHR: { + case spv::BuiltIn::BaryCoordKHR: + case spv::BuiltIn::BaryCoordNoPerspKHR: { return ValidateFragmentShaderF32Vec3InputAtDefinition(decoration, inst); } - case SpvBuiltInHelperInvocation: { + case spv::BuiltIn::HelperInvocation: { return ValidateHelperInvocationAtDefinition(decoration, inst); } - case SpvBuiltInInvocationId: { + case spv::BuiltIn::InvocationId: { return ValidateInvocationIdAtDefinition(decoration, inst); } - case SpvBuiltInInstanceIndex: { + case spv::BuiltIn::InstanceIndex: { return ValidateInstanceIndexAtDefinition(decoration, inst); } - case SpvBuiltInLayer: - case SpvBuiltInViewportIndex: { + case spv::BuiltIn::Layer: + case spv::BuiltIn::ViewportIndex: { return ValidateLayerOrViewportIndexAtDefinition(decoration, inst); } - case SpvBuiltInPatchVertices: { + case spv::BuiltIn::PatchVertices: { return ValidatePatchVerticesAtDefinition(decoration, inst); } - case SpvBuiltInPointCoord: { + case spv::BuiltIn::PointCoord: { return ValidatePointCoordAtDefinition(decoration, inst); } - case SpvBuiltInPointSize: { + case spv::BuiltIn::PointSize: { return ValidatePointSizeAtDefinition(decoration, inst); } - case SpvBuiltInPosition: { + case spv::BuiltIn::Position: { return ValidatePositionAtDefinition(decoration, inst); } - case SpvBuiltInPrimitiveId: { + case spv::BuiltIn::PrimitiveId: { return ValidatePrimitiveIdAtDefinition(decoration, inst); } - case SpvBuiltInSampleId: { + case spv::BuiltIn::SampleId: { return ValidateSampleIdAtDefinition(decoration, inst); } - case SpvBuiltInSampleMask: { + case spv::BuiltIn::SampleMask: { return ValidateSampleMaskAtDefinition(decoration, inst); } - case SpvBuiltInSamplePosition: { + case spv::BuiltIn::SamplePosition: { return ValidateSamplePositionAtDefinition(decoration, inst); } - case SpvBuiltInSubgroupId: - case SpvBuiltInNumSubgroups: { + case spv::BuiltIn::SubgroupId: + case spv::BuiltIn::NumSubgroups: { return ValidateComputeI32InputAtDefinition(decoration, inst); } - case SpvBuiltInSubgroupLocalInvocationId: - case SpvBuiltInSubgroupSize: { + case spv::BuiltIn::SubgroupLocalInvocationId: + case spv::BuiltIn::SubgroupSize: { return ValidateI32InputAtDefinition(decoration, inst); } - case SpvBuiltInSubgroupEqMask: - case SpvBuiltInSubgroupGeMask: - case SpvBuiltInSubgroupGtMask: - case SpvBuiltInSubgroupLeMask: - case SpvBuiltInSubgroupLtMask: { + case spv::BuiltIn::SubgroupEqMask: + case spv::BuiltIn::SubgroupGeMask: + case spv::BuiltIn::SubgroupGtMask: + case spv::BuiltIn::SubgroupLeMask: + case spv::BuiltIn::SubgroupLtMask: { return ValidateI32Vec4InputAtDefinition(decoration, inst); } - case SpvBuiltInTessCoord: { + case spv::BuiltIn::TessCoord: { return ValidateTessCoordAtDefinition(decoration, inst); } - case SpvBuiltInTessLevelOuter: { + case spv::BuiltIn::TessLevelOuter: { return ValidateTessLevelOuterAtDefinition(decoration, inst); } - case SpvBuiltInTessLevelInner: { + case spv::BuiltIn::TessLevelInner: { return ValidateTessLevelInnerAtDefinition(decoration, inst); } - case SpvBuiltInVertexIndex: { + case spv::BuiltIn::VertexIndex: { return ValidateVertexIndexAtDefinition(decoration, inst); } - case SpvBuiltInWorkgroupSize: { + case spv::BuiltIn::WorkgroupSize: { return ValidateWorkgroupSizeAtDefinition(decoration, inst); } - case SpvBuiltInVertexId: { + case spv::BuiltIn::VertexId: { return ValidateVertexIdAtDefinition(decoration, inst); } - case SpvBuiltInLocalInvocationIndex: { + case spv::BuiltIn::LocalInvocationIndex: { return ValidateLocalInvocationIndexAtDefinition(decoration, inst); } - case SpvBuiltInCoreIDARM: - case SpvBuiltInCoreCountARM: - case SpvBuiltInCoreMaxIDARM: - case SpvBuiltInWarpIDARM: - case SpvBuiltInWarpMaxIDARM: - case SpvBuiltInWarpsPerSMNV: - case SpvBuiltInSMCountNV: - case SpvBuiltInWarpIDNV: - case SpvBuiltInSMIDNV: { + case spv::BuiltIn::CoreIDARM: + case spv::BuiltIn::CoreCountARM: + case spv::BuiltIn::CoreMaxIDARM: + case spv::BuiltIn::WarpIDARM: + case spv::BuiltIn::WarpMaxIDARM: + case spv::BuiltIn::WarpsPerSMNV: + case spv::BuiltIn::SMCountNV: + case spv::BuiltIn::WarpIDNV: + case spv::BuiltIn::SMIDNV: { return ValidateNVSMOrARMCoreBuiltinsAtDefinition(decoration, inst); } - case SpvBuiltInBaseInstance: - case SpvBuiltInBaseVertex: { + case spv::BuiltIn::BaseInstance: + case spv::BuiltIn::BaseVertex: { return ValidateBaseInstanceOrVertexAtDefinition(decoration, inst); } - case SpvBuiltInDrawIndex: { + case spv::BuiltIn::DrawIndex: { return ValidateDrawIndexAtDefinition(decoration, inst); } - case SpvBuiltInViewIndex: { + case spv::BuiltIn::ViewIndex: { return ValidateViewIndexAtDefinition(decoration, inst); } - case SpvBuiltInDeviceIndex: { + case spv::BuiltIn::DeviceIndex: { return ValidateDeviceIndexAtDefinition(decoration, inst); } - case SpvBuiltInFragInvocationCountEXT: { - // alias SpvBuiltInInvocationsPerPixelNV + case spv::BuiltIn::FragInvocationCountEXT: { + // alias spv::BuiltIn::InvocationsPerPixelNV return ValidateFragInvocationCountAtDefinition(decoration, inst); } - case SpvBuiltInFragSizeEXT: { - // alias SpvBuiltInFragmentSizeNV + case spv::BuiltIn::FragSizeEXT: { + // alias spv::BuiltIn::FragmentSizeNV return ValidateFragSizeAtDefinition(decoration, inst); } - case SpvBuiltInFragStencilRefEXT: { + case spv::BuiltIn::FragStencilRefEXT: { return ValidateFragStencilRefAtDefinition(decoration, inst); } - case SpvBuiltInFullyCoveredEXT:{ + case spv::BuiltIn::FullyCoveredEXT:{ return ValidateFullyCoveredAtDefinition(decoration, inst); } // Ray tracing builtins - case SpvBuiltInHitKindKHR: // alias SpvBuiltInHitKindNV - case SpvBuiltInHitTNV: // NOT present in KHR - case SpvBuiltInInstanceId: - case SpvBuiltInLaunchIdKHR: // alias SpvBuiltInLaunchIdNV - case SpvBuiltInLaunchSizeKHR: // alias SpvBuiltInLaunchSizeNV - case SpvBuiltInWorldRayOriginKHR: // alias SpvBuiltInWorldRayOriginNV - case SpvBuiltInWorldRayDirectionKHR: // alias SpvBuiltInWorldRayDirectionNV - case SpvBuiltInObjectRayOriginKHR: // alias SpvBuiltInObjectRayOriginNV - case SpvBuiltInObjectRayDirectionKHR: // alias - // SpvBuiltInObjectRayDirectionNV - case SpvBuiltInRayTminKHR: // alias SpvBuiltInRayTminNV - case SpvBuiltInRayTmaxKHR: // alias SpvBuiltInRayTmaxNV - case SpvBuiltInInstanceCustomIndexKHR: // alias - // SpvBuiltInInstanceCustomIndexNV - case SpvBuiltInObjectToWorldKHR: // alias SpvBuiltInObjectToWorldNV - case SpvBuiltInWorldToObjectKHR: // alias SpvBuiltInWorldToObjectNV - case SpvBuiltInIncomingRayFlagsKHR: // alias SpvBuiltInIncomingRayFlagsNV - case SpvBuiltInRayGeometryIndexKHR: // NOT present in NV - case SpvBuiltInCullMaskKHR: { + case spv::BuiltIn::HitKindKHR: // alias spv::BuiltIn::HitKindNV + case spv::BuiltIn::HitTNV: // NOT present in KHR + case spv::BuiltIn::InstanceId: + case spv::BuiltIn::LaunchIdKHR: // alias spv::BuiltIn::LaunchIdNV + case spv::BuiltIn::LaunchSizeKHR: // alias spv::BuiltIn::LaunchSizeNV + case spv::BuiltIn::WorldRayOriginKHR: // alias spv::BuiltIn::WorldRayOriginNV + case spv::BuiltIn::WorldRayDirectionKHR: // alias spv::BuiltIn::WorldRayDirectionNV + case spv::BuiltIn::ObjectRayOriginKHR: // alias spv::BuiltIn::ObjectRayOriginNV + case spv::BuiltIn::ObjectRayDirectionKHR: // alias + // spv::BuiltIn::ObjectRayDirectionNV + case spv::BuiltIn::RayTminKHR: // alias spv::BuiltIn::RayTminNV + case spv::BuiltIn::RayTmaxKHR: // alias spv::BuiltIn::RayTmaxNV + case spv::BuiltIn::InstanceCustomIndexKHR: // alias + // spv::BuiltIn::InstanceCustomIndexNV + case spv::BuiltIn::ObjectToWorldKHR: // alias spv::BuiltIn::ObjectToWorldNV + case spv::BuiltIn::WorldToObjectKHR: // alias spv::BuiltIn::WorldToObjectNV + case spv::BuiltIn::IncomingRayFlagsKHR: // alias spv::BuiltIn::IncomingRayFlagsNV + case spv::BuiltIn::RayGeometryIndexKHR: // NOT present in NV + case spv::BuiltIn::CullMaskKHR: { return ValidateRayTracingBuiltinsAtDefinition(decoration, inst); } - case SpvBuiltInPrimitiveShadingRateKHR: { + case spv::BuiltIn::PrimitiveShadingRateKHR: { return ValidatePrimitiveShadingRateAtDefinition(decoration, inst); } - case SpvBuiltInShadingRateKHR: { + case spv::BuiltIn::ShadingRateKHR: { return ValidateShadingRateAtDefinition(decoration, inst); } default: @@ -4310,7 +4310,7 @@ spv_result_t BuiltInsValidator::ValidateBuiltInsAtDefinition() { assert(inst); for (const auto& decoration : kv.second) { - if (decoration.dec_type() != SpvDecorationBuiltIn) { + if (decoration.dec_type() != spv::Decoration::BuiltIn) { continue; } diff --git a/3rdparty/spirv-tools/source/val/validate_capability.cpp b/3rdparty/spirv-tools/source/val/validate_capability.cpp index 8efd55420..d70c8273c 100644 --- a/3rdparty/spirv-tools/source/val/validate_capability.cpp +++ b/3rdparty/spirv-tools/source/val/validate_capability.cpp @@ -29,74 +29,82 @@ namespace val { namespace { bool IsSupportGuaranteedVulkan_1_0(uint32_t capability) { - switch (capability) { - case SpvCapabilityMatrix: - case SpvCapabilityShader: - case SpvCapabilityInputAttachment: - case SpvCapabilitySampled1D: - case SpvCapabilityImage1D: - case SpvCapabilitySampledBuffer: - case SpvCapabilityImageBuffer: - case SpvCapabilityImageQuery: - case SpvCapabilityDerivativeControl: + switch (spv::Capability(capability)) { + case spv::Capability::Matrix: + case spv::Capability::Shader: + case spv::Capability::InputAttachment: + case spv::Capability::Sampled1D: + case spv::Capability::Image1D: + case spv::Capability::SampledBuffer: + case spv::Capability::ImageBuffer: + case spv::Capability::ImageQuery: + case spv::Capability::DerivativeControl: return true; + default: + break; } return false; } bool IsSupportGuaranteedVulkan_1_1(uint32_t capability) { if (IsSupportGuaranteedVulkan_1_0(capability)) return true; - switch (capability) { - case SpvCapabilityDeviceGroup: - case SpvCapabilityMultiView: + switch (spv::Capability(capability)) { + case spv::Capability::DeviceGroup: + case spv::Capability::MultiView: return true; + default: + break; } return false; } bool IsSupportGuaranteedVulkan_1_2(uint32_t capability) { if (IsSupportGuaranteedVulkan_1_1(capability)) return true; - switch (capability) { - case SpvCapabilityShaderNonUniform: + switch (spv::Capability(capability)) { + case spv::Capability::ShaderNonUniform: return true; + default: + break; } return false; } bool IsSupportOptionalVulkan_1_0(uint32_t capability) { - switch (capability) { - case SpvCapabilityGeometry: - case SpvCapabilityTessellation: - case SpvCapabilityFloat64: - case SpvCapabilityInt64: - case SpvCapabilityInt16: - case SpvCapabilityTessellationPointSize: - case SpvCapabilityGeometryPointSize: - case SpvCapabilityImageGatherExtended: - case SpvCapabilityStorageImageMultisample: - case SpvCapabilityUniformBufferArrayDynamicIndexing: - case SpvCapabilitySampledImageArrayDynamicIndexing: - case SpvCapabilityStorageBufferArrayDynamicIndexing: - case SpvCapabilityStorageImageArrayDynamicIndexing: - case SpvCapabilityClipDistance: - case SpvCapabilityCullDistance: - case SpvCapabilityImageCubeArray: - case SpvCapabilitySampleRateShading: - case SpvCapabilitySparseResidency: - case SpvCapabilityMinLod: - case SpvCapabilitySampledCubeArray: - case SpvCapabilityImageMSArray: - case SpvCapabilityStorageImageExtendedFormats: - case SpvCapabilityInterpolationFunction: - case SpvCapabilityStorageImageReadWithoutFormat: - case SpvCapabilityStorageImageWriteWithoutFormat: - case SpvCapabilityMultiViewport: - case SpvCapabilityInt64Atomics: - case SpvCapabilityTransformFeedback: - case SpvCapabilityGeometryStreams: - case SpvCapabilityFloat16: - case SpvCapabilityInt8: + switch (spv::Capability(capability)) { + case spv::Capability::Geometry: + case spv::Capability::Tessellation: + case spv::Capability::Float64: + case spv::Capability::Int64: + case spv::Capability::Int16: + case spv::Capability::TessellationPointSize: + case spv::Capability::GeometryPointSize: + case spv::Capability::ImageGatherExtended: + case spv::Capability::StorageImageMultisample: + case spv::Capability::UniformBufferArrayDynamicIndexing: + case spv::Capability::SampledImageArrayDynamicIndexing: + case spv::Capability::StorageBufferArrayDynamicIndexing: + case spv::Capability::StorageImageArrayDynamicIndexing: + case spv::Capability::ClipDistance: + case spv::Capability::CullDistance: + case spv::Capability::ImageCubeArray: + case spv::Capability::SampleRateShading: + case spv::Capability::SparseResidency: + case spv::Capability::MinLod: + case spv::Capability::SampledCubeArray: + case spv::Capability::ImageMSArray: + case spv::Capability::StorageImageExtendedFormats: + case spv::Capability::InterpolationFunction: + case spv::Capability::StorageImageReadWithoutFormat: + case spv::Capability::StorageImageWriteWithoutFormat: + case spv::Capability::MultiViewport: + case spv::Capability::Int64Atomics: + case spv::Capability::TransformFeedback: + case spv::Capability::GeometryStreams: + case spv::Capability::Float16: + case spv::Capability::Int8: return true; + default: + break; } return false; } @@ -104,27 +112,29 @@ bool IsSupportOptionalVulkan_1_0(uint32_t capability) { bool IsSupportOptionalVulkan_1_1(uint32_t capability) { if (IsSupportOptionalVulkan_1_0(capability)) return true; - switch (capability) { - case SpvCapabilityGroupNonUniform: - case SpvCapabilityGroupNonUniformVote: - case SpvCapabilityGroupNonUniformArithmetic: - case SpvCapabilityGroupNonUniformBallot: - case SpvCapabilityGroupNonUniformShuffle: - case SpvCapabilityGroupNonUniformShuffleRelative: - case SpvCapabilityGroupNonUniformClustered: - case SpvCapabilityGroupNonUniformQuad: - case SpvCapabilityDrawParameters: - // Alias SpvCapabilityStorageBuffer16BitAccess. - case SpvCapabilityStorageUniformBufferBlock16: - // Alias SpvCapabilityUniformAndStorageBuffer16BitAccess. - case SpvCapabilityStorageUniform16: - case SpvCapabilityStoragePushConstant16: - case SpvCapabilityStorageInputOutput16: - case SpvCapabilityDeviceGroup: - case SpvCapabilityMultiView: - case SpvCapabilityVariablePointersStorageBuffer: - case SpvCapabilityVariablePointers: + switch (spv::Capability(capability)) { + case spv::Capability::GroupNonUniform: + case spv::Capability::GroupNonUniformVote: + case spv::Capability::GroupNonUniformArithmetic: + case spv::Capability::GroupNonUniformBallot: + case spv::Capability::GroupNonUniformShuffle: + case spv::Capability::GroupNonUniformShuffleRelative: + case spv::Capability::GroupNonUniformClustered: + case spv::Capability::GroupNonUniformQuad: + case spv::Capability::DrawParameters: + // Alias spv::Capability::StorageBuffer16BitAccess. + case spv::Capability::StorageUniformBufferBlock16: + // Alias spv::Capability::UniformAndStorageBuffer16BitAccess. + case spv::Capability::StorageUniform16: + case spv::Capability::StoragePushConstant16: + case spv::Capability::StorageInputOutput16: + case spv::Capability::DeviceGroup: + case spv::Capability::MultiView: + case spv::Capability::VariablePointersStorageBuffer: + case spv::Capability::VariablePointers: return true; + default: + break; } return false; } @@ -132,47 +142,51 @@ bool IsSupportOptionalVulkan_1_1(uint32_t capability) { bool IsSupportOptionalVulkan_1_2(uint32_t capability) { if (IsSupportOptionalVulkan_1_1(capability)) return true; - switch (capability) { - case SpvCapabilityDenormPreserve: - case SpvCapabilityDenormFlushToZero: - case SpvCapabilitySignedZeroInfNanPreserve: - case SpvCapabilityRoundingModeRTE: - case SpvCapabilityRoundingModeRTZ: - case SpvCapabilityVulkanMemoryModel: - case SpvCapabilityVulkanMemoryModelDeviceScope: - case SpvCapabilityStorageBuffer8BitAccess: - case SpvCapabilityUniformAndStorageBuffer8BitAccess: - case SpvCapabilityStoragePushConstant8: - case SpvCapabilityShaderViewportIndex: - case SpvCapabilityShaderLayer: - case SpvCapabilityPhysicalStorageBufferAddresses: - case SpvCapabilityRuntimeDescriptorArray: - case SpvCapabilityUniformTexelBufferArrayDynamicIndexing: - case SpvCapabilityStorageTexelBufferArrayDynamicIndexing: - case SpvCapabilityUniformBufferArrayNonUniformIndexing: - case SpvCapabilitySampledImageArrayNonUniformIndexing: - case SpvCapabilityStorageBufferArrayNonUniformIndexing: - case SpvCapabilityStorageImageArrayNonUniformIndexing: - case SpvCapabilityInputAttachmentArrayNonUniformIndexing: - case SpvCapabilityUniformTexelBufferArrayNonUniformIndexing: - case SpvCapabilityStorageTexelBufferArrayNonUniformIndexing: + switch (spv::Capability(capability)) { + case spv::Capability::DenormPreserve: + case spv::Capability::DenormFlushToZero: + case spv::Capability::SignedZeroInfNanPreserve: + case spv::Capability::RoundingModeRTE: + case spv::Capability::RoundingModeRTZ: + case spv::Capability::VulkanMemoryModel: + case spv::Capability::VulkanMemoryModelDeviceScope: + case spv::Capability::StorageBuffer8BitAccess: + case spv::Capability::UniformAndStorageBuffer8BitAccess: + case spv::Capability::StoragePushConstant8: + case spv::Capability::ShaderViewportIndex: + case spv::Capability::ShaderLayer: + case spv::Capability::PhysicalStorageBufferAddresses: + case spv::Capability::RuntimeDescriptorArray: + case spv::Capability::UniformTexelBufferArrayDynamicIndexing: + case spv::Capability::StorageTexelBufferArrayDynamicIndexing: + case spv::Capability::UniformBufferArrayNonUniformIndexing: + case spv::Capability::SampledImageArrayNonUniformIndexing: + case spv::Capability::StorageBufferArrayNonUniformIndexing: + case spv::Capability::StorageImageArrayNonUniformIndexing: + case spv::Capability::InputAttachmentArrayNonUniformIndexing: + case spv::Capability::UniformTexelBufferArrayNonUniformIndexing: + case spv::Capability::StorageTexelBufferArrayNonUniformIndexing: return true; + default: + break; } return false; } bool IsSupportGuaranteedOpenCL_1_2(uint32_t capability, bool embedded_profile) { - switch (capability) { - case SpvCapabilityAddresses: - case SpvCapabilityFloat16Buffer: - case SpvCapabilityInt16: - case SpvCapabilityInt8: - case SpvCapabilityKernel: - case SpvCapabilityLinkage: - case SpvCapabilityVector16: + switch (spv::Capability(capability)) { + case spv::Capability::Addresses: + case spv::Capability::Float16Buffer: + case spv::Capability::Int16: + case spv::Capability::Int8: + case spv::Capability::Kernel: + case spv::Capability::Linkage: + case spv::Capability::Vector16: return true; - case SpvCapabilityInt64: + case spv::Capability::Int64: return !embedded_profile; + default: + break; } return false; } @@ -180,12 +194,14 @@ bool IsSupportGuaranteedOpenCL_1_2(uint32_t capability, bool embedded_profile) { bool IsSupportGuaranteedOpenCL_2_0(uint32_t capability, bool embedded_profile) { if (IsSupportGuaranteedOpenCL_1_2(capability, embedded_profile)) return true; - switch (capability) { - case SpvCapabilityDeviceEnqueue: - case SpvCapabilityGenericPointer: - case SpvCapabilityGroups: - case SpvCapabilityPipes: + switch (spv::Capability(capability)) { + case spv::Capability::DeviceEnqueue: + case spv::Capability::GenericPointer: + case spv::Capability::Groups: + case spv::Capability::Pipes: return true; + default: + break; } return false; } @@ -193,19 +209,23 @@ bool IsSupportGuaranteedOpenCL_2_0(uint32_t capability, bool embedded_profile) { bool IsSupportGuaranteedOpenCL_2_2(uint32_t capability, bool embedded_profile) { if (IsSupportGuaranteedOpenCL_2_0(capability, embedded_profile)) return true; - switch (capability) { - case SpvCapabilitySubgroupDispatch: - case SpvCapabilityPipeStorage: + switch (spv::Capability(capability)) { + case spv::Capability::SubgroupDispatch: + case spv::Capability::PipeStorage: return true; + default: + break; } return false; } bool IsSupportOptionalOpenCL_1_2(uint32_t capability) { - switch (capability) { - case SpvCapabilityImageBasic: - case SpvCapabilityFloat64: + switch (spv::Capability(capability)) { + case spv::Capability::ImageBasic: + case spv::Capability::Float64: return true; + default: + break; } return false; } @@ -229,14 +249,16 @@ bool IsEnabledByExtension(ValidationState_t& _, uint32_t capability) { bool IsEnabledByCapabilityOpenCL_1_2(ValidationState_t& _, uint32_t capability) { - if (_.HasCapability(SpvCapabilityImageBasic)) { - switch (capability) { - case SpvCapabilityLiteralSampler: - case SpvCapabilitySampled1D: - case SpvCapabilityImage1D: - case SpvCapabilitySampledBuffer: - case SpvCapabilityImageBuffer: + if (_.HasCapability(spv::Capability::ImageBasic)) { + switch (spv::Capability(capability)) { + case spv::Capability::LiteralSampler: + case spv::Capability::Sampled1D: + case spv::Capability::Image1D: + case spv::Capability::SampledBuffer: + case spv::Capability::ImageBuffer: return true; + default: + break; } return false; } @@ -245,15 +267,17 @@ bool IsEnabledByCapabilityOpenCL_1_2(ValidationState_t& _, bool IsEnabledByCapabilityOpenCL_2_0(ValidationState_t& _, uint32_t capability) { - if (_.HasCapability(SpvCapabilityImageBasic)) { - switch (capability) { - case SpvCapabilityImageReadWrite: - case SpvCapabilityLiteralSampler: - case SpvCapabilitySampled1D: - case SpvCapabilityImage1D: - case SpvCapabilitySampledBuffer: - case SpvCapabilityImageBuffer: + if (_.HasCapability(spv::Capability::ImageBasic)) { + switch (spv::Capability(capability)) { + case spv::Capability::ImageReadWrite: + case spv::Capability::LiteralSampler: + case spv::Capability::Sampled1D: + case spv::Capability::Image1D: + case spv::Capability::SampledBuffer: + case spv::Capability::ImageBuffer: return true; + default: + break; } return false; } @@ -265,7 +289,7 @@ bool IsEnabledByCapabilityOpenCL_2_0(ValidationState_t& _, // Validates that capability declarations use operands allowed in the current // context. spv_result_t CapabilityPass(ValidationState_t& _, const Instruction* inst) { - if (inst->opcode() != SpvOpCapability) return SPV_SUCCESS; + if (inst->opcode() != spv::Op::OpCapability) return SPV_SUCCESS; assert(inst->operands().size() == 1); diff --git a/3rdparty/spirv-tools/source/val/validate_cfg.cpp b/3rdparty/spirv-tools/source/val/validate_cfg.cpp index cc0b999f2..9ba66f422 100644 --- a/3rdparty/spirv-tools/source/val/validate_cfg.cpp +++ b/3rdparty/spirv-tools/source/val/validate_cfg.cpp @@ -54,7 +54,7 @@ spv_result_t ValidatePhi(ValidationState_t& _, const Instruction* inst) { << "OpPhi must not have void result type"; } if (_.IsPointerType(inst->type_id()) && - _.addressing_model() == SpvAddressingModelLogical) { + _.addressing_model() == spv::AddressingModel::Logical) { if (!_.features().variable_pointers) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Using pointers with OpPhi requires capability " @@ -64,13 +64,14 @@ spv_result_t ValidatePhi(ValidationState_t& _, const Instruction* inst) { const Instruction* type_inst = _.FindDef(inst->type_id()); assert(type_inst); - const SpvOp type_opcode = type_inst->opcode(); + const spv::Op type_opcode = type_inst->opcode(); if (!_.options()->before_hlsl_legalization && - !_.HasCapability(SpvCapabilityBindlessTextureNV)) { - if (type_opcode == SpvOpTypeSampledImage || - (_.HasCapability(SpvCapabilityShader) && - (type_opcode == SpvOpTypeImage || type_opcode == SpvOpTypeSampler))) { + !_.HasCapability(spv::Capability::BindlessTextureNV)) { + if (type_opcode == spv::Op::OpTypeSampledImage || + (_.HasCapability(spv::Capability::Shader) && + (type_opcode == spv::Op::OpTypeImage || + type_opcode == spv::Op::OpTypeSampler))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Result type cannot be Op" << spvOpcodeString(type_opcode); } @@ -108,7 +109,7 @@ spv_result_t ValidatePhi(ValidationState_t& _, const Instruction* inst) { << " type " << _.getIdName(inc_type_id) << "."; } } else { - if (_.GetIdOpcode(inc_id) != SpvOpLabel) { + if (_.GetIdOpcode(inc_id) != spv::Op::OpLabel) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpPhi's incoming basic block " << _.getIdName(inc_id) << " is not an OpLabel."; @@ -143,7 +144,7 @@ spv_result_t ValidateBranch(ValidationState_t& _, const Instruction* inst) { // target operands must be OpLabel const auto id = inst->GetOperandAs(0); const auto target = _.FindDef(id); - if (!target || SpvOpLabel != target->opcode()) { + if (!target || spv::Op::OpLabel != target->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "'Target Label' operands for OpBranch must be the ID " "of an OpLabel instruction"; @@ -178,7 +179,7 @@ spv_result_t ValidateBranchConditional(ValidationState_t& _, // PerformCfgChecks already checks for that const auto true_id = inst->GetOperandAs(1); const auto true_target = _.FindDef(true_id); - if (!true_target || SpvOpLabel != true_target->opcode()) { + if (!true_target || spv::Op::OpLabel != true_target->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The 'True Label' operand for OpBranchConditional must be the " "ID of an OpLabel instruction"; @@ -186,7 +187,7 @@ spv_result_t ValidateBranchConditional(ValidationState_t& _, const auto false_id = inst->GetOperandAs(2); const auto false_target = _.FindDef(false_id); - if (!false_target || SpvOpLabel != false_target->opcode()) { + if (!false_target || spv::Op::OpLabel != false_target->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The 'False Label' operand for OpBranchConditional must be the " "ID of an OpLabel instruction"; @@ -213,7 +214,7 @@ spv_result_t ValidateSwitch(ValidationState_t& _, const Instruction* inst) { } const auto default_label = _.FindDef(inst->GetOperandAs(1)); - if (default_label->opcode() != SpvOpLabel) { + if (default_label->opcode() != spv::Op::OpLabel) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Default must be an OpLabel instruction"; } @@ -223,7 +224,7 @@ spv_result_t ValidateSwitch(ValidationState_t& _, const Instruction* inst) { // literal, id const auto id = inst->GetOperandAs(i + 1); const auto target = _.FindDef(id); - if (!target || SpvOpLabel != target->opcode()) { + if (!target || spv::Op::OpLabel != target->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "'Target Label' operands for OpSwitch must be IDs of an " "OpLabel instruction"; @@ -243,14 +244,14 @@ spv_result_t ValidateReturnValue(ValidationState_t& _, << " does not represent a value."; } auto value_type = _.FindDef(value->type_id()); - if (!value_type || SpvOpTypeVoid == value_type->opcode()) { + if (!value_type || spv::Op::OpTypeVoid == value_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpReturnValue value's type " << _.getIdName(value->type_id()) << " is missing or void."; } - if (_.addressing_model() == SpvAddressingModelLogical && - SpvOpTypePointer == value_type->opcode() && + if (_.addressing_model() == spv::AddressingModel::Logical && + spv::Op::OpTypePointer == value_type->opcode() && !_.features().variable_pointers && !_.options()->relax_logical_pointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpReturnValue value's type " @@ -270,10 +271,15 @@ spv_result_t ValidateReturnValue(ValidationState_t& _, return SPV_SUCCESS; } +uint32_t operator>>(const spv::LoopControlShift& lhs, + const spv::LoopControlShift& rhs) { + return uint32_t(lhs) >> uint32_t(rhs); +} + spv_result_t ValidateLoopMerge(ValidationState_t& _, const Instruction* inst) { const auto merge_id = inst->GetOperandAs(0); const auto merge = _.FindDef(merge_id); - if (!merge || merge->opcode() != SpvOpLabel) { + if (!merge || merge->opcode() != spv::Op::OpLabel) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Merge Block " << _.getIdName(merge_id) << " must be an OpLabel"; } @@ -284,7 +290,7 @@ spv_result_t ValidateLoopMerge(ValidationState_t& _, const Instruction* inst) { const auto continue_id = inst->GetOperandAs(1); const auto continue_target = _.FindDef(continue_id); - if (!continue_target || continue_target->opcode() != SpvOpLabel) { + if (!continue_target || continue_target->opcode() != spv::Op::OpLabel) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Continue Target " << _.getIdName(continue_id) << " must be an OpLabel"; @@ -295,36 +301,36 @@ spv_result_t ValidateLoopMerge(ValidationState_t& _, const Instruction* inst) { << "Merge Block and Continue Target must be different ids"; } - const auto loop_control = inst->GetOperandAs(2); - if ((loop_control >> SpvLoopControlUnrollShift) & 0x1 && - (loop_control >> SpvLoopControlDontUnrollShift) & 0x1) { + const auto loop_control = inst->GetOperandAs(2); + if ((loop_control >> spv::LoopControlShift::Unroll) & 0x1 && + (loop_control >> spv::LoopControlShift::DontUnroll) & 0x1) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Unroll and DontUnroll loop controls must not both be specified"; } - if ((loop_control >> SpvLoopControlDontUnrollShift) & 0x1 && - (loop_control >> SpvLoopControlPeelCountShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::DontUnroll) & 0x1 && + (loop_control >> spv::LoopControlShift::PeelCount) & 0x1) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "PeelCount and DontUnroll " "loop controls must not " "both be specified"; } - if ((loop_control >> SpvLoopControlDontUnrollShift) & 0x1 && - (loop_control >> SpvLoopControlPartialCountShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::DontUnroll) & 0x1 && + (loop_control >> spv::LoopControlShift::PartialCount) & 0x1) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "PartialCount and " "DontUnroll loop controls " "must not both be specified"; } uint32_t operand = 3; - if ((loop_control >> SpvLoopControlDependencyLengthShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::DependencyLength) & 0x1) { ++operand; } - if ((loop_control >> SpvLoopControlMinIterationsShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::MinIterations) & 0x1) { ++operand; } - if ((loop_control >> SpvLoopControlMaxIterationsShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::MaxIterations) & 0x1) { ++operand; } - if ((loop_control >> SpvLoopControlIterationMultipleShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::IterationMultiple) & 0x1) { if (inst->operands().size() < operand || inst->GetOperandAs(operand) == 0) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "IterationMultiple loop " @@ -333,10 +339,10 @@ spv_result_t ValidateLoopMerge(ValidationState_t& _, const Instruction* inst) { } ++operand; } - if ((loop_control >> SpvLoopControlPeelCountShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::PeelCount) & 0x1) { ++operand; } - if ((loop_control >> SpvLoopControlPartialCountShift) & 0x1) { + if ((loop_control >> spv::LoopControlShift::PartialCount) & 0x1) { ++operand; } @@ -554,7 +560,7 @@ spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function, target_block->structurally_reachable() && !header->structurally_dominates(*target_block)) { return _.diag(SPV_ERROR_INVALID_CFG, header->label()) - << "Selection header " << _.getIdName(header->id()) + << "Switch header " << _.getIdName(header->id()) << " does not structurally dominate its case construct " << _.getIdName(target); } @@ -644,9 +650,9 @@ spv_result_t ValidateStructuredSelections( const auto index = terminator - &_.ordered_instructions()[0]; auto* merge = &_.ordered_instructions()[index - 1]; // Marks merges and continues as seen. - if (merge->opcode() == SpvOpSelectionMerge) { + if (merge->opcode() == spv::Op::OpSelectionMerge) { seen.insert(merge->GetOperandAs(0)); - } else if (merge->opcode() == SpvOpLoopMerge) { + } else if (merge->opcode() == spv::Op::OpLoopMerge) { seen.insert(merge->GetOperandAs(0)); seen.insert(merge->GetOperandAs(1)); } else { @@ -657,7 +663,7 @@ spv_result_t ValidateStructuredSelections( // Skip unreachable blocks. if (!block->structurally_reachable()) continue; - if (terminator->opcode() == SpvOpBranchConditional) { + if (terminator->opcode() == spv::Op::OpBranchConditional) { const auto true_label = terminator->GetOperandAs(1); const auto false_label = terminator->GetOperandAs(2); // Mark the upcoming blocks as seen now, but only error out if this block @@ -669,7 +675,7 @@ spv_result_t ValidateStructuredSelections( return _.diag(SPV_ERROR_INVALID_CFG, terminator) << "Selection must be structured"; } - } else if (terminator->opcode() == SpvOpSwitch) { + } else if (terminator->opcode() == spv::Op::OpSwitch) { if (!merge) { return _.diag(SPV_ERROR_INVALID_CFG, terminator) << "OpSwitch must be preceded by an OpSelectionMerge " @@ -746,6 +752,7 @@ spv_result_t StructuredControlFlowChecks( _.getIdName(merge->id()), "does not structurally dominate"); } + // If it's really a merge block for a selection or loop, then it must be // *strictly* structrually dominated by the header. if (construct.ExitBlockIsMergeBlock() && (header == merge)) { @@ -798,8 +805,8 @@ spv_result_t StructuredControlFlowChecks( block->is_type(BlockType::kBlockTypeLoop)) { size_t index = (block->terminator() - &_.ordered_instructions()[0]) - 1; const auto& merge_inst = _.ordered_instructions()[index]; - if (merge_inst.opcode() == SpvOpSelectionMerge || - merge_inst.opcode() == SpvOpLoopMerge) { + if (merge_inst.opcode() == spv::Op::OpSelectionMerge || + merge_inst.opcode() == spv::Op::OpLoopMerge) { uint32_t merge_id = merge_inst.GetOperandAs(0); auto merge_block = function->GetBlock(merge_id).first; if (merge_block->structurally_reachable() && @@ -854,7 +861,7 @@ spv_result_t StructuredControlFlowChecks( // Checks rules for case constructs. if (construct.type() == ConstructType::kSelection && - header->terminator()->opcode() == SpvOpSwitch) { + header->terminator()->opcode() == spv::Op::OpSwitch) { const auto terminator = header->terminator(); if (auto error = StructuredSwitchChecks(_, function, terminator, header, merge)) { @@ -928,7 +935,7 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) { } // If we have structured control flow, check that no block has a control // flow nesting depth larger than the limit. - if (_.HasCapability(SpvCapabilityShader)) { + if (_.HasCapability(spv::Capability::Shader)) { const int control_flow_nesting_depth_limit = _.options()->universal_limits_.max_control_flow_nesting_depth; for (auto block = begin(blocks); block != end(blocks); ++block) { @@ -942,7 +949,7 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) { } /// Structured control flow checks are only required for shader capabilities - if (_.HasCapability(SpvCapabilityShader)) { + if (_.HasCapability(spv::Capability::Shader)) { // Calculate structural dominance. postorder.clear(); std::vector postdom_postorder; @@ -998,9 +1005,9 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) { } spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) { - SpvOp opcode = inst->opcode(); + spv::Op opcode = inst->opcode(); switch (opcode) { - case SpvOpLabel: + case spv::Op::OpLabel: if (auto error = _.current_function().RegisterBlock(inst->id())) return error; @@ -1009,7 +1016,7 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) { // passes the OpLabel ends up not being part of the basic block it starts. _.current_function().current_block()->set_label(inst); break; - case SpvOpLoopMerge: { + case spv::Op::OpLoopMerge: { uint32_t merge_block = inst->GetOperandAs(0); uint32_t continue_block = inst->GetOperandAs(1); CFG_ASSERT(MergeBlockAssert, merge_block); @@ -1018,20 +1025,20 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) { continue_block)) return error; } break; - case SpvOpSelectionMerge: { + case spv::Op::OpSelectionMerge: { uint32_t merge_block = inst->GetOperandAs(0); CFG_ASSERT(MergeBlockAssert, merge_block); if (auto error = _.current_function().RegisterSelectionMerge(merge_block)) return error; } break; - case SpvOpBranch: { + case spv::Op::OpBranch: { uint32_t target = inst->GetOperandAs(0); CFG_ASSERT(FirstBlockAssert, target); _.current_function().RegisterBlockEnd({target}); } break; - case SpvOpBranchConditional: { + case spv::Op::OpBranchConditional: { uint32_t tlabel = inst->GetOperandAs(1); uint32_t flabel = inst->GetOperandAs(2); CFG_ASSERT(FirstBlockAssert, tlabel); @@ -1040,7 +1047,7 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) { _.current_function().RegisterBlockEnd({tlabel, flabel}); } break; - case SpvOpSwitch: { + case spv::Op::OpSwitch: { std::vector cases; for (size_t i = 1; i < inst->operands().size(); i += 2) { uint32_t target = inst->GetOperandAs(i); @@ -1049,44 +1056,44 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) { } _.current_function().RegisterBlockEnd({cases}); } break; - case SpvOpReturn: { + case spv::Op::OpReturn: { const uint32_t return_type = _.current_function().GetResultTypeId(); const Instruction* return_type_inst = _.FindDef(return_type); assert(return_type_inst); - if (return_type_inst->opcode() != SpvOpTypeVoid) + if (return_type_inst->opcode() != spv::Op::OpTypeVoid) return _.diag(SPV_ERROR_INVALID_CFG, inst) << "OpReturn can only be called from a function with void " << "return type."; _.current_function().RegisterBlockEnd(std::vector()); break; } - case SpvOpKill: - case SpvOpReturnValue: - case SpvOpUnreachable: - case SpvOpTerminateInvocation: - case SpvOpIgnoreIntersectionKHR: - case SpvOpTerminateRayKHR: - case SpvOpEmitMeshTasksEXT: + case spv::Op::OpKill: + case spv::Op::OpReturnValue: + case spv::Op::OpUnreachable: + case spv::Op::OpTerminateInvocation: + case spv::Op::OpIgnoreIntersectionKHR: + case spv::Op::OpTerminateRayKHR: + case spv::Op::OpEmitMeshTasksEXT: _.current_function().RegisterBlockEnd(std::vector()); // Ops with dedicated passes check for the Execution Model there - if (opcode == SpvOpKill) { + if (opcode == spv::Op::OpKill) { _.current_function().RegisterExecutionModelLimitation( - SpvExecutionModelFragment, + spv::ExecutionModel::Fragment, "OpKill requires Fragment execution model"); } - if (opcode == SpvOpTerminateInvocation) { + if (opcode == spv::Op::OpTerminateInvocation) { _.current_function().RegisterExecutionModelLimitation( - SpvExecutionModelFragment, + spv::ExecutionModel::Fragment, "OpTerminateInvocation requires Fragment execution model"); } - if (opcode == SpvOpIgnoreIntersectionKHR) { + if (opcode == spv::Op::OpIgnoreIntersectionKHR) { _.current_function().RegisterExecutionModelLimitation( - SpvExecutionModelAnyHitKHR, + spv::ExecutionModel::AnyHitKHR, "OpIgnoreIntersectionKHR requires AnyHitKHR execution model"); } - if (opcode == SpvOpTerminateRayKHR) { + if (opcode == spv::Op::OpTerminateRayKHR) { _.current_function().RegisterExecutionModelLimitation( - SpvExecutionModelAnyHitKHR, + spv::ExecutionModel::AnyHitKHR, "OpTerminateRayKHR requires AnyHitKHR execution model"); } @@ -1140,22 +1147,22 @@ void ReachabilityPass(ValidationState_t& _) { spv_result_t ControlFlowPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpPhi: + case spv::Op::OpPhi: if (auto error = ValidatePhi(_, inst)) return error; break; - case SpvOpBranch: + case spv::Op::OpBranch: if (auto error = ValidateBranch(_, inst)) return error; break; - case SpvOpBranchConditional: + case spv::Op::OpBranchConditional: if (auto error = ValidateBranchConditional(_, inst)) return error; break; - case SpvOpReturnValue: + case spv::Op::OpReturnValue: if (auto error = ValidateReturnValue(_, inst)) return error; break; - case SpvOpSwitch: + case spv::Op::OpSwitch: if (auto error = ValidateSwitch(_, inst)) return error; break; - case SpvOpLoopMerge: + case spv::Op::OpLoopMerge: if (auto error = ValidateLoopMerge(_, inst)) return error; break; default: diff --git a/3rdparty/spirv-tools/source/val/validate_composites.cpp b/3rdparty/spirv-tools/source/val/validate_composites.cpp index c3d948dc7..e777f1640 100644 --- a/3rdparty/spirv-tools/source/val/validate_composites.cpp +++ b/3rdparty/spirv-tools/source/val/validate_composites.cpp @@ -35,9 +35,10 @@ namespace { spv_result_t GetExtractInsertValueType(ValidationState_t& _, const Instruction* inst, uint32_t* member_type) { - const SpvOp opcode = inst->opcode(); - assert(opcode == SpvOpCompositeExtract || opcode == SpvOpCompositeInsert); - uint32_t word_index = opcode == SpvOpCompositeExtract ? 4 : 5; + const spv::Op opcode = inst->opcode(); + assert(opcode == spv::Op::OpCompositeExtract || + opcode == spv::Op::OpCompositeInsert); + uint32_t word_index = opcode == spv::Op::OpCompositeExtract ? 4 : 5; const uint32_t num_words = static_cast(inst->words().size()); const uint32_t composite_id_index = word_index - 1; const uint32_t num_indices = num_words - word_index; @@ -66,7 +67,7 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _, const Instruction* const type_inst = _.FindDef(*member_type); assert(type_inst); switch (type_inst->opcode()) { - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { *member_type = type_inst->word(2); const uint32_t vector_size = type_inst->word(3); if (component_index >= vector_size) { @@ -76,7 +77,7 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _, } break; } - case SpvOpTypeMatrix: { + case spv::Op::OpTypeMatrix: { *member_type = type_inst->word(2); const uint32_t num_cols = type_inst->word(3); if (component_index >= num_cols) { @@ -86,7 +87,7 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _, } break; } - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { uint64_t array_size = 0; auto size = _.FindDef(type_inst->word(3)); *member_type = type_inst->word(2); @@ -105,12 +106,12 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _, } break; } - case SpvOpTypeRuntimeArray: { + case spv::Op::OpTypeRuntimeArray: { *member_type = type_inst->word(2); // Array size is unknown. break; } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const size_t num_struct_members = type_inst->words().size() - 2; if (component_index >= num_struct_members) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -123,7 +124,7 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _, *member_type = type_inst->word(component_index + 2); break; } - case SpvOpTypeCooperativeMatrixNV: { + case spv::Op::OpTypeCooperativeMatrixNV: { *member_type = type_inst->word(2); break; } @@ -140,15 +141,15 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _, spv_result_t ValidateVectorExtractDynamic(ValidationState_t& _, const Instruction* inst) { const uint32_t result_type = inst->type_id(); - const SpvOp result_opcode = _.GetIdOpcode(result_type); + const spv::Op result_opcode = _.GetIdOpcode(result_type); if (!spvOpcodeIsScalarType(result_opcode)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be a scalar type"; } const uint32_t vector_type = _.GetOperandTypeId(inst, 2); - const SpvOp vector_opcode = _.GetIdOpcode(vector_type); - if (vector_opcode != SpvOpTypeVector) { + const spv::Op vector_opcode = _.GetIdOpcode(vector_type); + if (vector_opcode != spv::Op::OpTypeVector) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Vector type to be OpTypeVector"; } @@ -164,7 +165,7 @@ spv_result_t ValidateVectorExtractDynamic(ValidationState_t& _, << "Expected Index to be int scalar"; } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot extract from a vector of 8- or 16-bit types"; @@ -175,8 +176,8 @@ spv_result_t ValidateVectorExtractDynamic(ValidationState_t& _, spv_result_t ValidateVectorInsertDyanmic(ValidationState_t& _, const Instruction* inst) { const uint32_t result_type = inst->type_id(); - const SpvOp result_opcode = _.GetIdOpcode(result_type); - if (result_opcode != SpvOpTypeVector) { + const spv::Op result_opcode = _.GetIdOpcode(result_type); + if (result_opcode != spv::Op::OpTypeVector) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypeVector"; } @@ -200,7 +201,7 @@ spv_result_t ValidateVectorInsertDyanmic(ValidationState_t& _, << "Expected Index to be int scalar"; } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot insert into a vector of 8- or 16-bit types"; @@ -212,9 +213,9 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, const Instruction* inst) { const uint32_t num_operands = static_cast(inst->operands().size()); const uint32_t result_type = inst->type_id(); - const SpvOp result_opcode = _.GetIdOpcode(result_type); + const spv::Op result_opcode = _.GetIdOpcode(result_type); switch (result_opcode) { - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { const uint32_t num_result_components = _.GetDimension(result_type); const uint32_t result_component_type = _.GetComponentType(result_type); uint32_t given_component_count = 0; @@ -230,7 +231,7 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, if (operand_type == result_component_type) { ++given_component_count; } else { - if (_.GetIdOpcode(operand_type) != SpvOpTypeVector || + if (_.GetIdOpcode(operand_type) != spv::Op::OpTypeVector || _.GetComponentType(operand_type) != result_component_type) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Constituents to be scalars or vectors of" @@ -249,7 +250,7 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, break; } - case SpvOpTypeMatrix: { + case spv::Op::OpTypeMatrix: { uint32_t result_num_rows = 0; uint32_t result_num_cols = 0; uint32_t result_col_type = 0; @@ -277,10 +278,10 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, break; } - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { const Instruction* const array_inst = _.FindDef(result_type); assert(array_inst); - assert(array_inst->opcode() == SpvOpTypeArray); + assert(array_inst->opcode() == spv::Op::OpTypeArray); auto size = _.FindDef(array_inst->word(3)); if (spvOpcodeIsSpecConstant(size->opcode())) { @@ -312,10 +313,10 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, break; } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const Instruction* const struct_inst = _.FindDef(result_type); assert(struct_inst); - assert(struct_inst->opcode() == SpvOpTypeStruct); + assert(struct_inst->opcode() == spv::Op::OpTypeStruct); if (struct_inst->operands().size() + 1 != num_operands) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -336,7 +337,7 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, break; } - case SpvOpTypeCooperativeMatrixNV: { + case spv::Op::OpTypeCooperativeMatrixNV: { const auto result_type_inst = _.FindDef(result_type); assert(result_type_inst); const auto component_type_id = @@ -362,7 +363,7 @@ spv_result_t ValidateCompositeConstruct(ValidationState_t& _, } } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot create a composite containing 8- or 16-bit types"; @@ -386,7 +387,7 @@ spv_result_t ValidateCompositeExtract(ValidationState_t& _, << spvOpcodeString(_.GetIdOpcode(member_type)) << ")."; } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot extract from a composite of 8- or 16-bit types"; @@ -421,7 +422,7 @@ spv_result_t ValidateCompositeInsert(ValidationState_t& _, << spvOpcodeString(_.GetIdOpcode(member_type)) << ")."; } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot insert into a composite of 8- or 16-bit types"; @@ -480,7 +481,7 @@ spv_result_t ValidateTranspose(ValidationState_t& _, const Instruction* inst) { << "to be the reverse of those of Result Type"; } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot transpose matrices of 16-bit floats"; @@ -491,11 +492,12 @@ spv_result_t ValidateTranspose(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateVectorShuffle(ValidationState_t& _, const Instruction* inst) { auto resultType = _.FindDef(inst->type_id()); - if (!resultType || resultType->opcode() != SpvOpTypeVector) { + if (!resultType || resultType->opcode() != spv::Op::OpTypeVector) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The Result Type of OpVectorShuffle must be" << " OpTypeVector. Found Op" - << spvOpcodeString(static_cast(resultType->opcode())) << "."; + << spvOpcodeString(static_cast(resultType->opcode())) + << "."; } // The number of components in Result Type must be the same as the number of @@ -515,11 +517,11 @@ spv_result_t ValidateVectorShuffle(ValidationState_t& _, auto vector1Type = _.FindDef(vector1Object->type_id()); auto vector2Object = _.FindDef(inst->GetOperandAs(3)); auto vector2Type = _.FindDef(vector2Object->type_id()); - if (!vector1Type || vector1Type->opcode() != SpvOpTypeVector) { + if (!vector1Type || vector1Type->opcode() != spv::Op::OpTypeVector) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The type of Vector 1 must be OpTypeVector."; } - if (!vector2Type || vector2Type->opcode() != SpvOpTypeVector) { + if (!vector2Type || vector2Type->opcode() != spv::Op::OpTypeVector) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The type of Vector 2 must be OpTypeVector."; } @@ -548,7 +550,7 @@ spv_result_t ValidateVectorShuffle(ValidationState_t& _, } } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot shuffle a vector of 8- or 16-bit types"; @@ -572,7 +574,7 @@ spv_result_t ValidateCopyLogical(ValidationState_t& _, << "Result Type does not logically match the Operand type"; } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Cannot copy composites of 8- or 16-bit types"; @@ -586,23 +588,23 @@ spv_result_t ValidateCopyLogical(ValidationState_t& _, // Validates correctness of composite instructions. spv_result_t CompositesPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpVectorExtractDynamic: + case spv::Op::OpVectorExtractDynamic: return ValidateVectorExtractDynamic(_, inst); - case SpvOpVectorInsertDynamic: + case spv::Op::OpVectorInsertDynamic: return ValidateVectorInsertDyanmic(_, inst); - case SpvOpVectorShuffle: + case spv::Op::OpVectorShuffle: return ValidateVectorShuffle(_, inst); - case SpvOpCompositeConstruct: + case spv::Op::OpCompositeConstruct: return ValidateCompositeConstruct(_, inst); - case SpvOpCompositeExtract: + case spv::Op::OpCompositeExtract: return ValidateCompositeExtract(_, inst); - case SpvOpCompositeInsert: + case spv::Op::OpCompositeInsert: return ValidateCompositeInsert(_, inst); - case SpvOpCopyObject: + case spv::Op::OpCopyObject: return ValidateCopyObject(_, inst); - case SpvOpTranspose: + case spv::Op::OpTranspose: return ValidateTranspose(_, inst); - case SpvOpCopyLogical: + case spv::Op::OpCopyLogical: return ValidateCopyLogical(_, inst); default: break; diff --git a/3rdparty/spirv-tools/source/val/validate_constants.cpp b/3rdparty/spirv-tools/source/val/validate_constants.cpp index fdfaea5f7..a8ee5a6b1 100644 --- a/3rdparty/spirv-tools/source/val/validate_constants.cpp +++ b/3rdparty/spirv-tools/source/val/validate_constants.cpp @@ -24,7 +24,7 @@ namespace { spv_result_t ValidateConstantBool(ValidationState_t& _, const Instruction* inst) { auto type = _.FindDef(inst->type_id()); - if (!type || type->opcode() != SpvOpTypeBool) { + if (!type || type->opcode() != spv::Op::OpTypeBool) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Op" << spvOpcodeString(inst->opcode()) << " Result Type " << _.getIdName(inst->type_id()) << " is not a boolean type."; @@ -46,7 +46,7 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _, const auto constituent_count = inst->words().size() - 3; switch (result_type->opcode()) { - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { const auto component_count = result_type->GetOperandAs(2); if (component_count != constituent_count) { // TODO: Output ID's on diagnostic @@ -85,7 +85,7 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _, } } } break; - case SpvOpTypeMatrix: { + case spv::Op::OpTypeMatrix: { const auto column_count = result_type->GetOperandAs(2); if (column_count != constituent_count) { // TODO: Output ID's on diagnostic @@ -155,7 +155,7 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _, } } } break; - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { auto element_type = _.FindDef(result_type->GetOperandAs(1)); if (!element_type) { return _.diag(SPV_ERROR_INVALID_ID, result_type) @@ -203,7 +203,7 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _, } } } break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const auto member_count = result_type->words().size() - 2; if (member_count != constituent_count) { return _.diag(SPV_ERROR_INVALID_ID, inst) @@ -243,7 +243,7 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _, } } } break; - case SpvOpTypeCooperativeMatrixNV: { + case spv::Op::OpTypeCooperativeMatrixNV: { if (1 != constituent_count) { return _.diag(SPV_ERROR_INVALID_ID, inst) << opcode_name << " Constituent " @@ -281,7 +281,7 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _, spv_result_t ValidateConstantSampler(ValidationState_t& _, const Instruction* inst) { const auto result_type = _.FindDef(inst->type_id()); - if (!result_type || result_type->opcode() != SpvOpTypeSampler) { + if (!result_type || result_type->opcode() != spv::Op::OpTypeSampler) { return _.diag(SPV_ERROR_INVALID_ID, result_type) << "OpConstantSampler Result Type " << _.getIdName(inst->type_id()) << " is not a sampler type."; @@ -298,23 +298,23 @@ bool IsTypeNullable(const std::vector& instruction, uint16_t opcode; uint16_t word_count; spvOpcodeSplit(instruction[0], &word_count, &opcode); - switch (static_cast(opcode)) { - case SpvOpTypeBool: - case SpvOpTypeInt: - case SpvOpTypeFloat: - case SpvOpTypeEvent: - case SpvOpTypeDeviceEvent: - case SpvOpTypeReserveId: - case SpvOpTypeQueue: + switch (static_cast(opcode)) { + case spv::Op::OpTypeBool: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeEvent: + case spv::Op::OpTypeDeviceEvent: + case spv::Op::OpTypeReserveId: + case spv::Op::OpTypeQueue: return true; - case SpvOpTypeArray: - case SpvOpTypeMatrix: - case SpvOpTypeCooperativeMatrixNV: - case SpvOpTypeVector: { + case spv::Op::OpTypeArray: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeCooperativeMatrixNV: + case spv::Op::OpTypeVector: { auto base_type = _.FindDef(instruction[2]); return base_type && IsTypeNullable(base_type->words(), _); } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { for (size_t elementIndex = 2; elementIndex < instruction.size(); ++elementIndex) { auto element = _.FindDef(instruction[elementIndex]); @@ -322,8 +322,9 @@ bool IsTypeNullable(const std::vector& instruction, } return true; } - case SpvOpTypePointer: - if (instruction[2] == SpvStorageClassPhysicalStorageBuffer) { + case spv::Op::OpTypePointer: + if (spv::StorageClass(instruction[2]) == + spv::StorageClass::PhysicalStorageBuffer) { return false; } return true; @@ -351,7 +352,8 @@ spv_result_t ValidateSpecConstant(ValidationState_t& _, auto type_id = inst->GetOperandAs(0); auto type_instruction = _.FindDef(type_id); auto type_opcode = type_instruction->opcode(); - if (type_opcode != SpvOpTypeInt && type_opcode != SpvOpTypeFloat) { + if (type_opcode != spv::Op::OpTypeInt && + type_opcode != spv::Op::OpTypeFloat) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Specialization constant " "must be an integer or " "floating-point number."; @@ -361,22 +363,22 @@ spv_result_t ValidateSpecConstant(ValidationState_t& _, spv_result_t ValidateSpecConstantOp(ValidationState_t& _, const Instruction* inst) { - const auto op = inst->GetOperandAs(2); + const auto op = inst->GetOperandAs(2); // The binary parser already ensures that the op is valid for *some* // environment. Here we check restrictions. switch (op) { - case SpvOpQuantizeToF16: - if (!_.HasCapability(SpvCapabilityShader)) { + case spv::Op::OpQuantizeToF16: + if (!_.HasCapability(spv::Capability::Shader)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Specialization constant operation " << spvOpcodeString(op) << " requires Shader capability"; } break; - case SpvOpUConvert: + case spv::Op::OpUConvert: if (!_.features().uconvert_spec_constant_op && - !_.HasCapability(SpvCapabilityKernel)) { + !_.HasCapability(spv::Capability::Kernel)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Prior to SPIR-V 1.4, specialization constant operation " "UConvert requires Kernel capability or extension " @@ -384,27 +386,27 @@ spv_result_t ValidateSpecConstantOp(ValidationState_t& _, } break; - case SpvOpConvertFToS: - case SpvOpConvertSToF: - case SpvOpConvertFToU: - case SpvOpConvertUToF: - case SpvOpConvertPtrToU: - case SpvOpConvertUToPtr: - case SpvOpGenericCastToPtr: - case SpvOpPtrCastToGeneric: - case SpvOpBitcast: - case SpvOpFNegate: - case SpvOpFAdd: - case SpvOpFSub: - case SpvOpFMul: - case SpvOpFDiv: - case SpvOpFRem: - case SpvOpFMod: - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpPtrAccessChain: - case SpvOpInBoundsPtrAccessChain: - if (!_.HasCapability(SpvCapabilityKernel)) { + case spv::Op::OpConvertFToS: + case spv::Op::OpConvertSToF: + case spv::Op::OpConvertFToU: + case spv::Op::OpConvertUToF: + case spv::Op::OpConvertPtrToU: + case spv::Op::OpConvertUToPtr: + case spv::Op::OpGenericCastToPtr: + case spv::Op::OpPtrCastToGeneric: + case spv::Op::OpBitcast: + case spv::Op::OpFNegate: + case spv::Op::OpFAdd: + case spv::Op::OpFSub: + case spv::Op::OpFMul: + case spv::Op::OpFDiv: + case spv::Op::OpFRem: + case spv::Op::OpFMod: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpPtrAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: + if (!_.HasCapability(spv::Capability::Kernel)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Specialization constant operation " << spvOpcodeString(op) << " requires Kernel capability"; @@ -423,26 +425,26 @@ spv_result_t ValidateSpecConstantOp(ValidationState_t& _, spv_result_t ConstantPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpConstantTrue: - case SpvOpConstantFalse: - case SpvOpSpecConstantTrue: - case SpvOpSpecConstantFalse: + case spv::Op::OpConstantTrue: + case spv::Op::OpConstantFalse: + case spv::Op::OpSpecConstantTrue: + case spv::Op::OpSpecConstantFalse: if (auto error = ValidateConstantBool(_, inst)) return error; break; - case SpvOpConstantComposite: - case SpvOpSpecConstantComposite: + case spv::Op::OpConstantComposite: + case spv::Op::OpSpecConstantComposite: if (auto error = ValidateConstantComposite(_, inst)) return error; break; - case SpvOpConstantSampler: + case spv::Op::OpConstantSampler: if (auto error = ValidateConstantSampler(_, inst)) return error; break; - case SpvOpConstantNull: + case spv::Op::OpConstantNull: if (auto error = ValidateConstantNull(_, inst)) return error; break; - case SpvOpSpecConstant: + case spv::Op::OpSpecConstant: if (auto error = ValidateSpecConstant(_, inst)) return error; break; - case SpvOpSpecConstantOp: + case spv::Op::OpSpecConstantOp: if (auto error = ValidateSpecConstantOp(_, inst)) return error; break; default: @@ -452,7 +454,7 @@ spv_result_t ConstantPass(ValidationState_t& _, const Instruction* inst) { // Generally disallow creating 8- or 16-bit constants unless the full // capabilities are present. if (spvOpcodeIsConstant(inst->opcode()) && - _.HasCapability(SpvCapabilityShader) && + _.HasCapability(spv::Capability::Shader) && !_.IsPointerType(inst->type_id()) && _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_ID, inst) diff --git a/3rdparty/spirv-tools/source/val/validate_conversion.cpp b/3rdparty/spirv-tools/source/val/validate_conversion.cpp index dc6b15172..c67b19685 100644 --- a/3rdparty/spirv-tools/source/val/validate_conversion.cpp +++ b/3rdparty/spirv-tools/source/val/validate_conversion.cpp @@ -27,11 +27,11 @@ namespace val { // Validates correctness of conversion instructions. spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpConvertFToU: { + case spv::Op::OpConvertFToU: { if (!_.IsUnsignedIntScalarType(result_type) && !_.IsUnsignedIntVectorType(result_type) && !_.IsUnsignedIntCooperativeMatrixType(result_type)) @@ -62,7 +62,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpConvertFToS: { + case spv::Op::OpConvertFToS: { if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) && !_.IsIntCooperativeMatrixType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -92,8 +92,8 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpConvertSToF: - case SpvOpConvertUToF: { + case spv::Op::OpConvertSToF: + case spv::Op::OpConvertUToF: { if (!_.IsFloatScalarType(result_type) && !_.IsFloatVectorType(result_type) && !_.IsFloatCooperativeMatrixType(result_type)) @@ -124,7 +124,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpUConvert: { + case spv::Op::OpUConvert: { if (!_.IsUnsignedIntScalarType(result_type) && !_.IsUnsignedIntVectorType(result_type) && !_.IsUnsignedIntCooperativeMatrixType(result_type)) @@ -160,7 +160,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpSConvert: { + case spv::Op::OpSConvert: { if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) && !_.IsIntCooperativeMatrixType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -195,7 +195,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpFConvert: { + case spv::Op::OpFConvert: { if (!_.IsFloatScalarType(result_type) && !_.IsFloatVectorType(result_type) && !_.IsFloatCooperativeMatrixType(result_type)) @@ -231,7 +231,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpQuantizeToF16: { + case spv::Op::OpQuantizeToF16: { if ((!_.IsFloatScalarType(result_type) && !_.IsFloatVectorType(result_type)) || _.GetBitWidth(result_type) != 32) @@ -247,7 +247,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpConvertPtrToU: { + case spv::Op::OpConvertPtrToU: { if (!_.IsUnsignedIntScalarType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected unsigned int scalar type as Result Type: " @@ -258,17 +258,18 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected input to be a pointer: " << spvOpcodeString(opcode); - if (_.addressing_model() == SpvAddressingModelLogical) + if (_.addressing_model() == spv::AddressingModel::Logical) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Logical addressing not supported: " << spvOpcodeString(opcode); - if (_.addressing_model() == SpvAddressingModelPhysicalStorageBuffer64) { - uint32_t input_storage_class = 0; + if (_.addressing_model() == + spv::AddressingModel::PhysicalStorageBuffer64) { + spv::StorageClass input_storage_class; uint32_t input_data_type = 0; _.GetPointerTypeInfo(input_type, &input_data_type, &input_storage_class); - if (input_storage_class != SpvStorageClassPhysicalStorageBuffer) + if (input_storage_class != spv::StorageClass::PhysicalStorageBuffer) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Pointer storage class must be PhysicalStorageBuffer: " << spvOpcodeString(opcode); @@ -286,8 +287,8 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpSatConvertSToU: - case SpvOpSatConvertUToS: { + case spv::Op::OpSatConvertSToU: + case spv::Op::OpSatConvertUToS: { if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected int scalar or vector type as Result Type: " @@ -307,7 +308,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpConvertUToPtr: { + case spv::Op::OpConvertUToPtr: { if (!_.IsPointerType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be a pointer: " @@ -318,17 +319,18 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected int scalar as input: " << spvOpcodeString(opcode); - if (_.addressing_model() == SpvAddressingModelLogical) + if (_.addressing_model() == spv::AddressingModel::Logical) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Logical addressing not supported: " << spvOpcodeString(opcode); - if (_.addressing_model() == SpvAddressingModelPhysicalStorageBuffer64) { - uint32_t result_storage_class = 0; + if (_.addressing_model() == + spv::AddressingModel::PhysicalStorageBuffer64) { + spv::StorageClass result_storage_class; uint32_t result_data_type = 0; _.GetPointerTypeInfo(result_type, &result_data_type, &result_storage_class); - if (result_storage_class != SpvStorageClassPhysicalStorageBuffer) + if (result_storage_class != spv::StorageClass::PhysicalStorageBuffer) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Pointer storage class must be PhysicalStorageBuffer: " << spvOpcodeString(opcode); @@ -346,8 +348,8 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpPtrCastToGeneric: { - uint32_t result_storage_class = 0; + case spv::Op::OpPtrCastToGeneric: { + spv::StorageClass result_storage_class; uint32_t result_data_type = 0; if (!_.GetPointerTypeInfo(result_type, &result_data_type, &result_storage_class)) @@ -355,22 +357,22 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { << "Expected Result Type to be a pointer: " << spvOpcodeString(opcode); - if (result_storage_class != SpvStorageClassGeneric) + if (result_storage_class != spv::StorageClass::Generic) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to have storage class Generic: " << spvOpcodeString(opcode); const uint32_t input_type = _.GetOperandTypeId(inst, 2); - uint32_t input_storage_class = 0; + spv::StorageClass input_storage_class; uint32_t input_data_type = 0; if (!_.GetPointerTypeInfo(input_type, &input_data_type, &input_storage_class)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected input to be a pointer: " << spvOpcodeString(opcode); - if (input_storage_class != SpvStorageClassWorkgroup && - input_storage_class != SpvStorageClassCrossWorkgroup && - input_storage_class != SpvStorageClassFunction) + if (input_storage_class != spv::StorageClass::Workgroup && + input_storage_class != spv::StorageClass::CrossWorkgroup && + input_storage_class != spv::StorageClass::Function) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected input to have storage class Workgroup, " << "CrossWorkgroup or Function: " << spvOpcodeString(opcode); @@ -382,8 +384,8 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpGenericCastToPtr: { - uint32_t result_storage_class = 0; + case spv::Op::OpGenericCastToPtr: { + spv::StorageClass result_storage_class; uint32_t result_data_type = 0; if (!_.GetPointerTypeInfo(result_type, &result_data_type, &result_storage_class)) @@ -391,22 +393,22 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { << "Expected Result Type to be a pointer: " << spvOpcodeString(opcode); - if (result_storage_class != SpvStorageClassWorkgroup && - result_storage_class != SpvStorageClassCrossWorkgroup && - result_storage_class != SpvStorageClassFunction) + if (result_storage_class != spv::StorageClass::Workgroup && + result_storage_class != spv::StorageClass::CrossWorkgroup && + result_storage_class != spv::StorageClass::Function) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to have storage class Workgroup, " << "CrossWorkgroup or Function: " << spvOpcodeString(opcode); const uint32_t input_type = _.GetOperandTypeId(inst, 2); - uint32_t input_storage_class = 0; + spv::StorageClass input_storage_class; uint32_t input_data_type = 0; if (!_.GetPointerTypeInfo(input_type, &input_data_type, &input_storage_class)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected input to be a pointer: " << spvOpcodeString(opcode); - if (input_storage_class != SpvStorageClassGeneric) + if (input_storage_class != spv::StorageClass::Generic) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected input to have storage class Generic: " << spvOpcodeString(opcode); @@ -418,8 +420,8 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpGenericCastToPtrExplicit: { - uint32_t result_storage_class = 0; + case spv::Op::OpGenericCastToPtrExplicit: { + spv::StorageClass result_storage_class; uint32_t result_data_type = 0; if (!_.GetPointerTypeInfo(result_type, &result_data_type, &result_storage_class)) @@ -427,21 +429,22 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { << "Expected Result Type to be a pointer: " << spvOpcodeString(opcode); - const uint32_t target_storage_class = inst->word(4); + const auto target_storage_class = + inst->GetOperandAs(3); if (result_storage_class != target_storage_class) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be of target storage class: " << spvOpcodeString(opcode); const uint32_t input_type = _.GetOperandTypeId(inst, 2); - uint32_t input_storage_class = 0; + spv::StorageClass input_storage_class; uint32_t input_data_type = 0; if (!_.GetPointerTypeInfo(input_type, &input_data_type, &input_storage_class)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected input to be a pointer: " << spvOpcodeString(opcode); - if (input_storage_class != SpvStorageClassGeneric) + if (input_storage_class != spv::StorageClass::Generic) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected input to have storage class Generic: " << spvOpcodeString(opcode); @@ -451,16 +454,16 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { << "Expected input and Result Type to point to the same type: " << spvOpcodeString(opcode); - if (target_storage_class != SpvStorageClassWorkgroup && - target_storage_class != SpvStorageClassCrossWorkgroup && - target_storage_class != SpvStorageClassFunction) + if (target_storage_class != spv::StorageClass::Workgroup && + target_storage_class != spv::StorageClass::CrossWorkgroup && + target_storage_class != spv::StorageClass::Function) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected target storage class to be Workgroup, " << "CrossWorkgroup or Function: " << spvOpcodeString(opcode); break; } - case SpvOpBitcast: { + case spv::Op::OpBitcast: { const uint32_t input_type = _.GetOperandTypeId(inst, 2); if (!input_type) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -490,10 +493,10 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { _.HasExtension(kSPV_KHR_physical_storage_buffer)) { const bool result_is_int_vector = _.IsIntVectorType(result_type); const bool result_has_int32 = - _.ContainsSizedIntOrFloatType(result_type, SpvOpTypeInt, 32); + _.ContainsSizedIntOrFloatType(result_type, spv::Op::OpTypeInt, 32); const bool input_is_int_vector = _.IsIntVectorType(input_type); const bool input_has_int32 = - _.ContainsSizedIntOrFloatType(input_type, SpvOpTypeInt, 32); + _.ContainsSizedIntOrFloatType(input_type, spv::Op::OpTypeInt, 32); if (result_is_pointer && !input_is_pointer && !input_is_int_scalar && !(input_is_int_vector && input_has_int32)) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -534,7 +537,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpConvertUToAccelerationStructureKHR: { + case spv::Op::OpConvertUToAccelerationStructureKHR: { if (!_.IsAccelerationStructureType(result_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be a Acceleration Structure: " @@ -556,13 +559,13 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) { break; } - if (_.HasCapability(SpvCapabilityShader)) { + if (_.HasCapability(spv::Capability::Shader)) { switch (inst->opcode()) { - case SpvOpConvertFToU: - case SpvOpConvertFToS: - case SpvOpConvertSToF: - case SpvOpConvertUToF: - case SpvOpBitcast: + case spv::Op::OpConvertFToU: + case spv::Op::OpConvertFToS: + case spv::Op::OpConvertSToF: + case spv::Op::OpConvertUToF: + case spv::Op::OpBitcast: if (_.ContainsLimitedUseIntOrFloatType(inst->type_id()) || _.ContainsLimitedUseIntOrFloatType(_.GetOperandTypeId(inst, 2u))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) diff --git a/3rdparty/spirv-tools/source/val/validate_debug.cpp b/3rdparty/spirv-tools/source/val/validate_debug.cpp index 7ab597a11..c433c939f 100644 --- a/3rdparty/spirv-tools/source/val/validate_debug.cpp +++ b/3rdparty/spirv-tools/source/val/validate_debug.cpp @@ -26,7 +26,7 @@ namespace { spv_result_t ValidateMemberName(ValidationState_t& _, const Instruction* inst) { const auto type_id = inst->GetOperandAs(0); const auto type = _.FindDef(type_id); - if (!type || SpvOpTypeStruct != type->opcode()) { + if (!type || spv::Op::OpTypeStruct != type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpMemberName Type " << _.getIdName(type_id) << " is not a struct type."; @@ -45,7 +45,7 @@ spv_result_t ValidateMemberName(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateLine(ValidationState_t& _, const Instruction* inst) { const auto file_id = inst->GetOperandAs(0); const auto file = _.FindDef(file_id); - if (!file || SpvOpString != file->opcode()) { + if (!file || spv::Op::OpString != file->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpLine Target " << _.getIdName(file_id) << " is not an OpString."; @@ -57,10 +57,10 @@ spv_result_t ValidateLine(ValidationState_t& _, const Instruction* inst) { spv_result_t DebugPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpMemberName: + case spv::Op::OpMemberName: if (auto error = ValidateMemberName(_, inst)) return error; break; - case SpvOpLine: + case spv::Op::OpLine: if (auto error = ValidateLine(_, inst)) return error; break; default: diff --git a/3rdparty/spirv-tools/source/val/validate_decorations.cpp b/3rdparty/spirv-tools/source/val/validate_decorations.cpp index cd0ff209b..f9c843521 100644 --- a/3rdparty/spirv-tools/source/val/validate_decorations.cpp +++ b/3rdparty/spirv-tools/source/val/validate_decorations.cpp @@ -50,7 +50,7 @@ struct PairHash { // A functor for hashing decoration types. struct SpvDecorationHash { - std::size_t operator()(SpvDecoration dec) const { + std::size_t operator()(spv::Decoration dec) const { return static_cast(dec); } }; @@ -72,7 +72,7 @@ using MemberConstraints = std::unordered_map, // Returns the array stride of the given array type. uint32_t GetArrayStride(uint32_t array_id, ValidationState_t& vstate) { for (auto& decoration : vstate.id_decorations(array_id)) { - if (SpvDecorationArrayStride == decoration.dec_type()) { + if (spv::Decoration::ArrayStride == decoration.dec_type()) { return decoration.params()[0]; } } @@ -82,9 +82,10 @@ uint32_t GetArrayStride(uint32_t array_id, ValidationState_t& vstate) { // Returns true if the given variable has a BuiltIn decoration. bool isBuiltInVar(uint32_t var_id, ValidationState_t& vstate) { const auto& decorations = vstate.id_decorations(var_id); - return std::any_of( - decorations.begin(), decorations.end(), - [](const Decoration& d) { return SpvDecorationBuiltIn == d.dec_type(); }); + return std::any_of(decorations.begin(), decorations.end(), + [](const Decoration& d) { + return spv::Decoration::BuiltIn == d.dec_type(); + }); } // Returns true if the given structure type has any members with BuiltIn @@ -93,7 +94,7 @@ bool isBuiltInStruct(uint32_t struct_id, ValidationState_t& vstate) { const auto& decorations = vstate.id_decorations(struct_id); return std::any_of( decorations.begin(), decorations.end(), [](const Decoration& d) { - return SpvDecorationBuiltIn == d.dec_type() && + return spv::Decoration::BuiltIn == d.dec_type() && Decoration::kInvalidMember != d.struct_member_index(); }); } @@ -101,20 +102,21 @@ bool isBuiltInStruct(uint32_t struct_id, ValidationState_t& vstate) { // Returns true if the given structure type has a Block decoration. bool isBlock(uint32_t struct_id, ValidationState_t& vstate) { const auto& decorations = vstate.id_decorations(struct_id); - return std::any_of( - decorations.begin(), decorations.end(), - [](const Decoration& d) { return SpvDecorationBlock == d.dec_type(); }); + return std::any_of(decorations.begin(), decorations.end(), + [](const Decoration& d) { + return spv::Decoration::Block == d.dec_type(); + }); } // Returns true if the given ID has the Import LinkageAttributes decoration. bool hasImportLinkageAttribute(uint32_t id, ValidationState_t& vstate) { const auto& decorations = vstate.id_decorations(id); - return std::any_of(decorations.begin(), decorations.end(), - [](const Decoration& d) { - return SpvDecorationLinkageAttributes == d.dec_type() && - d.params().size() >= 2u && - d.params().back() == SpvLinkageTypeImport; - }); + return std::any_of( + decorations.begin(), decorations.end(), [](const Decoration& d) { + return spv::Decoration::LinkageAttributes == d.dec_type() && + d.params().size() >= 2u && + spv::LinkageType(d.params().back()) == spv::LinkageType::Import; + }); } // Returns a vector of all members of a structure. @@ -125,7 +127,7 @@ std::vector getStructMembers(uint32_t struct_id, } // Returns a vector of all members of a structure that have specific type. -std::vector getStructMembers(uint32_t struct_id, SpvOp type, +std::vector getStructMembers(uint32_t struct_id, spv::Op type, ValidationState_t& vstate) { std::vector members; for (auto id : getStructMembers(struct_id, vstate)) { @@ -142,21 +144,21 @@ bool isMissingOffsetInStruct(uint32_t struct_id, ValidationState_t& vstate) { const auto* inst = vstate.FindDef(struct_id); std::vector hasOffset; std::vector struct_members; - if (inst->opcode() == SpvOpTypeStruct) { + if (inst->opcode() == spv::Op::OpTypeStruct) { // Check offsets of member decorations. struct_members = getStructMembers(struct_id, vstate); hasOffset.resize(struct_members.size(), false); for (auto& decoration : vstate.id_decorations(struct_id)) { - if (SpvDecorationOffset == decoration.dec_type() && + if (spv::Decoration::Offset == decoration.dec_type() && Decoration::kInvalidMember != decoration.struct_member_index()) { // Offset 0xffffffff is not valid so ignore it for simplicity's sake. if (decoration.params()[0] == 0xffffffff) return true; hasOffset[decoration.struct_member_index()] = true; } } - } else if (inst->opcode() == SpvOpTypeArray || - inst->opcode() == SpvOpTypeRuntimeArray) { + } else if (inst->opcode() == spv::Op::OpTypeArray || + inst->opcode() == spv::Op::OpTypeRuntimeArray) { hasOffset.resize(1, true); struct_members.push_back(inst->GetOperandAs(1u)); } @@ -191,18 +193,18 @@ uint32_t getBaseAlignment(uint32_t member_id, bool roundUp, // Minimal alignment is byte-aligned. uint32_t baseAlignment = 1; switch (inst->opcode()) { - case SpvOpTypeSampledImage: - case SpvOpTypeSampler: - case SpvOpTypeImage: - if (vstate.HasCapability(SpvCapabilityBindlessTextureNV)) + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeImage: + if (vstate.HasCapability(spv::Capability::BindlessTextureNV)) return baseAlignment = vstate.samplerimage_variable_address_mode() / 8; assert(0); return 0; - case SpvOpTypeInt: - case SpvOpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: baseAlignment = words[2] / 8; break; - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { const auto componentId = words[2]; const auto numComponents = words[3]; const auto componentAlignment = getBaseAlignment( @@ -211,7 +213,7 @@ uint32_t getBaseAlignment(uint32_t member_id, bool roundUp, componentAlignment * (numComponents == 3 ? 4 : numComponents); break; } - case SpvOpTypeMatrix: { + case spv::Op::OpTypeMatrix: { const auto column_type = words[2]; if (inherited.majorness == kColumnMajor) { baseAlignment = getBaseAlignment(column_type, roundUp, inherited, @@ -229,13 +231,13 @@ uint32_t getBaseAlignment(uint32_t member_id, bool roundUp, } if (roundUp) baseAlignment = align(baseAlignment, 16u); } break; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: baseAlignment = getBaseAlignment(words[2], roundUp, inherited, constraints, vstate); if (roundUp) baseAlignment = align(baseAlignment, 16u); break; - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const auto members = getStructMembers(member_id, vstate); for (uint32_t memberIdx = 0, numMembers = uint32_t(members.size()); memberIdx < numMembers; ++memberIdx) { @@ -249,7 +251,7 @@ uint32_t getBaseAlignment(uint32_t member_id, bool roundUp, if (roundUp) baseAlignment = align(baseAlignment, 16u); break; } - case SpvOpTypePointer: + case spv::Op::OpTypePointer: baseAlignment = vstate.pointer_size_and_alignment(); break; default: @@ -265,24 +267,24 @@ uint32_t getScalarAlignment(uint32_t type_id, ValidationState_t& vstate) { const auto inst = vstate.FindDef(type_id); const auto& words = inst->words(); switch (inst->opcode()) { - case SpvOpTypeSampledImage: - case SpvOpTypeSampler: - case SpvOpTypeImage: - if (vstate.HasCapability(SpvCapabilityBindlessTextureNV)) + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeImage: + if (vstate.HasCapability(spv::Capability::BindlessTextureNV)) return vstate.samplerimage_variable_address_mode() / 8; assert(0); return 0; - case SpvOpTypeInt: - case SpvOpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: return words[2] / 8; - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: { + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: { const auto compositeMemberTypeId = words[2]; return getScalarAlignment(compositeMemberTypeId, vstate); } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const auto members = getStructMembers(type_id, vstate); uint32_t max_member_alignment = 1; for (uint32_t memberIdx = 0, numMembers = uint32_t(members.size()); @@ -295,7 +297,7 @@ uint32_t getScalarAlignment(uint32_t type_id, ValidationState_t& vstate) { } return max_member_alignment; } break; - case SpvOpTypePointer: + case spv::Op::OpTypePointer: return vstate.pointer_size_and_alignment(); default: assert(0); @@ -312,17 +314,17 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited, const auto inst = vstate.FindDef(member_id); const auto& words = inst->words(); switch (inst->opcode()) { - case SpvOpTypeSampledImage: - case SpvOpTypeSampler: - case SpvOpTypeImage: - if (vstate.HasCapability(SpvCapabilityBindlessTextureNV)) + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeSampler: + case spv::Op::OpTypeImage: + if (vstate.HasCapability(spv::Capability::BindlessTextureNV)) return vstate.samplerimage_variable_address_mode() / 8; assert(0); return 0; - case SpvOpTypeInt: - case SpvOpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: return words[2] / 8; - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { const auto componentId = words[2]; const auto numComponents = words[3]; const auto componentSize = @@ -330,10 +332,10 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited, const auto size = componentSize * numComponents; return size; } - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { const auto sizeInst = vstate.FindDef(words[3]); if (spvOpcodeIsSpecConstant(sizeInst->opcode())) return 0; - assert(SpvOpConstant == sizeInst->opcode()); + assert(spv::Op::OpConstant == sizeInst->opcode()); const uint32_t num_elem = sizeInst->words()[3]; const uint32_t elem_type = words[2]; const uint32_t elem_size = @@ -344,9 +346,9 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited, (num_elem - 1) * GetArrayStride(member_id, vstate) + elem_size; return size; } - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeRuntimeArray: return 0; - case SpvOpTypeMatrix: { + case spv::Op::OpTypeMatrix: { const auto num_columns = words[3]; if (inherited.majorness == kColumnMajor) { return num_columns * inherited.matrix_stride; @@ -362,7 +364,7 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited, num_columns * scalar_elem_size; } } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { const auto& members = getStructMembers(member_id, vstate); if (members.empty()) return 0; const auto lastIdx = uint32_t(members.size() - 1); @@ -374,7 +376,7 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited, for (auto decoration = member_decorations.begin; decoration != member_decorations.end; ++decoration) { assert(decoration->struct_member_index() == (int)lastIdx); - if (SpvDecorationOffset == decoration->dec_type()) { + if (spv::Decoration::Offset == decoration->dec_type()) { offset = decoration->params()[0]; } } @@ -384,7 +386,7 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited, const auto& constraint = constraints[std::make_pair(lastMember, lastIdx)]; return offset + getSize(lastMember, constraint, constraints, vstate); } - case SpvOpTypePointer: + case spv::Op::OpTypePointer: return vstate.pointer_size_and_alignment(); default: assert(0); @@ -477,7 +479,7 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, decoration != member_decorations.end; ++decoration) { assert(decoration->struct_member_index() == (int)memberIdx); switch (decoration->dec_type()) { - case SpvDecorationOffset: + case spv::Decoration::Offset: offset = decoration->params()[0]; break; default: @@ -517,7 +519,7 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, if (offset == 0xffffffff) return fail(memberIdx) << "is missing an Offset decoration"; if (!scalar_block_layout && relaxed_block_layout && - opcode == SpvOpTypeVector) { + opcode == spv::Op::OpTypeVector) { // In relaxed block layout, the vector offset must be aligned to the // vector's scalar element type. const auto componentId = inst->words()[2]; @@ -541,21 +543,20 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, << nextValidOffset - 1; if (!scalar_block_layout && relaxed_block_layout) { // Check improper straddle of vectors. - if (SpvOpTypeVector == opcode && + if (spv::Op::OpTypeVector == opcode && hasImproperStraddle(id, offset, constraint, constraints, vstate)) return fail(memberIdx) << "is an improperly straddling vector at offset " << offset; } // Check struct members recursively. spv_result_t recursive_status = SPV_SUCCESS; - if (SpvOpTypeStruct == opcode && + if (spv::Op::OpTypeStruct == opcode && SPV_SUCCESS != (recursive_status = checkLayout( id, storage_class_str, decoration_str, blockRules, - scalar_block_layout, - offset, constraints, vstate))) + scalar_block_layout, offset, constraints, vstate))) return recursive_status; // Check matrix stride. - if (SpvOpTypeMatrix == opcode) { + if (spv::Op::OpTypeMatrix == opcode) { const auto stride = constraint.matrix_stride; if (!IsAlignedTo(stride, alignment)) { return fail(memberIdx) << "is a matrix with stride " << stride @@ -566,14 +567,14 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, // Check arrays and runtime arrays recursively. auto array_inst = inst; auto array_alignment = alignment; - while (array_inst->opcode() == SpvOpTypeArray || - array_inst->opcode() == SpvOpTypeRuntimeArray) { + while (array_inst->opcode() == spv::Op::OpTypeArray || + array_inst->opcode() == spv::Op::OpTypeRuntimeArray) { const auto typeId = array_inst->word(2); const auto element_inst = vstate.FindDef(typeId); // Check array stride. uint32_t array_stride = 0; for (auto& decoration : vstate.id_decorations(array_inst->id())) { - if (SpvDecorationArrayStride == decoration.dec_type()) { + if (spv::Decoration::ArrayStride == decoration.dec_type()) { array_stride = decoration.params()[0]; if (array_stride == 0) { return fail(memberIdx) << "contains an array with stride 0"; @@ -588,7 +589,7 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, bool is_int32 = false; bool is_const = false; uint32_t num_elements = 0; - if (array_inst->opcode() == SpvOpTypeArray) { + if (array_inst->opcode() == spv::Op::OpTypeArray) { std::tie(is_int32, is_const, num_elements) = vstate.EvalInt32IfConst(array_inst->word(3)); } @@ -597,7 +598,7 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, // limitation to this check if the array size is a spec constant or is a // runtime array then we will only check a single element. This means // some improper straddles might be missed. - if (SpvOpTypeStruct == element_inst->opcode()) { + if (spv::Op::OpTypeStruct == element_inst->opcode()) { std::vector seen(16, false); for (uint32_t i = 0; i < num_elements; ++i) { uint32_t next_offset = i * array_stride + offset; @@ -632,10 +633,10 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, } } nextValidOffset = offset + size; - if (!scalar_block_layout && blockRules && - (SpvOpTypeArray == opcode || SpvOpTypeStruct == opcode)) { - // Uniform block rules don't permit anything in the padding of a struct - // or array. + if (!scalar_block_layout && + (spv::Op::OpTypeArray == opcode || spv::Op::OpTypeStruct == opcode)) { + // Non-scalar block layout rules don't permit anything in the padding of + // a struct or array. nextValidOffset = align(nextValidOffset, alignment); } } @@ -644,15 +645,15 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str, // Returns true if variable or structure id has given decoration. Handles also // nested structures. -bool hasDecoration(uint32_t id, SpvDecoration decoration, +bool hasDecoration(uint32_t id, spv::Decoration decoration, ValidationState_t& vstate) { for (auto& dec : vstate.id_decorations(id)) { if (decoration == dec.dec_type()) return true; } - if (SpvOpTypeStruct != vstate.FindDef(id)->opcode()) { + if (spv::Op::OpTypeStruct != vstate.FindDef(id)->opcode()) { return false; } - for (auto member_id : getStructMembers(id, SpvOpTypeStruct, vstate)) { + for (auto member_id : getStructMembers(id, spv::Op::OpTypeStruct, vstate)) { if (hasDecoration(member_id, decoration, vstate)) { return true; } @@ -662,8 +663,8 @@ bool hasDecoration(uint32_t id, SpvDecoration decoration, // Returns true if all ids of given type have a specified decoration. bool checkForRequiredDecoration(uint32_t struct_id, - std::function checker, - SpvOp type, ValidationState_t& vstate) { + std::function checker, + spv::Op type, ValidationState_t& vstate) { const auto& members = getStructMembers(struct_id, vstate); for (size_t memberIdx = 0; memberIdx < members.size(); memberIdx++) { const auto id = members[memberIdx]; @@ -682,7 +683,7 @@ bool checkForRequiredDecoration(uint32_t struct_id, return false; } } - for (auto id : getStructMembers(struct_id, SpvOpTypeStruct, vstate)) { + for (auto id : getStructMembers(struct_id, spv::Op::OpTypeStruct, vstate)) { if (!checkForRequiredDecoration(id, checker, type, vstate)) { return false; } @@ -738,8 +739,8 @@ spv_result_t CheckBuiltInVariable(uint32_t var_id, ValidationState_t& vstate) { const auto& decorations = vstate.id_decorations(var_id); for (const auto& d : decorations) { if (spvIsVulkanEnv(vstate.context()->target_env)) { - if (d.dec_type() == SpvDecorationLocation || - d.dec_type() == SpvDecorationComponent) { + if (d.dec_type() == spv::Decoration::Location || + d.dec_type() == spv::Decoration::Component) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) << vstate.VkErrorID(4915) << "A BuiltIn variable (id " << var_id << ") cannot have any Location or Component decorations"; @@ -762,18 +763,18 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { std::unordered_set seen_vars; for (auto interface : desc.interfaces) { Instruction* var_instr = vstate.FindDef(interface); - if (!var_instr || SpvOpVariable != var_instr->opcode()) { + if (!var_instr || spv::Op::OpVariable != var_instr->opcode()) { return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) << "Interfaces passed to OpEntryPoint must be of type " "OpTypeVariable. Found Op" << spvOpcodeString(var_instr->opcode()) << "."; } - const SpvStorageClass storage_class = - var_instr->GetOperandAs(2); + const spv::StorageClass storage_class = + var_instr->GetOperandAs(2); if (vstate.version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { // Starting in 1.4, OpEntryPoint must list all global variables // it statically uses and those interfaces must be unique. - if (storage_class == SpvStorageClassFunction) { + if (storage_class == spv::StorageClass::Function) { return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) << "OpEntryPoint interfaces should only list global " "variables"; @@ -785,14 +786,14 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { << vstate.getIdName(interface) << " is disallowed"; } } else { - if (storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + if (storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) << "OpEntryPoint interfaces must be OpVariables with " "Storage Class of Input(1) or Output(3). Found Storage " "Class " - << storage_class << " for Entry Point id " << entry_point - << "."; + << uint32_t(storage_class) << " for Entry Point id " + << entry_point << "."; } } @@ -803,7 +804,7 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { // to. const uint32_t type_id = ptr_instr->word(3); Instruction* type_instr = vstate.FindDef(type_id); - if (type_instr && SpvOpTypeStruct == type_instr->opcode() && + if (type_instr && spv::Op::OpTypeStruct == type_instr->opcode() && isBuiltInStruct(type_id, vstate)) { if (!isBlock(type_id, vstate)) { return vstate.diag(SPV_ERROR_INVALID_DATA, vstate.FindDef(type_id)) @@ -814,8 +815,9 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { "OpVariable with a structure type that is a block not " "decorated with Location."; } - if (storage_class == SpvStorageClassInput) ++num_builtin_block_inputs; - if (storage_class == SpvStorageClassOutput) + if (storage_class == spv::StorageClass::Input) + ++num_builtin_block_inputs; + if (storage_class == spv::StorageClass::Output) ++num_builtin_block_outputs; if (num_builtin_block_inputs > 1 || num_builtin_block_outputs > 1) break; @@ -826,12 +828,13 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { return error; } - if (storage_class == SpvStorageClassWorkgroup) { + if (storage_class == spv::StorageClass::Workgroup) { ++num_workgroup_variables; - if (type_instr && SpvOpTypeStruct == type_instr->opcode()) { - if (hasDecoration(type_id, SpvDecorationBlock, vstate)) + if (type_instr && spv::Op::OpTypeStruct == type_instr->opcode()) { + if (hasDecoration(type_id, spv::Decoration::Block, vstate)) ++num_workgroup_variables_with_block; - if (hasDecoration(var_instr->id(), SpvDecorationAliased, vstate)) + if (hasDecoration(var_instr->id(), spv::Decoration::Aliased, + vstate)) ++num_workgroup_variables_with_aliased; } } @@ -839,17 +842,17 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { if (spvIsVulkanEnv(vstate.context()->target_env)) { const auto* models = vstate.GetExecutionModels(entry_point); const bool has_frag = - models->find(SpvExecutionModelFragment) != models->end(); + models->find(spv::ExecutionModel::Fragment) != models->end(); const bool has_vert = - models->find(SpvExecutionModelVertex) != models->end(); + models->find(spv::ExecutionModel::Vertex) != models->end(); for (const auto& decoration : vstate.id_decorations(var_instr->id())) { - if (decoration == SpvDecorationFlat || - decoration == SpvDecorationNoPerspective || - decoration == SpvDecorationSample || - decoration == SpvDecorationCentroid) { + if (decoration == spv::Decoration::Flat || + decoration == spv::Decoration::NoPerspective || + decoration == spv::Decoration::Sample || + decoration == spv::Decoration::Centroid) { // VUID 04670 already validates these decorations are input/output - if (storage_class == SpvStorageClassInput && + if (storage_class == spv::StorageClass::Input && (models->size() > 1 || has_vert)) { return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) << vstate.VkErrorID(6202) @@ -858,7 +861,7 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { "execution model as an Input storage class for Entry " "Point id " << entry_point << "."; - } else if (storage_class == SpvStorageClassOutput && + } else if (storage_class == spv::StorageClass::Output && (models->size() > 1 || has_frag)) { return vstate.diag(SPV_ERROR_INVALID_ID, var_instr) << vstate.VkErrorID(6201) @@ -872,8 +875,9 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { } const bool has_flat = - hasDecoration(var_instr->id(), SpvDecorationFlat, vstate); - if (has_frag && storage_class == SpvStorageClassInput && !has_flat && + hasDecoration(var_instr->id(), spv::Decoration::Flat, vstate); + if (has_frag && storage_class == spv::StorageClass::Input && + !has_flat && ((vstate.IsFloatScalarType(type_id) && vstate.GetBitWidth(type_id) == 64) || vstate.IsIntScalarOrVectorType(type_id))) { @@ -898,7 +902,7 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { // The LinkageAttributes Decoration cannot be applied to functions // targeted by an OpEntryPoint instruction for (auto& decoration : vstate.id_decorations(entry_point)) { - if (SpvDecorationLinkageAttributes == decoration.dec_type()) { + if (spv::Decoration::LinkageAttributes == decoration.dec_type()) { const std::string linkage_name = spvtools::utils::MakeString(decoration.params()); return vstate.diag(SPV_ERROR_INVALID_BINARY, @@ -910,7 +914,8 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) { } } - if (vstate.HasCapability(SpvCapabilityWorkgroupMemoryExplicitLayoutKHR) && + if (vstate.HasCapability( + spv::Capability::WorkgroupMemoryExplicitLayoutKHR) && num_workgroup_variables > 0 && num_workgroup_variables_with_block > 0) { if (num_workgroup_variables != num_workgroup_variables_with_block) { @@ -964,13 +969,13 @@ void ComputeMemberConstraintsForStruct(MemberConstraints* constraints, decoration != member_decorations.end; ++decoration) { assert(decoration->struct_member_index() == (int)memberIdx); switch (decoration->dec_type()) { - case SpvDecorationRowMajor: + case spv::Decoration::RowMajor: constraint.majorness = kRowMajor; break; - case SpvDecorationColMajor: + case spv::Decoration::ColMajor: constraint.majorness = kColumnMajor; break; - case SpvDecorationMatrixStride: + case spv::Decoration::MatrixStride: constraint.matrix_stride = decoration->params()[0]; break; default: @@ -983,12 +988,12 @@ void ComputeMemberConstraintsForStruct(MemberConstraints* constraints, const auto member_type_inst = vstate.FindDef(member_type_id); const auto opcode = member_type_inst->opcode(); switch (opcode) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: ComputeMemberConstraintsForArray(constraints, member_type_id, inherited, vstate); break; - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: ComputeMemberConstraintsForStruct(constraints, member_type_id, inherited, vstate); break; @@ -1007,12 +1012,12 @@ void ComputeMemberConstraintsForArray(MemberConstraints* constraints, const auto elem_type_inst = vstate.FindDef(elem_type_id); const auto opcode = elem_type_inst->opcode(); switch (opcode) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: ComputeMemberConstraintsForArray(constraints, elem_type_id, inherited, vstate); break; - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: ComputeMemberConstraintsForStruct(constraints, elem_type_id, inherited, vstate); break; @@ -1026,16 +1031,18 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { std::unordered_set uses_push_constant; for (const auto& inst : vstate.ordered_instructions()) { const auto& words = inst.words(); - if (SpvOpVariable == inst.opcode()) { + if (spv::Op::OpVariable == inst.opcode()) { const auto var_id = inst.id(); // For storage class / decoration combinations, see Vulkan 14.5.4 "Offset // and Stride Assignment". - const auto storageClass = words[3]; - const bool uniform = storageClass == SpvStorageClassUniform; + const auto storageClass = inst.GetOperandAs(2); + const bool uniform = storageClass == spv::StorageClass::Uniform; const bool uniform_constant = - storageClass == SpvStorageClassUniformConstant; - const bool push_constant = storageClass == SpvStorageClassPushConstant; - const bool storage_buffer = storageClass == SpvStorageClassStorageBuffer; + storageClass == spv::StorageClass::UniformConstant; + const bool push_constant = + storageClass == spv::StorageClass::PushConstant; + const bool storage_buffer = + storageClass == spv::StorageClass::StorageBuffer; if (spvIsVulkanEnv(vstate.context()->target_env)) { // Vulkan: There must be no more than one PushConstant block per entry @@ -1059,7 +1066,7 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { if (uniform_constant) { auto entry_points = vstate.EntryPointReferences(var_id); if (!entry_points.empty() && - !hasDecoration(var_id, SpvDecorationDescriptorSet, vstate)) { + !hasDecoration(var_id, spv::Decoration::DescriptorSet, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) << vstate.VkErrorID(6677) << "UniformConstant id '" << var_id << "' is missing DescriptorSet decoration.\n" @@ -1068,7 +1075,7 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { "decorations specified"; } if (!entry_points.empty() && - !hasDecoration(var_id, SpvDecorationBinding, vstate)) { + !hasDecoration(var_id, spv::Decoration::Binding, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) << vstate.VkErrorID(6677) << "UniformConstant id '" << var_id << "' is missing Binding decoration.\n" @@ -1080,14 +1087,14 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { } if (spvIsOpenGLEnv(vstate.context()->target_env)) { - bool has_block = hasDecoration(var_id, SpvDecorationBlock, vstate); + bool has_block = hasDecoration(var_id, spv::Decoration::Block, vstate); bool has_buffer_block = - hasDecoration(var_id, SpvDecorationBufferBlock, vstate); + hasDecoration(var_id, spv::Decoration::BufferBlock, vstate); if ((uniform && (has_block || has_buffer_block)) || (storage_buffer && has_block)) { auto entry_points = vstate.EntryPointReferences(var_id); if (!entry_points.empty() && - !hasDecoration(var_id, SpvDecorationBinding, vstate)) { + !hasDecoration(var_id, spv::Decoration::Binding, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) << (uniform ? "Uniform" : "Storage Buffer") << " id '" << var_id << "' is missing Binding decoration.\n" @@ -1099,24 +1106,25 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { } const bool phys_storage_buffer = - storageClass == SpvStorageClassPhysicalStorageBuffer; + storageClass == spv::StorageClass::PhysicalStorageBuffer; const bool workgroup = - storageClass == SpvStorageClassWorkgroup && - vstate.HasCapability(SpvCapabilityWorkgroupMemoryExplicitLayoutKHR); + storageClass == spv::StorageClass::Workgroup && + vstate.HasCapability( + spv::Capability::WorkgroupMemoryExplicitLayoutKHR); if (uniform || push_constant || storage_buffer || phys_storage_buffer || workgroup) { const auto ptrInst = vstate.FindDef(words[1]); - assert(SpvOpTypePointer == ptrInst->opcode()); + assert(spv::Op::OpTypePointer == ptrInst->opcode()); auto id = ptrInst->words()[3]; auto id_inst = vstate.FindDef(id); // Jump through one level of arraying. - if (!workgroup && (id_inst->opcode() == SpvOpTypeArray || - id_inst->opcode() == SpvOpTypeRuntimeArray)) { + if (!workgroup && (id_inst->opcode() == spv::Op::OpTypeArray || + id_inst->opcode() == spv::Op::OpTypeRuntimeArray)) { id = id_inst->GetOperandAs(1u); id_inst = vstate.FindDef(id); } // Struct requirement is checked on variables so just move on here. - if (SpvOpTypeStruct != id_inst->opcode()) continue; + if (spv::Op::OpTypeStruct != id_inst->opcode()) continue; MemberConstraints constraints; ComputeMemberConstraintsForStruct(&constraints, id, LayoutConstraints(), vstate); @@ -1128,9 +1136,9 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { : "StorageBuffer")); if (spvIsVulkanEnv(vstate.context()->target_env)) { - const bool block = hasDecoration(id, SpvDecorationBlock, vstate); + const bool block = hasDecoration(id, spv::Decoration::Block, vstate); const bool buffer_block = - hasDecoration(id, SpvDecorationBufferBlock, vstate); + hasDecoration(id, spv::Decoration::BufferBlock, vstate); if (storage_buffer && buffer_block) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) << vstate.VkErrorID(6675) << "Storage buffer id '" << var_id @@ -1168,7 +1176,8 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { if (uniform || storage_buffer) { auto entry_points = vstate.EntryPointReferences(var_id); if (!entry_points.empty() && - !hasDecoration(var_id, SpvDecorationDescriptorSet, vstate)) { + !hasDecoration(var_id, spv::Decoration::DescriptorSet, + vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) << vstate.VkErrorID(6677) << sc_str << " id '" << var_id << "' is missing DescriptorSet decoration.\n" @@ -1177,7 +1186,7 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { "decorations specified"; } if (!entry_points.empty() && - !hasDecoration(var_id, SpvDecorationBinding, vstate)) { + !hasDecoration(var_id, spv::Decoration::Binding, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) << vstate.VkErrorID(6677) << sc_str << " id '" << var_id << "' is missing Binding decoration.\n" @@ -1189,8 +1198,9 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { } for (const auto& dec : vstate.id_decorations(id)) { - const bool blockDeco = SpvDecorationBlock == dec.dec_type(); - const bool bufferDeco = SpvDecorationBufferBlock == dec.dec_type(); + const bool blockDeco = spv::Decoration::Block == dec.dec_type(); + const bool bufferDeco = + spv::Decoration::BufferBlock == dec.dec_type(); const bool blockRules = uniform && blockDeco; const bool bufferRules = (uniform && bufferDeco) || @@ -1220,24 +1230,24 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { "decorations."; } - if (!checkForRequiredDecoration(id, - [](SpvDecoration d) { - return d == - SpvDecorationArrayStride; - }, - SpvOpTypeArray, vstate)) { + if (!checkForRequiredDecoration( + id, + [](spv::Decoration d) { + return d == spv::Decoration::ArrayStride; + }, + spv::Op::OpTypeArray, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) << "Structure id " << id << " decorated as " << deco_str << " must be explicitly laid out with ArrayStride " "decorations."; } - if (!checkForRequiredDecoration(id, - [](SpvDecoration d) { - return d == - SpvDecorationMatrixStride; - }, - SpvOpTypeMatrix, vstate)) { + if (!checkForRequiredDecoration( + id, + [](spv::Decoration d) { + return d == spv::Decoration::MatrixStride; + }, + spv::Op::OpTypeMatrix, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) << "Structure id " << id << " decorated as " << deco_str << " must be explicitly laid out with MatrixStride " @@ -1246,11 +1256,11 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { if (!checkForRequiredDecoration( id, - [](SpvDecoration d) { - return d == SpvDecorationRowMajor || - d == SpvDecorationColMajor; + [](spv::Decoration d) { + return d == spv::Decoration::RowMajor || + d == spv::Decoration::ColMajor; }, - SpvOpTypeMatrix, vstate)) { + spv::Op::OpTypeMatrix, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) << "Structure id " << id << " decorated as " << deco_str << " must be explicitly laid out with RowMajor or " @@ -1280,18 +1290,18 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { } // Returns true if |decoration| cannot be applied to the same id more than once. -bool AtMostOncePerId(SpvDecoration decoration) { - return decoration == SpvDecorationArrayStride; +bool AtMostOncePerId(spv::Decoration decoration) { + return decoration == spv::Decoration::ArrayStride; } // Returns true if |decoration| cannot be applied to the same member more than // once. -bool AtMostOncePerMember(SpvDecoration decoration) { +bool AtMostOncePerMember(spv::Decoration decoration) { switch (decoration) { - case SpvDecorationOffset: - case SpvDecorationMatrixStride: - case SpvDecorationRowMajor: - case SpvDecorationColMajor: + case spv::Decoration::Offset: + case spv::Decoration::MatrixStride: + case spv::Decoration::RowMajor: + case spv::Decoration::ColMajor: return true; default: return false; @@ -1299,32 +1309,32 @@ bool AtMostOncePerMember(SpvDecoration decoration) { } spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) { - using PerIDKey = std::tuple; - using PerMemberKey = std::tuple; + using PerIDKey = std::tuple; + using PerMemberKey = std::tuple; // An Array of pairs where the decorations in the pair cannot both be applied // to the same id. - static const SpvDecoration mutually_exclusive_per_id[][2] = { - {SpvDecorationBlock, SpvDecorationBufferBlock}, - {SpvDecorationRestrict, SpvDecorationAliased}}; + static const spv::Decoration mutually_exclusive_per_id[][2] = { + {spv::Decoration::Block, spv::Decoration::BufferBlock}, + {spv::Decoration::Restrict, spv::Decoration::Aliased}}; static const auto num_mutually_exclusive_per_id_pairs = - sizeof(mutually_exclusive_per_id) / (2 * sizeof(SpvDecoration)); + sizeof(mutually_exclusive_per_id) / (2 * sizeof(spv::Decoration)); // An Array of pairs where the decorations in the pair cannot both be applied // to the same member. - static const SpvDecoration mutually_exclusive_per_member[][2] = { - {SpvDecorationRowMajor, SpvDecorationColMajor}}; + static const spv::Decoration mutually_exclusive_per_member[][2] = { + {spv::Decoration::RowMajor, spv::Decoration::ColMajor}}; static const auto num_mutually_exclusive_per_mem_pairs = - sizeof(mutually_exclusive_per_member) / (2 * sizeof(SpvDecoration)); + sizeof(mutually_exclusive_per_member) / (2 * sizeof(spv::Decoration)); std::set seen_per_id; std::set seen_per_member; for (const auto& inst : vstate.ordered_instructions()) { const auto& words = inst.words(); - if (SpvOpDecorate == inst.opcode()) { + if (spv::Op::OpDecorate == inst.opcode()) { const auto id = words[1]; - const auto dec_type = static_cast(words[2]); + const auto dec_type = static_cast(words[2]); const auto k = PerIDKey(dec_type, id); const auto already_used = !seen_per_id.insert(k).second; if (already_used && AtMostOncePerId(dec_type)) { @@ -1337,7 +1347,7 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) { // an ID. for (uint32_t pair_idx = 0; pair_idx < num_mutually_exclusive_per_id_pairs; ++pair_idx) { - SpvDecoration excl_dec_type = SpvDecorationMax; + spv::Decoration excl_dec_type = spv::Decoration::Max; if (mutually_exclusive_per_id[pair_idx][0] == dec_type) { excl_dec_type = mutually_exclusive_per_id[pair_idx][1]; } else if (mutually_exclusive_per_id[pair_idx][1] == dec_type) { @@ -1355,10 +1365,10 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) { << " is not allowed."; } } - } else if (SpvOpMemberDecorate == inst.opcode()) { + } else if (spv::Op::OpMemberDecorate == inst.opcode()) { const auto id = words[1]; const auto member_id = words[2]; - const auto dec_type = static_cast(words[3]); + const auto dec_type = static_cast(words[3]); const auto k = PerMemberKey(dec_type, id, member_id); const auto already_used = !seen_per_member.insert(k).second; if (already_used && AtMostOncePerMember(dec_type)) { @@ -1371,7 +1381,7 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) { // a (ID, member) tuple. for (uint32_t pair_idx = 0; pair_idx < num_mutually_exclusive_per_mem_pairs; ++pair_idx) { - SpvDecoration excl_dec_type = SpvDecorationMax; + spv::Decoration excl_dec_type = spv::Decoration::Max; if (mutually_exclusive_per_member[pair_idx][0] == dec_type) { excl_dec_type = mutually_exclusive_per_member[pair_idx][1]; } else if (mutually_exclusive_per_member[pair_idx][1] == dec_type) { @@ -1397,7 +1407,7 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) { spv_result_t CheckVulkanMemoryModelDeprecatedDecorations( ValidationState_t& vstate) { - if (vstate.memory_model() != SpvMemoryModelVulkanKHR) return SPV_SUCCESS; + if (vstate.memory_model() != spv::MemoryModel::VulkanKHR) return SPV_SUCCESS; std::string msg; std::ostringstream str(msg); @@ -1406,10 +1416,10 @@ spv_result_t CheckVulkanMemoryModelDeprecatedDecorations( const auto id = inst->id(); for (const auto& dec : vstate.id_decorations(id)) { const auto member = dec.struct_member_index(); - if (dec.dec_type() == SpvDecorationCoherent || - dec.dec_type() == SpvDecorationVolatile) { - str << (dec.dec_type() == SpvDecorationCoherent ? "Coherent" - : "Volatile"); + if (dec.dec_type() == spv::Decoration::Coherent || + dec.dec_type() == spv::Decoration::Volatile) { + str << (dec.dec_type() == spv::Decoration::Coherent ? "Coherent" + : "Volatile"); str << " decoration targeting " << vstate.getIdName(id); if (member != Decoration::kInvalidMember) { str << " (member index " << member << ")"; @@ -1430,7 +1440,7 @@ spv_result_t CheckFPRoundingModeForShaders(ValidationState_t& vstate, const Decoration& decoration) { // Validates width-only conversion instruction for floating-point object // i.e., OpFConvert - if (inst.opcode() != SpvOpFConvert) { + if (inst.opcode() != spv::Op::OpFConvert) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "FPRoundingMode decoration can be applied only to a " "width-only conversion instruction for floating-point " @@ -1438,8 +1448,9 @@ spv_result_t CheckFPRoundingModeForShaders(ValidationState_t& vstate, } if (spvIsVulkanEnv(vstate.context()->target_env)) { - const auto mode = decoration.params()[0]; - if ((mode != SpvFPRoundingModeRTE) && (mode != SpvFPRoundingModeRTZ)) { + const auto mode = spv::FPRoundingMode(decoration.params()[0]); + if ((mode != spv::FPRoundingMode::RTE) && + (mode != spv::FPRoundingMode::RTZ)) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << vstate.VkErrorID(4675) << "In Vulkan, the FPRoundingMode mode must only by RTE or RTZ."; @@ -1449,11 +1460,11 @@ spv_result_t CheckFPRoundingModeForShaders(ValidationState_t& vstate, // Validates Object operand of an OpStore for (const auto& use : inst.uses()) { const auto store = use.first; - if (store->opcode() == SpvOpFConvert) continue; + if (store->opcode() == spv::Op::OpFConvert) continue; if (spvOpcodeIsDebug(store->opcode())) continue; if (store->IsNonSemantic()) continue; if (spvOpcodeIsDecoration(store->opcode())) continue; - if (store->opcode() != SpvOpStore) { + if (store->opcode() != spv::Op::OpStore) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "FPRoundingMode decoration can be applied only to the " "Object operand of an OpStore."; @@ -1479,12 +1490,13 @@ spv_result_t CheckFPRoundingModeForShaders(ValidationState_t& vstate, } // Validates storage class of the pointer to the OpStore - const auto storage = ptr_type->GetOperandAs(1); - if (storage != SpvStorageClassStorageBuffer && - storage != SpvStorageClassUniform && - storage != SpvStorageClassPushConstant && - storage != SpvStorageClassInput && storage != SpvStorageClassOutput && - storage != SpvStorageClassPhysicalStorageBuffer) { + const auto storage = ptr_type->GetOperandAs(1); + if (storage != spv::StorageClass::StorageBuffer && + storage != spv::StorageClass::Uniform && + storage != spv::StorageClass::PushConstant && + storage != spv::StorageClass::Input && + storage != spv::StorageClass::Output && + storage != spv::StorageClass::PhysicalStorageBuffer) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "FPRoundingMode decoration can be applied only to the " "Object operand of an OpStore in the StorageBuffer, " @@ -1509,16 +1521,17 @@ spv_result_t CheckNonWritableDecoration(ValidationState_t& vstate, // First, it must be a variable or function parameter. const auto opcode = inst.opcode(); const auto type_id = inst.type_id(); - if (opcode != SpvOpVariable && opcode != SpvOpFunctionParameter) { + if (opcode != spv::Op::OpVariable && + opcode != spv::Op::OpFunctionParameter) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "Target of NonWritable decoration must be a memory object " "declaration (a variable or a function parameter)"; } - const auto var_storage_class = opcode == SpvOpVariable - ? inst.GetOperandAs(2) - : SpvStorageClassMax; - if ((var_storage_class == SpvStorageClassFunction || - var_storage_class == SpvStorageClassPrivate) && + const auto var_storage_class = opcode == spv::Op::OpVariable + ? inst.GetOperandAs(2) + : spv::StorageClass::Max; + if ((var_storage_class == spv::StorageClass::Function || + var_storage_class == spv::StorageClass::Private) && vstate.features().nonwritable_var_in_function_or_private) { // New permitted feature in SPIR-V 1.4. } else if ( @@ -1548,8 +1561,9 @@ spv_result_t CheckNonWritableDecoration(ValidationState_t& vstate, spv_result_t CheckUniformDecoration(ValidationState_t& vstate, const Instruction& inst, const Decoration& decoration) { - const char* const dec_name = - decoration.dec_type() == SpvDecorationUniform ? "Uniform" : "UniformId"; + const char* const dec_name = decoration.dec_type() == spv::Decoration::Uniform + ? "Uniform" + : "UniformId"; // Uniform or UniformId must decorate an "object" // - has a result ID @@ -1563,7 +1577,7 @@ spv_result_t CheckUniformDecoration(ValidationState_t& vstate, << dec_name << " decoration applied to a non-object"; } if (Instruction* type_inst = vstate.FindDef(inst.type_id())) { - if (type_inst->opcode() == SpvOpTypeVoid) { + if (type_inst->opcode() == spv::Op::OpTypeVoid) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << dec_name << " decoration applied to a value with void type"; } @@ -1577,7 +1591,7 @@ spv_result_t CheckUniformDecoration(ValidationState_t& vstate, // Use of Uniform with OpDecorate is checked elsewhere. // Use of UniformId with OpDecorateId is checked elsewhere. - if (decoration.dec_type() == SpvDecorationUniformId) { + if (decoration.dec_type() == spv::Decoration::UniformId) { assert(decoration.params().size() == 1 && "Grammar ensures UniformId has one parameter"); @@ -1598,13 +1612,13 @@ spv_result_t CheckIntegerWrapDecoration(ValidationState_t& vstate, const Instruction& inst, const Decoration& decoration) { switch (inst.opcode()) { - case SpvOpIAdd: - case SpvOpISub: - case SpvOpIMul: - case SpvOpShiftLeftLogical: - case SpvOpSNegate: + case spv::Op::OpIAdd: + case spv::Op::OpISub: + case spv::Op::OpIMul: + case spv::Op::OpShiftLeftLogical: + case spv::Op::OpSNegate: return SPV_SUCCESS; - case SpvOpExtInst: + case spv::Op::OpExtInst: // TODO(dneto): Only certain extended instructions allow these // decorations. For now allow anything. return SPV_SUCCESS; @@ -1613,7 +1627,7 @@ spv_result_t CheckIntegerWrapDecoration(ValidationState_t& vstate, } return vstate.diag(SPV_ERROR_INVALID_ID, &inst) - << (decoration.dec_type() == SpvDecorationNoSignedWrap + << (decoration.dec_type() == spv::Decoration::NoSignedWrap ? "NoSignedWrap" : "NoUnsignedWrap") << " decoration may not be applied to " @@ -1634,24 +1648,25 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate, if (decoration.struct_member_index() == Decoration::kInvalidMember) { // The target must be a memory object declaration. const auto opcode = inst.opcode(); - if (opcode != SpvOpVariable && opcode != SpvOpFunctionParameter) { + if (opcode != spv::Op::OpVariable && + opcode != spv::Op::OpFunctionParameter) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "Target of Component decoration must be a memory object " "declaration (a variable or a function parameter)"; } // Only valid for the Input and Output Storage Classes. - const auto storage_class = opcode == SpvOpVariable - ? inst.GetOperandAs(2) - : SpvStorageClassMax; - if (storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput && - storage_class != SpvStorageClassMax) { + const auto storage_class = opcode == spv::Op::OpVariable + ? inst.GetOperandAs(2) + : spv::StorageClass::Max; + if (storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output && + storage_class != spv::StorageClass::Max) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << "Target of Component decoration is invalid: must point to a " "Storage Class of Input(1) or Output(3). Found Storage " "Class " - << storage_class; + << uint32_t(storage_class); } type_id = inst.type_id(); @@ -1660,7 +1675,7 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate, type_id = pointer->GetOperandAs(2); } } else { - if (inst.opcode() != SpvOpTypeStruct) { + if (inst.opcode() != spv::Op::OpTypeStruct) { return vstate.diag(SPV_ERROR_INVALID_DATA, &inst) << "Attempted to get underlying data type via member index for " "non-struct type."; @@ -1670,7 +1685,7 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate, if (spvIsVulkanEnv(vstate.context()->target_env)) { // Strip the array, if present. - if (vstate.GetIdOpcode(type_id) == SpvOpTypeArray) { + if (vstate.GetIdOpcode(type_id) == spv::Op::OpTypeArray) { type_id = vstate.FindDef(type_id)->word(2u); } @@ -1703,6 +1718,7 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate, } else if (bit_width == 64) { if (dimension > 2) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) + << vstate.VkErrorID(7703) << "Component decoration only allowed on 64-bit scalar and " "2-component vector"; } @@ -1734,9 +1750,10 @@ spv_result_t CheckBlockDecoration(ValidationState_t& vstate, const Instruction& inst, const Decoration& decoration) { assert(inst.id() && "Parser ensures the target of the decoration has an ID"); - if (inst.opcode() != SpvOpTypeStruct) { - const char* const dec_name = - decoration.dec_type() == SpvDecorationBlock ? "Block" : "BufferBlock"; + if (inst.opcode() != spv::Op::OpTypeStruct) { + const char* const dec_name = decoration.dec_type() == spv::Decoration::Block + ? "Block" + : "BufferBlock"; return vstate.diag(SPV_ERROR_INVALID_ID, &inst) << dec_name << " decoration on a non-struct type."; } @@ -1746,10 +1763,10 @@ spv_result_t CheckBlockDecoration(ValidationState_t& vstate, spv_result_t CheckLocationDecoration(ValidationState_t& vstate, const Instruction& inst, const Decoration& decoration) { - if (inst.opcode() == SpvOpVariable) return SPV_SUCCESS; + if (inst.opcode() == spv::Op::OpVariable) return SPV_SUCCESS; if (decoration.struct_member_index() != Decoration::kInvalidMember && - inst.opcode() == SpvOpTypeStruct) { + inst.opcode() == spv::Op::OpTypeStruct) { return SPV_SUCCESS; } @@ -1769,7 +1786,7 @@ spv_result_t CheckRelaxPrecisionDecoration(ValidationState_t& vstate, } if (decoration.struct_member_index() != Decoration::kInvalidMember && - inst.opcode() == SpvOpTypeStruct) { + inst.opcode() == spv::Op::OpTypeStruct) { return SPV_SUCCESS; } return vstate.diag(SPV_ERROR_INVALID_ID, &inst) @@ -1788,7 +1805,7 @@ spv_result_t CheckRelaxPrecisionDecoration(ValidationState_t& vstate, // propagated down to the group members. spv_result_t CheckDecorationsFromDecoration(ValidationState_t& vstate) { // Some rules are only checked for shaders. - const bool is_shader = vstate.HasCapability(SpvCapabilityShader); + const bool is_shader = vstate.HasCapability(spv::Capability::Shader); for (const auto& kv : vstate.id_decorations()) { const uint32_t id = kv.first; @@ -1800,37 +1817,37 @@ spv_result_t CheckDecorationsFromDecoration(ValidationState_t& vstate) { // We assume the decorations applied to a decoration group have already // been propagated down to the group members. - if (inst->opcode() == SpvOpDecorationGroup) continue; + if (inst->opcode() == spv::Op::OpDecorationGroup) continue; for (const auto& decoration : decorations) { switch (decoration.dec_type()) { - case SpvDecorationComponent: + case spv::Decoration::Component: PASS_OR_BAIL(CheckComponentDecoration(vstate, *inst, decoration)); break; - case SpvDecorationFPRoundingMode: + case spv::Decoration::FPRoundingMode: if (is_shader) PASS_OR_BAIL( CheckFPRoundingModeForShaders(vstate, *inst, decoration)); break; - case SpvDecorationNonWritable: + case spv::Decoration::NonWritable: PASS_OR_BAIL(CheckNonWritableDecoration(vstate, *inst, decoration)); break; - case SpvDecorationUniform: - case SpvDecorationUniformId: + case spv::Decoration::Uniform: + case spv::Decoration::UniformId: PASS_OR_BAIL(CheckUniformDecoration(vstate, *inst, decoration)); break; - case SpvDecorationNoSignedWrap: - case SpvDecorationNoUnsignedWrap: + case spv::Decoration::NoSignedWrap: + case spv::Decoration::NoUnsignedWrap: PASS_OR_BAIL(CheckIntegerWrapDecoration(vstate, *inst, decoration)); break; - case SpvDecorationBlock: - case SpvDecorationBufferBlock: + case spv::Decoration::Block: + case spv::Decoration::BufferBlock: PASS_OR_BAIL(CheckBlockDecoration(vstate, *inst, decoration)); break; - case SpvDecorationLocation: + case spv::Decoration::Location: PASS_OR_BAIL(CheckLocationDecoration(vstate, *inst, decoration)); break; - case SpvDecorationRelaxedPrecision: + case spv::Decoration::RelaxedPrecision: PASS_OR_BAIL( CheckRelaxPrecisionDecoration(vstate, *inst, decoration)); break; diff --git a/3rdparty/spirv-tools/source/val/validate_derivatives.cpp b/3rdparty/spirv-tools/source/val/validate_derivatives.cpp index 25b941aba..d87240f60 100644 --- a/3rdparty/spirv-tools/source/val/validate_derivatives.cpp +++ b/3rdparty/spirv-tools/source/val/validate_derivatives.cpp @@ -28,25 +28,26 @@ namespace val { // Validates correctness of derivative instructions. spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpDPdx: - case SpvOpDPdy: - case SpvOpFwidth: - case SpvOpDPdxFine: - case SpvOpDPdyFine: - case SpvOpFwidthFine: - case SpvOpDPdxCoarse: - case SpvOpDPdyCoarse: - case SpvOpFwidthCoarse: { + case spv::Op::OpDPdx: + case spv::Op::OpDPdy: + case spv::Op::OpFwidth: + case spv::Op::OpDPdxFine: + case spv::Op::OpDPdyFine: + case spv::Op::OpFwidthFine: + case spv::Op::OpDPdxCoarse: + case spv::Op::OpDPdyCoarse: + case spv::Op::OpFwidthCoarse: { if (!_.IsFloatScalarOrVectorType(result_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be float scalar or vector type: " << spvOpcodeString(opcode); } - if (!_.ContainsSizedIntOrFloatType(result_type, SpvOpTypeFloat, 32)) { + if (!_.ContainsSizedIntOrFloatType(result_type, spv::Op::OpTypeFloat, + 32)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Result type component width must be 32 bits"; } @@ -58,10 +59,10 @@ spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) { << spvOpcodeString(opcode); } _.function(inst->function()->id()) - ->RegisterExecutionModelLimitation([opcode](SpvExecutionModel model, + ->RegisterExecutionModelLimitation([opcode](spv::ExecutionModel model, std::string* message) { - if (model != SpvExecutionModelFragment && - model != SpvExecutionModelGLCompute) { + if (model != spv::ExecutionModel::Fragment && + model != spv::ExecutionModel::GLCompute) { if (message) { *message = std::string( @@ -80,11 +81,11 @@ spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) { const auto* models = state.GetExecutionModels(entry_point->id()); const auto* modes = state.GetExecutionModes(entry_point->id()); if (models && - models->find(SpvExecutionModelGLCompute) != models->end() && + models->find(spv::ExecutionModel::GLCompute) != models->end() && (!modes || - (modes->find(SpvExecutionModeDerivativeGroupLinearNV) == + (modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) == modes->end() && - modes->find(SpvExecutionModeDerivativeGroupQuadsNV) == + modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) == modes->end()))) { if (message) { *message = std::string( diff --git a/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp b/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp index e1f4d7b04..00c660358 100644 --- a/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp +++ b/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp @@ -22,7 +22,7 @@ namespace val { spv_result_t ValidateExecutionLimitations(ValidationState_t& _, const Instruction* inst) { - if (inst->opcode() != SpvOpFunction) { + if (inst->opcode() != spv::Op::OpFunction) { return SPV_SUCCESS; } diff --git a/3rdparty/spirv-tools/source/val/validate_extensions.cpp b/3rdparty/spirv-tools/source/val/validate_extensions.cpp index 1e69cb37f..fa58e0f94 100644 --- a/3rdparty/spirv-tools/source/val/validate_extensions.cpp +++ b/3rdparty/spirv-tools/source/val/validate_extensions.cpp @@ -39,10 +39,24 @@ namespace spvtools { namespace val { namespace { -uint32_t GetSizeTBitWidth(const ValidationState_t& _) { - if (_.addressing_model() == SpvAddressingModelPhysical32) return 32; +std::string ReflectionInstructionName(ValidationState_t& _, + const Instruction* inst) { + spv_ext_inst_desc desc = nullptr; + if (_.grammar().lookupExtInst(SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION, + inst->word(4), &desc) != SPV_SUCCESS || + !desc) { + return std::string("Unknown ExtInst"); + } + std::ostringstream ss; + ss << desc->name; - if (_.addressing_model() == SpvAddressingModelPhysical64) return 64; + return ss.str(); +} + +uint32_t GetSizeTBitWidth(const ValidationState_t& _) { + if (_.addressing_model() == spv::AddressingModel::Physical32) return 32; + + if (_.addressing_model() == spv::AddressingModel::Physical64) return 64; return 0; } @@ -50,7 +64,7 @@ uint32_t GetSizeTBitWidth(const ValidationState_t& _) { bool IsIntScalar(ValidationState_t& _, uint32_t id, bool must_len32, bool must_unsigned) { auto type = _.FindDef(id); - if (!type || type->opcode() != SpvOpTypeInt) { + if (!type || type->opcode() != spv::Op::OpTypeInt) { return false; } @@ -63,7 +77,7 @@ bool IsIntScalar(ValidationState_t& _, uint32_t id, bool must_len32, bool IsUint32Constant(ValidationState_t& _, uint32_t id) { auto inst = _.FindDef(id); - if (!inst || inst->opcode() != SpvOpConstant) { + if (!inst || inst->opcode() != spv::Op::OpConstant) { return false; } @@ -79,7 +93,7 @@ uint32_t GetUint32Constant(ValidationState_t& _, uint32_t id) { // is a result id of an instruction with |expected_opcode|. spv_result_t ValidateOperandForDebugInfo( ValidationState_t& _, const std::string& operand_name, - SpvOp expected_opcode, const Instruction* inst, uint32_t word_index, + spv::Op expected_opcode, const Instruction* inst, uint32_t word_index, const std::function& ext_inst_name) { auto* operand = _.FindDef(inst->word(word_index)); if (operand->opcode() != expected_opcode) { @@ -137,7 +151,7 @@ bool DoesDebugInfoOperandMatchExpectation( const Instruction* inst, uint32_t word_index) { if (inst->words().size() <= word_index) return false; auto* debug_inst = _.FindDef(inst->word(word_index)); - if (debug_inst->opcode() != SpvOpExtInst || + if (debug_inst->opcode() != spv::Op::OpExtInst || (debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 && debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) || @@ -155,7 +169,7 @@ bool DoesDebugInfoOperandMatchExpectation( const Instruction* inst, uint32_t word_index) { if (inst->words().size() <= word_index) return false; auto* debug_inst = _.FindDef(inst->word(word_index)); - if (debug_inst->opcode() != SpvOpExtInst || + if (debug_inst->opcode() != spv::Op::OpExtInst || (debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) || !expectation( @@ -273,12 +287,14 @@ spv_result_t ValidateOperandDebugType( } spv_result_t ValidateClspvReflectionKernel(ValidationState_t& _, - const Instruction* inst) { + const Instruction* inst, + uint32_t version) { + const auto inst_name = ReflectionInstructionName(_, inst); const auto kernel_id = inst->GetOperandAs(4); const auto kernel = _.FindDef(kernel_id); - if (kernel->opcode() != SpvOpFunction) { + if (kernel->opcode() != spv::Op::OpFunction) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Kernel does not reference a function"; + << inst_name << " does not reference a function"; } bool found_kernel = false; @@ -290,23 +306,23 @@ spv_result_t ValidateClspvReflectionKernel(ValidationState_t& _, } if (!found_kernel) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Kernel does not reference an entry-point"; + << inst_name << " does not reference an entry-point"; } const auto* exec_models = _.GetExecutionModels(kernel_id); if (!exec_models || exec_models->empty()) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Kernel does not reference an entry-point"; + << inst_name << " does not reference an entry-point"; } for (auto exec_model : *exec_models) { - if (exec_model != SpvExecutionModelGLCompute) { + if (exec_model != spv::ExecutionModel::GLCompute) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "Kernel must refer only to GLCompute entry-points"; + << inst_name << " must refer only to GLCompute entry-points"; } } auto name = _.FindDef(inst->GetOperandAs(5)); - if (!name || name->opcode() != SpvOpString) { + if (!name || name->opcode() != spv::Op::OpString) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Name must be an OpString"; } @@ -323,17 +339,48 @@ spv_result_t ValidateClspvReflectionKernel(ValidationState_t& _, << "Name must match an entry-point for Kernel"; } + const auto num_operands = inst->operands().size(); + if (version < 5 && num_operands > 6) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Version " << version << " of the " << inst_name + << " instruction can only have 2 additional operands"; + } + + if (num_operands > 6) { + const auto num_args_id = inst->GetOperandAs(6); + if (!IsUint32Constant(_, num_args_id)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "NumArguments must be a 32-bit unsigned integer OpConstant"; + } + } + + if (num_operands > 7) { + const auto flags_id = inst->GetOperandAs(7); + if (!IsUint32Constant(_, flags_id)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Flags must be a 32-bit unsigned integer OpConstant"; + } + } + + if (num_operands > 8) { + const auto atts_id = inst->GetOperandAs(8); + if (_.GetIdOpcode(atts_id) != spv::Op::OpString) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Attributes must be an OpString"; + } + } + return SPV_SUCCESS; } spv_result_t ValidateClspvReflectionArgumentInfo(ValidationState_t& _, const Instruction* inst) { const auto num_operands = inst->operands().size(); - if (_.GetIdOpcode(inst->GetOperandAs(4)) != SpvOpString) { + if (_.GetIdOpcode(inst->GetOperandAs(4)) != spv::Op::OpString) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Name must be an OpString"; } if (num_operands > 5) { - if (_.GetIdOpcode(inst->GetOperandAs(5)) != SpvOpString) { + if (_.GetIdOpcode(inst->GetOperandAs(5)) != spv::Op::OpString) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "TypeName must be an OpString"; } @@ -366,7 +413,7 @@ spv_result_t ValidateClspvReflectionArgumentInfo(ValidationState_t& _, spv_result_t ValidateKernelDecl(ValidationState_t& _, const Instruction* inst) { const auto decl_id = inst->GetOperandAs(4); const auto decl = _.FindDef(decl_id); - if (!decl || decl->opcode() != SpvOpExtInst) { + if (!decl || decl->opcode() != spv::Op::OpExtInst) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Kernel must be a Kernel extended instruction"; } @@ -389,7 +436,7 @@ spv_result_t ValidateKernelDecl(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateArgInfo(ValidationState_t& _, const Instruction* inst, uint32_t info_index) { auto info = _.FindDef(inst->GetOperandAs(info_index)); - if (!info || info->opcode() != SpvOpExtInst) { + if (!info || info->opcode() != spv::Op::OpExtInst) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "ArgInfo must be an ArgumentInfo extended instruction"; } @@ -439,8 +486,8 @@ spv_result_t ValidateClspvReflectionArgumentBuffer(ValidationState_t& _, return SPV_SUCCESS; } -spv_result_t ValidateClspvReflectionArgumentPodBuffer(ValidationState_t& _, - const Instruction* inst) { +spv_result_t ValidateClspvReflectionArgumentOffsetBuffer(ValidationState_t& _, + const Instruction* inst) { const auto num_operands = inst->operands().size(); if (auto error = ValidateKernelDecl(_, inst)) { return error; @@ -480,7 +527,7 @@ spv_result_t ValidateClspvReflectionArgumentPodBuffer(ValidationState_t& _, return SPV_SUCCESS; } -spv_result_t ValidateClspvReflectionArgumentPodPushConstant( +spv_result_t ValidateClspvReflectionArgumentPushConstant( ValidationState_t& _, const Instruction* inst) { const auto num_operands = inst->operands().size(); if (auto error = ValidateKernelDecl(_, inst)) { @@ -587,8 +634,8 @@ spv_result_t ValidateClspvReflectionPushConstant(ValidationState_t& _, return SPV_SUCCESS; } -spv_result_t ValidateClspvReflectionConstantData(ValidationState_t& _, - const Instruction* inst) { +spv_result_t ValidateClspvReflectionInitializedData(ValidationState_t& _, + const Instruction* inst) { if (!IsUint32Constant(_, inst->GetOperandAs(4))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "DescriptorSet must be a 32-bit unsigned integer OpConstant"; @@ -599,7 +646,7 @@ spv_result_t ValidateClspvReflectionConstantData(ValidationState_t& _, << "Binding must be a 32-bit unsigned integer OpConstant"; } - if (_.GetIdOpcode(inst->GetOperandAs(6)) != SpvOpString) { + if (_.GetIdOpcode(inst->GetOperandAs(6)) != spv::Op::OpString) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Data must be an OpString"; } @@ -650,18 +697,250 @@ spv_result_t ValidateClspvReflectionPropertyRequiredWorkgroupSize( return SPV_SUCCESS; } +spv_result_t ValidateClspvReflectionSubgroupMaxSize(ValidationState_t& _, + const Instruction* inst) { + const auto size_id = inst->GetOperandAs(4); + if (!IsUint32Constant(_, size_id)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a 32-bit unsigned integer OpConstant"; + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateClspvReflectionPointerRelocation(ValidationState_t& _, + const Instruction* inst) { + if (!IsUint32Constant(_, inst->GetOperandAs(4))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "ObjectOffset must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(5))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "PointerOffset must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(6))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "PointerSize must be a 32-bit unsigned integer OpConstant"; + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateClspvReflectionImageMetadataPushConstant( + ValidationState_t& _, const Instruction* inst) { + if (auto error = ValidateKernelDecl(_, inst)) { + return error; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(5))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Ordinal must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(6))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Offset must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(7))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a 32-bit unsigned integer OpConstant"; + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateClspvReflectionImageMetadataUniform( + ValidationState_t& _, const Instruction* inst) { + if (auto error = ValidateKernelDecl(_, inst)) { + return error; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(5))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Ordinal must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(6))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "DescriptorSet must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(7))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Binding must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(8))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Offset must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(9))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a 32-bit unsigned integer OpConstant"; + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateClspvReflectionPushConstantData(ValidationState_t& _, + const Instruction* inst) { + if (!IsUint32Constant(_, inst->GetOperandAs(4))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Offset must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(5))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a 32-bit unsigned integer OpConstant"; + } + + if (_.GetIdOpcode(inst->GetOperandAs(6)) != spv::Op::OpString) { + return _.diag(SPV_ERROR_INVALID_ID, inst) << "Data must be an OpString"; + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateClspvReflectionPrintfInfo(ValidationState_t& _, + const Instruction* inst) { + if (!IsUint32Constant(_, inst->GetOperandAs(4))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "PrintfID must be a 32-bit unsigned integer OpConstant"; + } + + if (_.GetIdOpcode(inst->GetOperandAs(5)) != spv::Op::OpString) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "FormatString must be an OpString"; + } + + for (size_t i = 6; i < inst->operands().size(); ++i) { + if (!IsUint32Constant(_, inst->GetOperandAs(i))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "ArgumentSizes must be a 32-bit unsigned integer OpConstant"; + } + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateClspvReflectionPrintfStorageBuffer(ValidationState_t& _, + const Instruction* inst) { + if (!IsUint32Constant(_, inst->GetOperandAs(4))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "DescriptorSet must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(5))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Binding must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(6))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a 32-bit unsigned integer OpConstant"; + } + + return SPV_SUCCESS; +} + +spv_result_t ValidateClspvReflectionPrintfPushConstant(ValidationState_t& _, + const Instruction* inst) { + if (!IsUint32Constant(_, inst->GetOperandAs(4))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Offset must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(5))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "Size must be a 32-bit unsigned integer OpConstant"; + } + + if (!IsUint32Constant(_, inst->GetOperandAs(6))) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "BufferSize must be a 32-bit unsigned integer OpConstant"; + } + + return SPV_SUCCESS; +} + spv_result_t ValidateClspvReflectionInstruction(ValidationState_t& _, const Instruction* inst, - uint32_t /*version*/) { + uint32_t version) { if (!_.IsVoidType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Return Type must be OpTypeVoid"; } - auto ext_inst = inst->GetOperandAs(3); + uint32_t required_version = 0; + const auto ext_inst = + inst->GetOperandAs(3); switch (ext_inst) { case NonSemanticClspvReflectionKernel: - return ValidateClspvReflectionKernel(_, inst); + case NonSemanticClspvReflectionArgumentInfo: + case NonSemanticClspvReflectionArgumentStorageBuffer: + case NonSemanticClspvReflectionArgumentUniform: + case NonSemanticClspvReflectionArgumentPodStorageBuffer: + case NonSemanticClspvReflectionArgumentPodUniform: + case NonSemanticClspvReflectionArgumentPodPushConstant: + case NonSemanticClspvReflectionArgumentSampledImage: + case NonSemanticClspvReflectionArgumentStorageImage: + case NonSemanticClspvReflectionArgumentSampler: + case NonSemanticClspvReflectionArgumentWorkgroup: + case NonSemanticClspvReflectionSpecConstantWorkgroupSize: + case NonSemanticClspvReflectionSpecConstantGlobalOffset: + case NonSemanticClspvReflectionSpecConstantWorkDim: + case NonSemanticClspvReflectionPushConstantGlobalOffset: + case NonSemanticClspvReflectionPushConstantEnqueuedLocalSize: + case NonSemanticClspvReflectionPushConstantGlobalSize: + case NonSemanticClspvReflectionPushConstantRegionOffset: + case NonSemanticClspvReflectionPushConstantNumWorkgroups: + case NonSemanticClspvReflectionPushConstantRegionGroupOffset: + case NonSemanticClspvReflectionConstantDataStorageBuffer: + case NonSemanticClspvReflectionConstantDataUniform: + case NonSemanticClspvReflectionLiteralSampler: + case NonSemanticClspvReflectionPropertyRequiredWorkgroupSize: + required_version = 1; + break; + case NonSemanticClspvReflectionSpecConstantSubgroupMaxSize: + required_version = 2; + break; + case NonSemanticClspvReflectionArgumentPointerPushConstant: + case NonSemanticClspvReflectionArgumentPointerUniform: + case NonSemanticClspvReflectionProgramScopeVariablesStorageBuffer: + case NonSemanticClspvReflectionProgramScopeVariablePointerRelocation: + case NonSemanticClspvReflectionImageArgumentInfoChannelOrderPushConstant: + case NonSemanticClspvReflectionImageArgumentInfoChannelDataTypePushConstant: + case NonSemanticClspvReflectionImageArgumentInfoChannelOrderUniform: + case NonSemanticClspvReflectionImageArgumentInfoChannelDataTypeUniform: + required_version = 3; + break; + case NonSemanticClspvReflectionArgumentStorageTexelBuffer: + case NonSemanticClspvReflectionArgumentUniformTexelBuffer: + required_version = 4; + break; + case NonSemanticClspvReflectionConstantDataPointerPushConstant: + case NonSemanticClspvReflectionProgramScopeVariablePointerPushConstant: + case NonSemanticClspvReflectionPrintfInfo: + case NonSemanticClspvReflectionPrintfBufferStorageBuffer: + case NonSemanticClspvReflectionPrintfBufferPointerPushConstant: + required_version = 5; + break; + default: + break; + } + if (version < required_version) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << ReflectionInstructionName(_, inst) << " requires version " + << required_version << ", but parsed version is " << version; + } + + switch (ext_inst) { + case NonSemanticClspvReflectionKernel: + return ValidateClspvReflectionKernel(_, inst, version); case NonSemanticClspvReflectionArgumentInfo: return ValidateClspvReflectionArgumentInfo(_, inst); case NonSemanticClspvReflectionArgumentStorageBuffer: @@ -669,12 +948,16 @@ spv_result_t ValidateClspvReflectionInstruction(ValidationState_t& _, case NonSemanticClspvReflectionArgumentSampledImage: case NonSemanticClspvReflectionArgumentStorageImage: case NonSemanticClspvReflectionArgumentSampler: + case NonSemanticClspvReflectionArgumentStorageTexelBuffer: + case NonSemanticClspvReflectionArgumentUniformTexelBuffer: return ValidateClspvReflectionArgumentBuffer(_, inst); case NonSemanticClspvReflectionArgumentPodStorageBuffer: case NonSemanticClspvReflectionArgumentPodUniform: - return ValidateClspvReflectionArgumentPodBuffer(_, inst); + case NonSemanticClspvReflectionArgumentPointerUniform: + return ValidateClspvReflectionArgumentOffsetBuffer(_, inst); case NonSemanticClspvReflectionArgumentPodPushConstant: - return ValidateClspvReflectionArgumentPodPushConstant(_, inst); + case NonSemanticClspvReflectionArgumentPointerPushConstant: + return ValidateClspvReflectionArgumentPushConstant(_, inst); case NonSemanticClspvReflectionArgumentWorkgroup: return ValidateClspvReflectionArgumentWorkgroup(_, inst); case NonSemanticClspvReflectionSpecConstantWorkgroupSize: @@ -691,11 +974,31 @@ spv_result_t ValidateClspvReflectionInstruction(ValidationState_t& _, return ValidateClspvReflectionPushConstant(_, inst); case NonSemanticClspvReflectionConstantDataStorageBuffer: case NonSemanticClspvReflectionConstantDataUniform: - return ValidateClspvReflectionConstantData(_, inst); + case NonSemanticClspvReflectionProgramScopeVariablesStorageBuffer: + return ValidateClspvReflectionInitializedData(_, inst); case NonSemanticClspvReflectionLiteralSampler: return ValidateClspvReflectionSampler(_, inst); case NonSemanticClspvReflectionPropertyRequiredWorkgroupSize: return ValidateClspvReflectionPropertyRequiredWorkgroupSize(_, inst); + case NonSemanticClspvReflectionSpecConstantSubgroupMaxSize: + return ValidateClspvReflectionSubgroupMaxSize(_, inst); + case NonSemanticClspvReflectionProgramScopeVariablePointerRelocation: + return ValidateClspvReflectionPointerRelocation(_, inst); + case NonSemanticClspvReflectionImageArgumentInfoChannelOrderPushConstant: + case NonSemanticClspvReflectionImageArgumentInfoChannelDataTypePushConstant: + return ValidateClspvReflectionImageMetadataPushConstant(_, inst); + case NonSemanticClspvReflectionImageArgumentInfoChannelOrderUniform: + case NonSemanticClspvReflectionImageArgumentInfoChannelDataTypeUniform: + return ValidateClspvReflectionImageMetadataUniform(_, inst); + case NonSemanticClspvReflectionConstantDataPointerPushConstant: + case NonSemanticClspvReflectionProgramScopeVariablePointerPushConstant: + return ValidateClspvReflectionPushConstantData(_, inst); + case NonSemanticClspvReflectionPrintfInfo: + return ValidateClspvReflectionPrintfInfo(_, inst); + case NonSemanticClspvReflectionPrintfBufferStorageBuffer: + return ValidateClspvReflectionPrintfStorageBuffer(_, inst); + case NonSemanticClspvReflectionPrintfBufferPointerPushConstant: + return ValidateClspvReflectionPrintfPushConstant(_, inst); default: break; } @@ -705,7 +1008,7 @@ spv_result_t ValidateClspvReflectionInstruction(ValidationState_t& _, bool IsConstIntScalarTypeWith32Or64Bits(ValidationState_t& _, Instruction* instr) { - if (instr->opcode() != SpvOpConstant) return false; + if (instr->opcode() != spv::Op::OpConstant) return false; if (!_.IsIntScalarType(instr->type_id())) return false; uint32_t size_in_bits = _.GetBitWidth(instr->type_id()); return size_in_bits == 32 || size_in_bits == 64; @@ -714,7 +1017,7 @@ bool IsConstIntScalarTypeWith32Or64Bits(ValidationState_t& _, bool IsConstWithIntScalarType(ValidationState_t& _, const Instruction* inst, uint32_t word_index) { auto* int_scalar_const = _.FindDef(inst->word(word_index)); - if (int_scalar_const->opcode() == SpvOpConstant && + if (int_scalar_const->opcode() == spv::Op::OpConstant && _.IsIntScalarType(int_scalar_const->type_id())) { return true; } @@ -757,7 +1060,8 @@ spv_result_t ValidateExtension(ValidationState_t& _, const Instruction* inst) { std::string extension = GetExtensionString(&(inst->c_inst())); if (extension == ExtensionToString(kSPV_KHR_workgroup_memory_explicit_layout) || - extension == ExtensionToString(kSPV_EXT_mesh_shader)) { + extension == ExtensionToString(kSPV_EXT_mesh_shader) || + extension == ExtensionToString(kSPV_NV_shader_invocation_reorder)) { return _.diag(SPV_ERROR_WRONG_VERSION, inst) << extension << " extension requires SPIR-V version 1.4 or later."; } @@ -1020,7 +1324,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand X type to be equal to Result Type"; } - uint32_t i_storage_class = 0; + spv::StorageClass i_storage_class; uint32_t i_data_type = 0; if (!_.GetPointerTypeInfo(i_type, &i_data_type, &i_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1075,7 +1379,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand X type to be equal to Result Type"; } - uint32_t exp_storage_class = 0; + spv::StorageClass exp_storage_class; uint32_t exp_data_type = 0; if (!_.GetPointerTypeInfo(exp_type, &exp_data_type, &exp_storage_class)) { @@ -1424,7 +1728,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { case GLSLstd450InterpolateAtCentroid: case GLSLstd450InterpolateAtSample: case GLSLstd450InterpolateAtOffset: { - if (!_.HasCapability(SpvCapabilityInterpolationFunction)) { + if (!_.HasCapability(spv::Capability::InterpolationFunction)) { return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst) << ext_inst_name() << " requires capability InterpolationFunction"; @@ -1444,11 +1748,11 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { uint32_t interp_id = inst->GetOperandAs(4); auto* interp_inst = _.FindDef(interp_id); uint32_t interpolant_type = (_.options()->before_hlsl_legalization && - interp_inst->opcode() == SpvOpLoad) + interp_inst->opcode() == spv::Op::OpLoad) ? _.GetOperandTypeId(interp_inst, 2) : _.GetOperandTypeId(inst, 4); - uint32_t interpolant_storage_class = 0; + spv::StorageClass interpolant_storage_class; uint32_t interpolant_data_type = 0; if (!_.GetPointerTypeInfo(interpolant_type, &interpolant_data_type, &interpolant_storage_class)) { @@ -1463,7 +1767,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected Interpolant data type to be equal to Result Type"; } - if (interpolant_storage_class != SpvStorageClassInput) { + if (interpolant_storage_class != spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected Interpolant storage class to be Input"; @@ -1492,7 +1796,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - SpvExecutionModelFragment, + spv::ExecutionModel::Fragment, ext_inst_name() + std::string(" requires Fragment execution model")); break; @@ -1662,7 +1966,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { } const uint32_t p_type = _.GetOperandTypeId(inst, 5); - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1670,10 +1974,10 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected the last operand to be a pointer"; } - if (p_storage_class != SpvStorageClassGeneric && - p_storage_class != SpvStorageClassCrossWorkgroup && - p_storage_class != SpvStorageClassWorkgroup && - p_storage_class != SpvStorageClassFunction) { + if (p_storage_class != spv::StorageClass::Generic && + p_storage_class != spv::StorageClass::CrossWorkgroup && + p_storage_class != spv::StorageClass::Workgroup && + p_storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected storage class of the pointer to be Generic, " @@ -1724,7 +2028,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { } const uint32_t p_type = _.GetOperandTypeId(inst, operand_index++); - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1732,10 +2036,10 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected the last operand to be a pointer"; } - if (p_storage_class != SpvStorageClassGeneric && - p_storage_class != SpvStorageClassCrossWorkgroup && - p_storage_class != SpvStorageClassWorkgroup && - p_storage_class != SpvStorageClassFunction) { + if (p_storage_class != spv::StorageClass::Generic && + p_storage_class != spv::StorageClass::CrossWorkgroup && + p_storage_class != spv::StorageClass::Workgroup && + p_storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected storage class of the pointer to be Generic, " @@ -2254,7 +2558,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "-bit integer for the addressing model used in the module)"; } - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -2262,11 +2566,11 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand P to be a pointer"; } - if (p_storage_class != SpvStorageClassUniformConstant && - p_storage_class != SpvStorageClassGeneric && - p_storage_class != SpvStorageClassCrossWorkgroup && - p_storage_class != SpvStorageClassWorkgroup && - p_storage_class != SpvStorageClassFunction) { + if (p_storage_class != spv::StorageClass::UniformConstant && + p_storage_class != spv::StorageClass::Generic && + p_storage_class != spv::StorageClass::CrossWorkgroup && + p_storage_class != spv::StorageClass::Workgroup && + p_storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P storage class to be UniformConstant, " @@ -2291,7 +2595,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { } case OpenCLLIB::Vstoren: { - if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { + if (_.GetIdOpcode(result_type) != spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": expected Result Type to be void"; } @@ -2329,7 +2633,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "-bit integer for the addressing model used in the module)"; } - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -2337,10 +2641,10 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand P to be a pointer"; } - if (p_storage_class != SpvStorageClassGeneric && - p_storage_class != SpvStorageClassCrossWorkgroup && - p_storage_class != SpvStorageClassWorkgroup && - p_storage_class != SpvStorageClassFunction) { + if (p_storage_class != spv::StorageClass::Generic && + p_storage_class != spv::StorageClass::CrossWorkgroup && + p_storage_class != spv::StorageClass::Workgroup && + p_storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P storage class to be Generic, " @@ -2382,7 +2686,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "-bit integer for the addressing model used in the module)"; } - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -2390,11 +2694,11 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand P to be a pointer"; } - if (p_storage_class != SpvStorageClassUniformConstant && - p_storage_class != SpvStorageClassGeneric && - p_storage_class != SpvStorageClassCrossWorkgroup && - p_storage_class != SpvStorageClassWorkgroup && - p_storage_class != SpvStorageClassFunction) { + if (p_storage_class != spv::StorageClass::UniformConstant && + p_storage_class != spv::StorageClass::Generic && + p_storage_class != spv::StorageClass::CrossWorkgroup && + p_storage_class != spv::StorageClass::Workgroup && + p_storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P storage class to be UniformConstant, " @@ -2444,7 +2748,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "-bit integer for the addressing model used in the module)"; } - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -2452,11 +2756,11 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand P to be a pointer"; } - if (p_storage_class != SpvStorageClassUniformConstant && - p_storage_class != SpvStorageClassGeneric && - p_storage_class != SpvStorageClassCrossWorkgroup && - p_storage_class != SpvStorageClassWorkgroup && - p_storage_class != SpvStorageClassFunction) { + if (p_storage_class != spv::StorageClass::UniformConstant && + p_storage_class != spv::StorageClass::Generic && + p_storage_class != spv::StorageClass::CrossWorkgroup && + p_storage_class != spv::StorageClass::Workgroup && + p_storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P storage class to be UniformConstant, " @@ -2486,7 +2790,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { case OpenCLLIB::Vstore_halfn_r: case OpenCLLIB::Vstorea_halfn: case OpenCLLIB::Vstorea_halfn_r: { - if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { + if (_.GetIdOpcode(result_type) != spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": expected Result Type to be void"; } @@ -2537,7 +2841,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "-bit integer for the addressing model used in the module)"; } - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -2545,10 +2849,10 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand P to be a pointer"; } - if (p_storage_class != SpvStorageClassGeneric && - p_storage_class != SpvStorageClassCrossWorkgroup && - p_storage_class != SpvStorageClassWorkgroup && - p_storage_class != SpvStorageClassFunction) { + if (p_storage_class != spv::StorageClass::Generic && + p_storage_class != spv::StorageClass::CrossWorkgroup && + p_storage_class != spv::StorageClass::Workgroup && + p_storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand P storage class to be Generic, " @@ -2653,7 +2957,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { } const uint32_t format_type = _.GetOperandTypeId(inst, 4); - uint32_t format_storage_class = 0; + spv::StorageClass format_storage_class; uint32_t format_data_type = 0; if (!_.GetPointerTypeInfo(format_type, &format_data_type, &format_storage_class)) { @@ -2662,7 +2966,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand Format to be a pointer"; } - if (format_storage_class != SpvStorageClassUniformConstant) { + if (format_storage_class != spv::StorageClass::UniformConstant) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected Format storage class to be UniformConstant"; @@ -2678,7 +2982,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { } case OpenCLLIB::Prefetch: { - if (_.GetIdOpcode(result_type) != SpvOpTypeVoid) { + if (_.GetIdOpcode(result_type) != spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": expected Result Type to be void"; } @@ -2686,7 +2990,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { const uint32_t p_type = _.GetOperandTypeId(inst, 4); const uint32_t num_elements_type = _.GetOperandTypeId(inst, 5); - uint32_t p_storage_class = 0; + spv::StorageClass p_storage_class; uint32_t p_data_type = 0; if (!_.GetPointerTypeInfo(p_type, &p_data_type, &p_storage_class)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -2694,7 +2998,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand Ptr to be a pointer"; } - if (p_storage_class != SpvStorageClassCrossWorkgroup) { + if (p_storage_class != spv::StorageClass::CrossWorkgroup) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand Ptr storage class to be CrossWorkgroup"; @@ -2857,13 +3161,13 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugSource: { - CHECK_OPERAND("File", SpvOpString, 5); - if (num_words == 7) CHECK_OPERAND("Text", SpvOpString, 6); + CHECK_OPERAND("File", spv::Op::OpString, 5); + if (num_words == 7) CHECK_OPERAND("Text", spv::Op::OpString, 6); break; } case CommonDebugInfoDebugTypeBasic: { - CHECK_OPERAND("Name", SpvOpString, 5); - CHECK_OPERAND("Size", SpvOpConstant, 6); + CHECK_OPERAND("Name", spv::Op::OpString, 5); + CHECK_OPERAND("Size", spv::Op::OpConstant, 6); CHECK_CONST_UINT_OPERAND("Encoding", 7); break; } @@ -2966,7 +3270,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugTypedef: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); auto validate_base_type = ValidateOperandBaseType(_, inst, 6, ext_inst_name); if (validate_base_type != SPV_SUCCESS) return validate_base_type; @@ -2983,7 +3287,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { auto* return_type = _.FindDef(inst->word(6)); // TODO: We need a spec discussion that we have to allow return and // parameter types of a DebugTypeFunction to have template parameter. - if (return_type->opcode() != SpvOpTypeVoid) { + if (return_type->opcode() != spv::Op::OpTypeVoid) { auto validate_return = ValidateOperandDebugType( _, "Return Type", inst, 6, ext_inst_name, true); if (validate_return != SPV_SUCCESS) return validate_return; @@ -2996,7 +3300,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugTypeEnum: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); if (!DoesDebugInfoOperandMatchExpectation( _, [](CommonDebugInfoInstructions dbg_inst) { @@ -3014,7 +3318,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { auto validate_parent = ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Size", SpvOpConstant, 11); + CHECK_OPERAND("Size", spv::Op::OpConstant, 11); auto* size = _.FindDef(inst->word(11)); if (!_.IsIntScalarType(size->type_id()) || !size->word(3)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -3024,27 +3328,27 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { CHECK_CONST_UINT_OPERAND("Flags", 12); for (uint32_t word_index = 13; word_index + 1 < num_words; word_index += 2) { - CHECK_OPERAND("Value", SpvOpConstant, word_index); - CHECK_OPERAND("Name", SpvOpString, word_index + 1); + CHECK_OPERAND("Value", spv::Op::OpConstant, word_index); + CHECK_OPERAND("Name", spv::Op::OpString, word_index + 1); } break; } case CommonDebugInfoDebugTypeComposite: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7); CHECK_CONST_UINT_OPERAND("Line", 8); CHECK_CONST_UINT_OPERAND("Column", 9); auto validate_parent = ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); + CHECK_OPERAND("Linkage Name", spv::Op::OpString, 11); if (!DoesDebugInfoOperandMatchExpectation( _, [](CommonDebugInfoInstructions dbg_inst) { return dbg_inst == CommonDebugInfoDebugInfoNone; }, inst, 12)) { - CHECK_OPERAND("Size", SpvOpConstant, 12); + CHECK_OPERAND("Size", spv::Op::OpConstant, 12); } CHECK_CONST_UINT_OPERAND("Flags", 13); for (uint32_t word_index = 14; word_index < num_words; ++word_index) { @@ -3066,7 +3370,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugTypeMember: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); // TODO: We need a spec discussion that we have to allow member types // to have template parameter. auto validate_type = @@ -3077,17 +3381,19 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { CHECK_CONST_UINT_OPERAND("Column", 9); // NonSemantic.Shader.DebugInfo doesn't have the Parent operand if (vulkanDebugInfo) { - CHECK_OPERAND("Offset", SpvOpConstant, 10); - CHECK_OPERAND("Size", SpvOpConstant, 11); + CHECK_OPERAND("Offset", spv::Op::OpConstant, 10); + CHECK_OPERAND("Size", spv::Op::OpConstant, 11); CHECK_CONST_UINT_OPERAND("Flags", 12); - if (num_words == 14) CHECK_OPERAND("Value", SpvOpConstant, 13); + if (num_words == 14) + CHECK_OPERAND("Value", spv::Op::OpConstant, 13); } else { CHECK_DEBUG_OPERAND("Parent", CommonDebugInfoDebugTypeComposite, 10); - CHECK_OPERAND("Offset", SpvOpConstant, 11); - CHECK_OPERAND("Size", SpvOpConstant, 12); + CHECK_OPERAND("Offset", spv::Op::OpConstant, 11); + CHECK_OPERAND("Size", spv::Op::OpConstant, 12); CHECK_CONST_UINT_OPERAND("Flags", 13); - if (num_words == 15) CHECK_OPERAND("Value", SpvOpConstant, 14); + if (num_words == 15) + CHECK_OPERAND("Value", spv::Op::OpConstant, 14); } break; } @@ -3114,13 +3420,13 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { << "expected operand Parent must be class or struct debug " "type"; } - CHECK_OPERAND("Offset", SpvOpConstant, 7); - CHECK_OPERAND("Size", SpvOpConstant, 8); + CHECK_OPERAND("Offset", spv::Op::OpConstant, 7); + CHECK_OPERAND("Size", spv::Op::OpConstant, 8); CHECK_CONST_UINT_OPERAND("Flags", 9); break; } case CommonDebugInfoDebugFunction: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, false); if (validate_type != SPV_SUCCESS) return validate_type; @@ -3130,7 +3436,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { auto validate_parent = ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); + CHECK_OPERAND("Linkage Name", spv::Op::OpString, 11); CHECK_CONST_UINT_OPERAND("Flags", 12); CHECK_CONST_UINT_OPERAND("Scope Line", 13); // NonSemantic.Shader.DebugInfo.100 doesn't include a reference to the @@ -3147,7 +3453,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { return dbg_inst == CommonDebugInfoDebugInfoNone; }, inst, 14)) { - CHECK_OPERAND("Function", SpvOpFunction, 14); + CHECK_OPERAND("Function", spv::Op::OpFunction, 14); } if (num_words == 16) { CHECK_DEBUG_OPERAND("Declaration", @@ -3157,7 +3463,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugFunctionDeclaration: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, false); if (validate_type != SPV_SUCCESS) return validate_type; @@ -3167,7 +3473,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { auto validate_parent = ValidateOperandLexicalScope(_, "Parent", inst, 10, ext_inst_name); if (validate_parent != SPV_SUCCESS) return validate_parent; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); + CHECK_OPERAND("Linkage Name", spv::Op::OpString, 11); CHECK_CONST_UINT_OPERAND("Flags", 12); break; } @@ -3178,7 +3484,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { auto validate_parent = ValidateOperandLexicalScope(_, "Parent", inst, 8, ext_inst_name); if (validate_parent != SPV_SUCCESS) return validate_parent; - if (num_words == 10) CHECK_OPERAND("Name", SpvOpString, 9); + if (num_words == 10) CHECK_OPERAND("Name", spv::Op::OpString, 9); break; } case CommonDebugInfoDebugScope: { @@ -3191,7 +3497,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugLocalVariable: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); // TODO: We need a spec discussion that we have to allow local // variable types to have template parameter. auto validate_type = @@ -3213,8 +3519,8 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { CHECK_DEBUG_OPERAND("Local Variable", CommonDebugInfoDebugLocalVariable, 5); auto* operand = _.FindDef(inst->word(6)); - if (operand->opcode() != SpvOpVariable && - operand->opcode() != SpvOpFunctionParameter) { + if (operand->opcode() != spv::Op::OpVariable && + operand->opcode() != spv::Op::OpFunctionParameter) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand Variable must be a result id of " @@ -3276,7 +3582,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugTypeTemplateParameter: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); auto validate_actual_type = ValidateOperandDebugType( _, "Actual Type", inst, 6, ext_inst_name, false); if (validate_actual_type != SPV_SUCCESS) return validate_actual_type; @@ -3286,7 +3592,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { return dbg_inst == CommonDebugInfoDebugInfoNone; }, inst, 7)) { - CHECK_OPERAND("Value", SpvOpConstant, 7); + CHECK_OPERAND("Value", spv::Op::OpConstant, 7); } CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 8); CHECK_CONST_UINT_OPERAND("Line", 9); @@ -3294,7 +3600,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { break; } case CommonDebugInfoDebugGlobalVariable: { - CHECK_OPERAND("Name", SpvOpString, 5); + CHECK_OPERAND("Name", spv::Op::OpString, 5); auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6, ext_inst_name, false); if (validate_type != SPV_SUCCESS) return validate_type; @@ -3304,7 +3610,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { auto validate_scope = ValidateOperandLexicalScope(_, "Scope", inst, 10, ext_inst_name); if (validate_scope != SPV_SUCCESS) return validate_scope; - CHECK_OPERAND("Linkage Name", SpvOpString, 11); + CHECK_OPERAND("Linkage Name", spv::Op::OpString, 11); if (!DoesDebugInfoOperandMatchExpectation( _, [](CommonDebugInfoInstructions dbg_inst) { @@ -3312,8 +3618,8 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { }, inst, 12)) { auto* operand = _.FindDef(inst->word(12)); - if (operand->opcode() != SpvOpVariable && - operand->opcode() != SpvOpConstant) { + if (operand->opcode() != spv::Op::OpVariable && + operand->opcode() != spv::Op::OpConstant) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << ext_inst_name() << ": " << "expected operand Variable must be a result id of " @@ -3401,10 +3707,10 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) { } spv_result_t ExtensionPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); - if (opcode == SpvOpExtension) return ValidateExtension(_, inst); - if (opcode == SpvOpExtInstImport) return ValidateExtInstImport(_, inst); - if (opcode == SpvOpExtInst) return ValidateExtInst(_, inst); + const spv::Op opcode = inst->opcode(); + if (opcode == spv::Op::OpExtension) return ValidateExtension(_, inst); + if (opcode == spv::Op::OpExtInstImport) return ValidateExtInstImport(_, inst); + if (opcode == spv::Op::OpExtInst) return ValidateExtInst(_, inst); return SPV_SUCCESS; } diff --git a/3rdparty/spirv-tools/source/val/validate_function.cpp b/3rdparty/spirv-tools/source/val/validate_function.cpp index 0ccf5a9ea..db402aa32 100644 --- a/3rdparty/spirv-tools/source/val/validate_function.cpp +++ b/3rdparty/spirv-tools/source/val/validate_function.cpp @@ -28,7 +28,8 @@ namespace { // of the decorations that apply to |a|. bool DoPointeesLogicallyMatch(val::Instruction* a, val::Instruction* b, ValidationState_t& _) { - if (a->opcode() != SpvOpTypePointer || b->opcode() != SpvOpTypePointer) { + if (a->opcode() != spv::Op::OpTypePointer || + b->opcode() != spv::Op::OpTypePointer) { return false; } @@ -56,7 +57,7 @@ bool DoPointeesLogicallyMatch(val::Instruction* a, val::Instruction* b, spv_result_t ValidateFunction(ValidationState_t& _, const Instruction* inst) { const auto function_type_id = inst->GetOperandAs(3); const auto function_type = _.FindDef(function_type_id); - if (!function_type || SpvOpTypeFunction != function_type->opcode()) { + if (!function_type || spv::Op::OpTypeFunction != function_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpFunction Function Type " << _.getIdName(function_type_id) << " is not a function type."; @@ -70,21 +71,21 @@ spv_result_t ValidateFunction(ValidationState_t& _, const Instruction* inst) { << _.getIdName(return_id) << "."; } - const std::vector acceptable = { - SpvOpGroupDecorate, - SpvOpDecorate, - SpvOpEnqueueKernel, - SpvOpEntryPoint, - SpvOpExecutionMode, - SpvOpExecutionModeId, - SpvOpFunctionCall, - SpvOpGetKernelNDrangeSubGroupCount, - SpvOpGetKernelNDrangeMaxSubGroupSize, - SpvOpGetKernelWorkGroupSize, - SpvOpGetKernelPreferredWorkGroupSizeMultiple, - SpvOpGetKernelLocalSizeForSubgroupCount, - SpvOpGetKernelMaxNumSubgroups, - SpvOpName}; + const std::vector acceptable = { + spv::Op::OpGroupDecorate, + spv::Op::OpDecorate, + spv::Op::OpEnqueueKernel, + spv::Op::OpEntryPoint, + spv::Op::OpExecutionMode, + spv::Op::OpExecutionModeId, + spv::Op::OpFunctionCall, + spv::Op::OpGetKernelNDrangeSubGroupCount, + spv::Op::OpGetKernelNDrangeMaxSubGroupSize, + spv::Op::OpGetKernelWorkGroupSize, + spv::Op::OpGetKernelPreferredWorkGroupSizeMultiple, + spv::Op::OpGetKernelLocalSizeForSubgroupCount, + spv::Op::OpGetKernelMaxNumSubgroups, + spv::Op::OpName}; for (auto& pair : inst->uses()) { const auto* use = pair.first; if (std::find(acceptable.begin(), acceptable.end(), use->opcode()) == @@ -112,14 +113,14 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _, auto func_inst = &_.ordered_instructions()[inst_num]; while (--inst_num) { func_inst = &_.ordered_instructions()[inst_num]; - if (func_inst->opcode() == SpvOpFunction) { + if (func_inst->opcode() == spv::Op::OpFunction) { break; - } else if (func_inst->opcode() == SpvOpFunctionParameter) { + } else if (func_inst->opcode() == spv::Op::OpFunctionParameter) { ++param_index; } } - if (func_inst->opcode() != SpvOpFunction) { + if (func_inst->opcode() != spv::Op::OpFunction) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << "Function parameter must be preceded by a function."; } @@ -150,25 +151,25 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _, // Validate that PhysicalStorageBuffer have one of Restrict, Aliased, // RestrictPointer, or AliasedPointer. auto param_nonarray_type_id = param_type->id(); - while (_.GetIdOpcode(param_nonarray_type_id) == SpvOpTypeArray) { + while (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypeArray) { param_nonarray_type_id = _.FindDef(param_nonarray_type_id)->GetOperandAs(1u); } - if (_.GetIdOpcode(param_nonarray_type_id) == SpvOpTypePointer) { + if (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypePointer) { auto param_nonarray_type = _.FindDef(param_nonarray_type_id); - if (param_nonarray_type->GetOperandAs(1u) == - SpvStorageClassPhysicalStorageBuffer) { + if (param_nonarray_type->GetOperandAs(1u) == + spv::StorageClass::PhysicalStorageBuffer) { // check for Aliased or Restrict const auto& decorations = _.id_decorations(inst->id()); bool foundAliased = std::any_of( decorations.begin(), decorations.end(), [](const Decoration& d) { - return SpvDecorationAliased == d.dec_type(); + return spv::Decoration::Aliased == d.dec_type(); }); bool foundRestrict = std::any_of( decorations.begin(), decorations.end(), [](const Decoration& d) { - return SpvDecorationRestrict == d.dec_type(); + return spv::Decoration::Restrict == d.dec_type(); }); if (!foundAliased && !foundRestrict) { @@ -187,20 +188,20 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _, const auto pointee_type_id = param_nonarray_type->GetOperandAs(2); const auto pointee_type = _.FindDef(pointee_type_id); - if (SpvOpTypePointer == pointee_type->opcode() && - pointee_type->GetOperandAs(1u) == - SpvStorageClassPhysicalStorageBuffer) { + if (spv::Op::OpTypePointer == pointee_type->opcode() && + pointee_type->GetOperandAs(1u) == + spv::StorageClass::PhysicalStorageBuffer) { // check for AliasedPointer/RestrictPointer const auto& decorations = _.id_decorations(inst->id()); bool foundAliased = std::any_of( decorations.begin(), decorations.end(), [](const Decoration& d) { - return SpvDecorationAliasedPointer == d.dec_type(); + return spv::Decoration::AliasedPointer == d.dec_type(); }); bool foundRestrict = std::any_of( decorations.begin(), decorations.end(), [](const Decoration& d) { - return SpvDecorationRestrictPointer == d.dec_type(); + return spv::Decoration::RestrictPointer == d.dec_type(); }); if (!foundAliased && !foundRestrict) { @@ -226,7 +227,7 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _, const Instruction* inst) { const auto function_id = inst->GetOperandAs(2); const auto function = _.FindDef(function_id); - if (!function || SpvOpFunction != function->opcode()) { + if (!function || spv::Op::OpFunction != function->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpFunctionCall Function " << _.getIdName(function_id) << " is not a function."; @@ -242,7 +243,7 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _, const auto function_type_id = function->GetOperandAs(3); const auto function_type = _.FindDef(function_type_id); - if (!function_type || function_type->opcode() != SpvOpTypeFunction) { + if (!function_type || function_type->opcode() != spv::Op::OpTypeFunction) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Missing function type definition."; } @@ -285,20 +286,21 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _, } } - if (_.addressing_model() == SpvAddressingModelLogical) { - if (parameter_type->opcode() == SpvOpTypePointer && + if (_.addressing_model() == spv::AddressingModel::Logical) { + if (parameter_type->opcode() == spv::Op::OpTypePointer && !_.options()->relax_logical_pointer) { - SpvStorageClass sc = parameter_type->GetOperandAs(1u); + spv::StorageClass sc = + parameter_type->GetOperandAs(1u); // Validate which storage classes can be pointer operands. switch (sc) { - case SpvStorageClassUniformConstant: - case SpvStorageClassFunction: - case SpvStorageClassPrivate: - case SpvStorageClassWorkgroup: - case SpvStorageClassAtomicCounter: + case spv::StorageClass::UniformConstant: + case spv::StorageClass::Function: + case spv::StorageClass::Private: + case spv::StorageClass::Workgroup: + case spv::StorageClass::AtomicCounter: // These are always allowed. break; - case SpvStorageClassStorageBuffer: + case spv::StorageClass::StorageBuffer: if (!_.features().variable_pointers) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "StorageBuffer pointer operand " @@ -313,13 +315,14 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _, } // Validate memory object declaration requirements. - if (argument->opcode() != SpvOpVariable && - argument->opcode() != SpvOpFunctionParameter) { + if (argument->opcode() != spv::Op::OpVariable && + argument->opcode() != spv::Op::OpFunctionParameter) { const bool ssbo_vptr = _.features().variable_pointers && - sc == SpvStorageClassStorageBuffer; - const bool wg_vptr = _.HasCapability(SpvCapabilityVariablePointers) && - sc == SpvStorageClassWorkgroup; - const bool uc_ptr = sc == SpvStorageClassUniformConstant; + sc == spv::StorageClass::StorageBuffer; + const bool wg_vptr = + _.HasCapability(spv::Capability::VariablePointers) && + sc == spv::StorageClass::Workgroup; + const bool uc_ptr = sc == spv::StorageClass::UniformConstant; if (!ssbo_vptr && !wg_vptr && !uc_ptr) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Pointer operand " << _.getIdName(argument_id) @@ -336,13 +339,13 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _, spv_result_t FunctionPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpFunction: + case spv::Op::OpFunction: if (auto error = ValidateFunction(_, inst)) return error; break; - case SpvOpFunctionParameter: + case spv::Op::OpFunctionParameter: if (auto error = ValidateFunctionParameter(_, inst)) return error; break; - case SpvOpFunctionCall: + case spv::Op::OpFunctionCall: if (auto error = ValidateFunctionCall(_, inst)) return error; break; default: diff --git a/3rdparty/spirv-tools/source/val/validate_id.cpp b/3rdparty/spirv-tools/source/val/validate_id.cpp index 2bab20349..89a5ddd79 100644 --- a/3rdparty/spirv-tools/source/val/validate_id.cpp +++ b/3rdparty/spirv-tools/source/val/validate_id.cpp @@ -71,7 +71,7 @@ spv_result_t CheckIdDefinitionDominateUse(ValidationState_t& _) { const Instruction* use = use_index_pair.first; if (const BasicBlock* use_block = use->block()) { if (use_block->reachable() == false) continue; - if (use->opcode() == SpvOpPhi) { + if (use->opcode() == spv::Op::OpPhi) { if (phi_ids.insert(use->id()).second) { phi_instructions.push_back(use); } @@ -131,7 +131,7 @@ spv_result_t CheckIdDefinitionDominateUse(ValidationState_t& _) { // instruction operand's ID can be forward referenced. spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { auto can_have_forward_declared_ids = - inst->opcode() == SpvOpExtInst && + inst->opcode() == spv::Op::OpExtInst && spvExtInstIsDebugInfo(inst->ext_inst_type()) ? spvDbgInfoExtOperandCanBeForwardDeclaredFunction( inst->ext_inst_type(), inst->word(4)) @@ -172,23 +172,27 @@ spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { if (spvOpcodeGeneratesType(def->opcode()) && !spvOpcodeGeneratesType(opcode) && !spvOpcodeIsDebug(opcode) && !inst->IsDebugInfo() && !inst->IsNonSemantic() && - !spvOpcodeIsDecoration(opcode) && opcode != SpvOpFunction && - opcode != SpvOpCooperativeMatrixLengthNV && - !(opcode == SpvOpSpecConstantOp && - inst->word(3) == SpvOpCooperativeMatrixLengthNV)) { + !spvOpcodeIsDecoration(opcode) && opcode != spv::Op::OpFunction && + opcode != spv::Op::OpCooperativeMatrixLengthNV && + !(opcode == spv::Op::OpSpecConstantOp && + spv::Op(inst->word(3)) == + spv::Op::OpCooperativeMatrixLengthNV)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Operand " << _.getIdName(operand_word) << " cannot be a type"; } else if (def->type_id() == 0 && !spvOpcodeGeneratesType(opcode) && !spvOpcodeIsDebug(opcode) && !inst->IsDebugInfo() && !inst->IsNonSemantic() && !spvOpcodeIsDecoration(opcode) && - !spvOpcodeIsBranch(opcode) && opcode != SpvOpPhi && - opcode != SpvOpExtInst && opcode != SpvOpExtInstImport && - opcode != SpvOpSelectionMerge && - opcode != SpvOpLoopMerge && opcode != SpvOpFunction && - opcode != SpvOpCooperativeMatrixLengthNV && - !(opcode == SpvOpSpecConstantOp && - inst->word(3) == SpvOpCooperativeMatrixLengthNV)) { + !spvOpcodeIsBranch(opcode) && opcode != spv::Op::OpPhi && + opcode != spv::Op::OpExtInst && + opcode != spv::Op::OpExtInstImport && + opcode != spv::Op::OpSelectionMerge && + opcode != spv::Op::OpLoopMerge && + opcode != spv::Op::OpFunction && + opcode != spv::Op::OpCooperativeMatrixLengthNV && + !(opcode == spv::Op::OpSpecConstantOp && + spv::Op(inst->word(3)) == + spv::Op::OpCooperativeMatrixLengthNV)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Operand " << _.getIdName(operand_word) << " requires a type"; diff --git a/3rdparty/spirv-tools/source/val/validate_image.cpp b/3rdparty/spirv-tools/source/val/validate_image.cpp index 9c7c8c1c1..8f0e6c4d4 100644 --- a/3rdparty/spirv-tools/source/val/validate_image.cpp +++ b/3rdparty/spirv-tools/source/val/validate_image.cpp @@ -32,47 +32,47 @@ namespace spvtools { namespace val { namespace { -// Performs compile time check that all SpvImageOperandsXXX cases are handled in -// this module. If SpvImageOperandsXXX list changes, this function will fail the -// build. -// For all other purposes this is a placeholder function. +// Performs compile time check that all spv::ImageOperandsMask::XXX cases are +// handled in this module. If spv::ImageOperandsMask::XXX list changes, this +// function will fail the build. For all other purposes this is a placeholder +// function. bool CheckAllImageOperandsHandled() { - SpvImageOperandsMask enum_val = SpvImageOperandsBiasMask; + spv::ImageOperandsMask enum_val = spv::ImageOperandsMask::Bias; // Some improvised code to prevent the compiler from considering enum_val // constant and optimizing the switch away. uint32_t stack_var = 0; if (reinterpret_cast(&stack_var) % 256) - enum_val = SpvImageOperandsLodMask; + enum_val = spv::ImageOperandsMask::Lod; switch (enum_val) { // Please update the validation rules in this module if you are changing // the list of image operands, and add new enum values to this switch. - case SpvImageOperandsMaskNone: + case spv::ImageOperandsMask::MaskNone: return false; - case SpvImageOperandsBiasMask: - case SpvImageOperandsLodMask: - case SpvImageOperandsGradMask: - case SpvImageOperandsConstOffsetMask: - case SpvImageOperandsOffsetMask: - case SpvImageOperandsConstOffsetsMask: - case SpvImageOperandsSampleMask: - case SpvImageOperandsMinLodMask: + case spv::ImageOperandsMask::Bias: + case spv::ImageOperandsMask::Lod: + case spv::ImageOperandsMask::Grad: + case spv::ImageOperandsMask::ConstOffset: + case spv::ImageOperandsMask::Offset: + case spv::ImageOperandsMask::ConstOffsets: + case spv::ImageOperandsMask::Sample: + case spv::ImageOperandsMask::MinLod: // TODO(dneto): Support image operands related to the Vulkan memory model. // https://gitlab.khronos.org/spirv/spirv-tools/issues/32 - case SpvImageOperandsMakeTexelAvailableKHRMask: - case SpvImageOperandsMakeTexelVisibleKHRMask: - case SpvImageOperandsNonPrivateTexelKHRMask: - case SpvImageOperandsVolatileTexelKHRMask: - case SpvImageOperandsSignExtendMask: - case SpvImageOperandsZeroExtendMask: + case spv::ImageOperandsMask::MakeTexelAvailableKHR: + case spv::ImageOperandsMask::MakeTexelVisibleKHR: + case spv::ImageOperandsMask::NonPrivateTexelKHR: + case spv::ImageOperandsMask::VolatileTexelKHR: + case spv::ImageOperandsMask::SignExtend: + case spv::ImageOperandsMask::ZeroExtend: // TODO(jaebaek): Move this line properly after handling image offsets // operand. This line temporarily fixes CI failure that // blocks other PRs. // https://github.com/KhronosGroup/SPIRV-Tools/issues/4565 - case SpvImageOperandsOffsetsMask: - case SpvImageOperandsNontemporalMask: + case spv::ImageOperandsMask::Offsets: + case spv::ImageOperandsMask::Nontemporal: return true; } return false; @@ -81,13 +81,13 @@ bool CheckAllImageOperandsHandled() { // Used by GetImageTypeInfo. See OpTypeImage spec for more information. struct ImageTypeInfo { uint32_t sampled_type = 0; - SpvDim dim = SpvDimMax; + spv::Dim dim = spv::Dim::Max; uint32_t depth = 0; uint32_t arrayed = 0; uint32_t multisampled = 0; uint32_t sampled = 0; - SpvImageFormat format = SpvImageFormatMax; - SpvAccessQualifier access_qualifier = SpvAccessQualifierMax; + spv::ImageFormat format = spv::ImageFormat::Max; + spv::AccessQualifier access_qualifier = spv::AccessQualifier::Max; }; // Provides information on image type. |id| should be object of either @@ -100,39 +100,39 @@ bool GetImageTypeInfo(const ValidationState_t& _, uint32_t id, const Instruction* inst = _.FindDef(id); assert(inst); - if (inst->opcode() == SpvOpTypeSampledImage) { + if (inst->opcode() == spv::Op::OpTypeSampledImage) { inst = _.FindDef(inst->word(2)); assert(inst); } - if (inst->opcode() != SpvOpTypeImage) return false; + if (inst->opcode() != spv::Op::OpTypeImage) return false; const size_t num_words = inst->words().size(); if (num_words != 9 && num_words != 10) return false; info->sampled_type = inst->word(2); - info->dim = static_cast(inst->word(3)); + info->dim = static_cast(inst->word(3)); info->depth = inst->word(4); info->arrayed = inst->word(5); info->multisampled = inst->word(6); info->sampled = inst->word(7); - info->format = static_cast(inst->word(8)); - info->access_qualifier = num_words < 10 - ? SpvAccessQualifierMax - : static_cast(inst->word(9)); + info->format = static_cast(inst->word(8)); + info->access_qualifier = + num_words < 10 ? spv::AccessQualifier::Max + : static_cast(inst->word(9)); return true; } -bool IsImplicitLod(SpvOp opcode) { +bool IsImplicitLod(spv::Op opcode) { switch (opcode) { - case SpvOpImageSampleImplicitLod: - case SpvOpImageSampleDrefImplicitLod: - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageSparseSampleProjImplicitLod: - case SpvOpImageSparseSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseSampleProjImplicitLod: + case spv::Op::OpImageSparseSampleProjDrefImplicitLod: return true; default: break; @@ -140,16 +140,16 @@ bool IsImplicitLod(SpvOp opcode) { return false; } -bool IsExplicitLod(SpvOp opcode) { +bool IsExplicitLod(spv::Op opcode) { switch (opcode) { - case SpvOpImageSampleExplicitLod: - case SpvOpImageSampleDrefExplicitLod: - case SpvOpImageSampleProjExplicitLod: - case SpvOpImageSampleProjDrefExplicitLod: - case SpvOpImageSparseSampleExplicitLod: - case SpvOpImageSparseSampleDrefExplicitLod: - case SpvOpImageSparseSampleProjExplicitLod: - case SpvOpImageSparseSampleProjDrefExplicitLod: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSparseSampleProjExplicitLod: + case spv::Op::OpImageSparseSampleProjDrefExplicitLod: return true; default: break; @@ -157,22 +157,22 @@ bool IsExplicitLod(SpvOp opcode) { return false; } -bool IsValidLodOperand(const ValidationState_t& _, SpvOp opcode) { +bool IsValidLodOperand(const ValidationState_t& _, spv::Op opcode) { switch (opcode) { - case SpvOpImageRead: - case SpvOpImageWrite: - case SpvOpImageSparseRead: - return _.HasCapability(SpvCapabilityImageReadWriteLodAMD); + case spv::Op::OpImageRead: + case spv::Op::OpImageWrite: + case spv::Op::OpImageSparseRead: + return _.HasCapability(spv::Capability::ImageReadWriteLodAMD); default: return IsExplicitLod(opcode); } } -bool IsValidGatherLodBiasAMD(const ValidationState_t& _, SpvOp opcode) { +bool IsValidGatherLodBiasAMD(const ValidationState_t& _, spv::Op opcode) { switch (opcode) { - case SpvOpImageGather: - case SpvOpImageSparseGather: - return _.HasCapability(SpvCapabilityImageGatherBiasLodAMD); + case spv::Op::OpImageGather: + case spv::Op::OpImageSparseGather: + return _.HasCapability(spv::Capability::ImageGatherBiasLodAMD); default: break; } @@ -181,16 +181,16 @@ bool IsValidGatherLodBiasAMD(const ValidationState_t& _, SpvOp opcode) { // Returns true if the opcode is a Image instruction which applies // homogenous projection to the coordinates. -bool IsProj(SpvOp opcode) { +bool IsProj(spv::Op opcode) { switch (opcode) { - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleProjImplicitLod: - case SpvOpImageSparseSampleProjDrefImplicitLod: - case SpvOpImageSampleProjExplicitLod: - case SpvOpImageSampleProjDrefExplicitLod: - case SpvOpImageSparseSampleProjExplicitLod: - case SpvOpImageSparseSampleProjDrefExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleProjImplicitLod: + case spv::Op::OpImageSparseSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseSampleProjExplicitLod: + case spv::Op::OpImageSparseSampleProjDrefExplicitLod: return true; default: break; @@ -204,21 +204,21 @@ uint32_t GetPlaneCoordSize(const ImageTypeInfo& info) { uint32_t plane_size = 0; // If this switch breaks your build, please add new values below. switch (info.dim) { - case SpvDim1D: - case SpvDimBuffer: + case spv::Dim::Dim1D: + case spv::Dim::Buffer: plane_size = 1; break; - case SpvDim2D: - case SpvDimRect: - case SpvDimSubpassData: + case spv::Dim::Dim2D: + case spv::Dim::Rect: + case spv::Dim::SubpassData: plane_size = 2; break; - case SpvDim3D: - case SpvDimCube: + case spv::Dim::Dim3D: + case spv::Dim::Cube: // For Cube direction vector is used instead of UV. plane_size = 3; break; - case SpvDimMax: + case spv::Dim::Max: assert(0); break; } @@ -228,10 +228,10 @@ uint32_t GetPlaneCoordSize(const ImageTypeInfo& info) { // Returns minimal number of coordinates based on image dim, arrayed and whether // the instruction uses projection coordinates. -uint32_t GetMinCoordSize(SpvOp opcode, const ImageTypeInfo& info) { - if (info.dim == SpvDimCube && - (opcode == SpvOpImageRead || opcode == SpvOpImageWrite || - opcode == SpvOpImageSparseRead)) { +uint32_t GetMinCoordSize(spv::Op opcode, const ImageTypeInfo& info) { + if (info.dim == spv::Dim::Cube && + (opcode == spv::Op::OpImageRead || opcode == spv::Op::OpImageWrite || + opcode == spv::Op::OpImageSparseRead)) { // These opcodes use UV for Cube, not direction vector. return 3; } @@ -248,7 +248,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, static const bool kAllImageOperandsHandled = CheckAllImageOperandsHandled(); (void)kAllImageOperandsHandled; - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const size_t num_words = inst->words().size(); const bool have_explicit_mask = (word_index - 1 < num_words); @@ -257,14 +257,14 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, if (have_explicit_mask) { // NonPrivate, Volatile, SignExtend, ZeroExtend take no operand words. const uint32_t mask_bits_having_operands = - mask & ~uint32_t(SpvImageOperandsNonPrivateTexelKHRMask | - SpvImageOperandsVolatileTexelKHRMask | - SpvImageOperandsSignExtendMask | - SpvImageOperandsZeroExtendMask | - SpvImageOperandsNontemporalMask); + mask & ~uint32_t(spv::ImageOperandsMask::NonPrivateTexelKHR | + spv::ImageOperandsMask::VolatileTexelKHR | + spv::ImageOperandsMask::SignExtend | + spv::ImageOperandsMask::ZeroExtend | + spv::ImageOperandsMask::Nontemporal); size_t expected_num_image_operand_words = spvtools::utils::CountSetBits(mask_bits_having_operands); - if (mask & SpvImageOperandsGradMask) { + if (mask & uint32_t(spv::ImageOperandsMask::Grad)) { // Grad uses two words. ++expected_num_image_operand_words; } @@ -279,7 +279,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, << "Number of image operand ids doesn't correspond to the bit mask"; } - if (info.multisampled & (0 == (mask & SpvImageOperandsSampleMask))) { + if (info.multisampled & + (0 == (mask & uint32_t(spv::ImageOperandsMask::Sample)))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Sample is required for operation on " "multi-sampled image"; @@ -289,10 +290,11 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // the module to be invalid. if (mask == 0) return SPV_SUCCESS; - if (spvtools::utils::CountSetBits(mask & (SpvImageOperandsOffsetMask | - SpvImageOperandsConstOffsetMask | - SpvImageOperandsConstOffsetsMask | - SpvImageOperandsOffsetsMask)) > 1) { + if (spvtools::utils::CountSetBits( + mask & uint32_t(spv::ImageOperandsMask::Offset | + spv::ImageOperandsMask::ConstOffset | + spv::ImageOperandsMask::ConstOffsets | + spv::ImageOperandsMask::Offsets)) > 1) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4662) << "Image Operands Offset, ConstOffset, ConstOffsets, Offsets " @@ -306,7 +308,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // The checks should be done in the order of definition of OperandImage. - if (mask & SpvImageOperandsBiasMask) { + if (mask & uint32_t(spv::ImageOperandsMask::Bias)) { if (!is_implicit_lod && !is_valid_gather_lod_bias_amd) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Bias can only be used with ImplicitLod opcodes"; @@ -318,8 +320,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, << "Expected Image Operand Bias to be float scalar"; } - if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && - info.dim != SpvDimCube) { + if (info.dim != spv::Dim::Dim1D && info.dim != spv::Dim::Dim2D && + info.dim != spv::Dim::Dim3D && info.dim != spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Bias requires 'Dim' parameter to be 1D, 2D, 3D " "or Cube"; @@ -328,15 +330,16 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // Multisampled is already checked. } - if (mask & SpvImageOperandsLodMask) { - if (!is_valid_lod_operand && opcode != SpvOpImageFetch && - opcode != SpvOpImageSparseFetch && !is_valid_gather_lod_bias_amd) { + if (mask & uint32_t(spv::ImageOperandsMask::Lod)) { + if (!is_valid_lod_operand && opcode != spv::Op::OpImageFetch && + opcode != spv::Op::OpImageSparseFetch && + !is_valid_gather_lod_bias_amd) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Lod can only be used with ExplicitLod opcodes " << "and OpImageFetch"; } - if (mask & SpvImageOperandsGradMask) { + if (mask & uint32_t(spv::ImageOperandsMask::Grad)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand bits Lod and Grad cannot be set at the same " "time"; @@ -357,8 +360,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, } } - if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && - info.dim != SpvDimCube) { + if (info.dim != spv::Dim::Dim1D && info.dim != spv::Dim::Dim2D && + info.dim != spv::Dim::Dim3D && info.dim != spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Lod requires 'Dim' parameter to be 1D, 2D, 3D " "or Cube"; @@ -367,7 +370,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // Multisampled is already checked. } - if (mask & SpvImageOperandsGradMask) { + if (mask & uint32_t(spv::ImageOperandsMask::Grad)) { if (!is_explicit_lod) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Grad can only be used with ExplicitLod opcodes"; @@ -400,8 +403,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // Multisampled is already checked. } - if (mask & SpvImageOperandsConstOffsetMask) { - if (info.dim == SpvDimCube) { + if (mask & uint32_t(spv::ImageOperandsMask::ConstOffset)) { + if (info.dim == spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand ConstOffset cannot be used with Cube Image " "'Dim'"; @@ -429,8 +432,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, } } - if (mask & SpvImageOperandsOffsetMask) { - if (info.dim == SpvDimCube) { + if (mask & uint32_t(spv::ImageOperandsMask::Offset)) { + if (info.dim == spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Offset cannot be used with Cube Image 'Dim'"; } @@ -453,9 +456,10 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, if (!_.options()->before_hlsl_legalization && spvIsVulkanEnv(_.context()->target_env)) { - if (opcode != SpvOpImageGather && opcode != SpvOpImageDrefGather && - opcode != SpvOpImageSparseGather && - opcode != SpvOpImageSparseDrefGather) { + if (opcode != spv::Op::OpImageGather && + opcode != spv::Op::OpImageDrefGather && + opcode != spv::Op::OpImageSparseGather && + opcode != spv::Op::OpImageSparseDrefGather) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4663) << "Image Operand Offset can only be used with " @@ -464,16 +468,17 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, } } - if (mask & SpvImageOperandsConstOffsetsMask) { - if (opcode != SpvOpImageGather && opcode != SpvOpImageDrefGather && - opcode != SpvOpImageSparseGather && - opcode != SpvOpImageSparseDrefGather) { + if (mask & uint32_t(spv::ImageOperandsMask::ConstOffsets)) { + if (opcode != spv::Op::OpImageGather && + opcode != spv::Op::OpImageDrefGather && + opcode != spv::Op::OpImageSparseGather && + opcode != spv::Op::OpImageSparseDrefGather) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand ConstOffsets can only be used with " "OpImageGather and OpImageDrefGather"; } - if (info.dim == SpvDimCube) { + if (info.dim == spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand ConstOffsets cannot be used with Cube Image " "'Dim'"; @@ -484,7 +489,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, const Instruction* type_inst = _.FindDef(type_id); assert(type_inst); - if (type_inst->opcode() != SpvOpTypeArray) { + if (type_inst->opcode() != spv::Op::OpTypeArray) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image Operand ConstOffsets to be an array of size 4"; } @@ -513,10 +518,11 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, } } - if (mask & SpvImageOperandsSampleMask) { - if (opcode != SpvOpImageFetch && opcode != SpvOpImageRead && - opcode != SpvOpImageWrite && opcode != SpvOpImageSparseFetch && - opcode != SpvOpImageSparseRead) { + if (mask & uint32_t(spv::ImageOperandsMask::Sample)) { + if (opcode != spv::Op::OpImageFetch && opcode != spv::Op::OpImageRead && + opcode != spv::Op::OpImageWrite && + opcode != spv::Op::OpImageSparseFetch && + opcode != spv::Op::OpImageSparseRead) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand Sample can only be used with OpImageFetch, " << "OpImageRead, OpImageWrite, OpImageSparseFetch and " @@ -535,8 +541,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, } } - if (mask & SpvImageOperandsMinLodMask) { - if (!is_implicit_lod && !(mask & SpvImageOperandsGradMask)) { + if (mask & uint32_t(spv::ImageOperandsMask::MinLod)) { + if (!is_implicit_lod && !(mask & uint32_t(spv::ImageOperandsMask::Grad))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand MinLod can only be used with ImplicitLod " << "opcodes or together with Image Operand Grad"; @@ -548,8 +554,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, << "Expected Image Operand MinLod to be float scalar"; } - if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && - info.dim != SpvDimCube) { + if (info.dim != spv::Dim::Dim1D && info.dim != spv::Dim::Dim2D && + info.dim != spv::Dim::Dim3D && info.dim != spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand MinLod requires 'Dim' parameter to be 1D, 2D, " "3D or Cube"; @@ -561,16 +567,16 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, } } - if (mask & SpvImageOperandsMakeTexelAvailableKHRMask) { + if (mask & uint32_t(spv::ImageOperandsMask::MakeTexelAvailableKHR)) { // Checked elsewhere: capability and memory model are correct. - if (opcode != SpvOpImageWrite) { + if (opcode != spv::Op::OpImageWrite) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand MakeTexelAvailableKHR can only be used with Op" - << spvOpcodeString(SpvOpImageWrite) << ": Op" + << spvOpcodeString(spv::Op::OpImageWrite) << ": Op" << spvOpcodeString(opcode); } - if (!(mask & SpvImageOperandsNonPrivateTexelKHRMask)) { + if (!(mask & uint32_t(spv::ImageOperandsMask::NonPrivateTexelKHR))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand MakeTexelAvailableKHR requires " "NonPrivateTexelKHR is also specified: Op" @@ -582,17 +588,18 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, return error; } - if (mask & SpvImageOperandsMakeTexelVisibleKHRMask) { + if (mask & uint32_t(spv::ImageOperandsMask::MakeTexelVisibleKHR)) { // Checked elsewhere: capability and memory model are correct. - if (opcode != SpvOpImageRead && opcode != SpvOpImageSparseRead) { + if (opcode != spv::Op::OpImageRead && + opcode != spv::Op::OpImageSparseRead) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand MakeTexelVisibleKHR can only be used with Op" - << spvOpcodeString(SpvOpImageRead) << " or Op" - << spvOpcodeString(SpvOpImageSparseRead) << ": Op" + << spvOpcodeString(spv::Op::OpImageRead) << " or Op" + << spvOpcodeString(spv::Op::OpImageSparseRead) << ": Op" << spvOpcodeString(opcode); } - if (!(mask & SpvImageOperandsNonPrivateTexelKHRMask)) { + if (!(mask & uint32_t(spv::ImageOperandsMask::NonPrivateTexelKHR))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Operand MakeTexelVisibleKHR requires NonPrivateTexelKHR " "is also specified: Op" @@ -603,7 +610,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, if (auto error = ValidateMemoryScope(_, inst, visible_scope)) return error; } - if (mask & SpvImageOperandsSignExtendMask) { + if (mask & uint32_t(spv::ImageOperandsMask::SignExtend)) { // Checked elsewhere: SPIR-V 1.4 version or later. // "The texel value is converted to the target value via sign extension. @@ -616,7 +623,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // setup. } - if (mask & SpvImageOperandsZeroExtendMask) { + if (mask & uint32_t(spv::ImageOperandsMask::ZeroExtend)) { // Checked elsewhere: SPIR-V 1.4 version or later. // "The texel value is converted to the target value via zero extension. @@ -629,11 +636,11 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // setup. } - if (mask & SpvImageOperandsOffsetsMask) { + if (mask & uint32_t(spv::ImageOperandsMask::Offsets)) { // TODO: add validation } - if (mask & SpvImageOperandsNontemporalMask) { + if (mask & uint32_t(spv::ImageOperandsMask::Nontemporal)) { // Checked elsewhere: SPIR-V 1.6 version or later. } @@ -643,8 +650,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _, // Validate OpImage*Proj* instructions spv_result_t ValidateImageProj(ValidationState_t& _, const Instruction* inst, const ImageTypeInfo& info) { - if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && - info.dim != SpvDimRect) { + if (info.dim != spv::Dim::Dim1D && info.dim != spv::Dim::Dim2D && + info.dim != spv::Dim::Dim3D && info.dim != spv::Dim::Rect) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image 'Dim' parameter to be 1D, 2D, 3D or Rect"; } @@ -667,25 +674,27 @@ spv_result_t ValidateImageReadWrite(ValidationState_t& _, const Instruction* inst, const ImageTypeInfo& info) { if (info.sampled == 2) { - if (info.dim == SpvDim1D && !_.HasCapability(SpvCapabilityImage1D)) { + if (info.dim == spv::Dim::Dim1D && + !_.HasCapability(spv::Capability::Image1D)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability Image1D is required to access storage image"; - } else if (info.dim == SpvDimRect && - !_.HasCapability(SpvCapabilityImageRect)) { + } else if (info.dim == spv::Dim::Rect && + !_.HasCapability(spv::Capability::ImageRect)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability ImageRect is required to access storage image"; - } else if (info.dim == SpvDimBuffer && - !_.HasCapability(SpvCapabilityImageBuffer)) { + } else if (info.dim == spv::Dim::Buffer && + !_.HasCapability(spv::Capability::ImageBuffer)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability ImageBuffer is required to access storage image"; - } else if (info.dim == SpvDimCube && info.arrayed == 1 && - !_.HasCapability(SpvCapabilityImageCubeArray)) { + } else if (info.dim == spv::Dim::Cube && info.arrayed == 1 && + !_.HasCapability(spv::Capability::ImageCubeArray)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability ImageCubeArray is required to access " << "storage image"; } - if (info.multisampled == 1 && !_.HasCapability(SpvCapabilityImageMSArray)) { + if (info.multisampled == 1 && + !_.HasCapability(spv::Capability::ImageMSArray)) { #if 0 // TODO(atgoo@github.com) The description of this rule in the spec // is unclear and Glslang doesn't declare ImageMSArray. Need to clarify @@ -704,21 +713,21 @@ spv_result_t ValidateImageReadWrite(ValidationState_t& _, } // Returns true if opcode is *ImageSparse*, false otherwise. -bool IsSparse(SpvOp opcode) { +bool IsSparse(spv::Op opcode) { switch (opcode) { - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleExplicitLod: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageSparseSampleDrefExplicitLod: - case SpvOpImageSparseSampleProjImplicitLod: - case SpvOpImageSparseSampleProjExplicitLod: - case SpvOpImageSparseSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleProjDrefExplicitLod: - case SpvOpImageSparseFetch: - case SpvOpImageSparseGather: - case SpvOpImageSparseDrefGather: - case SpvOpImageSparseTexelsResident: - case SpvOpImageSparseRead: { + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSparseSampleProjImplicitLod: + case spv::Op::OpImageSparseSampleProjExplicitLod: + case spv::Op::OpImageSparseSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseFetch: + case spv::Op::OpImageSparseGather: + case spv::Op::OpImageSparseDrefGather: + case spv::Op::OpImageSparseTexelsResident: + case spv::Op::OpImageSparseRead: { return true; } @@ -733,13 +742,13 @@ bool IsSparse(SpvOp opcode) { // Not valid for sparse image opcodes which do not return a struct. spv_result_t GetActualResultType(ValidationState_t& _, const Instruction* inst, uint32_t* actual_result_type) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); if (IsSparse(opcode)) { const Instruction* const type_inst = _.FindDef(inst->type_id()); assert(type_inst); - if (!type_inst || type_inst->opcode() != SpvOpTypeStruct) { + if (!type_inst || type_inst->opcode() != spv::Op::OpTypeStruct) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypeStruct"; } @@ -761,7 +770,7 @@ spv_result_t GetActualResultType(ValidationState_t& _, const Instruction* inst, // Returns a string describing actual result type of an opcode. // Not valid for sparse image opcodes which do not return a struct. -const char* GetActualResultTypeStr(SpvOp opcode) { +const char* GetActualResultTypeStr(spv::Op opcode) { if (IsSparse(opcode)) return "Result Type's second member"; return "Result Type"; } @@ -777,7 +786,7 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { if (_.IsIntScalarType(info.sampled_type) && (64 == _.GetBitWidth(info.sampled_type)) && - !_.HasCapability(SpvCapabilityInt64ImageEXT)) { + !_.HasCapability(spv::Capability::Int64ImageEXT)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability Int64ImageEXT is required when using Sampled Type of " "64-bit int"; @@ -802,10 +811,10 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { << "Sampled Type must be OpTypeVoid in the OpenCL environment."; } } else { - const SpvOp sampled_type_opcode = _.GetIdOpcode(info.sampled_type); - if (sampled_type_opcode != SpvOpTypeVoid && - sampled_type_opcode != SpvOpTypeInt && - sampled_type_opcode != SpvOpTypeFloat) { + const spv::Op sampled_type_opcode = _.GetIdOpcode(info.sampled_type); + if (sampled_type_opcode != spv::Op::OpTypeVoid && + sampled_type_opcode != spv::Op::OpTypeInt && + sampled_type_opcode != spv::Op::OpTypeFloat) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Sampled Type to be either void or" << " numerical scalar type"; @@ -835,19 +844,19 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { << "Invalid Sampled " << info.sampled << " (must be 0, 1 or 2)"; } - if (info.dim == SpvDimSubpassData) { + if (info.dim == spv::Dim::SubpassData) { if (info.sampled != 2) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(6214) << "Dim SubpassData requires Sampled to be 2"; } - if (info.format != SpvImageFormatUnknown) { + if (info.format != spv::ImageFormat::Unknown) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Dim SubpassData requires format Unknown"; } } else { if (info.multisampled && (info.sampled == 2) && - !_.HasCapability(SpvCapabilityStorageImageMultisample)) { + !_.HasCapability(spv::Capability::StorageImageMultisample)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability StorageImageMultisample is required when using " "multisampled storage image"; @@ -855,8 +864,8 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { } if (spvIsOpenCLEnv(target_env)) { - if ((info.arrayed == 1) && (info.dim != SpvDim1D) && - (info.dim != SpvDim2D)) { + if ((info.arrayed == 1) && (info.dim != spv::Dim::Dim1D) && + (info.dim != spv::Dim::Dim2D)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "In the OpenCL environment, Arrayed may only be set to 1 " << "when Dim is either 1D or 2D."; @@ -872,7 +881,7 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { << "Sampled must be 0 in the OpenCL environment."; } - if (info.access_qualifier == SpvAccessQualifierMax) { + if (info.access_qualifier == spv::AccessQualifier::Max) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "In the OpenCL environment, the optional Access Qualifier" << " must be present."; @@ -886,7 +895,7 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { << "Sampled must be 1 or 2 in the Vulkan environment."; } - if (info.dim == SpvDimSubpassData && info.arrayed != 0) { + if (info.dim == spv::Dim::SubpassData && info.arrayed != 0) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(6214) << "Dim SubpassData requires Arrayed to be 0"; } @@ -898,7 +907,7 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateTypeSampledImage(ValidationState_t& _, const Instruction* inst) { const uint32_t image_type = inst->word(2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage"; } @@ -918,7 +927,8 @@ spv_result_t ValidateTypeSampledImage(ValidationState_t& _, } // This covers both OpTypeSampledImage and OpSampledImage. - if (_.version() >= SPV_SPIRV_VERSION_WORD(1, 6) && info.dim == SpvDimBuffer) { + if (_.version() >= SPV_SPIRV_VERSION_WORD(1, 6) && + info.dim == spv::Dim::Buffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "In SPIR-V 1.6 or later, sampled image dimension must not be " "Buffer"; @@ -927,31 +937,31 @@ spv_result_t ValidateTypeSampledImage(ValidationState_t& _, return SPV_SUCCESS; } -bool IsAllowedSampledImageOperand(SpvOp opcode, ValidationState_t& _) { +bool IsAllowedSampledImageOperand(spv::Op opcode, ValidationState_t& _) { switch (opcode) { - case SpvOpSampledImage: - case SpvOpImageSampleImplicitLod: - case SpvOpImageSampleExplicitLod: - case SpvOpImageSampleDrefImplicitLod: - case SpvOpImageSampleDrefExplicitLod: - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjExplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSampleProjDrefExplicitLod: - case SpvOpImageGather: - case SpvOpImageDrefGather: - case SpvOpImage: - case SpvOpImageQueryLod: - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleExplicitLod: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageSparseSampleDrefExplicitLod: - case SpvOpImageSparseGather: - case SpvOpImageSparseDrefGather: - case SpvOpCopyObject: + case spv::Op::OpSampledImage: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageGather: + case spv::Op::OpImageDrefGather: + case spv::Op::OpImage: + case spv::Op::OpImageQueryLod: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSparseGather: + case spv::Op::OpImageSparseDrefGather: + case spv::Op::OpCopyObject: return true; - case SpvOpStore: - if (_.HasCapability(SpvCapabilityBindlessTextureNV)) return true; + case spv::Op::OpStore: + if (_.HasCapability(spv::Capability::BindlessTextureNV)) return true; return false; default: return false; @@ -960,13 +970,13 @@ bool IsAllowedSampledImageOperand(SpvOp opcode, ValidationState_t& _) { spv_result_t ValidateSampledImage(ValidationState_t& _, const Instruction* inst) { - if (_.GetIdOpcode(inst->type_id()) != SpvOpTypeSampledImage) { + if (_.GetIdOpcode(inst->type_id()) != spv::Op::OpTypeSampledImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypeSampledImage."; } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage."; } @@ -994,12 +1004,12 @@ spv_result_t ValidateSampledImage(ValidationState_t& _, } } - if (info.dim == SpvDimSubpassData) { + if (info.dim == spv::Dim::SubpassData) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image 'Dim' parameter to be not SubpassData."; } - if (_.GetIdOpcode(_.GetOperandTypeId(inst, 3)) != SpvOpTypeSampler) { + if (_.GetIdOpcode(_.GetOperandTypeId(inst, 3)) != spv::Op::OpTypeSampler) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Sampler to be of type OpTypeSampler"; } @@ -1027,12 +1037,13 @@ spv_result_t ValidateSampledImage(ValidationState_t& _, << _.getIdName(consumer_instr->id()) << "."; } - if (consumer_opcode == SpvOpPhi || consumer_opcode == SpvOpSelect) { + if (consumer_opcode == spv::Op::OpPhi || + consumer_opcode == spv::Op::OpSelect) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Result from OpSampledImage instruction must not appear " "as " "operands of Op" - << spvOpcodeString(static_cast(consumer_opcode)) << "." + << spvOpcodeString(static_cast(consumer_opcode)) << "." << " Found result " << _.getIdName(inst->id()) << " as an operand of " << _.getIdName(consumer_instr->id()) << "."; @@ -1042,7 +1053,7 @@ spv_result_t ValidateSampledImage(ValidationState_t& _, return _.diag(SPV_ERROR_INVALID_ID, inst) << "Result from OpSampledImage instruction must not appear " "as operand for Op" - << spvOpcodeString(static_cast(consumer_opcode)) + << spvOpcodeString(static_cast(consumer_opcode)) << ", since it is not specified as taking an " << "OpTypeSampledImage." << " Found result " << _.getIdName(inst->id()) @@ -1057,13 +1068,13 @@ spv_result_t ValidateSampledImage(ValidationState_t& _, spv_result_t ValidateImageTexelPointer(ValidationState_t& _, const Instruction* inst) { const auto result_type = _.FindDef(inst->type_id()); - if (result_type->opcode() != SpvOpTypePointer) { + if (result_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypePointer"; } - const auto storage_class = result_type->GetOperandAs(1); - if (storage_class != SpvStorageClassImage) { + const auto storage_class = result_type->GetOperandAs(1); + if (storage_class != spv::StorageClass::Image) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypePointer whose Storage Class " "operand is Image"; @@ -1071,21 +1082,21 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, const auto ptr_type = result_type->GetOperandAs(2); const auto ptr_opcode = _.GetIdOpcode(ptr_type); - if (ptr_opcode != SpvOpTypeInt && ptr_opcode != SpvOpTypeFloat && - ptr_opcode != SpvOpTypeVoid) { + if (ptr_opcode != spv::Op::OpTypeInt && ptr_opcode != spv::Op::OpTypeFloat && + ptr_opcode != spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypePointer whose Type operand " "must be a scalar numerical type or OpTypeVoid"; } const auto image_ptr = _.FindDef(_.GetOperandTypeId(inst, 2)); - if (!image_ptr || image_ptr->opcode() != SpvOpTypePointer) { + if (!image_ptr || image_ptr->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be OpTypePointer"; } const auto image_type = image_ptr->GetOperandAs(2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be OpTypePointer with Type OpTypeImage"; } @@ -1102,7 +1113,7 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, "pointed to by Result Type"; } - if (info.dim == SpvDimSubpassData) { + if (info.dim == spv::Dim::SubpassData) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Dim SubpassData cannot be used with OpImageTexelPointer"; } @@ -1118,11 +1129,11 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, expected_coord_size = GetPlaneCoordSize(info); } else if (info.arrayed == 1) { switch (info.dim) { - case SpvDim1D: + case spv::Dim::Dim1D: expected_coord_size = 2; break; - case SpvDimCube: - case SpvDim2D: + case spv::Dim::Cube: + case spv::Dim::Dim2D: expected_coord_size = 3; break; default: @@ -1157,11 +1168,11 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, } if (spvIsVulkanEnv(_.context()->target_env)) { - if ((info.format != SpvImageFormatR64i) && - (info.format != SpvImageFormatR64ui) && - (info.format != SpvImageFormatR32f) && - (info.format != SpvImageFormatR32i) && - (info.format != SpvImageFormatR32ui)) { + if ((info.format != spv::ImageFormat::R64i) && + (info.format != spv::ImageFormat::R64ui) && + (info.format != spv::ImageFormat::R32f) && + (info.format != spv::ImageFormat::R32i) && + (info.format != spv::ImageFormat::R32ui)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4658) << "Expected the Image Format in Image to be R64i, R64ui, R32f, " @@ -1173,7 +1184,7 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, } spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); uint32_t actual_result_type = 0; if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) { return error; @@ -1193,7 +1204,7 @@ spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) { } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeSampledImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Sampled Image to be of type OpTypeSampledImage"; } @@ -1216,7 +1227,7 @@ spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) { << "Sampling operation is invalid for multisample image"; } - if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + if (_.GetIdOpcode(info.sampled_type) != spv::Op::OpTypeVoid) { const uint32_t texel_component_type = _.GetComponentType(actual_result_type); if (texel_component_type != info.sampled_type) { @@ -1227,9 +1238,9 @@ spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) { } const uint32_t coord_type = _.GetOperandTypeId(inst, 3); - if ((opcode == SpvOpImageSampleExplicitLod || - opcode == SpvOpImageSparseSampleExplicitLod) && - _.HasCapability(SpvCapabilityKernel)) { + if ((opcode == spv::Op::OpImageSampleExplicitLod || + opcode == spv::Op::OpImageSparseSampleExplicitLod) && + _.HasCapability(spv::Capability::Kernel)) { if (!_.IsFloatScalarOrVectorType(coord_type) && !_.IsIntScalarOrVectorType(coord_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1252,9 +1263,9 @@ spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) { const uint32_t mask = inst->words().size() <= 5 ? 0 : inst->word(5); - if (mask & SpvImageOperandsConstOffsetMask) { + if (mask & uint32_t(spv::ImageOperandsMask::ConstOffset)) { if (spvIsOpenCLEnv(_.context()->target_env)) { - if (opcode == SpvOpImageSampleExplicitLod) { + if (opcode == spv::Op::OpImageSampleExplicitLod) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "ConstOffset image operand not allowed " << "in the OpenCL environment."; @@ -1279,7 +1290,7 @@ spv_result_t ValidateImageDref(ValidationState_t& _, const Instruction* inst, } if (spvIsVulkanEnv(_.context()->target_env)) { - if (info.dim == SpvDim3D) { + if (info.dim == spv::Dim::Dim3D) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4777) << "In Vulkan, OpImage*Dref* instructions must not use images " @@ -1292,7 +1303,7 @@ spv_result_t ValidateImageDref(ValidationState_t& _, const Instruction* inst, spv_result_t ValidateImageDrefLod(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); uint32_t actual_result_type = 0; if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) { return error; @@ -1306,7 +1317,7 @@ spv_result_t ValidateImageDrefLod(ValidationState_t& _, } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeSampledImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Sampled Image to be of type OpTypeSampledImage"; } @@ -1364,7 +1375,7 @@ spv_result_t ValidateImageFetch(ValidationState_t& _, const Instruction* inst) { return error; } - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); if (!_.IsIntVectorType(actual_result_type) && !_.IsFloatVectorType(actual_result_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1379,7 +1390,7 @@ spv_result_t ValidateImageFetch(ValidationState_t& _, const Instruction* inst) { } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage"; } @@ -1390,7 +1401,7 @@ spv_result_t ValidateImageFetch(ValidationState_t& _, const Instruction* inst) { << "Corrupt image type definition"; } - if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + if (_.GetIdOpcode(info.sampled_type) != spv::Op::OpTypeVoid) { const uint32_t result_component_type = _.GetComponentType(actual_result_type); if (result_component_type != info.sampled_type) { @@ -1400,7 +1411,7 @@ spv_result_t ValidateImageFetch(ValidationState_t& _, const Instruction* inst) { } } - if (info.dim == SpvDimCube) { + if (info.dim == spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'Dim' cannot be Cube"; } @@ -1436,7 +1447,7 @@ spv_result_t ValidateImageGather(ValidationState_t& _, if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) return error; - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); if (!_.IsIntVectorType(actual_result_type) && !_.IsFloatVectorType(actual_result_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1451,7 +1462,7 @@ spv_result_t ValidateImageGather(ValidationState_t& _, } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeSampledImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Sampled Image to be of type OpTypeSampledImage"; } @@ -1470,8 +1481,9 @@ spv_result_t ValidateImageGather(ValidationState_t& _, << "Gather operation is invalid for multisample image"; } - if (opcode == SpvOpImageDrefGather || opcode == SpvOpImageSparseDrefGather || - _.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + if (opcode == spv::Op::OpImageDrefGather || + opcode == spv::Op::OpImageSparseDrefGather || + _.GetIdOpcode(info.sampled_type) != spv::Op::OpTypeVoid) { const uint32_t result_component_type = _.GetComponentType(actual_result_type); if (result_component_type != info.sampled_type) { @@ -1481,8 +1493,8 @@ spv_result_t ValidateImageGather(ValidationState_t& _, } } - if (info.dim != SpvDim2D && info.dim != SpvDimCube && - info.dim != SpvDimRect) { + if (info.dim != spv::Dim::Dim2D && info.dim != spv::Dim::Cube && + info.dim != spv::Dim::Rect) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4777) << "Expected Image 'Dim' to be 2D, Cube, or Rect"; @@ -1502,7 +1514,8 @@ spv_result_t ValidateImageGather(ValidationState_t& _, << " components, but given only " << actual_coord_size; } - if (opcode == SpvOpImageGather || opcode == SpvOpImageSparseGather) { + if (opcode == spv::Op::OpImageGather || + opcode == spv::Op::OpImageSparseGather) { const uint32_t component = inst->GetOperandAs(4); const uint32_t component_index_type = _.GetTypeId(component); if (!_.IsIntScalarType(component_index_type) || @@ -1519,8 +1532,8 @@ spv_result_t ValidateImageGather(ValidationState_t& _, } } } else { - assert(opcode == SpvOpImageDrefGather || - opcode == SpvOpImageSparseDrefGather); + assert(opcode == spv::Op::OpImageDrefGather || + opcode == spv::Op::OpImageSparseDrefGather); if (spv_result_t result = ValidateImageDref(_, inst, info)) return result; } @@ -1532,7 +1545,7 @@ spv_result_t ValidateImageGather(ValidationState_t& _, } spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); uint32_t actual_result_type = 0; if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) { return error; @@ -1557,7 +1570,7 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { } // Check OpenCL below, after we get the image info. const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage"; } @@ -1591,27 +1604,27 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { } const uint32_t mask = inst->words().size() <= 5 ? 0 : inst->word(5); - if (mask & SpvImageOperandsConstOffsetMask) { + if (mask & uint32_t(spv::ImageOperandsMask::ConstOffset)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "ConstOffset image operand not allowed " << "in the OpenCL environment."; } } - if (info.dim == SpvDimSubpassData) { - if (opcode == SpvOpImageSparseRead) { + if (info.dim == spv::Dim::SubpassData) { + if (opcode == spv::Op::OpImageSparseRead) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image Dim SubpassData cannot be used with ImageSparseRead"; } _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - SpvExecutionModelFragment, + spv::ExecutionModel::Fragment, std::string("Dim SubpassData requires Fragment execution model: ") + spvOpcodeString(opcode)); } - if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + if (_.GetIdOpcode(info.sampled_type) != spv::Op::OpTypeVoid) { const uint32_t result_component_type = _.GetComponentType(actual_result_type); if (result_component_type != info.sampled_type) { @@ -1639,8 +1652,9 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { } if (spvIsVulkanEnv(_.context()->target_env)) { - if (info.format == SpvImageFormatUnknown && info.dim != SpvDimSubpassData && - !_.HasCapability(SpvCapabilityStorageImageReadWithoutFormat)) { + if (info.format == spv::ImageFormat::Unknown && + info.dim != spv::Dim::SubpassData && + !_.HasCapability(spv::Capability::StorageImageReadWithoutFormat)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability StorageImageReadWithoutFormat is required to " << "read storage image"; @@ -1656,7 +1670,7 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { const uint32_t image_type = _.GetOperandTypeId(inst, 0); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage"; } @@ -1667,7 +1681,7 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { << "Corrupt image type definition"; } - if (info.dim == SpvDimSubpassData) { + if (info.dim == spv::Dim::SubpassData) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'Dim' cannot be SubpassData"; } @@ -1697,7 +1711,7 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { << "Expected Texel to be int or float vector or scalar"; } - if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) { + if (_.GetIdOpcode(info.sampled_type) != spv::Op::OpTypeVoid) { const uint32_t texel_component_type = _.GetComponentType(texel_type); if (texel_component_type != info.sampled_type) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1707,8 +1721,9 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { } if (spvIsVulkanEnv(_.context()->target_env)) { - if (info.format == SpvImageFormatUnknown && info.dim != SpvDimSubpassData && - !_.HasCapability(SpvCapabilityStorageImageWriteWithoutFormat)) { + if (info.format == spv::ImageFormat::Unknown && + info.dim != spv::Dim::SubpassData && + !_.HasCapability(spv::Capability::StorageImageWriteWithoutFormat)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Capability StorageImageWriteWithoutFormat is required to " "write " @@ -1733,7 +1748,7 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateImage(ValidationState_t& _, const Instruction* inst) { const uint32_t result_type = inst->type_id(); - if (_.GetIdOpcode(result_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(result_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Result Type to be OpTypeImage"; } @@ -1742,7 +1757,7 @@ spv_result_t ValidateImage(ValidationState_t& _, const Instruction* inst) { const Instruction* sampled_image_type_inst = _.FindDef(sampled_image_type); assert(sampled_image_type_inst); - if (sampled_image_type_inst->opcode() != SpvOpTypeSampledImage) { + if (sampled_image_type_inst->opcode() != spv::Op::OpTypeSampledImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Sample Image to be of type OpTypeSampleImage"; } @@ -1764,7 +1779,7 @@ spv_result_t ValidateImageQuerySizeLod(ValidationState_t& _, } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage"; } @@ -1777,14 +1792,14 @@ spv_result_t ValidateImageQuerySizeLod(ValidationState_t& _, uint32_t expected_num_components = info.arrayed; switch (info.dim) { - case SpvDim1D: + case spv::Dim::Dim1D: expected_num_components += 1; break; - case SpvDim2D: - case SpvDimCube: + case spv::Dim::Dim2D: + case spv::Dim::Cube: expected_num_components += 2; break; - case SpvDim3D: + case spv::Dim::Dim3D: expected_num_components += 3; break; default: @@ -1830,7 +1845,7 @@ spv_result_t ValidateImageQuerySize(ValidationState_t& _, } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage"; } @@ -1843,16 +1858,16 @@ spv_result_t ValidateImageQuerySize(ValidationState_t& _, uint32_t expected_num_components = info.arrayed; switch (info.dim) { - case SpvDim1D: - case SpvDimBuffer: + case spv::Dim::Dim1D: + case spv::Dim::Buffer: expected_num_components += 1; break; - case SpvDim2D: - case SpvDimCube: - case SpvDimRect: + case spv::Dim::Dim2D: + case spv::Dim::Cube: + case spv::Dim::Rect: expected_num_components += 2; break; - case SpvDim3D: + case spv::Dim::Dim3D: expected_num_components += 3; break; default: @@ -1860,8 +1875,8 @@ spv_result_t ValidateImageQuerySize(ValidationState_t& _, << "Image 'Dim' must be 1D, Buffer, 2D, Cube, 3D or Rect"; } - if (info.dim == SpvDim1D || info.dim == SpvDim2D || info.dim == SpvDim3D || - info.dim == SpvDimCube) { + if (info.dim == spv::Dim::Dim1D || info.dim == spv::Dim::Dim2D || + info.dim == spv::Dim::Dim3D || info.dim == spv::Dim::Cube) { if (info.multisampled != 1 && info.sampled != 0 && info.sampled != 2) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image must have either 'MS'=1 or 'Sampled'=0 or 'Sampled'=2"; @@ -1885,7 +1900,7 @@ spv_result_t ValidateImageQueryFormatOrOrder(ValidationState_t& _, << "Expected Result Type to be int scalar type"; } - if (_.GetIdOpcode(_.GetOperandTypeId(inst, 2)) != SpvOpTypeImage) { + if (_.GetIdOpcode(_.GetOperandTypeId(inst, 2)) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected operand to be of type OpTypeImage"; } @@ -1896,9 +1911,9 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _, const Instruction* inst) { _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [&](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelFragment && - model != SpvExecutionModelGLCompute) { + [&](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::Fragment && + model != spv::ExecutionModel::GLCompute) { if (message) { *message = std::string( "OpImageQueryLod requires Fragment or GLCompute execution " @@ -1914,10 +1929,10 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _, std::string* message) { const auto* models = state.GetExecutionModels(entry_point->id()); const auto* modes = state.GetExecutionModes(entry_point->id()); - if (models->find(SpvExecutionModelGLCompute) != models->end() && - modes->find(SpvExecutionModeDerivativeGroupLinearNV) == + if (models->find(spv::ExecutionModel::GLCompute) != models->end() && + modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) == modes->end() && - modes->find(SpvExecutionModeDerivativeGroupQuadsNV) == + modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) == modes->end()) { if (message) { *message = std::string( @@ -1942,7 +1957,7 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _, } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeSampledImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeSampledImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image operand to be of type OpTypeSampledImage"; } @@ -1953,14 +1968,14 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _, << "Corrupt image type definition"; } - if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && - info.dim != SpvDimCube) { + if (info.dim != spv::Dim::Dim1D && info.dim != spv::Dim::Dim2D && + info.dim != spv::Dim::Dim3D && info.dim != spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'Dim' must be 1D, 2D, 3D or Cube"; } const uint32_t coord_type = _.GetOperandTypeId(inst, 3); - if (_.HasCapability(SpvCapabilityKernel)) { + if (_.HasCapability(spv::Capability::Kernel)) { if (!_.IsFloatScalarOrVectorType(coord_type) && !_.IsIntScalarOrVectorType(coord_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -2005,7 +2020,7 @@ spv_result_t ValidateImageQueryLevelsOrSamples(ValidationState_t& _, } const uint32_t image_type = _.GetOperandTypeId(inst, 2); - if (_.GetIdOpcode(image_type) != SpvOpTypeImage) { + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Image to be of type OpTypeImage"; } @@ -2016,10 +2031,10 @@ spv_result_t ValidateImageQueryLevelsOrSamples(ValidationState_t& _, << "Corrupt image type definition"; } - const SpvOp opcode = inst->opcode(); - if (opcode == SpvOpImageQueryLevels) { - if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D && - info.dim != SpvDimCube) { + const spv::Op opcode = inst->opcode(); + if (opcode == spv::Op::OpImageQueryLevels) { + if (info.dim != spv::Dim::Dim1D && info.dim != spv::Dim::Dim2D && + info.dim != spv::Dim::Dim3D && info.dim != spv::Dim::Cube) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'Dim' must be 1D, 2D, 3D or Cube"; } @@ -2033,8 +2048,8 @@ spv_result_t ValidateImageQueryLevelsOrSamples(ValidationState_t& _, } } } else { - assert(opcode == SpvOpImageQuerySamples); - if (info.dim != SpvDim2D) { + assert(opcode == spv::Op::OpImageQuerySamples); + if (info.dim != spv::Dim::Dim2D) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'Dim' must be 2D"; } @@ -2065,13 +2080,13 @@ spv_result_t ValidateImageSparseTexelsResident(ValidationState_t& _, // Validates correctness of image instructions. spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); if (IsImplicitLod(opcode)) { _.function(inst->function()->id()) - ->RegisterExecutionModelLimitation([opcode](SpvExecutionModel model, + ->RegisterExecutionModelLimitation([opcode](spv::ExecutionModel model, std::string* message) { - if (model != SpvExecutionModelFragment && - model != SpvExecutionModelGLCompute) { + if (model != spv::ExecutionModel::Fragment && + model != spv::ExecutionModel::GLCompute) { if (message) { *message = std::string( @@ -2090,11 +2105,11 @@ spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { const auto* models = state.GetExecutionModels(entry_point->id()); const auto* modes = state.GetExecutionModes(entry_point->id()); if (models && - models->find(SpvExecutionModelGLCompute) != models->end() && + models->find(spv::ExecutionModel::GLCompute) != models->end() && (!modes || - (modes->find(SpvExecutionModeDerivativeGroupLinearNV) == + (modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) == modes->end() && - modes->find(SpvExecutionModeDerivativeGroupQuadsNV) == + modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) == modes->end()))) { if (message) { *message = @@ -2111,73 +2126,73 @@ spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { } switch (opcode) { - case SpvOpTypeImage: + case spv::Op::OpTypeImage: return ValidateTypeImage(_, inst); - case SpvOpTypeSampledImage: + case spv::Op::OpTypeSampledImage: return ValidateTypeSampledImage(_, inst); - case SpvOpSampledImage: + case spv::Op::OpSampledImage: return ValidateSampledImage(_, inst); - case SpvOpImageTexelPointer: + case spv::Op::OpImageTexelPointer: return ValidateImageTexelPointer(_, inst); - case SpvOpImageSampleImplicitLod: - case SpvOpImageSampleExplicitLod: - case SpvOpImageSampleProjImplicitLod: - case SpvOpImageSampleProjExplicitLod: - case SpvOpImageSparseSampleImplicitLod: - case SpvOpImageSparseSampleExplicitLod: + case spv::Op::OpImageSampleImplicitLod: + case spv::Op::OpImageSampleExplicitLod: + case spv::Op::OpImageSampleProjImplicitLod: + case spv::Op::OpImageSampleProjExplicitLod: + case spv::Op::OpImageSparseSampleImplicitLod: + case spv::Op::OpImageSparseSampleExplicitLod: return ValidateImageLod(_, inst); - case SpvOpImageSampleDrefImplicitLod: - case SpvOpImageSampleDrefExplicitLod: - case SpvOpImageSampleProjDrefImplicitLod: - case SpvOpImageSampleProjDrefExplicitLod: - case SpvOpImageSparseSampleDrefImplicitLod: - case SpvOpImageSparseSampleDrefExplicitLod: + case spv::Op::OpImageSampleDrefImplicitLod: + case spv::Op::OpImageSampleDrefExplicitLod: + case spv::Op::OpImageSampleProjDrefImplicitLod: + case spv::Op::OpImageSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseSampleDrefImplicitLod: + case spv::Op::OpImageSparseSampleDrefExplicitLod: return ValidateImageDrefLod(_, inst); - case SpvOpImageFetch: - case SpvOpImageSparseFetch: + case spv::Op::OpImageFetch: + case spv::Op::OpImageSparseFetch: return ValidateImageFetch(_, inst); - case SpvOpImageGather: - case SpvOpImageDrefGather: - case SpvOpImageSparseGather: - case SpvOpImageSparseDrefGather: + case spv::Op::OpImageGather: + case spv::Op::OpImageDrefGather: + case spv::Op::OpImageSparseGather: + case spv::Op::OpImageSparseDrefGather: return ValidateImageGather(_, inst); - case SpvOpImageRead: - case SpvOpImageSparseRead: + case spv::Op::OpImageRead: + case spv::Op::OpImageSparseRead: return ValidateImageRead(_, inst); - case SpvOpImageWrite: + case spv::Op::OpImageWrite: return ValidateImageWrite(_, inst); - case SpvOpImage: + case spv::Op::OpImage: return ValidateImage(_, inst); - case SpvOpImageQueryFormat: - case SpvOpImageQueryOrder: + case spv::Op::OpImageQueryFormat: + case spv::Op::OpImageQueryOrder: return ValidateImageQueryFormatOrOrder(_, inst); - case SpvOpImageQuerySizeLod: + case spv::Op::OpImageQuerySizeLod: return ValidateImageQuerySizeLod(_, inst); - case SpvOpImageQuerySize: + case spv::Op::OpImageQuerySize: return ValidateImageQuerySize(_, inst); - case SpvOpImageQueryLod: + case spv::Op::OpImageQueryLod: return ValidateImageQueryLod(_, inst); - case SpvOpImageQueryLevels: - case SpvOpImageQuerySamples: + case spv::Op::OpImageQueryLevels: + case spv::Op::OpImageQuerySamples: return ValidateImageQueryLevelsOrSamples(_, inst); - case SpvOpImageSparseSampleProjImplicitLod: - case SpvOpImageSparseSampleProjExplicitLod: - case SpvOpImageSparseSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleProjDrefExplicitLod: + case spv::Op::OpImageSparseSampleProjImplicitLod: + case spv::Op::OpImageSparseSampleProjExplicitLod: + case spv::Op::OpImageSparseSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleProjDrefExplicitLod: return ValidateImageSparseLod(_, inst); - case SpvOpImageSparseTexelsResident: + case spv::Op::OpImageSparseTexelsResident: return ValidateImageSparseTexelsResident(_, inst); default: diff --git a/3rdparty/spirv-tools/source/val/validate_instruction.cpp b/3rdparty/spirv-tools/source/val/validate_instruction.cpp index 767c0cee1..1b7847cac 100644 --- a/3rdparty/spirv-tools/source/val/validate_instruction.cpp +++ b/3rdparty/spirv-tools/source/val/validate_instruction.cpp @@ -44,13 +44,13 @@ namespace { std::string ToString(const CapabilitySet& capabilities, const AssemblyGrammar& grammar) { std::stringstream ss; - capabilities.ForEach([&grammar, &ss](SpvCapability cap) { + capabilities.ForEach([&grammar, &ss](spv::Capability cap) { spv_operand_desc desc; - if (SPV_SUCCESS == - grammar.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) + if (SPV_SUCCESS == grammar.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, + uint32_t(cap), &desc)) ss << desc->name << " "; else - ss << cap << " "; + ss << uint32_t(cap) << " "; }); return ss.str(); } @@ -60,18 +60,18 @@ std::string ToString(const CapabilitySet& capabilities, // the opcode may only be used if at least one of the capabilities is specified // by the module. CapabilitySet EnablingCapabilitiesForOp(const ValidationState_t& state, - SpvOp opcode) { + spv::Op opcode) { // Exceptions for SPV_AMD_shader_ballot switch (opcode) { // Normally these would require Group capability - case SpvOpGroupIAddNonUniformAMD: - case SpvOpGroupFAddNonUniformAMD: - case SpvOpGroupFMinNonUniformAMD: - case SpvOpGroupUMinNonUniformAMD: - case SpvOpGroupSMinNonUniformAMD: - case SpvOpGroupFMaxNonUniformAMD: - case SpvOpGroupUMaxNonUniformAMD: - case SpvOpGroupSMaxNonUniformAMD: + case spv::Op::OpGroupIAddNonUniformAMD: + case spv::Op::OpGroupFAddNonUniformAMD: + case spv::Op::OpGroupFMinNonUniformAMD: + case spv::Op::OpGroupUMinNonUniformAMD: + case spv::Op::OpGroupSMinNonUniformAMD: + case spv::Op::OpGroupFMaxNonUniformAMD: + case spv::Op::OpGroupUMaxNonUniformAMD: + case spv::Op::OpGroupSMaxNonUniformAMD: if (state.HasExtension(kSPV_AMD_shader_ballot)) return CapabilitySet(); break; default: @@ -151,10 +151,10 @@ spv_result_t CheckRequiredCapabilities(ValidationState_t& state, // not implemented yet. This rule is independent of target environment. // See https://github.com/KhronosGroup/SPIRV-Tools/issues/365 if (operand.type == SPV_OPERAND_TYPE_BUILT_IN) { - switch (word) { - case SpvBuiltInPointSize: - case SpvBuiltInClipDistance: - case SpvBuiltInCullDistance: + switch (spv::BuiltIn(word)) { + case spv::BuiltIn::PointSize: + case spv::BuiltIn::ClipDistance: + case spv::BuiltIn::CullDistance: return SPV_SUCCESS; default: break; @@ -166,7 +166,7 @@ spv_result_t CheckRequiredCapabilities(ValidationState_t& state, } } else if (operand.type == SPV_OPERAND_TYPE_GROUP_OPERATION && state.features().group_ops_reduce_and_scans && - (word <= uint32_t(SpvGroupOperationExclusiveScan))) { + (word <= uint32_t(spv::GroupOperation::ExclusiveScan))) { // Allow certain group operations if requested. return SPV_SUCCESS; } @@ -178,15 +178,16 @@ spv_result_t CheckRequiredCapabilities(ValidationState_t& state, if (lookup_result == SPV_SUCCESS) { // Allow FPRoundingMode decoration if requested. if (operand.type == SPV_OPERAND_TYPE_DECORATION && - operand_desc->value == SpvDecorationFPRoundingMode) { + spv::Decoration(operand_desc->value) == + spv::Decoration::FPRoundingMode) { if (state.features().free_fp_rounding_mode) return SPV_SUCCESS; // Vulkan API requires more capabilities on rounding mode. if (spvIsVulkanEnv(state.context()->target_env)) { - enabling_capabilities.Add(SpvCapabilityStorageUniformBufferBlock16); - enabling_capabilities.Add(SpvCapabilityStorageUniform16); - enabling_capabilities.Add(SpvCapabilityStoragePushConstant16); - enabling_capabilities.Add(SpvCapabilityStorageInputOutput16); + enabling_capabilities.Add(spv::Capability::StorageUniformBufferBlock16); + enabling_capabilities.Add(spv::Capability::StorageUniform16); + enabling_capabilities.Add(spv::Capability::StoragePushConstant16); + enabling_capabilities.Add(spv::Capability::StorageInputOutput16); } } else { enabling_capabilities = state.grammar().filterCapsAgainstTargetEnv( @@ -197,7 +198,7 @@ spv_result_t CheckRequiredCapabilities(ValidationState_t& state, // registers a capability with the module *before* checking capabilities. // So in the case of an OpCapability instruction, don't bother checking // enablement by another capability. - if (inst->opcode() != SpvOpCapability) { + if (inst->opcode() != spv::Op::OpCapability) { const bool enabled_by_cap = state.HasAnyOfCapabilities(enabling_capabilities); if (!enabling_capabilities.IsEmpty() && !enabled_by_cap) { @@ -218,14 +219,14 @@ spv_result_t CheckRequiredCapabilities(ValidationState_t& state, // is explicitly reserved in the SPIR-V core spec. Otherwise return // SPV_SUCCESS. spv_result_t ReservedCheck(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); switch (opcode) { // These instructions are enabled by a capability, but should never // be used anyway. - case SpvOpImageSparseSampleProjImplicitLod: - case SpvOpImageSparseSampleProjExplicitLod: - case SpvOpImageSparseSampleProjDrefImplicitLod: - case SpvOpImageSparseSampleProjDrefExplicitLod: { + case spv::Op::OpImageSparseSampleProjImplicitLod: + case spv::Op::OpImageSparseSampleProjExplicitLod: + case spv::Op::OpImageSparseSampleProjDrefImplicitLod: + case spv::Op::OpImageSparseSampleProjDrefExplicitLod: { spv_opcode_desc inst_desc; _.grammar().lookupOpcode(opcode, &inst_desc); return _.diag(SPV_ERROR_INVALID_BINARY, inst) @@ -241,7 +242,7 @@ spv_result_t ReservedCheck(ValidationState_t& _, const Instruction* inst) { // instruction is invalid because the required capability isn't declared // in the module. spv_result_t CapabilityCheck(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); CapabilitySet opcode_caps = EnablingCapabilitiesForOp(_, opcode); if (!_.HasAnyOfCapabilities(opcode_caps)) { return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst) @@ -299,7 +300,7 @@ spv_result_t VersionCheck(ValidationState_t& _, const Instruction* inst) { // OpTerminateInvocation is special because it is enabled by Shader // capability, but also requires an extension and/or version check. const bool capability_check_is_sufficient = - inst->opcode() != SpvOpTerminateInvocation; + inst->opcode() != spv::Op::OpTerminateInvocation; if (capability_check_is_sufficient && (inst_desc->numCapabilities > 0u)) { // We already checked that the direct capability dependency has been @@ -357,7 +358,7 @@ spv_result_t LimitCheckIdBound(ValidationState_t& _, const Instruction* inst) { // Checks that the number of OpTypeStruct members is within the limit. spv_result_t LimitCheckStruct(ValidationState_t& _, const Instruction* inst) { - if (SpvOpTypeStruct != inst->opcode()) { + if (spv::Op::OpTypeStruct != inst->opcode()) { return SPV_SUCCESS; } @@ -382,7 +383,7 @@ spv_result_t LimitCheckStruct(ValidationState_t& _, const Instruction* inst) { for (size_t word_i = 2; word_i < inst->words().size(); ++word_i) { auto member = inst->word(word_i); auto memberTypeInstr = _.FindDef(member); - if (memberTypeInstr && SpvOpTypeStruct == memberTypeInstr->opcode()) { + if (memberTypeInstr && spv::Op::OpTypeStruct == memberTypeInstr->opcode()) { max_member_depth = std::max( max_member_depth, _.struct_nesting_depth(memberTypeInstr->id())); } @@ -402,7 +403,7 @@ spv_result_t LimitCheckStruct(ValidationState_t& _, const Instruction* inst) { // Checks that the number of (literal, label) pairs in OpSwitch is within // the limit. spv_result_t LimitCheckSwitch(ValidationState_t& _, const Instruction* inst) { - if (SpvOpSwitch == inst->opcode()) { + if (spv::Op::OpSwitch == inst->opcode()) { // The instruction syntax is as follows: // OpSwitch literal label literal label ... // literal,label pairs come after the first 2 operands. @@ -422,8 +423,8 @@ spv_result_t LimitCheckSwitch(ValidationState_t& _, const Instruction* inst) { // Ensure the number of variables of the given class does not exceed the // limit. spv_result_t LimitCheckNumVars(ValidationState_t& _, const uint32_t var_id, - const SpvStorageClass storage_class) { - if (SpvStorageClassFunction == storage_class) { + const spv::StorageClass storage_class) { + if (spv::StorageClass::Function == storage_class) { _.registerLocalVariable(var_id); const uint32_t num_local_vars_limit = _.options()->universal_limits_.max_local_variables; @@ -462,29 +463,29 @@ spv_result_t CheckIfKnownExtension(ValidationState_t& _, } // namespace spv_result_t InstructionPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); - if (opcode == SpvOpExtension) { + const spv::Op opcode = inst->opcode(); + if (opcode == spv::Op::OpExtension) { CheckIfKnownExtension(_, inst); - } else if (opcode == SpvOpCapability) { - _.RegisterCapability(inst->GetOperandAs(0)); - } else if (opcode == SpvOpMemoryModel) { + } else if (opcode == spv::Op::OpCapability) { + _.RegisterCapability(inst->GetOperandAs(0)); + } else if (opcode == spv::Op::OpMemoryModel) { if (_.has_memory_model_specified()) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << "OpMemoryModel should only be provided once."; } - _.set_addressing_model(inst->GetOperandAs(0)); - _.set_memory_model(inst->GetOperandAs(1)); - } else if (opcode == SpvOpExecutionMode) { + _.set_addressing_model(inst->GetOperandAs(0)); + _.set_memory_model(inst->GetOperandAs(1)); + } else if (opcode == spv::Op::OpExecutionMode) { const uint32_t entry_point = inst->word(1); _.RegisterExecutionModeForEntryPoint(entry_point, - SpvExecutionMode(inst->word(2))); - } else if (opcode == SpvOpVariable) { - const auto storage_class = inst->GetOperandAs(2); + spv::ExecutionMode(inst->word(2))); + } else if (opcode == spv::Op::OpVariable) { + const auto storage_class = inst->GetOperandAs(2); if (auto error = LimitCheckNumVars(_, inst->id(), storage_class)) { return error; } - } else if (opcode == SpvOpSamplerImageAddressingModeNV) { - if (!_.HasCapability(SpvCapabilityBindlessTextureNV)) { + } else if (opcode == spv::Op::OpSamplerImageAddressingModeNV) { + if (!_.HasCapability(spv::Capability::BindlessTextureNV)) { return _.diag(SPV_ERROR_MISSING_EXTENSION, inst) << "OpSamplerImageAddressingModeNV supported only with extension " "SPV_NV_bindless_texture"; diff --git a/3rdparty/spirv-tools/source/val/validate_interfaces.cpp b/3rdparty/spirv-tools/source/val/validate_interfaces.cpp index 7f2d6488c..00a5999bd 100644 --- a/3rdparty/spirv-tools/source/val/validate_interfaces.cpp +++ b/3rdparty/spirv-tools/source/val/validate_interfaces.cpp @@ -35,12 +35,15 @@ const uint32_t kMaxLocations = 4096 * 4; bool is_interface_variable(const Instruction* inst, bool is_spv_1_4) { if (is_spv_1_4) { // Starting in SPIR-V 1.4, all global variables are interface variables. - return inst->opcode() == SpvOpVariable && - inst->word(3u) != SpvStorageClassFunction; + return inst->opcode() == spv::Op::OpVariable && + inst->GetOperandAs(2u) != + spv::StorageClass::Function; } else { - return inst->opcode() == SpvOpVariable && - (inst->word(3u) == SpvStorageClassInput || - inst->word(3u) == SpvStorageClassOutput); + return inst->opcode() == spv::Op::OpVariable && + (inst->GetOperandAs(2u) == + spv::StorageClass::Input || + inst->GetOperandAs(2u) == + spv::StorageClass::Output); } } @@ -114,29 +117,30 @@ spv_result_t NumConsumedLocations(ValidationState_t& _, const Instruction* type, uint32_t* num_locations) { *num_locations = 0; switch (type->opcode()) { - case SpvOpTypeInt: - case SpvOpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: // Scalars always consume a single location. *num_locations = 1; break; - case SpvOpTypeVector: + case spv::Op::OpTypeVector: // 3- and 4-component 64-bit vectors consume two locations. - if ((_.ContainsSizedIntOrFloatType(type->id(), SpvOpTypeInt, 64) || - _.ContainsSizedIntOrFloatType(type->id(), SpvOpTypeFloat, 64)) && + if ((_.ContainsSizedIntOrFloatType(type->id(), spv::Op::OpTypeInt, 64) || + _.ContainsSizedIntOrFloatType(type->id(), spv::Op::OpTypeFloat, + 64)) && (type->GetOperandAs(2) > 2)) { *num_locations = 2; } else { *num_locations = 1; } break; - case SpvOpTypeMatrix: + case spv::Op::OpTypeMatrix: // Matrices consume locations equal to the underlying vector type for // each column. NumConsumedLocations(_, _.FindDef(type->GetOperandAs(1)), num_locations); *num_locations *= type->GetOperandAs(2); break; - case SpvOpTypeArray: { + case spv::Op::OpTypeArray: { // Arrays consume locations equal to the underlying type times the number // of elements in the vector. NumConsumedLocations(_, _.FindDef(type->GetOperandAs(1)), @@ -150,9 +154,9 @@ spv_result_t NumConsumedLocations(ValidationState_t& _, const Instruction* type, if (is_int && is_const) *num_locations *= value; break; } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { // Members cannot have location decorations at this point. - if (_.HasDecoration(type->id(), SpvDecorationLocation)) { + if (_.HasDecoration(type->id(), spv::Decoration::Location)) { return _.diag(SPV_ERROR_INVALID_DATA, type) << _.VkErrorID(4918) << "Members cannot be assigned a location"; } @@ -182,8 +186,8 @@ spv_result_t NumConsumedLocations(ValidationState_t& _, const Instruction* type, uint32_t NumConsumedComponents(ValidationState_t& _, const Instruction* type) { uint32_t num_components = 0; switch (type->opcode()) { - case SpvOpTypeInt: - case SpvOpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: // 64-bit types consume two components. if (type->GetOperandAs(1) == 64) { num_components = 2; @@ -191,7 +195,7 @@ uint32_t NumConsumedComponents(ValidationState_t& _, const Instruction* type) { num_components = 1; } break; - case SpvOpTypeVector: + case spv::Op::OpTypeVector: // Vectors consume components equal to the underlying type's consumption // times the number of elements in the vector. Note that 3- and 4-element // vectors cannot have a component decoration (i.e. assumed to be zero). @@ -199,7 +203,7 @@ uint32_t NumConsumedComponents(ValidationState_t& _, const Instruction* type) { NumConsumedComponents(_, _.FindDef(type->GetOperandAs(1))); num_components *= type->GetOperandAs(2); break; - case SpvOpTypeArray: + case spv::Op::OpTypeArray: // Skip the array. return NumConsumedComponents(_, _.FindDef(type->GetOperandAs(1))); @@ -218,10 +222,10 @@ spv_result_t GetLocationsForVariable( ValidationState_t& _, const Instruction* entry_point, const Instruction* variable, std::unordered_set* locations, std::unordered_set* output_index1_locations) { - const bool is_fragment = entry_point->GetOperandAs(0) == - SpvExecutionModelFragment; + const bool is_fragment = entry_point->GetOperandAs(0) == + spv::ExecutionModel::Fragment; const bool is_output = - variable->GetOperandAs(2) == SpvStorageClassOutput; + variable->GetOperandAs(2) == spv::StorageClass::Output; auto ptr_type_id = variable->GetOperandAs(0); auto ptr_type = _.FindDef(ptr_type_id); auto type_id = ptr_type->GetOperandAs(2); @@ -240,21 +244,21 @@ spv_result_t GetLocationsForVariable( bool has_per_task_nv = false; bool has_per_vertex_khr = false; for (auto& dec : _.id_decorations(variable->id())) { - if (dec.dec_type() == SpvDecorationLocation) { + if (dec.dec_type() == spv::Decoration::Location) { if (has_location && dec.params()[0] != location) { return _.diag(SPV_ERROR_INVALID_DATA, variable) << "Variable has conflicting location decorations"; } has_location = true; location = dec.params()[0]; - } else if (dec.dec_type() == SpvDecorationComponent) { + } else if (dec.dec_type() == spv::Decoration::Component) { if (has_component && dec.params()[0] != component) { return _.diag(SPV_ERROR_INVALID_DATA, variable) << "Variable has conflicting component decorations"; } has_component = true; component = dec.params()[0]; - } else if (dec.dec_type() == SpvDecorationIndex) { + } else if (dec.dec_type() == spv::Decoration::Index) { if (!is_output || !is_fragment) { return _.diag(SPV_ERROR_INVALID_DATA, variable) << "Index can only be applied to Fragment output variables"; @@ -265,22 +269,22 @@ spv_result_t GetLocationsForVariable( } has_index = true; index = dec.params()[0]; - } else if (dec.dec_type() == SpvDecorationBuiltIn) { + } else if (dec.dec_type() == spv::Decoration::BuiltIn) { // Don't check built-ins. return SPV_SUCCESS; - } else if (dec.dec_type() == SpvDecorationPatch) { + } else if (dec.dec_type() == spv::Decoration::Patch) { has_patch = true; - } else if (dec.dec_type() == SpvDecorationPerTaskNV) { + } else if (dec.dec_type() == spv::Decoration::PerTaskNV) { has_per_task_nv = true; - } else if (dec.dec_type() == SpvDecorationPerVertexKHR) { + } else if (dec.dec_type() == spv::Decoration::PerVertexKHR) { if (!is_fragment) { return _.diag(SPV_ERROR_INVALID_DATA, variable) << _.VkErrorID(6777) << "PerVertexKHR can only be applied to Fragment Execution " "Models"; } - if (type->opcode() != SpvOpTypeArray && - type->opcode() != SpvOpTypeRuntimeArray) { + if (type->opcode() != spv::Op::OpTypeArray && + type->opcode() != spv::Op::OpTypeRuntimeArray) { return _.diag(SPV_ERROR_INVALID_DATA, variable) << _.VkErrorID(6778) << "PerVertexKHR must be declared as arrays"; @@ -293,28 +297,28 @@ spv_result_t GetLocationsForVariable( // tessellation control, evaluation and geometry per-vertex inputs have a // layer of arraying that is not included in interface matching. bool is_arrayed = false; - switch (entry_point->GetOperandAs(0)) { - case SpvExecutionModelTessellationControl: + switch (entry_point->GetOperandAs(0)) { + case spv::ExecutionModel::TessellationControl: if (!has_patch) { is_arrayed = true; } break; - case SpvExecutionModelTessellationEvaluation: + case spv::ExecutionModel::TessellationEvaluation: if (!is_output && !has_patch) { is_arrayed = true; } break; - case SpvExecutionModelGeometry: + case spv::ExecutionModel::Geometry: if (!is_output) { is_arrayed = true; } break; - case SpvExecutionModelFragment: + case spv::ExecutionModel::Fragment: if (!is_output && has_per_vertex_khr) { is_arrayed = true; } break; - case SpvExecutionModelMeshNV: + case spv::ExecutionModel::MeshNV: if (is_output && !has_per_task_nv) { is_arrayed = true; } @@ -324,21 +328,21 @@ spv_result_t GetLocationsForVariable( } // Unpack arrayness. - if (is_arrayed && (type->opcode() == SpvOpTypeArray || - type->opcode() == SpvOpTypeRuntimeArray)) { + if (is_arrayed && (type->opcode() == spv::Op::OpTypeArray || + type->opcode() == spv::Op::OpTypeRuntimeArray)) { type_id = type->GetOperandAs(1); type = _.FindDef(type_id); } - if (type->opcode() == SpvOpTypeStruct) { + if (type->opcode() == spv::Op::OpTypeStruct) { // Don't check built-ins. - if (_.HasDecoration(type_id, SpvDecorationBuiltIn)) return SPV_SUCCESS; + if (_.HasDecoration(type_id, spv::Decoration::BuiltIn)) return SPV_SUCCESS; } // Only block-decorated structs don't need a location on the variable. - const bool is_block = _.HasDecoration(type_id, SpvDecorationBlock); + const bool is_block = _.HasDecoration(type_id, spv::Decoration::Block); if (!has_location && !is_block) { - const auto vuid = (type->opcode() == SpvOpTypeStruct) ? 4917 : 4916; + const auto vuid = (type->opcode() == spv::Op::OpTypeStruct) ? 4917 : 4916; return _.diag(SPV_ERROR_INVALID_DATA, variable) << _.VkErrorID(vuid) << "Variable must be decorated with a location"; } @@ -351,7 +355,7 @@ spv_result_t GetLocationsForVariable( uint32_t array_size = 1; // If the variable is still arrayed, mark the locations/components per // index. - if (type->opcode() == SpvOpTypeArray) { + if (type->opcode() == spv::Op::OpTypeArray) { // Determine the array size if possible and get the element type. std::tie(is_int, is_const, array_size) = _.EvalInt32IfConst(type->GetOperandAs(2)); @@ -399,7 +403,7 @@ spv_result_t GetLocationsForVariable( std::unordered_map member_locations; std::unordered_map member_components; for (auto& dec : _.id_decorations(type_id)) { - if (dec.dec_type() == SpvDecorationLocation) { + if (dec.dec_type() == spv::Decoration::Location) { auto where = member_locations.find(dec.struct_member_index()); if (where == member_locations.end()) { member_locations[dec.struct_member_index()] = dec.params()[0]; @@ -408,7 +412,7 @@ spv_result_t GetLocationsForVariable( << "Member index " << dec.struct_member_index() << " has conflicting location assignments"; } - } else if (dec.dec_type() == SpvDecorationComponent) { + } else if (dec.dec_type() == spv::Decoration::Component) { auto where = member_components.find(dec.struct_member_index()); if (where == member_components.end()) { member_components[dec.struct_member_index()] = dec.params()[0]; @@ -447,7 +451,7 @@ spv_result_t GetLocationsForVariable( continue; } - if (member->opcode() == SpvOpTypeArray && num_components >= 1 && + if (member->opcode() == spv::Op::OpTypeArray && num_components >= 1 && num_components < 4) { // When an array has an element that takes less than a location in // size, calculate the used locations in a strided manner. @@ -492,12 +496,12 @@ spv_result_t ValidateLocations(ValidationState_t& _, // TODO(dneto): SPV_NV_ray_tracing also uses locations on interface variables, // in other shader stages. Similarly, the *provisional* version of // SPV_KHR_ray_tracing did as well, but not the final version. - switch (entry_point->GetOperandAs(0)) { - case SpvExecutionModelVertex: - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: - case SpvExecutionModelGeometry: - case SpvExecutionModelFragment: + switch (entry_point->GetOperandAs(0)) { + case spv::ExecutionModel::Vertex: + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::Fragment: break; default: return SPV_SUCCESS; @@ -511,9 +515,9 @@ spv_result_t ValidateLocations(ValidationState_t& _, for (uint32_t i = 3; i < entry_point->operands().size(); ++i) { auto interface_id = entry_point->GetOperandAs(i); auto interface_var = _.FindDef(interface_id); - auto storage_class = interface_var->GetOperandAs(2); - if (storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { + auto storage_class = interface_var->GetOperandAs(2); + if (storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { continue; } if (!seen.insert(interface_id).second) { @@ -522,7 +526,7 @@ spv_result_t ValidateLocations(ValidationState_t& _, continue; } - auto locations = (storage_class == SpvStorageClassInput) + auto locations = (storage_class == spv::StorageClass::Input) ? &input_locations : &output_locations_index0; if (auto error = GetLocationsForVariable( @@ -547,12 +551,12 @@ spv_result_t ValidateInterfaces(ValidationState_t& _) { if (spvIsVulkanEnv(_.context()->target_env)) { for (auto& inst : _.ordered_instructions()) { - if (inst.opcode() == SpvOpEntryPoint) { + if (inst.opcode() == spv::Op::OpEntryPoint) { if (auto error = ValidateLocations(_, &inst)) { return error; } } - if (inst.opcode() == SpvOpTypeVoid) break; + if (inst.opcode() == spv::Op::OpTypeVoid) break; } } diff --git a/3rdparty/spirv-tools/source/val/validate_layout.cpp b/3rdparty/spirv-tools/source/val/validate_layout.cpp index 6f9513523..238dd9b2f 100644 --- a/3rdparty/spirv-tools/source/val/validate_layout.cpp +++ b/3rdparty/spirv-tools/source/val/validate_layout.cpp @@ -35,9 +35,9 @@ namespace { // is part of the current layout section. If it is not then the next sections is // checked. spv_result_t ModuleScopedInstructions(ValidationState_t& _, - const Instruction* inst, SpvOp opcode) { + const Instruction* inst, spv::Op opcode) { switch (opcode) { - case SpvOpExtInst: + case spv::Op::OpExtInst: if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { const uint32_t ext_inst_index = inst->word(4); bool local_debug_info = false; @@ -131,7 +131,7 @@ spv_result_t ModuleScopedInstructions(ValidationState_t& _, switch (_.current_layout_section()) { case kLayoutMemoryModel: - if (opcode != SpvOpMemoryModel) { + if (opcode != spv::Op::OpMemoryModel) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << spvOpcodeString(opcode) << " cannot appear before the memory model instruction"; @@ -154,7 +154,8 @@ spv_result_t ModuleScopedInstructions(ValidationState_t& _, // inside of another function. This stage ends when the first label is // encountered inside of a function. spv_result_t FunctionScopedInstructions(ValidationState_t& _, - const Instruction* inst, SpvOp opcode) { + const Instruction* inst, + spv::Op opcode) { // Make sure we advance into the function definitions when we hit // non-function declaration instructions. if (_.current_layout_section() == kLayoutFunctionDeclarations && @@ -171,12 +172,12 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, if (_.IsOpcodeInCurrentLayoutSection(opcode)) { switch (opcode) { - case SpvOpFunction: { + case spv::Op::OpFunction: { if (_.in_function_body()) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << "Cannot declare a function in a function body"; } - auto control_mask = inst->GetOperandAs(2); + auto control_mask = inst->GetOperandAs(2); if (auto error = _.RegisterFunction(inst->id(), inst->type_id(), control_mask, inst->GetOperandAs(3))) @@ -188,7 +189,7 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, } } break; - case SpvOpFunctionParameter: + case spv::Op::OpFunctionParameter: if (_.in_function_body() == false) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << "Function parameter instructions must be in a " @@ -204,7 +205,7 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, return error; break; - case SpvOpFunctionEnd: + case spv::Op::OpFunctionEnd: if (_.in_function_body() == false) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << "Function end instructions must be in a function body"; @@ -227,10 +228,10 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, if (auto error = _.RegisterFunctionEnd()) return error; break; - case SpvOpLine: - case SpvOpNoLine: + case spv::Op::OpLine: + case spv::Op::OpNoLine: break; - case SpvOpLabel: + case spv::Op::OpLabel: // If the label is encountered then the current function is a // definition so set the function to a declaration and update the // module section @@ -244,7 +245,7 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, } break; - case SpvOpExtInst: + case spv::Op::OpExtInst: if (spvExtInstIsDebugInfo(inst->ext_inst_type())) { const uint32_t ext_inst_index = inst->word(4); bool local_debug_info = false; @@ -356,7 +357,7 @@ spv_result_t FunctionScopedInstructions(ValidationState_t& _, // NOTE: This function does not handle CFG related validation // Performs logical layout validation. See Section 2.4 spv_result_t ModuleLayoutPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); switch (_.current_layout_section()) { case kLayoutCapabilities: diff --git a/3rdparty/spirv-tools/source/val/validate_logicals.cpp b/3rdparty/spirv-tools/source/val/validate_logicals.cpp index ec1e207be..dd66ce948 100644 --- a/3rdparty/spirv-tools/source/val/validate_logicals.cpp +++ b/3rdparty/spirv-tools/source/val/validate_logicals.cpp @@ -26,12 +26,12 @@ namespace val { // Validates correctness of logical instructions. spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpAny: - case SpvOpAll: { + case spv::Op::OpAny: + case spv::Op::OpAll: { if (!_.IsBoolScalarType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected bool scalar type as Result Type: " @@ -46,11 +46,11 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpIsNan: - case SpvOpIsInf: - case SpvOpIsFinite: - case SpvOpIsNormal: - case SpvOpSignBitSet: { + case spv::Op::OpIsNan: + case spv::Op::OpIsInf: + case spv::Op::OpIsFinite: + case spv::Op::OpIsNormal: + case spv::Op::OpSignBitSet: { if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected bool scalar or vector type as Result Type: " @@ -72,21 +72,21 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpFOrdEqual: - case SpvOpFUnordEqual: - case SpvOpFOrdNotEqual: - case SpvOpFUnordNotEqual: - case SpvOpFOrdLessThan: - case SpvOpFUnordLessThan: - case SpvOpFOrdGreaterThan: - case SpvOpFUnordGreaterThan: - case SpvOpFOrdLessThanEqual: - case SpvOpFUnordLessThanEqual: - case SpvOpFOrdGreaterThanEqual: - case SpvOpFUnordGreaterThanEqual: - case SpvOpLessOrGreater: - case SpvOpOrdered: - case SpvOpUnordered: { + case spv::Op::OpFOrdEqual: + case spv::Op::OpFUnordEqual: + case spv::Op::OpFOrdNotEqual: + case spv::Op::OpFUnordNotEqual: + case spv::Op::OpFOrdLessThan: + case spv::Op::OpFUnordLessThan: + case spv::Op::OpFOrdGreaterThan: + case spv::Op::OpFUnordGreaterThan: + case spv::Op::OpFOrdLessThanEqual: + case spv::Op::OpFUnordLessThanEqual: + case spv::Op::OpFOrdGreaterThanEqual: + case spv::Op::OpFUnordGreaterThanEqual: + case spv::Op::OpLessOrGreater: + case spv::Op::OpOrdered: + case spv::Op::OpUnordered: { if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected bool scalar or vector type as Result Type: " @@ -113,10 +113,10 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpLogicalEqual: - case SpvOpLogicalNotEqual: - case SpvOpLogicalOr: - case SpvOpLogicalAnd: { + case spv::Op::OpLogicalEqual: + case spv::Op::OpLogicalNotEqual: + case spv::Op::OpLogicalOr: + case spv::Op::OpLogicalAnd: { if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected bool scalar or vector type as Result Type: " @@ -131,7 +131,7 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpLogicalNot: { + case spv::Op::OpLogicalNot: { if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected bool scalar or vector type as Result Type: " @@ -145,7 +145,7 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpSelect: { + case spv::Op::OpSelect: { uint32_t dimension = 1; { const Instruction* type_inst = _.FindDef(result_type); @@ -159,10 +159,10 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { << " type as Result Type: " << spvOpcodeString(opcode); }; - const SpvOp type_opcode = type_inst->opcode(); + const spv::Op type_opcode = type_inst->opcode(); switch (type_opcode) { - case SpvOpTypePointer: { - if (_.addressing_model() == SpvAddressingModelLogical && + case spv::Op::OpTypePointer: { + if (_.addressing_model() == spv::AddressingModel::Logical && !_.features().variable_pointers) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Using pointers with OpSelect requires capability " @@ -170,31 +170,31 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpTypeSampledImage: - case SpvOpTypeImage: - case SpvOpTypeSampler: { - if (!_.HasCapability(SpvCapabilityBindlessTextureNV)) + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampler: { + if (!_.HasCapability(spv::Capability::BindlessTextureNV)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Using image/sampler with OpSelect requires capability " << "BindlessTextureNV"; break; } - case SpvOpTypeVector: { + case spv::Op::OpTypeVector: { dimension = type_inst->word(3); break; } - case SpvOpTypeBool: - case SpvOpTypeInt: - case SpvOpTypeFloat: { + case spv::Op::OpTypeBool: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeFloat: { break; } // Not RuntimeArray because of other rules. - case SpvOpTypeArray: - case SpvOpTypeMatrix: - case SpvOpTypeStruct: { + case spv::Op::OpTypeArray: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeStruct: { if (!composites) return fail(); break; } @@ -235,16 +235,16 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) { } } - case SpvOpIEqual: - case SpvOpINotEqual: - case SpvOpUGreaterThan: - case SpvOpUGreaterThanEqual: - case SpvOpULessThan: - case SpvOpULessThanEqual: - case SpvOpSGreaterThan: - case SpvOpSGreaterThanEqual: - case SpvOpSLessThan: - case SpvOpSLessThanEqual: { + case spv::Op::OpIEqual: + case spv::Op::OpINotEqual: + case spv::Op::OpUGreaterThan: + case spv::Op::OpUGreaterThanEqual: + case spv::Op::OpULessThan: + case spv::Op::OpULessThanEqual: + case spv::Op::OpSGreaterThan: + case spv::Op::OpSGreaterThanEqual: + case spv::Op::OpSLessThan: + case spv::Op::OpSLessThanEqual: { if (!_.IsBoolScalarType(result_type) && !_.IsBoolVectorType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected bool scalar or vector type as Result Type: " diff --git a/3rdparty/spirv-tools/source/val/validate_memory.cpp b/3rdparty/spirv-tools/source/val/validate_memory.cpp index 09fd2b643..5f7358c68 100644 --- a/3rdparty/spirv-tools/source/val/validate_memory.cpp +++ b/3rdparty/spirv-tools/source/val/validate_memory.cpp @@ -39,13 +39,13 @@ bool HasConflictingMemberOffsets(const std::set&, const std::set&); bool IsAllowedTypeOrArrayOfSame(ValidationState_t& _, const Instruction* type, - std::initializer_list allowed) { + std::initializer_list allowed) { if (std::find(allowed.begin(), allowed.end(), type->opcode()) != allowed.end()) { return true; } - if (type->opcode() == SpvOpTypeArray || - type->opcode() == SpvOpTypeRuntimeArray) { + if (type->opcode() == spv::Op::OpTypeArray || + type->opcode() == spv::Op::OpTypeRuntimeArray) { auto elem_type = _.FindDef(type->word(2)); return std::find(allowed.begin(), allowed.end(), elem_type->opcode()) != allowed.end(); @@ -57,10 +57,10 @@ bool IsAllowedTypeOrArrayOfSame(ValidationState_t& _, const Instruction* type, // validator can tell, have the exact same data layout. bool AreLayoutCompatibleStructs(ValidationState_t& _, const Instruction* type1, const Instruction* type2) { - if (type1->opcode() != SpvOpTypeStruct) { + if (type1->opcode() != spv::Op::OpTypeStruct) { return false; } - if (type2->opcode() != SpvOpTypeStruct) { + if (type2->opcode() != spv::Op::OpTypeStruct) { return false; } @@ -74,9 +74,9 @@ bool AreLayoutCompatibleStructs(ValidationState_t& _, const Instruction* type1, // be OpTypeStruct instructions. bool HaveLayoutCompatibleMembers(ValidationState_t& _, const Instruction* type1, const Instruction* type2) { - assert(type1->opcode() == SpvOpTypeStruct && + assert(type1->opcode() == spv::Op::OpTypeStruct && "type1 must be an OpTypeStruct instruction."); - assert(type2->opcode() == SpvOpTypeStruct && + assert(type2->opcode() == spv::Op::OpTypeStruct && "type2 must be an OpTypeStruct instruction."); const auto& type1_operands = type1->operands(); const auto& type2_operands = type2->operands(); @@ -101,9 +101,9 @@ bool HaveLayoutCompatibleMembers(ValidationState_t& _, const Instruction* type1, // OpTypeStruct instructions. bool HaveSameLayoutDecorations(ValidationState_t& _, const Instruction* type1, const Instruction* type2) { - assert(type1->opcode() == SpvOpTypeStruct && + assert(type1->opcode() == spv::Op::OpTypeStruct && "type1 must be an OpTypeStruct instruction."); - assert(type2->opcode() == SpvOpTypeStruct && + assert(type2->opcode() == spv::Op::OpTypeStruct && "type2 must be an OpTypeStruct instruction."); const std::set& type1_decorations = _.id_decorations(type1->id()); const std::set& type2_decorations = _.id_decorations(type2->id()); @@ -130,11 +130,11 @@ bool HasConflictingMemberOffsets( // type1_decoration. Therefore, it cannot lead to a conflict. for (const Decoration& decoration : type1_decorations) { switch (decoration.dec_type()) { - case SpvDecorationOffset: { + case spv::Decoration::Offset: { // Since these affect the layout of the struct, they must be present // in both structs. auto compare = [&decoration](const Decoration& rhs) { - if (rhs.dec_type() != SpvDecorationOffset) return false; + if (rhs.dec_type() != spv::Decoration::Offset) return false; return decoration.struct_member_index() == rhs.struct_member_index(); }; @@ -163,7 +163,7 @@ bool ContainsInvalidBool(ValidationState_t& _, const Instruction* storage, bool skip_builtin) { if (skip_builtin) { for (const Decoration& decoration : _.id_decorations(storage->id())) { - if (decoration.dec_type() == SpvDecorationBuiltIn) return false; + if (decoration.dec_type() == spv::Decoration::BuiltIn) return false; } } @@ -172,16 +172,16 @@ bool ContainsInvalidBool(ValidationState_t& _, const Instruction* storage, Instruction* elem_type; switch (storage->opcode()) { - case SpvOpTypeBool: + case spv::Op::OpTypeBool: return true; - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: elem_type_id = storage->GetOperandAs(elem_type_index); elem_type = _.FindDef(elem_type_id); return ContainsInvalidBool(_, elem_type, skip_builtin); - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: for (size_t member_type_index = 1; member_type_index < storage->operands().size(); ++member_type_index) { @@ -203,14 +203,14 @@ bool ContainsCooperativeMatrix(ValidationState_t& _, Instruction* elem_type; switch (storage->opcode()) { - case SpvOpTypeCooperativeMatrixNV: + case spv::Op::OpTypeCooperativeMatrixNV: return true; - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: elem_type_id = storage->GetOperandAs(elem_type_index); elem_type = _.FindDef(elem_type_id); return ContainsCooperativeMatrix(_, elem_type); - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: for (size_t member_type_index = 1; member_type_index < storage->operands().size(); ++member_type_index) { @@ -226,33 +226,33 @@ bool ContainsCooperativeMatrix(ValidationState_t& _, return false; } -std::pair GetStorageClass( +std::pair GetStorageClass( ValidationState_t& _, const Instruction* inst) { - SpvStorageClass dst_sc = SpvStorageClassMax; - SpvStorageClass src_sc = SpvStorageClassMax; + spv::StorageClass dst_sc = spv::StorageClass::Max; + spv::StorageClass src_sc = spv::StorageClass::Max; switch (inst->opcode()) { - case SpvOpCooperativeMatrixLoadNV: - case SpvOpLoad: { + case spv::Op::OpCooperativeMatrixLoadNV: + case spv::Op::OpLoad: { auto load_pointer = _.FindDef(inst->GetOperandAs(2)); auto load_pointer_type = _.FindDef(load_pointer->type_id()); - dst_sc = load_pointer_type->GetOperandAs(1); + dst_sc = load_pointer_type->GetOperandAs(1); break; } - case SpvOpCooperativeMatrixStoreNV: - case SpvOpStore: { + case spv::Op::OpCooperativeMatrixStoreNV: + case spv::Op::OpStore: { auto store_pointer = _.FindDef(inst->GetOperandAs(0)); auto store_pointer_type = _.FindDef(store_pointer->type_id()); - dst_sc = store_pointer_type->GetOperandAs(1); + dst_sc = store_pointer_type->GetOperandAs(1); break; } - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: { + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: { auto dst = _.FindDef(inst->GetOperandAs(0)); auto dst_type = _.FindDef(dst->type_id()); - dst_sc = dst_type->GetOperandAs(1); + dst_sc = dst_type->GetOperandAs(1); auto src = _.FindDef(inst->GetOperandAs(1)); auto src_type = _.FindDef(src->type_id()); - src_sc = src_type->GetOperandAs(1); + src_sc = src_type->GetOperandAs(1); break; } default: @@ -266,9 +266,9 @@ std::pair GetStorageClass( // argument and its implied operands. int MemoryAccessNumWords(uint32_t mask) { int result = 1; // Count the mask - if (mask & SpvMemoryAccessAlignedMask) ++result; - if (mask & SpvMemoryAccessMakePointerAvailableKHRMask) ++result; - if (mask & SpvMemoryAccessMakePointerVisibleKHRMask) ++result; + if (mask & uint32_t(spv::MemoryAccessMask::Aligned)) ++result; + if (mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR)) ++result; + if (mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)) ++result; return result; } @@ -279,8 +279,8 @@ int MemoryAccessNumWords(uint32_t mask) { // OpCooperativeMatrixStoreNV. uint32_t GetMakeAvailableScope(const Instruction* inst, uint32_t mask, uint32_t mask_index) { - assert(mask & SpvMemoryAccessMakePointerAvailableKHRMask); - uint32_t this_bit = uint32_t(SpvMemoryAccessMakePointerAvailableKHRMask); + assert(mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR)); + uint32_t this_bit = uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR); uint32_t index = mask_index - 1 + MemoryAccessNumWords(mask & (this_bit | (this_bit - 1))); return inst->GetOperandAs(index); @@ -291,8 +291,8 @@ uint32_t GetMakeAvailableScope(const Instruction* inst, uint32_t mask, // OpCooperativeMatrixStoreNV. uint32_t GetMakeVisibleScope(const Instruction* inst, uint32_t mask, uint32_t mask_index) { - assert(mask & SpvMemoryAccessMakePointerVisibleKHRMask); - uint32_t this_bit = uint32_t(SpvMemoryAccessMakePointerVisibleKHRMask); + assert(mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)); + uint32_t this_bit = uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR); uint32_t index = mask_index - 1 + MemoryAccessNumWords(mask & (this_bit | (this_bit - 1))); return inst->GetOperandAs(index); @@ -303,19 +303,19 @@ bool DoesStructContainRTA(const ValidationState_t& _, const Instruction* inst) { ++member_index) { const auto member_id = inst->GetOperandAs(member_index); const auto member_type = _.FindDef(member_id); - if (member_type->opcode() == SpvOpTypeRuntimeArray) return true; + if (member_type->opcode() == spv::Op::OpTypeRuntimeArray) return true; } return false; } spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, uint32_t index) { - SpvStorageClass dst_sc, src_sc; + spv::StorageClass dst_sc, src_sc; std::tie(dst_sc, src_sc) = GetStorageClass(_, inst); if (inst->operands().size() <= index) { // Cases where lack of some operand is invalid - if (src_sc == SpvStorageClassPhysicalStorageBuffer || - dst_sc == SpvStorageClassPhysicalStorageBuffer) { + if (src_sc == spv::StorageClass::PhysicalStorageBuffer || + dst_sc == spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4708) << "Memory accesses with PhysicalStorageBuffer must use Aligned."; @@ -324,14 +324,14 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, } const uint32_t mask = inst->GetOperandAs(index); - if (mask & SpvMemoryAccessMakePointerAvailableKHRMask) { - if (inst->opcode() == SpvOpLoad || - inst->opcode() == SpvOpCooperativeMatrixLoadNV) { + if (mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR)) { + if (inst->opcode() == spv::Op::OpLoad || + inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "MakePointerAvailableKHR cannot be used with OpLoad."; } - if (!(mask & SpvMemoryAccessNonPrivatePointerKHRMask)) { + if (!(mask & uint32_t(spv::MemoryAccessMask::NonPrivatePointerKHR))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "NonPrivatePointerKHR must be specified if " "MakePointerAvailableKHR is specified."; @@ -343,14 +343,14 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, return error; } - if (mask & SpvMemoryAccessMakePointerVisibleKHRMask) { - if (inst->opcode() == SpvOpStore || - inst->opcode() == SpvOpCooperativeMatrixStoreNV) { + if (mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)) { + if (inst->opcode() == spv::Op::OpStore || + inst->opcode() == spv::Op::OpCooperativeMatrixStoreNV) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "MakePointerVisibleKHR cannot be used with OpStore."; } - if (!(mask & SpvMemoryAccessNonPrivatePointerKHRMask)) { + if (!(mask & uint32_t(spv::MemoryAccessMask::NonPrivatePointerKHR))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "NonPrivatePointerKHR must be specified if " << "MakePointerVisibleKHR is specified."; @@ -361,24 +361,27 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, if (auto error = ValidateMemoryScope(_, inst, visible_scope)) return error; } - if (mask & SpvMemoryAccessNonPrivatePointerKHRMask) { - if (dst_sc != SpvStorageClassUniform && - dst_sc != SpvStorageClassWorkgroup && - dst_sc != SpvStorageClassCrossWorkgroup && - dst_sc != SpvStorageClassGeneric && dst_sc != SpvStorageClassImage && - dst_sc != SpvStorageClassStorageBuffer && - dst_sc != SpvStorageClassPhysicalStorageBuffer) { + if (mask & uint32_t(spv::MemoryAccessMask::NonPrivatePointerKHR)) { + if (dst_sc != spv::StorageClass::Uniform && + dst_sc != spv::StorageClass::Workgroup && + dst_sc != spv::StorageClass::CrossWorkgroup && + dst_sc != spv::StorageClass::Generic && + dst_sc != spv::StorageClass::Image && + dst_sc != spv::StorageClass::StorageBuffer && + dst_sc != spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "NonPrivatePointerKHR requires a pointer in Uniform, " << "Workgroup, CrossWorkgroup, Generic, Image or StorageBuffer " << "storage classes."; } - if (src_sc != SpvStorageClassMax && src_sc != SpvStorageClassUniform && - src_sc != SpvStorageClassWorkgroup && - src_sc != SpvStorageClassCrossWorkgroup && - src_sc != SpvStorageClassGeneric && src_sc != SpvStorageClassImage && - src_sc != SpvStorageClassStorageBuffer && - src_sc != SpvStorageClassPhysicalStorageBuffer) { + if (src_sc != spv::StorageClass::Max && + src_sc != spv::StorageClass::Uniform && + src_sc != spv::StorageClass::Workgroup && + src_sc != spv::StorageClass::CrossWorkgroup && + src_sc != spv::StorageClass::Generic && + src_sc != spv::StorageClass::Image && + src_sc != spv::StorageClass::StorageBuffer && + src_sc != spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "NonPrivatePointerKHR requires a pointer in Uniform, " << "Workgroup, CrossWorkgroup, Generic, Image or StorageBuffer " @@ -386,9 +389,9 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, } } - if (!(mask & SpvMemoryAccessAlignedMask)) { - if (src_sc == SpvStorageClassPhysicalStorageBuffer || - dst_sc == SpvStorageClassPhysicalStorageBuffer) { + if (!(mask & uint32_t(spv::MemoryAccessMask::Aligned))) { + if (src_sc == spv::StorageClass::PhysicalStorageBuffer || + dst_sc == spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4708) << "Memory accesses with PhysicalStorageBuffer must use Aligned."; @@ -400,7 +403,7 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst, spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { auto result_type = _.FindDef(inst->type_id()); - if (!result_type || result_type->opcode() != SpvOpTypePointer) { + if (!result_type || result_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpVariable Result Type " << _.getIdName(inst->type_id()) << " is not a pointer type."; @@ -416,9 +419,9 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { const auto initializer_id = inst->GetOperandAs(initializer_index); const auto initializer = _.FindDef(initializer_id); const auto is_module_scope_var = - initializer && (initializer->opcode() == SpvOpVariable) && - (initializer->GetOperandAs(storage_class_index) != - SpvStorageClassFunction); + initializer && (initializer->opcode() == spv::Op::OpVariable) && + (initializer->GetOperandAs(storage_class_index) != + spv::StorageClass::Function); const auto is_constant = initializer && spvOpcodeIsConstant(initializer->opcode()); if (!initializer || !(is_constant || is_module_scope_var)) { @@ -433,23 +436,25 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } } - auto storage_class = inst->GetOperandAs(storage_class_index); - if (storage_class != SpvStorageClassWorkgroup && - storage_class != SpvStorageClassCrossWorkgroup && - storage_class != SpvStorageClassPrivate && - storage_class != SpvStorageClassFunction && - storage_class != SpvStorageClassRayPayloadKHR && - storage_class != SpvStorageClassIncomingRayPayloadKHR && - storage_class != SpvStorageClassHitAttributeKHR && - storage_class != SpvStorageClassCallableDataKHR && - storage_class != SpvStorageClassIncomingCallableDataKHR && - storage_class != SpvStorageClassTaskPayloadWorkgroupEXT) { - bool storage_input_or_output = storage_class == SpvStorageClassInput || - storage_class == SpvStorageClassOutput; + auto storage_class = + inst->GetOperandAs(storage_class_index); + if (storage_class != spv::StorageClass::Workgroup && + storage_class != spv::StorageClass::CrossWorkgroup && + storage_class != spv::StorageClass::Private && + storage_class != spv::StorageClass::Function && + storage_class != spv::StorageClass::RayPayloadKHR && + storage_class != spv::StorageClass::IncomingRayPayloadKHR && + storage_class != spv::StorageClass::HitAttributeKHR && + storage_class != spv::StorageClass::CallableDataKHR && + storage_class != spv::StorageClass::IncomingCallableDataKHR && + storage_class != spv::StorageClass::TaskPayloadWorkgroupEXT && + storage_class != spv::StorageClass::HitObjectAttributeNV) { + bool storage_input_or_output = storage_class == spv::StorageClass::Input || + storage_class == spv::StorageClass::Output; bool builtin = false; if (storage_input_or_output) { for (const Decoration& decoration : _.id_decorations(inst->id())) { - if (decoration.dec_type() == SpvDecorationBuiltIn) { + if (decoration.dec_type() == spv::Decoration::BuiltIn) { builtin = true; break; } @@ -482,18 +487,18 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { << "Invalid storage class for target environment"; } - if (storage_class == SpvStorageClassGeneric) { + if (storage_class == spv::StorageClass::Generic) { return _.diag(SPV_ERROR_INVALID_BINARY, inst) << "OpVariable storage class cannot be Generic"; } - if (inst->function() && storage_class != SpvStorageClassFunction) { + if (inst->function() && storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << "Variables must have a function[7] storage class inside" " of a function"; } - if (!inst->function() && storage_class == SpvStorageClassFunction) { + if (!inst->function() && storage_class == spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_LAYOUT, inst) << "Variables can not have a function[7] storage class " "outside of a function"; @@ -503,7 +508,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // storage class. const auto result_storage_class_index = 1; const auto result_storage_class = - result_type->GetOperandAs(result_storage_class_index); + result_type->GetOperandAs(result_storage_class_index); if (storage_class != result_storage_class) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "From SPIR-V spec, section 3.32.8 on OpVariable:\n" @@ -513,16 +518,16 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // Variable pointer related restrictions. const auto pointee = _.FindDef(result_type->word(3)); - if (_.addressing_model() == SpvAddressingModelLogical && + if (_.addressing_model() == spv::AddressingModel::Logical && !_.options()->relax_logical_pointer) { // VariablePointersStorageBuffer is implied by VariablePointers. - if (pointee->opcode() == SpvOpTypePointer) { - if (!_.HasCapability(SpvCapabilityVariablePointersStorageBuffer)) { + if (pointee->opcode() == spv::Op::OpTypePointer) { + if (!_.HasCapability(spv::Capability::VariablePointersStorageBuffer)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "In Logical addressing, variables may not allocate a pointer " << "type"; - } else if (storage_class != SpvStorageClassFunction && - storage_class != SpvStorageClassPrivate) { + } else if (storage_class != spv::StorageClass::Function && + storage_class != spv::StorageClass::Private) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "In Logical addressing with variable pointers, variables " << "that allocate pointers must be in Function or Private " @@ -534,8 +539,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { if (spvIsVulkanEnv(_.context()->target_env)) { // Vulkan Push Constant Interface section: Check type of PushConstant // variables. - if (storage_class == SpvStorageClassPushConstant) { - if (pointee->opcode() != SpvOpTypeStruct) { + if (storage_class == spv::StorageClass::PushConstant) { + if (pointee->opcode() != spv::Op::OpTypeStruct) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(6808) << "PushConstant OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -546,11 +551,12 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // Vulkan Descriptor Set Interface: Check type of UniformConstant and // Uniform variables. - if (storage_class == SpvStorageClassUniformConstant) { + if (storage_class == spv::StorageClass::UniformConstant) { if (!IsAllowedTypeOrArrayOfSame( _, pointee, - {SpvOpTypeImage, SpvOpTypeSampler, SpvOpTypeSampledImage, - SpvOpTypeAccelerationStructureKHR})) { + {spv::Op::OpTypeImage, spv::Op::OpTypeSampler, + spv::Op::OpTypeSampledImage, + spv::Op::OpTypeAccelerationStructureKHR})) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4655) << "UniformConstant OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -562,8 +568,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } } - if (storage_class == SpvStorageClassUniform) { - if (!IsAllowedTypeOrArrayOfSame(_, pointee, {SpvOpTypeStruct})) { + if (storage_class == spv::StorageClass::Uniform) { + if (!IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(6807) << "Uniform OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -575,8 +581,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } } - if (storage_class == SpvStorageClassStorageBuffer) { - if (!IsAllowedTypeOrArrayOfSame(_, pointee, {SpvOpTypeStruct})) { + if (storage_class == spv::StorageClass::StorageBuffer) { + if (!IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(6807) << "StorageBuffer OpVariable " << _.getIdName(inst->id()) << " has illegal type.\n" @@ -589,9 +595,9 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } // Check for invalid use of Invariant - if (storage_class != SpvStorageClassInput && - storage_class != SpvStorageClassOutput) { - if (_.HasDecoration(inst->id(), SpvDecorationInvariant)) { + if (storage_class != spv::StorageClass::Input && + storage_class != spv::StorageClass::Output) { + if (_.HasDecoration(inst->id(), spv::Decoration::Invariant)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4677) << "Variable decorated with Invariant must only be identified " @@ -599,8 +605,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { "environment."; } // Need to check if only the members in a struct are decorated - if (value_type && value_type->opcode() == SpvOpTypeStruct) { - if (_.HasDecoration(value_id, SpvDecorationInvariant)) { + if (value_type && value_type->opcode() == spv::Op::OpTypeStruct) { + if (_.HasDecoration(value_id, spv::Decoration::Invariant)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4677) << "Variable struct member decorated with Invariant must only " @@ -612,10 +618,10 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // Initializers in Vulkan are only allowed in some storage clases if (inst->operands().size() > 3) { - if (storage_class == SpvStorageClassWorkgroup) { + if (storage_class == spv::StorageClass::Workgroup) { auto init_id = inst->GetOperandAs(3); auto init = _.FindDef(init_id); - if (init->opcode() != SpvOpConstantNull) { + if (init->opcode() != spv::Op::OpConstantNull) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4734) << "OpVariable, " << _.getIdName(inst->id()) @@ -623,9 +629,9 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { "Workgroup " "storage class"; } - } else if (storage_class != SpvStorageClassOutput && - storage_class != SpvStorageClassPrivate && - storage_class != SpvStorageClassFunction) { + } else if (storage_class != spv::StorageClass::Output && + storage_class != spv::StorageClass::Private && + storage_class != spv::StorageClass::Function) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4651) << "OpVariable, " << _.getIdName(inst->id()) @@ -641,35 +647,40 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } if (inst->operands().size() > 3) { - if (storage_class == SpvStorageClassTaskPayloadWorkgroupEXT) { + if (storage_class == spv::StorageClass::TaskPayloadWorkgroupEXT) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpVariable, " << _.getIdName(inst->id()) << ", initializer are not allowed for TaskPayloadWorkgroupEXT"; } - if (storage_class == SpvStorageClassInput) { + if (storage_class == spv::StorageClass::Input) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpVariable, " << _.getIdName(inst->id()) << ", initializer are not allowed for Input"; } + if (storage_class == spv::StorageClass::HitObjectAttributeNV) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << "OpVariable, " << _.getIdName(inst->id()) + << ", initializer are not allowed for HitObjectAttributeNV"; + } } - if (storage_class == SpvStorageClassPhysicalStorageBuffer) { + if (storage_class == spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "PhysicalStorageBuffer must not be used with OpVariable."; } auto pointee_base = pointee; - while (pointee_base->opcode() == SpvOpTypeArray) { + while (pointee_base->opcode() == spv::Op::OpTypeArray) { pointee_base = _.FindDef(pointee_base->GetOperandAs(1u)); } - if (pointee_base->opcode() == SpvOpTypePointer) { - if (pointee_base->GetOperandAs(1u) == - SpvStorageClassPhysicalStorageBuffer) { + if (pointee_base->opcode() == spv::Op::OpTypePointer) { + if (pointee_base->GetOperandAs(1u) == + spv::StorageClass::PhysicalStorageBuffer) { // check for AliasedPointer/RestrictPointer bool foundAliased = - _.HasDecoration(inst->id(), SpvDecorationAliasedPointer); + _.HasDecoration(inst->id(), spv::Decoration::AliasedPointer); bool foundRestrict = - _.HasDecoration(inst->id(), SpvDecorationRestrictPointer); + _.HasDecoration(inst->id(), spv::Decoration::RestrictPointer); if (!foundAliased && !foundRestrict) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpVariable " << inst->id() @@ -690,8 +701,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // OpTypeRuntimeArray should only ever be in a container like OpTypeStruct, // so should never appear as a bare variable. // Unless the module has the RuntimeDescriptorArrayEXT capability. - if (value_type && value_type->opcode() == SpvOpTypeRuntimeArray) { - if (!_.HasCapability(SpvCapabilityRuntimeDescriptorArrayEXT)) { + if (value_type && value_type->opcode() == spv::Op::OpTypeRuntimeArray) { + if (!_.HasCapability(spv::Capability::RuntimeDescriptorArrayEXT)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4680) << "OpVariable, " << _.getIdName(inst->id()) @@ -702,9 +713,9 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } else { // A bare variable OpTypeRuntimeArray is allowed in this context, but // still need to check the storage class. - if (storage_class != SpvStorageClassStorageBuffer && - storage_class != SpvStorageClassUniform && - storage_class != SpvStorageClassUniformConstant) { + if (storage_class != spv::StorageClass::StorageBuffer && + storage_class != spv::StorageClass::Uniform && + storage_class != spv::StorageClass::UniformConstant) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4680) << "For Vulkan with RuntimeDescriptorArrayEXT, a variable " @@ -718,11 +729,11 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { // must either have the storage class StorageBuffer and be decorated // with Block, or it must be in the Uniform storage class and be decorated // as BufferBlock. - if (value_type && value_type->opcode() == SpvOpTypeStruct) { + if (value_type && value_type->opcode() == spv::Op::OpTypeStruct) { if (DoesStructContainRTA(_, value_type)) { - if (storage_class == SpvStorageClassStorageBuffer || - storage_class == SpvStorageClassPhysicalStorageBuffer) { - if (!_.HasDecoration(value_id, SpvDecorationBlock)) { + if (storage_class == spv::StorageClass::StorageBuffer || + storage_class == spv::StorageClass::PhysicalStorageBuffer) { + if (!_.HasDecoration(value_id, spv::Decoration::Block)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4680) << "For Vulkan, an OpTypeStruct variable containing an " @@ -730,8 +741,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { << "has storage class StorageBuffer or " "PhysicalStorageBuffer."; } - } else if (storage_class == SpvStorageClassUniform) { - if (!_.HasDecoration(value_id, SpvDecorationBufferBlock)) { + } else if (storage_class == spv::StorageClass::Uniform) { + if (!_.HasDecoration(value_id, spv::Decoration::BufferBlock)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4680) << "For Vulkan, an OpTypeStruct variable containing an " @@ -750,8 +761,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } // Cooperative matrix types can only be allocated in Function or Private - if ((storage_class != SpvStorageClassFunction && - storage_class != SpvStorageClassPrivate) && + if ((storage_class != spv::StorageClass::Function && + storage_class != spv::StorageClass::Private) && ContainsCooperativeMatrix(_, pointee)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Cooperative matrix types (or types containing them) can only be " @@ -760,57 +771,59 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { "parameters"; } - if (_.HasCapability(SpvCapabilityShader)) { + if (_.HasCapability(spv::Capability::Shader)) { // Don't allow variables containing 16-bit elements without the appropriate // capabilities. - if ((!_.HasCapability(SpvCapabilityInt16) && - _.ContainsSizedIntOrFloatType(value_id, SpvOpTypeInt, 16)) || - (!_.HasCapability(SpvCapabilityFloat16) && - _.ContainsSizedIntOrFloatType(value_id, SpvOpTypeFloat, 16))) { + if ((!_.HasCapability(spv::Capability::Int16) && + _.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeInt, 16)) || + (!_.HasCapability(spv::Capability::Float16) && + _.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeFloat, 16))) { auto underlying_type = value_type; - while (underlying_type->opcode() == SpvOpTypePointer) { - storage_class = underlying_type->GetOperandAs(1u); + while (underlying_type->opcode() == spv::Op::OpTypePointer) { + storage_class = underlying_type->GetOperandAs(1u); underlying_type = _.FindDef(underlying_type->GetOperandAs(2u)); } bool storage_class_ok = true; std::string sc_name = _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_STORAGE_CLASS, storage_class); + SPV_OPERAND_TYPE_STORAGE_CLASS, uint32_t(storage_class)); switch (storage_class) { - case SpvStorageClassStorageBuffer: - case SpvStorageClassPhysicalStorageBuffer: - if (!_.HasCapability(SpvCapabilityStorageBuffer16BitAccess)) { + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::PhysicalStorageBuffer: + if (!_.HasCapability(spv::Capability::StorageBuffer16BitAccess)) { storage_class_ok = false; } break; - case SpvStorageClassUniform: + case spv::StorageClass::Uniform: if (!_.HasCapability( - SpvCapabilityUniformAndStorageBuffer16BitAccess)) { - if (underlying_type->opcode() == SpvOpTypeArray || - underlying_type->opcode() == SpvOpTypeRuntimeArray) { + spv::Capability::UniformAndStorageBuffer16BitAccess)) { + if (underlying_type->opcode() == spv::Op::OpTypeArray || + underlying_type->opcode() == spv::Op::OpTypeRuntimeArray) { underlying_type = _.FindDef(underlying_type->GetOperandAs(1u)); } - if (!_.HasCapability(SpvCapabilityStorageBuffer16BitAccess) || + if (!_.HasCapability(spv::Capability::StorageBuffer16BitAccess) || !_.HasDecoration(underlying_type->id(), - SpvDecorationBufferBlock)) { + spv::Decoration::BufferBlock)) { storage_class_ok = false; } } break; - case SpvStorageClassPushConstant: - if (!_.HasCapability(SpvCapabilityStoragePushConstant16)) { + case spv::StorageClass::PushConstant: + if (!_.HasCapability(spv::Capability::StoragePushConstant16)) { storage_class_ok = false; } break; - case SpvStorageClassInput: - case SpvStorageClassOutput: - if (!_.HasCapability(SpvCapabilityStorageInputOutput16)) { + case spv::StorageClass::Input: + case spv::StorageClass::Output: + if (!_.HasCapability(spv::Capability::StorageInputOutput16)) { storage_class_ok = false; } break; - case SpvStorageClassWorkgroup: - if (!_.HasCapability(SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR)) { + case spv::StorageClass::Workgroup: + if (!_.HasCapability( + spv::Capability:: + WorkgroupMemoryExplicitLayout16BitAccessKHR)) { storage_class_ok = false; } break; @@ -827,46 +840,48 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) { } // Don't allow variables containing 8-bit elements without the appropriate // capabilities. - if (!_.HasCapability(SpvCapabilityInt8) && - _.ContainsSizedIntOrFloatType(value_id, SpvOpTypeInt, 8)) { + if (!_.HasCapability(spv::Capability::Int8) && + _.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeInt, 8)) { auto underlying_type = value_type; - while (underlying_type->opcode() == SpvOpTypePointer) { - storage_class = underlying_type->GetOperandAs(1u); + while (underlying_type->opcode() == spv::Op::OpTypePointer) { + storage_class = underlying_type->GetOperandAs(1u); underlying_type = _.FindDef(underlying_type->GetOperandAs(2u)); } bool storage_class_ok = true; std::string sc_name = _.grammar().lookupOperandName( - SPV_OPERAND_TYPE_STORAGE_CLASS, storage_class); + SPV_OPERAND_TYPE_STORAGE_CLASS, uint32_t(storage_class)); switch (storage_class) { - case SpvStorageClassStorageBuffer: - case SpvStorageClassPhysicalStorageBuffer: - if (!_.HasCapability(SpvCapabilityStorageBuffer8BitAccess)) { + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::PhysicalStorageBuffer: + if (!_.HasCapability(spv::Capability::StorageBuffer8BitAccess)) { storage_class_ok = false; } break; - case SpvStorageClassUniform: + case spv::StorageClass::Uniform: if (!_.HasCapability( - SpvCapabilityUniformAndStorageBuffer8BitAccess)) { - if (underlying_type->opcode() == SpvOpTypeArray || - underlying_type->opcode() == SpvOpTypeRuntimeArray) { + spv::Capability::UniformAndStorageBuffer8BitAccess)) { + if (underlying_type->opcode() == spv::Op::OpTypeArray || + underlying_type->opcode() == spv::Op::OpTypeRuntimeArray) { underlying_type = _.FindDef(underlying_type->GetOperandAs(1u)); } - if (!_.HasCapability(SpvCapabilityStorageBuffer8BitAccess) || + if (!_.HasCapability(spv::Capability::StorageBuffer8BitAccess) || !_.HasDecoration(underlying_type->id(), - SpvDecorationBufferBlock)) { + spv::Decoration::BufferBlock)) { storage_class_ok = false; } } break; - case SpvStorageClassPushConstant: - if (!_.HasCapability(SpvCapabilityStoragePushConstant8)) { + case spv::StorageClass::PushConstant: + if (!_.HasCapability(spv::Capability::StoragePushConstant8)) { storage_class_ok = false; } break; - case SpvStorageClassWorkgroup: - if (!_.HasCapability(SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR)) { + case spv::StorageClass::Workgroup: + if (!_.HasCapability( + spv::Capability:: + WorkgroupMemoryExplicitLayout8BitAccessKHR)) { storage_class_ok = false; } break; @@ -898,7 +913,7 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) { const auto pointer_id = inst->GetOperandAs(pointer_index); const auto pointer = _.FindDef(pointer_id); if (!pointer || - ((_.addressing_model() == SpvAddressingModelLogical) && + ((_.addressing_model() == spv::AddressingModel::Logical) && ((!_.features().variable_pointers && !spvOpcodeReturnsLogicalPointer(pointer->opcode())) || (_.features().variable_pointers && @@ -909,14 +924,14 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) { } const auto pointer_type = _.FindDef(pointer->type_id()); - if (!pointer_type || pointer_type->opcode() != SpvOpTypePointer) { + if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpLoad type for pointer " << _.getIdName(pointer_id) << " is not a pointer type."; } uint32_t pointee_data_type; - uint32_t storage_class; + spv::StorageClass storage_class; if (!_.GetPointerTypeInfo(pointer_type->id(), &pointee_data_type, &storage_class) || result_type->id() != pointee_data_type) { @@ -934,13 +949,13 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) { if (auto error = CheckMemoryAccess(_, inst, 3)) return error; - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id()) && - result_type->opcode() != SpvOpTypePointer) { - if (result_type->opcode() != SpvOpTypeInt && - result_type->opcode() != SpvOpTypeFloat && - result_type->opcode() != SpvOpTypeVector && - result_type->opcode() != SpvOpTypeMatrix) { + result_type->opcode() != spv::Op::OpTypePointer) { + if (result_type->opcode() != spv::Op::OpTypeInt && + result_type->opcode() != spv::Op::OpTypeFloat && + result_type->opcode() != spv::Op::OpTypeVector && + result_type->opcode() != spv::Op::OpTypeMatrix) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "8- or 16-bit loads must be a scalar, vector or matrix type"; } @@ -954,7 +969,7 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { const auto pointer_id = inst->GetOperandAs(pointer_index); const auto pointer = _.FindDef(pointer_id); if (!pointer || - (_.addressing_model() == SpvAddressingModelLogical && + (_.addressing_model() == spv::AddressingModel::Logical && ((!_.features().variable_pointers && !spvOpcodeReturnsLogicalPointer(pointer->opcode())) || (_.features().variable_pointers && @@ -964,14 +979,14 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { << " is not a logical pointer."; } const auto pointer_type = _.FindDef(pointer->type_id()); - if (!pointer_type || pointer_type->opcode() != SpvOpTypePointer) { + if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpStore type for pointer " << _.getIdName(pointer_id) << " is not a pointer type."; } const auto type_id = pointer_type->GetOperandAs(2); const auto type = _.FindDef(type_id); - if (!type || SpvOpTypeVoid == type->opcode()) { + if (!type || spv::Op::OpTypeVoid == type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpStore Pointer " << _.getIdName(pointer_id) << "s type is void."; @@ -980,29 +995,29 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { // validate storage class { uint32_t data_type; - uint32_t storage_class; + spv::StorageClass storage_class; if (!_.GetPointerTypeInfo(pointer_type->id(), &data_type, &storage_class)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpStore Pointer " << _.getIdName(pointer_id) << " is not pointer type"; } - if (storage_class == SpvStorageClassUniformConstant || - storage_class == SpvStorageClassInput || - storage_class == SpvStorageClassPushConstant) { + if (storage_class == spv::StorageClass::UniformConstant || + storage_class == spv::StorageClass::Input || + storage_class == spv::StorageClass::PushConstant) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpStore Pointer " << _.getIdName(pointer_id) << " storage class is read-only"; - } else if (storage_class == SpvStorageClassShaderRecordBufferKHR) { + } else if (storage_class == spv::StorageClass::ShaderRecordBufferKHR) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "ShaderRecordBufferKHR Storage Class variables are read only"; - } else if (storage_class == SpvStorageClassHitAttributeKHR) { + } else if (storage_class == spv::StorageClass::HitAttributeKHR) { std::string errorVUID = _.VkErrorID(4703); _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model == SpvExecutionModelAnyHitKHR || - model == SpvExecutionModelClosestHitKHR) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model == spv::ExecutionModel::AnyHitKHR || + model == spv::ExecutionModel::ClosestHitKHR) { if (message) { *message = errorVUID + @@ -1016,18 +1031,18 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { } if (spvIsVulkanEnv(_.context()->target_env) && - storage_class == SpvStorageClassUniform) { + storage_class == spv::StorageClass::Uniform) { auto base_ptr = _.TracePointer(pointer); - if (base_ptr->opcode() == SpvOpVariable) { + if (base_ptr->opcode() == spv::Op::OpVariable) { // If it's not a variable a different check should catch the problem. auto base_type = _.FindDef(base_ptr->GetOperandAs(0)); // Get the pointed-to type. base_type = _.FindDef(base_type->GetOperandAs(2u)); - if (base_type->opcode() == SpvOpTypeArray || - base_type->opcode() == SpvOpTypeRuntimeArray) { + if (base_type->opcode() == spv::Op::OpTypeArray || + base_type->opcode() == spv::Op::OpTypeRuntimeArray) { base_type = _.FindDef(base_type->GetOperandAs(1u)); } - if (_.HasDecoration(base_type->id(), SpvDecorationBlock)) { + if (_.HasDecoration(base_type->id(), spv::Decoration::Block)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(6925) << "In the Vulkan environment, cannot store to Uniform Blocks"; @@ -1045,15 +1060,16 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { << " is not an object."; } const auto object_type = _.FindDef(object->type_id()); - if (!object_type || SpvOpTypeVoid == object_type->opcode()) { + if (!object_type || spv::Op::OpTypeVoid == object_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpStore Object " << _.getIdName(object_id) << "s type is void."; } if (type->id() != object_type->id()) { - if (!_.options()->relax_struct_store || type->opcode() != SpvOpTypeStruct || - object_type->opcode() != SpvOpTypeStruct) { + if (!_.options()->relax_struct_store || + type->opcode() != spv::Op::OpTypeStruct || + object_type->opcode() != spv::Op::OpTypeStruct) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpStore Pointer " << _.getIdName(pointer_id) << "s type does not match Object " @@ -1071,13 +1087,13 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { if (auto error = CheckMemoryAccess(_, inst, 2)) return error; - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id()) && - object_type->opcode() != SpvOpTypePointer) { - if (object_type->opcode() != SpvOpTypeInt && - object_type->opcode() != SpvOpTypeFloat && - object_type->opcode() != SpvOpTypeVector && - object_type->opcode() != SpvOpTypeMatrix) { + object_type->opcode() != spv::Op::OpTypePointer) { + if (object_type->opcode() != spv::Op::OpTypeInt && + object_type->opcode() != spv::Op::OpTypeFloat && + object_type->opcode() != spv::Op::OpTypeVector && + object_type->opcode() != spv::Op::OpTypeMatrix) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "8- or 16-bit stores must be a scalar, vector or matrix type"; } @@ -1088,9 +1104,10 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateCopyMemoryMemoryAccess(ValidationState_t& _, const Instruction* inst) { - assert(inst->opcode() == SpvOpCopyMemory || - inst->opcode() == SpvOpCopyMemorySized); - const uint32_t first_access_index = inst->opcode() == SpvOpCopyMemory ? 2 : 3; + assert(inst->opcode() == spv::Op::OpCopyMemory || + inst->opcode() == spv::Op::OpCopyMemorySized); + const uint32_t first_access_index = + inst->opcode() == spv::Op::OpCopyMemory ? 2 : 3; if (inst->operands().size() > first_access_index) { if (auto error = CheckMemoryAccess(_, inst, first_access_index)) return error; @@ -1108,21 +1125,23 @@ spv_result_t ValidateCopyMemoryMemoryAccess(ValidationState_t& _, // make-visible. // - the second is the source (read) access and it can't have // make-available. - if (first_access & SpvMemoryAccessMakePointerVisibleKHRMask) { + if (first_access & + uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Target memory access must not include " "MakePointerVisibleKHR"; } const auto second_access = inst->GetOperandAs(second_access_index); - if (second_access & SpvMemoryAccessMakePointerAvailableKHRMask) { + if (second_access & + uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Source memory access must not include " "MakePointerAvailableKHR"; } } else { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << spvOpcodeString(static_cast(inst->opcode())) + << spvOpcodeString(static_cast(inst->opcode())) << " with two memory access operands requires SPIR-V 1.4 or " "later"; } @@ -1152,7 +1171,7 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { const auto target_pointer_type = _.FindDef(target->type_id()); if (!target_pointer_type || - target_pointer_type->opcode() != SpvOpTypePointer) { + target_pointer_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Target operand " << _.getIdName(target_id) << " is not a pointer."; @@ -1160,16 +1179,16 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { const auto source_pointer_type = _.FindDef(source->type_id()); if (!source_pointer_type || - source_pointer_type->opcode() != SpvOpTypePointer) { + source_pointer_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Source operand " << _.getIdName(source_id) << " is not a pointer."; } - if (inst->opcode() == SpvOpCopyMemory) { + if (inst->opcode() == spv::Op::OpCopyMemory) { const auto target_type = _.FindDef(target_pointer_type->GetOperandAs(2)); - if (!target_type || target_type->opcode() == SpvOpTypeVoid) { + if (!target_type || target_type->opcode() == spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Target operand " << _.getIdName(target_id) << " cannot be a void pointer."; @@ -1177,7 +1196,7 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { const auto source_type = _.FindDef(source_pointer_type->GetOperandAs(2)); - if (!source_type || source_type->opcode() == SpvOpTypeVoid) { + if (!source_type || source_type->opcode() == spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Source operand " << _.getIdName(source_id) << " cannot be a void pointer."; @@ -1207,11 +1226,11 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { bool is_zero = true; switch (size->opcode()) { - case SpvOpConstantNull: + case spv::Op::OpConstantNull: return _.diag(SPV_ERROR_INVALID_ID, inst) << "Size operand " << _.getIdName(size_id) << " cannot be a constant zero."; - case SpvOpConstant: + case spv::Op::OpConstant: if (size_type->word(3) == 1 && size->word(size->words().size() - 1) & 0x80000000) { return _.diag(SPV_ERROR_INVALID_ID, inst) @@ -1236,10 +1255,10 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { // Get past the pointers to avoid checking a pointer copy. auto sub_type = _.FindDef(target_pointer_type->GetOperandAs(2)); - while (sub_type->opcode() == SpvOpTypePointer) { + while (sub_type->opcode() == spv::Op::OpTypePointer) { sub_type = _.FindDef(sub_type->GetOperandAs(2)); } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(sub_type->id())) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Cannot copy memory of objects containing 8- or 16-bit types"; @@ -1251,15 +1270,16 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) { spv_result_t ValidateAccessChain(ValidationState_t& _, const Instruction* inst) { std::string instr_name = - "Op" + std::string(spvOpcodeString(static_cast(inst->opcode()))); + "Op" + std::string(spvOpcodeString(static_cast(inst->opcode()))); // The result type must be OpTypePointer. auto result_type = _.FindDef(inst->type_id()); - if (SpvOpTypePointer != result_type->opcode()) { + if (spv::Op::OpTypePointer != result_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The Result Type of " << instr_name << " " << _.getIdName(inst->id()) << " must be OpTypePointer. Found Op" - << spvOpcodeString(static_cast(result_type->opcode())) << "."; + << spvOpcodeString(static_cast(result_type->opcode())) + << "."; } // Result type is a pointer. Find out what it's pointing to. @@ -1272,7 +1292,7 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, const auto base_id = inst->GetOperandAs(base_index); const auto base = _.FindDef(base_id); const auto base_type = _.FindDef(base->type_id()); - if (!base_type || SpvOpTypePointer != base_type->opcode()) { + if (!base_type || spv::Op::OpTypePointer != base_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "The Base " << _.getIdName(base_id) << " in " << instr_name << " instruction must be a pointer."; @@ -1296,8 +1316,8 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, // The number of indexes passed to OpAccessChain may not exceed 255 // The instruction includes 4 words + N words (for N indexes) size_t num_indexes = inst->words().size() - 4; - if (inst->opcode() == SpvOpPtrAccessChain || - inst->opcode() == SpvOpInBoundsPtrAccessChain) { + if (inst->opcode() == spv::Op::OpPtrAccessChain || + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) { // In pointer access chains, the element operand is required, but not // counted as an index. --num_indexes; @@ -1317,8 +1337,8 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, // on. Once any non-composite type is reached, there must be no remaining // (unused) indexes. auto starting_index = 4; - if (inst->opcode() == SpvOpPtrAccessChain || - inst->opcode() == SpvOpInBoundsPtrAccessChain) { + if (inst->opcode() == spv::Op::OpPtrAccessChain || + inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) { ++starting_index; } for (size_t i = starting_index; i < inst->words().size(); ++i) { @@ -1327,26 +1347,26 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, auto cur_word_instr = _.FindDef(cur_word); // The index must be a scalar integer type (See OpAccessChain in the Spec.) auto index_type = _.FindDef(cur_word_instr->type_id()); - if (!index_type || SpvOpTypeInt != index_type->opcode()) { + if (!index_type || spv::Op::OpTypeInt != index_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Indexes passed to " << instr_name << " must be of type integer."; } switch (type_pointee->opcode()) { - case SpvOpTypeMatrix: - case SpvOpTypeVector: - case SpvOpTypeCooperativeMatrixNV: - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: { - // In OpTypeMatrix, OpTypeVector, SpvOpTypeCooperativeMatrixNV, + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeCooperativeMatrixNV: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: { + // In OpTypeMatrix, OpTypeVector, spv::Op::OpTypeCooperativeMatrixNV, // OpTypeArray, and OpTypeRuntimeArray, word 2 is the Element Type. type_pointee = _.FindDef(type_pointee->word(2)); break; } - case SpvOpTypeStruct: { + case spv::Op::OpTypeStruct: { // In case of structures, there is an additional constraint on the // index: the index must be an OpConstant. - if (SpvOpConstant != cur_word_instr->opcode()) { + if (spv::Op::OpConstant != cur_word_instr->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, cur_word_instr) << "The passed to " << instr_name << " to index into a " @@ -1378,7 +1398,7 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, } default: { // Give an error. reached non-composite type while indexes still remain. - return _.diag(SPV_ERROR_INVALID_ID, cur_word_instr) + return _.diag(SPV_ERROR_INVALID_ID, inst) << instr_name << " reached non-composite type while indexes " "still remain to be traversed."; @@ -1390,11 +1410,12 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, if (type_pointee->id() != result_type_pointee->id()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << instr_name << " result type (Op" - << spvOpcodeString(static_cast(result_type_pointee->opcode())) + << spvOpcodeString( + static_cast(result_type_pointee->opcode())) << ") does not match the type that results from indexing into the " "base " " (Op" - << spvOpcodeString(static_cast(type_pointee->opcode())) + << spvOpcodeString(static_cast(type_pointee->opcode())) << ")."; } @@ -1403,7 +1424,7 @@ spv_result_t ValidateAccessChain(ValidationState_t& _, spv_result_t ValidatePtrAccessChain(ValidationState_t& _, const Instruction* inst) { - if (_.addressing_model() == SpvAddressingModelLogical) { + if (_.addressing_model() == spv::AddressingModel::Logical) { if (!_.features().variable_pointers) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Generating variable pointers requires capability " @@ -1417,30 +1438,31 @@ spv_result_t ValidatePtrAccessChain(ValidationState_t& _, const auto base_id = inst->GetOperandAs(2); const auto base = _.FindDef(base_id); const auto base_type = _.FindDef(base->type_id()); - const auto base_type_storage_class = base_type->word(2); + const auto base_type_storage_class = + base_type->GetOperandAs(1); - if (_.HasCapability(SpvCapabilityShader) && - (base_type_storage_class == SpvStorageClassUniform || - base_type_storage_class == SpvStorageClassStorageBuffer || - base_type_storage_class == SpvStorageClassPhysicalStorageBuffer || - base_type_storage_class == SpvStorageClassPushConstant || - (_.HasCapability(SpvCapabilityWorkgroupMemoryExplicitLayoutKHR) && - base_type_storage_class == SpvStorageClassWorkgroup)) && - !_.HasDecoration(base_type->id(), SpvDecorationArrayStride)) { + if (_.HasCapability(spv::Capability::Shader) && + (base_type_storage_class == spv::StorageClass::Uniform || + base_type_storage_class == spv::StorageClass::StorageBuffer || + base_type_storage_class == spv::StorageClass::PhysicalStorageBuffer || + base_type_storage_class == spv::StorageClass::PushConstant || + (_.HasCapability(spv::Capability::WorkgroupMemoryExplicitLayoutKHR) && + base_type_storage_class == spv::StorageClass::Workgroup)) && + !_.HasDecoration(base_type->id(), spv::Decoration::ArrayStride)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "OpPtrAccessChain must have a Base whose type is decorated " "with ArrayStride"; } if (spvIsVulkanEnv(_.context()->target_env)) { - if (base_type_storage_class == SpvStorageClassWorkgroup) { - if (!_.HasCapability(SpvCapabilityVariablePointers)) { + if (base_type_storage_class == spv::StorageClass::Workgroup) { + if (!_.HasCapability(spv::Capability::VariablePointers)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(7651) << "OpPtrAccessChain Base operand pointing to Workgroup " "storage class must use VariablePointers capability"; } - } else if (base_type_storage_class == SpvStorageClassStorageBuffer) { + } else if (base_type_storage_class == spv::StorageClass::StorageBuffer) { if (!_.features().variable_pointers) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(7652) @@ -1449,7 +1471,7 @@ spv_result_t ValidatePtrAccessChain(ValidationState_t& _, "VariablePointersStorageBuffer capability"; } } else if (base_type_storage_class != - SpvStorageClassPhysicalStorageBuffer) { + spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(7650) << "OpPtrAccessChain Base operand must point to Workgroup, " @@ -1463,11 +1485,11 @@ spv_result_t ValidatePtrAccessChain(ValidationState_t& _, spv_result_t ValidateArrayLength(ValidationState_t& state, const Instruction* inst) { std::string instr_name = - "Op" + std::string(spvOpcodeString(static_cast(inst->opcode()))); + "Op" + std::string(spvOpcodeString(static_cast(inst->opcode()))); // Result type must be a 32-bit unsigned int. auto result_type = state.FindDef(inst->type_id()); - if (result_type->opcode() != SpvOpTypeInt || + if (result_type->opcode() != spv::Op::OpTypeInt || result_type->GetOperandAs(1) != 32 || result_type->GetOperandAs(2) != 0) { return state.diag(SPV_ERROR_INVALID_ID, inst) @@ -1480,7 +1502,7 @@ spv_result_t ValidateArrayLength(ValidationState_t& state, // last element is a runtime array. auto pointer = state.FindDef(inst->GetOperandAs(2)); auto pointer_type = state.FindDef(pointer->type_id()); - if (pointer_type->opcode() != SpvOpTypePointer) { + if (pointer_type->opcode() != spv::Op::OpTypePointer) { return state.diag(SPV_ERROR_INVALID_ID, inst) << "The Structure's type in " << instr_name << " " << state.getIdName(inst->id()) @@ -1488,7 +1510,7 @@ spv_result_t ValidateArrayLength(ValidationState_t& state, } auto structure_type = state.FindDef(pointer_type->GetOperandAs(2)); - if (structure_type->opcode() != SpvOpTypeStruct) { + if (structure_type->opcode() != spv::Op::OpTypeStruct) { return state.diag(SPV_ERROR_INVALID_ID, inst) << "The Structure's type in " << instr_name << " " << state.getIdName(inst->id()) @@ -1498,7 +1520,7 @@ spv_result_t ValidateArrayLength(ValidationState_t& state, auto num_of_members = structure_type->operands().size() - 1; auto last_member = state.FindDef(structure_type->GetOperandAs(num_of_members)); - if (last_member->opcode() != SpvOpTypeRuntimeArray) { + if (last_member->opcode() != spv::Op::OpTypeRuntimeArray) { return state.diag(SPV_ERROR_INVALID_ID, inst) << "The Structure's last member in " << instr_name << " " << state.getIdName(inst->id()) << " must be an OpTypeRuntimeArray."; @@ -1518,11 +1540,11 @@ spv_result_t ValidateArrayLength(ValidationState_t& state, spv_result_t ValidateCooperativeMatrixLengthNV(ValidationState_t& state, const Instruction* inst) { std::string instr_name = - "Op" + std::string(spvOpcodeString(static_cast(inst->opcode()))); + "Op" + std::string(spvOpcodeString(static_cast(inst->opcode()))); // Result type must be a 32-bit unsigned int. auto result_type = state.FindDef(inst->type_id()); - if (result_type->opcode() != SpvOpTypeInt || + if (result_type->opcode() != spv::Op::OpTypeInt || result_type->GetOperandAs(1) != 32 || result_type->GetOperandAs(2) != 0) { return state.diag(SPV_ERROR_INVALID_ID, inst) @@ -1533,7 +1555,7 @@ spv_result_t ValidateCooperativeMatrixLengthNV(ValidationState_t& state, auto type_id = inst->GetOperandAs(2); auto type = state.FindDef(type_id); - if (type->opcode() != SpvOpTypeCooperativeMatrixNV) { + if (type->opcode() != spv::Op::OpTypeCooperativeMatrixNV) { return state.diag(SPV_ERROR_INVALID_ID, inst) << "The type in " << instr_name << " " << state.getIdName(type_id) << " must be OpTypeCooperativeMatrixNV."; @@ -1545,35 +1567,35 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _, const Instruction* inst) { uint32_t type_id; const char* opname; - if (inst->opcode() == SpvOpCooperativeMatrixLoadNV) { + if (inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV) { type_id = inst->type_id(); - opname = "SpvOpCooperativeMatrixLoadNV"; + opname = "spv::Op::OpCooperativeMatrixLoadNV"; } else { // get Object operand's type type_id = _.FindDef(inst->GetOperandAs(1))->type_id(); - opname = "SpvOpCooperativeMatrixStoreNV"; + opname = "spv::Op::OpCooperativeMatrixStoreNV"; } auto matrix_type = _.FindDef(type_id); - if (matrix_type->opcode() != SpvOpTypeCooperativeMatrixNV) { - if (inst->opcode() == SpvOpCooperativeMatrixLoadNV) { + if (matrix_type->opcode() != spv::Op::OpTypeCooperativeMatrixNV) { + if (inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV) { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "SpvOpCooperativeMatrixLoadNV Result Type " + << "spv::Op::OpCooperativeMatrixLoadNV Result Type " << _.getIdName(type_id) << " is not a cooperative matrix type."; } else { return _.diag(SPV_ERROR_INVALID_ID, inst) - << "SpvOpCooperativeMatrixStoreNV Object type " + << "spv::Op::OpCooperativeMatrixStoreNV Object type " << _.getIdName(type_id) << " is not a cooperative matrix type."; } } const auto pointer_index = - (inst->opcode() == SpvOpCooperativeMatrixLoadNV) ? 2u : 0u; + (inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV) ? 2u : 0u; const auto pointer_id = inst->GetOperandAs(pointer_index); const auto pointer = _.FindDef(pointer_id); if (!pointer || - ((_.addressing_model() == SpvAddressingModelLogical) && + ((_.addressing_model() == spv::AddressingModel::Logical) && ((!_.features().variable_pointers && !spvOpcodeReturnsLogicalPointer(pointer->opcode())) || (_.features().variable_pointers && @@ -1585,7 +1607,7 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _, const auto pointer_type_id = pointer->type_id(); const auto pointer_type = _.FindDef(pointer_type_id); - if (!pointer_type || pointer_type->opcode() != SpvOpTypePointer) { + if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << opname << " type for pointer " << _.getIdName(pointer_id) << " is not a pointer type."; @@ -1593,11 +1615,11 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _, const auto storage_class_index = 1u; const auto storage_class = - pointer_type->GetOperandAs(storage_class_index); + pointer_type->GetOperandAs(storage_class_index); - if (storage_class != SpvStorageClassWorkgroup && - storage_class != SpvStorageClassStorageBuffer && - storage_class != SpvStorageClassPhysicalStorageBuffer) { + if (storage_class != spv::StorageClass::Workgroup && + storage_class != spv::StorageClass::StorageBuffer && + storage_class != spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << opname << " storage class for pointer type " << _.getIdName(pointer_type_id) @@ -1614,7 +1636,7 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _, } const auto stride_index = - (inst->opcode() == SpvOpCooperativeMatrixLoadNV) ? 3u : 2u; + (inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV) ? 3u : 2u; const auto stride_id = inst->GetOperandAs(stride_index); const auto stride = _.FindDef(stride_id); if (!stride || !_.IsIntScalarType(stride->type_id())) { @@ -1624,7 +1646,7 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _, } const auto colmajor_index = - (inst->opcode() == SpvOpCooperativeMatrixLoadNV) ? 4u : 3u; + (inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV) ? 4u : 3u; const auto colmajor_id = inst->GetOperandAs(colmajor_index); const auto colmajor = _.FindDef(colmajor_id); if (!colmajor || !_.IsBoolScalarType(colmajor->type_id()) || @@ -1636,7 +1658,7 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _, } const auto memory_access_index = - (inst->opcode() == SpvOpCooperativeMatrixLoadNV) ? 5u : 4u; + (inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV) ? 5u : 4u; if (inst->operands().size() > memory_access_index) { if (auto error = CheckMemoryAccess(_, inst, memory_access_index)) return error; @@ -1647,7 +1669,7 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _, spv_result_t ValidatePtrComparison(ValidationState_t& _, const Instruction* inst) { - if (_.addressing_model() == SpvAddressingModelLogical && + if (_.addressing_model() == spv::AddressingModel::Logical && !_.features().variable_pointers) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Instruction cannot for logical addressing model be used without " @@ -1655,13 +1677,13 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _, } const auto result_type = _.FindDef(inst->type_id()); - if (inst->opcode() == SpvOpPtrDiff) { - if (!result_type || result_type->opcode() != SpvOpTypeInt) { + if (inst->opcode() == spv::Op::OpPtrDiff) { + if (!result_type || result_type->opcode() != spv::Op::OpTypeInt) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Result Type must be an integer scalar"; } } else { - if (!result_type || result_type->opcode() != SpvOpTypeBool) { + if (!result_type || result_type->opcode() != spv::Op::OpTypeBool) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Result Type must be OpTypeBool"; } @@ -1674,25 +1696,26 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _, << "The types of Operand 1 and Operand 2 must match"; } const auto op1_type = _.FindDef(op1->type_id()); - if (!op1_type || op1_type->opcode() != SpvOpTypePointer) { + if (!op1_type || op1_type->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Operand type must be a pointer"; } - SpvStorageClass sc = op1_type->GetOperandAs(1u); - if (_.addressing_model() == SpvAddressingModelLogical) { - if (sc != SpvStorageClassWorkgroup && sc != SpvStorageClassStorageBuffer) { + spv::StorageClass sc = op1_type->GetOperandAs(1u); + if (_.addressing_model() == spv::AddressingModel::Logical) { + if (sc != spv::StorageClass::Workgroup && + sc != spv::StorageClass::StorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Invalid pointer storage class"; } - if (sc == SpvStorageClassWorkgroup && - !_.HasCapability(SpvCapabilityVariablePointers)) { + if (sc == spv::StorageClass::Workgroup && + !_.HasCapability(spv::Capability::VariablePointers)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Workgroup storage class pointer requires VariablePointers " "capability to be specified"; } - } else if (sc == SpvStorageClassPhysicalStorageBuffer) { + } else if (sc == spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Cannot use a pointer in the PhysicalStorageBuffer storage class"; } @@ -1704,45 +1727,45 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _, spv_result_t MemoryPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpVariable: + case spv::Op::OpVariable: if (auto error = ValidateVariable(_, inst)) return error; break; - case SpvOpLoad: + case spv::Op::OpLoad: if (auto error = ValidateLoad(_, inst)) return error; break; - case SpvOpStore: + case spv::Op::OpStore: if (auto error = ValidateStore(_, inst)) return error; break; - case SpvOpCopyMemory: - case SpvOpCopyMemorySized: + case spv::Op::OpCopyMemory: + case spv::Op::OpCopyMemorySized: if (auto error = ValidateCopyMemory(_, inst)) return error; break; - case SpvOpPtrAccessChain: + case spv::Op::OpPtrAccessChain: if (auto error = ValidatePtrAccessChain(_, inst)) return error; break; - case SpvOpAccessChain: - case SpvOpInBoundsAccessChain: - case SpvOpInBoundsPtrAccessChain: + case spv::Op::OpAccessChain: + case spv::Op::OpInBoundsAccessChain: + case spv::Op::OpInBoundsPtrAccessChain: if (auto error = ValidateAccessChain(_, inst)) return error; break; - case SpvOpArrayLength: + case spv::Op::OpArrayLength: if (auto error = ValidateArrayLength(_, inst)) return error; break; - case SpvOpCooperativeMatrixLoadNV: - case SpvOpCooperativeMatrixStoreNV: + case spv::Op::OpCooperativeMatrixLoadNV: + case spv::Op::OpCooperativeMatrixStoreNV: if (auto error = ValidateCooperativeMatrixLoadStoreNV(_, inst)) return error; break; - case SpvOpCooperativeMatrixLengthNV: + case spv::Op::OpCooperativeMatrixLengthNV: if (auto error = ValidateCooperativeMatrixLengthNV(_, inst)) return error; break; - case SpvOpPtrEqual: - case SpvOpPtrNotEqual: - case SpvOpPtrDiff: + case spv::Op::OpPtrEqual: + case spv::Op::OpPtrNotEqual: + case spv::Op::OpPtrDiff: if (auto error = ValidatePtrComparison(_, inst)) return error; break; - case SpvOpImageTexelPointer: - case SpvOpGenericPtrMemSemantics: + case spv::Op::OpImageTexelPointer: + case spv::Op::OpGenericPtrMemSemantics: default: break; } diff --git a/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp b/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp index d9189313a..748b23861 100644 --- a/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp +++ b/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp @@ -27,7 +27,7 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, const Instruction* inst, uint32_t operand_index, uint32_t memory_scope) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const auto id = inst->GetOperandAs(operand_index); bool is_int32 = false, is_const_int32 = false; uint32_t value = 0; @@ -40,15 +40,15 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, } if (!is_const_int32) { - if (_.HasCapability(SpvCapabilityShader) && - !_.HasCapability(SpvCapabilityCooperativeMatrixNV)) { + if (_.HasCapability(spv::Capability::Shader) && + !_.HasCapability(spv::Capability::CooperativeMatrixNV)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Memory Semantics ids must be OpConstant when Shader " "capability is present"; } - if (_.HasCapability(SpvCapabilityShader) && - _.HasCapability(SpvCapabilityCooperativeMatrixNV) && + if (_.HasCapability(spv::Capability::Shader) && + _.HasCapability(spv::Capability::CooperativeMatrixNV) && !spvOpcodeIsConstant(_.GetIdOpcode(id))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Memory Semantics must be a constant instruction when " @@ -58,9 +58,10 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, } const size_t num_memory_order_set_bits = spvtools::utils::CountSetBits( - value & (SpvMemorySemanticsAcquireMask | SpvMemorySemanticsReleaseMask | - SpvMemorySemanticsAcquireReleaseMask | - SpvMemorySemanticsSequentiallyConsistentMask)); + value & uint32_t(spv::MemorySemanticsMask::Acquire | + spv::MemorySemanticsMask::Release | + spv::MemorySemanticsMask::AcquireRelease | + spv::MemorySemanticsMask::SequentiallyConsistent)); if (num_memory_order_set_bits > 1) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -71,40 +72,40 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, "SequentiallyConsistent"; } - if (_.memory_model() == SpvMemoryModelVulkanKHR && - value & SpvMemorySemanticsSequentiallyConsistentMask) { + if (_.memory_model() == spv::MemoryModel::VulkanKHR && + value & uint32_t(spv::MemorySemanticsMask::SequentiallyConsistent)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "SequentiallyConsistent memory " "semantics cannot be used with " "the VulkanKHR memory model."; } - if (value & SpvMemorySemanticsMakeAvailableKHRMask && - !_.HasCapability(SpvCapabilityVulkanMemoryModelKHR)) { + if (value & uint32_t(spv::MemorySemanticsMask::MakeAvailableKHR) && + !_.HasCapability(spv::Capability::VulkanMemoryModelKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Memory Semantics MakeAvailableKHR requires capability " << "VulkanMemoryModelKHR"; } - if (value & SpvMemorySemanticsMakeVisibleKHRMask && - !_.HasCapability(SpvCapabilityVulkanMemoryModelKHR)) { + if (value & uint32_t(spv::MemorySemanticsMask::MakeVisibleKHR) && + !_.HasCapability(spv::Capability::VulkanMemoryModelKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Memory Semantics MakeVisibleKHR requires capability " << "VulkanMemoryModelKHR"; } - if (value & SpvMemorySemanticsOutputMemoryKHRMask && - !_.HasCapability(SpvCapabilityVulkanMemoryModelKHR)) { + if (value & uint32_t(spv::MemorySemanticsMask::OutputMemoryKHR) && + !_.HasCapability(spv::Capability::VulkanMemoryModelKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Memory Semantics OutputMemoryKHR requires capability " << "VulkanMemoryModelKHR"; } - if (value & SpvMemorySemanticsVolatileMask) { - if (!_.HasCapability(SpvCapabilityVulkanMemoryModelKHR)) { + if (value & uint32_t(spv::MemorySemanticsMask::Volatile)) { + if (!_.HasCapability(spv::Capability::VulkanMemoryModelKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Memory Semantics Volatile requires capability " @@ -118,26 +119,27 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, } } - if (value & SpvMemorySemanticsUniformMemoryMask && - !_.HasCapability(SpvCapabilityShader)) { + if (value & uint32_t(spv::MemorySemanticsMask::UniformMemory) && + !_.HasCapability(spv::Capability::Shader)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Memory Semantics UniformMemory requires capability Shader"; } - // Checking for SpvCapabilityAtomicStorage is intentionally not done here. See - // https://github.com/KhronosGroup/glslang/issues/1618 for the reasoning why. + // Checking for spv::Capability::AtomicStorage is intentionally not done here. + // See https://github.com/KhronosGroup/glslang/issues/1618 for the reasoning + // why. - if (value & (SpvMemorySemanticsMakeAvailableKHRMask | - SpvMemorySemanticsMakeVisibleKHRMask)) { + if (value & uint32_t(spv::MemorySemanticsMask::MakeAvailableKHR | + spv::MemorySemanticsMask::MakeVisibleKHR)) { const bool includes_storage_class = - value & (SpvMemorySemanticsUniformMemoryMask | - SpvMemorySemanticsSubgroupMemoryMask | - SpvMemorySemanticsWorkgroupMemoryMask | - SpvMemorySemanticsCrossWorkgroupMemoryMask | - SpvMemorySemanticsAtomicCounterMemoryMask | - SpvMemorySemanticsImageMemoryMask | - SpvMemorySemanticsOutputMemoryKHRMask); + value & uint32_t(spv::MemorySemanticsMask::UniformMemory | + spv::MemorySemanticsMask::SubgroupMemory | + spv::MemorySemanticsMask::WorkgroupMemory | + spv::MemorySemanticsMask::CrossWorkgroupMemory | + spv::MemorySemanticsMask::AtomicCounterMemory | + spv::MemorySemanticsMask::ImageMemory | + spv::MemorySemanticsMask::OutputMemoryKHR); if (!includes_storage_class) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -146,18 +148,18 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, } } - if (value & SpvMemorySemanticsMakeVisibleKHRMask && - !(value & (SpvMemorySemanticsAcquireMask | - SpvMemorySemanticsAcquireReleaseMask))) { + if (value & uint32_t(spv::MemorySemanticsMask::MakeVisibleKHR) && + !(value & uint32_t(spv::MemorySemanticsMask::Acquire | + spv::MemorySemanticsMask::AcquireRelease))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": MakeVisibleKHR Memory Semantics also requires either Acquire " "or AcquireRelease Memory Semantics"; } - if (value & SpvMemorySemanticsMakeAvailableKHRMask && - !(value & (SpvMemorySemanticsReleaseMask | - SpvMemorySemanticsAcquireReleaseMask))) { + if (value & uint32_t(spv::MemorySemanticsMask::MakeAvailableKHR) && + !(value & uint32_t(spv::MemorySemanticsMask::Release | + spv::MemorySemanticsMask::AcquireRelease))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": MakeAvailableKHR Memory Semantics also requires either " @@ -166,12 +168,12 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, if (spvIsVulkanEnv(_.context()->target_env)) { const bool includes_storage_class = - value & (SpvMemorySemanticsUniformMemoryMask | - SpvMemorySemanticsWorkgroupMemoryMask | - SpvMemorySemanticsImageMemoryMask | - SpvMemorySemanticsOutputMemoryKHRMask); + value & uint32_t(spv::MemorySemanticsMask::UniformMemory | + spv::MemorySemanticsMask::WorkgroupMemory | + spv::MemorySemanticsMask::ImageMemory | + spv::MemorySemanticsMask::OutputMemoryKHR); - if (opcode == SpvOpMemoryBarrier && !num_memory_order_set_bits) { + if (opcode == spv::Op::OpMemoryBarrier && !num_memory_order_set_bits) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4732) << spvOpcodeString(opcode) << ": Vulkan specification requires Memory Semantics to have " @@ -179,13 +181,15 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, "of the following bits set: Acquire, Release, " "AcquireRelease " "or SequentiallyConsistent"; - } else if (opcode != SpvOpMemoryBarrier && num_memory_order_set_bits) { + } else if (opcode != spv::Op::OpMemoryBarrier && + num_memory_order_set_bits) { // should leave only atomics and control barriers for Vulkan env bool memory_is_int32 = false, memory_is_const_int32 = false; uint32_t memory_value = 0; std::tie(memory_is_int32, memory_is_const_int32, memory_value) = _.EvalInt32IfConst(memory_scope); - if (memory_is_int32 && memory_value == SpvScopeInvocation) { + if (memory_is_int32 && + spv::Scope(memory_value) == spv::Scope::Invocation) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4641) << spvOpcodeString(opcode) << ": Vulkan specification requires Memory Semantics to be None " @@ -193,7 +197,7 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, } } - if (opcode == SpvOpMemoryBarrier && !includes_storage_class) { + if (opcode == spv::Op::OpMemoryBarrier && !includes_storage_class) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4733) << spvOpcodeString(opcode) << ": expected Memory Semantics to include a Vulkan-supported " @@ -202,7 +206,7 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, #if 0 // TODO(atgoo@github.com): this check fails Vulkan CTS, reenable once fixed. - if (opcode == SpvOpControlBarrier && value && !includes_storage_class) { + if (opcode == spv::Op::OpControlBarrier && value && !includes_storage_class) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": expected Memory Semantics to include a Vulkan-supported " @@ -211,18 +215,18 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, #endif } - if (opcode == SpvOpAtomicFlagClear && - (value & SpvMemorySemanticsAcquireMask || - value & SpvMemorySemanticsAcquireReleaseMask)) { + if (opcode == spv::Op::OpAtomicFlagClear && + (value & uint32_t(spv::MemorySemanticsMask::Acquire) || + value & uint32_t(spv::MemorySemanticsMask::AcquireRelease))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Memory Semantics Acquire and AcquireRelease cannot be used " "with " << spvOpcodeString(opcode); } - if (opcode == SpvOpAtomicCompareExchange && operand_index == 5 && - (value & SpvMemorySemanticsReleaseMask || - value & SpvMemorySemanticsAcquireReleaseMask)) { + if (opcode == spv::Op::OpAtomicCompareExchange && operand_index == 5 && + (value & uint32_t(spv::MemorySemanticsMask::Release) || + value & uint32_t(spv::MemorySemanticsMask::AcquireRelease))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Memory Semantics Release and AcquireRelease cannot be " @@ -231,20 +235,20 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _, } if (spvIsVulkanEnv(_.context()->target_env)) { - if (opcode == SpvOpAtomicLoad && - (value & SpvMemorySemanticsReleaseMask || - value & SpvMemorySemanticsAcquireReleaseMask || - value & SpvMemorySemanticsSequentiallyConsistentMask)) { + if (opcode == spv::Op::OpAtomicLoad && + (value & uint32_t(spv::MemorySemanticsMask::Release) || + value & uint32_t(spv::MemorySemanticsMask::AcquireRelease) || + value & uint32_t(spv::MemorySemanticsMask::SequentiallyConsistent))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4731) << "Vulkan spec disallows OpAtomicLoad with Memory Semantics " "Release, AcquireRelease and SequentiallyConsistent"; } - if (opcode == SpvOpAtomicStore && - (value & SpvMemorySemanticsAcquireMask || - value & SpvMemorySemanticsAcquireReleaseMask || - value & SpvMemorySemanticsSequentiallyConsistentMask)) { + if (opcode == spv::Op::OpAtomicStore && + (value & uint32_t(spv::MemorySemanticsMask::Acquire) || + value & uint32_t(spv::MemorySemanticsMask::AcquireRelease) || + value & uint32_t(spv::MemorySemanticsMask::SequentiallyConsistent))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4730) << "Vulkan spec disallows OpAtomicStore with Memory Semantics " diff --git a/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp b/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp index a7f072672..e569e251c 100644 --- a/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp +++ b/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp @@ -23,13 +23,13 @@ namespace spvtools { namespace val { spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); switch (opcode) { - case SpvOpEmitMeshTasksEXT: { + case spv::Op::OpEmitMeshTasksEXT: { _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelTaskEXT) { + [](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::TaskEXT) { if (message) { *message = "OpEmitMeshTasksEXT requires TaskEXT execution model"; @@ -62,12 +62,12 @@ spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst) { if (inst->operands().size() == 4) { const auto payload = _.FindDef(inst->GetOperandAs(3)); - if (payload->opcode() != SpvOpVariable) { + if (payload->opcode() != spv::Op::OpVariable) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Payload must be the result of a OpVariable"; } - if (SpvStorageClass(payload->GetOperandAs(2)) != - SpvStorageClassTaskPayloadWorkgroupEXT) { + if (payload->GetOperandAs(2) != + spv::StorageClass::TaskPayloadWorkgroupEXT) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Payload OpVariable must have a storage class of " "TaskPayloadWorkgroupEXT"; @@ -76,11 +76,11 @@ spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpSetMeshOutputsEXT: { + case spv::Op::OpSetMeshOutputsEXT: { _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelMeshEXT) { + [](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::MeshEXT) { if (message) { *message = "OpSetMeshOutputsEXT requires MeshEXT execution model"; @@ -107,7 +107,7 @@ spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpWritePackedPrimitiveIndices4x8NV: { + case spv::Op::OpWritePackedPrimitiveIndices4x8NV: { // No validation rules (for the moment). break; } diff --git a/3rdparty/spirv-tools/source/val/validate_misc.cpp b/3rdparty/spirv-tools/source/val/validate_misc.cpp index 5acc21eaa..d71fd2d26 100644 --- a/3rdparty/spirv-tools/source/val/validate_misc.cpp +++ b/3rdparty/spirv-tools/source/val/validate_misc.cpp @@ -30,7 +30,7 @@ spv_result_t ValidateUndef(ValidationState_t& _, const Instruction* inst) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Cannot create undefined values with void type"; } - if (_.HasCapability(SpvCapabilityShader) && + if (_.HasCapability(spv::Capability::Shader) && _.ContainsLimitedUseIntOrFloatType(inst->type_id()) && !_.IsPointerType(inst->type_id())) { return _.diag(SPV_ERROR_INVALID_ID, inst) @@ -50,7 +50,8 @@ spv_result_t ValidateShaderClock(ValidationState_t& _, bool is_int32 = false, is_const_int32 = false; uint32_t value = 0; std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(scope); - if (is_const_int32 && value != SpvScopeSubgroup && value != SpvScopeDevice) { + if (is_const_int32 && spv::Scope(value) != spv::Scope::Subgroup && + spv::Scope(value) != spv::Scope::Device) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4652) << "Scope must be Subgroup or Device"; } @@ -104,18 +105,18 @@ spv_result_t ValidateExpect(ValidationState_t& _, const Instruction* inst) { spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpUndef: + case spv::Op::OpUndef: if (auto error = ValidateUndef(_, inst)) return error; break; default: break; } switch (inst->opcode()) { - case SpvOpBeginInvocationInterlockEXT: - case SpvOpEndInvocationInterlockEXT: + case spv::Op::OpBeginInvocationInterlockEXT: + case spv::Op::OpEndInvocationInterlockEXT: _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - SpvExecutionModelFragment, + spv::ExecutionModel::Fragment, "OpBeginInvocationInterlockEXT/OpEndInvocationInterlockEXT " "require Fragment execution model"); @@ -126,14 +127,14 @@ spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) { const auto* execution_modes = state.GetExecutionModes(entry_point->id()); - auto find_interlock = [](const SpvExecutionMode& mode) { + auto find_interlock = [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModePixelInterlockOrderedEXT: - case SpvExecutionModePixelInterlockUnorderedEXT: - case SpvExecutionModeSampleInterlockOrderedEXT: - case SpvExecutionModeSampleInterlockUnorderedEXT: - case SpvExecutionModeShadingRateInterlockOrderedEXT: - case SpvExecutionModeShadingRateInterlockUnorderedEXT: + case spv::ExecutionMode::PixelInterlockOrderedEXT: + case spv::ExecutionMode::PixelInterlockUnorderedEXT: + case spv::ExecutionMode::SampleInterlockOrderedEXT: + case spv::ExecutionMode::SampleInterlockUnorderedEXT: + case spv::ExecutionMode::ShadingRateInterlockOrderedEXT: + case spv::ExecutionMode::ShadingRateInterlockUnorderedEXT: return true; default: return false; @@ -156,18 +157,18 @@ spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) { return true; }); break; - case SpvOpDemoteToHelperInvocationEXT: + case spv::Op::OpDemoteToHelperInvocationEXT: _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - SpvExecutionModelFragment, + spv::ExecutionModel::Fragment, "OpDemoteToHelperInvocationEXT requires Fragment execution " "model"); break; - case SpvOpIsHelperInvocationEXT: { + case spv::Op::OpIsHelperInvocationEXT: { const uint32_t result_type = inst->type_id(); _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - SpvExecutionModelFragment, + spv::ExecutionModel::Fragment, "OpIsHelperInvocationEXT requires Fragment execution model"); if (!_.IsBoolScalarType(result_type)) return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -175,17 +176,17 @@ spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) { << spvOpcodeString(inst->opcode()); break; } - case SpvOpReadClockKHR: + case spv::Op::OpReadClockKHR: if (auto error = ValidateShaderClock(_, inst)) { return error; } break; - case SpvOpAssumeTrueKHR: + case spv::Op::OpAssumeTrueKHR: if (auto error = ValidateAssumeTrue(_, inst)) { return error; } break; - case SpvOpExpectKHR: + case spv::Op::OpExpectKHR: if (auto error = ValidateExpect(_, inst)) { return error; } diff --git a/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp b/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp index 672192b9c..dfa46466f 100644 --- a/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp +++ b/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp @@ -27,16 +27,16 @@ namespace { spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { const auto entry_point_id = inst->GetOperandAs(1); auto entry_point = _.FindDef(entry_point_id); - if (!entry_point || SpvOpFunction != entry_point->opcode()) { + if (!entry_point || spv::Op::OpFunction != entry_point->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpEntryPoint Entry Point " << _.getIdName(entry_point_id) << " is not a function."; } // Only check the shader execution models - const SpvExecutionModel execution_model = - inst->GetOperandAs(0); - if (execution_model != SpvExecutionModelKernel) { + const spv::ExecutionModel execution_model = + inst->GetOperandAs(0); + if (execution_model != spv::ExecutionModel::Kernel) { const auto entry_point_type_id = entry_point->GetOperandAs(3); const auto entry_point_type = _.FindDef(entry_point_type_id); if (!entry_point_type || 3 != entry_point_type->words().size()) { @@ -48,7 +48,7 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { } auto return_type = _.FindDef(entry_point->type_id()); - if (!return_type || SpvOpTypeVoid != return_type->opcode()) { + if (!return_type || spv::Op::OpTypeVoid != return_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4633) << "OpEntryPoint Entry Point " << _.getIdName(entry_point_id) @@ -56,31 +56,31 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { } const auto* execution_modes = _.GetExecutionModes(entry_point_id); - if (_.HasCapability(SpvCapabilityShader)) { + if (_.HasCapability(spv::Capability::Shader)) { switch (execution_model) { - case SpvExecutionModelFragment: + case spv::ExecutionModel::Fragment: if (execution_modes && - execution_modes->count(SpvExecutionModeOriginUpperLeft) && - execution_modes->count(SpvExecutionModeOriginLowerLeft)) { + execution_modes->count(spv::ExecutionMode::OriginUpperLeft) && + execution_modes->count(spv::ExecutionMode::OriginLowerLeft)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Fragment execution model entry points can only specify " "one of OriginUpperLeft or OriginLowerLeft execution " "modes."; } if (!execution_modes || - (!execution_modes->count(SpvExecutionModeOriginUpperLeft) && - !execution_modes->count(SpvExecutionModeOriginLowerLeft))) { + (!execution_modes->count(spv::ExecutionMode::OriginUpperLeft) && + !execution_modes->count(spv::ExecutionMode::OriginLowerLeft))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Fragment execution model entry points require either an " "OriginUpperLeft or OriginLowerLeft execution mode."; } if (execution_modes && 1 < std::count_if(execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeDepthGreater: - case SpvExecutionModeDepthLess: - case SpvExecutionModeDepthUnchanged: + case spv::ExecutionMode::DepthGreater: + case spv::ExecutionMode::DepthLess: + case spv::ExecutionMode::DepthUnchanged: return true; default: return false; @@ -94,14 +94,15 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { if (execution_modes && 1 < std::count_if( execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModePixelInterlockOrderedEXT: - case SpvExecutionModePixelInterlockUnorderedEXT: - case SpvExecutionModeSampleInterlockOrderedEXT: - case SpvExecutionModeSampleInterlockUnorderedEXT: - case SpvExecutionModeShadingRateInterlockOrderedEXT: - case SpvExecutionModeShadingRateInterlockUnorderedEXT: + case spv::ExecutionMode::PixelInterlockOrderedEXT: + case spv::ExecutionMode::PixelInterlockUnorderedEXT: + case spv::ExecutionMode::SampleInterlockOrderedEXT: + case spv::ExecutionMode::SampleInterlockUnorderedEXT: + case spv::ExecutionMode::ShadingRateInterlockOrderedEXT: + case spv::ExecutionMode:: + ShadingRateInterlockUnorderedEXT: return true; default: return false; @@ -114,11 +115,11 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { if (execution_modes && 1 < std::count_if( execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeStencilRefUnchangedFrontAMD: - case SpvExecutionModeStencilRefLessFrontAMD: - case SpvExecutionModeStencilRefGreaterFrontAMD: + case spv::ExecutionMode::StencilRefUnchangedFrontAMD: + case spv::ExecutionMode::StencilRefLessFrontAMD: + case spv::ExecutionMode::StencilRefGreaterFrontAMD: return true; default: return false; @@ -133,11 +134,11 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { if (execution_modes && 1 < std::count_if( execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeStencilRefUnchangedBackAMD: - case SpvExecutionModeStencilRefLessBackAMD: - case SpvExecutionModeStencilRefGreaterBackAMD: + case spv::ExecutionMode::StencilRefUnchangedBackAMD: + case spv::ExecutionMode::StencilRefLessBackAMD: + case spv::ExecutionMode::StencilRefGreaterBackAMD: return true; default: return false; @@ -150,20 +151,21 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { "execution modes."; } break; - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: if (execution_modes && - 1 < std::count_if(execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { - switch (mode) { - case SpvExecutionModeSpacingEqual: - case SpvExecutionModeSpacingFractionalEven: - case SpvExecutionModeSpacingFractionalOdd: - return true; - default: - return false; - } - })) { + 1 < std::count_if( + execution_modes->begin(), execution_modes->end(), + [](const spv::ExecutionMode& mode) { + switch (mode) { + case spv::ExecutionMode::SpacingEqual: + case spv::ExecutionMode::SpacingFractionalEven: + case spv::ExecutionMode::SpacingFractionalOdd: + return true; + default: + return false; + } + })) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Tessellation execution model entry points can specify at " "most one of SpacingEqual, SpacingFractionalOdd or " @@ -171,11 +173,11 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { } if (execution_modes && 1 < std::count_if(execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeTriangles: - case SpvExecutionModeQuads: - case SpvExecutionModeIsolines: + case spv::ExecutionMode::Triangles: + case spv::ExecutionMode::Quads: + case spv::ExecutionMode::Isolines: return true; default: return false; @@ -187,10 +189,10 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { } if (execution_modes && 1 < std::count_if(execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeVertexOrderCw: - case SpvExecutionModeVertexOrderCcw: + case spv::ExecutionMode::VertexOrderCw: + case spv::ExecutionMode::VertexOrderCcw: return true; default: return false; @@ -202,21 +204,22 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { "modes."; } break; - case SpvExecutionModelGeometry: + case spv::ExecutionModel::Geometry: if (!execution_modes || - 1 != std::count_if(execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { - switch (mode) { - case SpvExecutionModeInputPoints: - case SpvExecutionModeInputLines: - case SpvExecutionModeInputLinesAdjacency: - case SpvExecutionModeTriangles: - case SpvExecutionModeInputTrianglesAdjacency: - return true; - default: - return false; - } - })) { + 1 != std::count_if( + execution_modes->begin(), execution_modes->end(), + [](const spv::ExecutionMode& mode) { + switch (mode) { + case spv::ExecutionMode::InputPoints: + case spv::ExecutionMode::InputLines: + case spv::ExecutionMode::InputLinesAdjacency: + case spv::ExecutionMode::Triangles: + case spv::ExecutionMode::InputTrianglesAdjacency: + return true; + default: + return false; + } + })) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Geometry execution model entry points must specify " "exactly one of InputPoints, InputLines, " @@ -225,11 +228,11 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { } if (!execution_modes || 1 != std::count_if(execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeOutputPoints: - case SpvExecutionModeOutputLineStrip: - case SpvExecutionModeOutputTriangleStrip: + case spv::ExecutionMode::OutputPoints: + case spv::ExecutionMode::OutputLineStrip: + case spv::ExecutionMode::OutputTriangleStrip: return true; default: return false; @@ -241,14 +244,14 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { "OutputTriangleStrip execution modes."; } break; - case SpvExecutionModelMeshEXT: + case spv::ExecutionModel::MeshEXT: if (!execution_modes || 1 != std::count_if(execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeOutputPoints: - case SpvExecutionModeOutputLinesEXT: - case SpvExecutionModeOutputTrianglesEXT: + case spv::ExecutionMode::OutputPoints: + case spv::ExecutionMode::OutputLinesEXT: + case spv::ExecutionMode::OutputTrianglesEXT: return true; default: return false; @@ -260,10 +263,10 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { "OutputTrianglesEXT Execution Modes."; } else if (2 != std::count_if( execution_modes->begin(), execution_modes->end(), - [](const SpvExecutionMode& mode) { + [](const spv::ExecutionMode& mode) { switch (mode) { - case SpvExecutionModeOutputPrimitivesEXT: - case SpvExecutionModeOutputVertices: + case spv::ExecutionMode::OutputPrimitivesEXT: + case spv::ExecutionMode::OutputVertices: return true; default: return false; @@ -281,23 +284,25 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) { if (spvIsVulkanEnv(_.context()->target_env)) { switch (execution_model) { - case SpvExecutionModelGLCompute: + case spv::ExecutionModel::GLCompute: if (!execution_modes || - !execution_modes->count(SpvExecutionModeLocalSize)) { + !execution_modes->count(spv::ExecutionMode::LocalSize)) { bool ok = false; for (auto& i : _.ordered_instructions()) { - if (i.opcode() == SpvOpDecorate) { + if (i.opcode() == spv::Op::OpDecorate) { if (i.operands().size() > 2) { - if (i.GetOperandAs(1) == SpvDecorationBuiltIn && - i.GetOperandAs(2) == SpvBuiltInWorkgroupSize) { + if (i.GetOperandAs(1) == + spv::Decoration::BuiltIn && + i.GetOperandAs(2) == + spv::BuiltIn::WorkgroupSize) { ok = true; break; } } } - if (i.opcode() == SpvOpExecutionModeId) { - const auto mode = i.GetOperandAs(1); - if (mode == SpvExecutionModeLocalSizeId) { + if (i.opcode() == spv::Op::OpExecutionModeId) { + const auto mode = i.GetOperandAs(1); + if (mode == spv::ExecutionMode::LocalSizeId) { ok = true; break; } @@ -333,15 +338,15 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, "operand of an OpEntryPoint."; } - const auto mode = inst->GetOperandAs(1); - if (inst->opcode() == SpvOpExecutionModeId) { + const auto mode = inst->GetOperandAs(1); + if (inst->opcode() == spv::Op::OpExecutionModeId) { size_t operand_count = inst->operands().size(); for (size_t i = 2; i < operand_count; ++i) { const auto operand_id = inst->GetOperandAs(2); const auto* operand_inst = _.FindDef(operand_id); - if (mode == SpvExecutionModeSubgroupsPerWorkgroupId || - mode == SpvExecutionModeLocalSizeHintId || - mode == SpvExecutionModeLocalSizeId) { + if (mode == spv::ExecutionMode::SubgroupsPerWorkgroupId || + mode == spv::ExecutionMode::LocalSizeHintId || + mode == spv::ExecutionMode::LocalSizeId) { if (!spvOpcodeIsConstant(operand_inst->opcode())) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "For OpExecutionModeId all Extra Operand ids must be " @@ -355,9 +360,9 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, "operands."; } } - } else if (mode == SpvExecutionModeSubgroupsPerWorkgroupId || - mode == SpvExecutionModeLocalSizeHintId || - mode == SpvExecutionModeLocalSizeId) { + } else if (mode == spv::ExecutionMode::SubgroupsPerWorkgroupId || + mode == spv::ExecutionMode::LocalSizeHintId || + mode == spv::ExecutionMode::LocalSizeId) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "OpExecutionMode is only valid when the Mode operand is an " "execution mode that takes no Extra Operands, or takes Extra " @@ -366,39 +371,39 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, const auto* models = _.GetExecutionModels(entry_point_id); switch (mode) { - case SpvExecutionModeInvocations: - case SpvExecutionModeInputPoints: - case SpvExecutionModeInputLines: - case SpvExecutionModeInputLinesAdjacency: - case SpvExecutionModeInputTrianglesAdjacency: - case SpvExecutionModeOutputLineStrip: - case SpvExecutionModeOutputTriangleStrip: + case spv::ExecutionMode::Invocations: + case spv::ExecutionMode::InputPoints: + case spv::ExecutionMode::InputLines: + case spv::ExecutionMode::InputLinesAdjacency: + case spv::ExecutionMode::InputTrianglesAdjacency: + case spv::ExecutionMode::OutputLineStrip: + case spv::ExecutionMode::OutputTriangleStrip: if (!std::all_of(models->begin(), models->end(), - [](const SpvExecutionModel& model) { - return model == SpvExecutionModelGeometry; + [](const spv::ExecutionModel& model) { + return model == spv::ExecutionModel::Geometry; })) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with the Geometry execution " "model."; } break; - case SpvExecutionModeOutputPoints: - if (!std::all_of(models->begin(), models->end(), - [&_](const SpvExecutionModel& model) { - switch (model) { - case SpvExecutionModelGeometry: - return true; - case SpvExecutionModelMeshNV: - return _.HasCapability(SpvCapabilityMeshShadingNV); - case SpvExecutionModelMeshEXT: - return _.HasCapability( - SpvCapabilityMeshShadingEXT); - default: - return false; - } - })) { - if (_.HasCapability(SpvCapabilityMeshShadingNV) || - _.HasCapability(SpvCapabilityMeshShadingEXT)) { + case spv::ExecutionMode::OutputPoints: + if (!std::all_of( + models->begin(), models->end(), + [&_](const spv::ExecutionModel& model) { + switch (model) { + case spv::ExecutionModel::Geometry: + return true; + case spv::ExecutionModel::MeshNV: + return _.HasCapability(spv::Capability::MeshShadingNV); + case spv::ExecutionModel::MeshEXT: + return _.HasCapability(spv::Capability::MeshShadingEXT); + default: + return false; + } + })) { + if (_.HasCapability(spv::Capability::MeshShadingNV) || + _.HasCapability(spv::Capability::MeshShadingEXT)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with the Geometry " "MeshNV or MeshEXT execution model."; @@ -410,32 +415,32 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, } } break; - case SpvExecutionModeSpacingEqual: - case SpvExecutionModeSpacingFractionalEven: - case SpvExecutionModeSpacingFractionalOdd: - case SpvExecutionModeVertexOrderCw: - case SpvExecutionModeVertexOrderCcw: - case SpvExecutionModePointMode: - case SpvExecutionModeQuads: - case SpvExecutionModeIsolines: + case spv::ExecutionMode::SpacingEqual: + case spv::ExecutionMode::SpacingFractionalEven: + case spv::ExecutionMode::SpacingFractionalOdd: + case spv::ExecutionMode::VertexOrderCw: + case spv::ExecutionMode::VertexOrderCcw: + case spv::ExecutionMode::PointMode: + case spv::ExecutionMode::Quads: + case spv::ExecutionMode::Isolines: if (!std::all_of( models->begin(), models->end(), - [](const SpvExecutionModel& model) { - return (model == SpvExecutionModelTessellationControl) || - (model == SpvExecutionModelTessellationEvaluation); + [](const spv::ExecutionModel& model) { + return (model == spv::ExecutionModel::TessellationControl) || + (model == spv::ExecutionModel::TessellationEvaluation); })) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with a tessellation " "execution model."; } break; - case SpvExecutionModeTriangles: + case spv::ExecutionMode::Triangles: if (!std::all_of(models->begin(), models->end(), - [](const SpvExecutionModel& model) { + [](const spv::ExecutionModel& model) { switch (model) { - case SpvExecutionModelGeometry: - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: return true; default: return false; @@ -446,25 +451,25 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, "tessellation execution model."; } break; - case SpvExecutionModeOutputVertices: - if (!std::all_of(models->begin(), models->end(), - [&_](const SpvExecutionModel& model) { - switch (model) { - case SpvExecutionModelGeometry: - case SpvExecutionModelTessellationControl: - case SpvExecutionModelTessellationEvaluation: - return true; - case SpvExecutionModelMeshNV: - return _.HasCapability(SpvCapabilityMeshShadingNV); - case SpvExecutionModelMeshEXT: - return _.HasCapability( - SpvCapabilityMeshShadingEXT); - default: - return false; - } - })) { - if (_.HasCapability(SpvCapabilityMeshShadingNV) || - _.HasCapability(SpvCapabilityMeshShadingEXT)) { + case spv::ExecutionMode::OutputVertices: + if (!std::all_of( + models->begin(), models->end(), + [&_](const spv::ExecutionModel& model) { + switch (model) { + case spv::ExecutionModel::Geometry: + case spv::ExecutionModel::TessellationControl: + case spv::ExecutionModel::TessellationEvaluation: + return true; + case spv::ExecutionModel::MeshNV: + return _.HasCapability(spv::Capability::MeshShadingNV); + case spv::ExecutionModel::MeshEXT: + return _.HasCapability(spv::Capability::MeshShadingEXT); + default: + return false; + } + })) { + if (_.HasCapability(spv::Capability::MeshShadingNV) || + _.HasCapability(spv::Capability::MeshShadingEXT)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with a Geometry, " "tessellation, MeshNV or MeshEXT execution model."; @@ -475,13 +480,13 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, } } break; - case SpvExecutionModeOutputLinesEXT: - case SpvExecutionModeOutputTrianglesEXT: - case SpvExecutionModeOutputPrimitivesEXT: + case spv::ExecutionMode::OutputLinesEXT: + case spv::ExecutionMode::OutputTrianglesEXT: + case spv::ExecutionMode::OutputPrimitivesEXT: if (!std::all_of(models->begin(), models->end(), - [](const SpvExecutionModel& model) { - return (model == SpvExecutionModelMeshEXT || - model == SpvExecutionModelMeshNV); + [](const spv::ExecutionModel& model) { + return (model == spv::ExecutionModel::MeshEXT || + model == spv::ExecutionModel::MeshNV); })) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with the MeshEXT or MeshNV " @@ -489,74 +494,74 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, "model."; } break; - case SpvExecutionModePixelCenterInteger: - case SpvExecutionModeOriginUpperLeft: - case SpvExecutionModeOriginLowerLeft: - case SpvExecutionModeEarlyFragmentTests: - case SpvExecutionModeDepthReplacing: - case SpvExecutionModeDepthGreater: - case SpvExecutionModeDepthLess: - case SpvExecutionModeDepthUnchanged: - case SpvExecutionModePixelInterlockOrderedEXT: - case SpvExecutionModePixelInterlockUnorderedEXT: - case SpvExecutionModeSampleInterlockOrderedEXT: - case SpvExecutionModeSampleInterlockUnorderedEXT: - case SpvExecutionModeShadingRateInterlockOrderedEXT: - case SpvExecutionModeShadingRateInterlockUnorderedEXT: - case SpvExecutionModeEarlyAndLateFragmentTestsAMD: - case SpvExecutionModeStencilRefUnchangedFrontAMD: - case SpvExecutionModeStencilRefGreaterFrontAMD: - case SpvExecutionModeStencilRefLessFrontAMD: - case SpvExecutionModeStencilRefUnchangedBackAMD: - case SpvExecutionModeStencilRefGreaterBackAMD: - case SpvExecutionModeStencilRefLessBackAMD: + case spv::ExecutionMode::PixelCenterInteger: + case spv::ExecutionMode::OriginUpperLeft: + case spv::ExecutionMode::OriginLowerLeft: + case spv::ExecutionMode::EarlyFragmentTests: + case spv::ExecutionMode::DepthReplacing: + case spv::ExecutionMode::DepthGreater: + case spv::ExecutionMode::DepthLess: + case spv::ExecutionMode::DepthUnchanged: + case spv::ExecutionMode::PixelInterlockOrderedEXT: + case spv::ExecutionMode::PixelInterlockUnorderedEXT: + case spv::ExecutionMode::SampleInterlockOrderedEXT: + case spv::ExecutionMode::SampleInterlockUnorderedEXT: + case spv::ExecutionMode::ShadingRateInterlockOrderedEXT: + case spv::ExecutionMode::ShadingRateInterlockUnorderedEXT: + case spv::ExecutionMode::EarlyAndLateFragmentTestsAMD: + case spv::ExecutionMode::StencilRefUnchangedFrontAMD: + case spv::ExecutionMode::StencilRefGreaterFrontAMD: + case spv::ExecutionMode::StencilRefLessFrontAMD: + case spv::ExecutionMode::StencilRefUnchangedBackAMD: + case spv::ExecutionMode::StencilRefGreaterBackAMD: + case spv::ExecutionMode::StencilRefLessBackAMD: if (!std::all_of(models->begin(), models->end(), - [](const SpvExecutionModel& model) { - return model == SpvExecutionModelFragment; + [](const spv::ExecutionModel& model) { + return model == spv::ExecutionModel::Fragment; })) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with the Fragment execution " "model."; } break; - case SpvExecutionModeLocalSizeHint: - case SpvExecutionModeVecTypeHint: - case SpvExecutionModeContractionOff: - case SpvExecutionModeLocalSizeHintId: + case spv::ExecutionMode::LocalSizeHint: + case spv::ExecutionMode::VecTypeHint: + case spv::ExecutionMode::ContractionOff: + case spv::ExecutionMode::LocalSizeHintId: if (!std::all_of(models->begin(), models->end(), - [](const SpvExecutionModel& model) { - return model == SpvExecutionModelKernel; + [](const spv::ExecutionModel& model) { + return model == spv::ExecutionModel::Kernel; })) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with the Kernel execution " "model."; } break; - case SpvExecutionModeLocalSize: - case SpvExecutionModeLocalSizeId: - if (mode == SpvExecutionModeLocalSizeId && !_.IsLocalSizeIdAllowed()) + case spv::ExecutionMode::LocalSize: + case spv::ExecutionMode::LocalSizeId: + if (mode == spv::ExecutionMode::LocalSizeId && !_.IsLocalSizeIdAllowed()) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "LocalSizeId mode is not allowed by the current environment."; - if (!std::all_of(models->begin(), models->end(), - [&_](const SpvExecutionModel& model) { - switch (model) { - case SpvExecutionModelKernel: - case SpvExecutionModelGLCompute: - return true; - case SpvExecutionModelTaskNV: - case SpvExecutionModelMeshNV: - return _.HasCapability(SpvCapabilityMeshShadingNV); - case SpvExecutionModelTaskEXT: - case SpvExecutionModelMeshEXT: - return _.HasCapability( - SpvCapabilityMeshShadingEXT); - default: - return false; - } - })) { - if (_.HasCapability(SpvCapabilityMeshShadingNV) || - _.HasCapability(SpvCapabilityMeshShadingEXT)) { + if (!std::all_of( + models->begin(), models->end(), + [&_](const spv::ExecutionModel& model) { + switch (model) { + case spv::ExecutionModel::Kernel: + case spv::ExecutionModel::GLCompute: + return true; + case spv::ExecutionModel::TaskNV: + case spv::ExecutionModel::MeshNV: + return _.HasCapability(spv::Capability::MeshShadingNV); + case spv::ExecutionModel::TaskEXT: + case spv::ExecutionModel::MeshEXT: + return _.HasCapability(spv::Capability::MeshShadingEXT); + default: + return false; + } + })) { + if (_.HasCapability(spv::Capability::MeshShadingNV) || + _.HasCapability(spv::Capability::MeshShadingEXT)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Execution mode can only be used with a Kernel, GLCompute, " "MeshNV, MeshEXT, TaskNV or TaskEXT execution model."; @@ -572,13 +577,13 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, } if (spvIsVulkanEnv(_.context()->target_env)) { - if (mode == SpvExecutionModeOriginLowerLeft) { + if (mode == spv::ExecutionMode::OriginLowerLeft) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4653) << "In the Vulkan environment, the OriginLowerLeft execution mode " "must not be used."; } - if (mode == SpvExecutionModePixelCenterInteger) { + if (mode == spv::ExecutionMode::PixelCenterInteger) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4654) << "In the Vulkan environment, the PixelCenterInteger execution " @@ -593,29 +598,30 @@ spv_result_t ValidateMemoryModel(ValidationState_t& _, const Instruction* inst) { // Already produced an error if multiple memory model instructions are // present. - if (_.memory_model() != SpvMemoryModelVulkanKHR && - _.HasCapability(SpvCapabilityVulkanMemoryModelKHR)) { + if (_.memory_model() != spv::MemoryModel::VulkanKHR && + _.HasCapability(spv::Capability::VulkanMemoryModelKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "VulkanMemoryModelKHR capability must only be specified if " "the VulkanKHR memory model is used."; } if (spvIsOpenCLEnv(_.context()->target_env)) { - if ((_.addressing_model() != SpvAddressingModelPhysical32) && - (_.addressing_model() != SpvAddressingModelPhysical64)) { + if ((_.addressing_model() != spv::AddressingModel::Physical32) && + (_.addressing_model() != spv::AddressingModel::Physical64)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Addressing model must be Physical32 or Physical64 " << "in the OpenCL environment."; } - if (_.memory_model() != SpvMemoryModelOpenCL) { + if (_.memory_model() != spv::MemoryModel::OpenCL) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Memory model must be OpenCL in the OpenCL environment."; } } if (spvIsVulkanEnv(_.context()->target_env)) { - if ((_.addressing_model() != SpvAddressingModelLogical) && - (_.addressing_model() != SpvAddressingModelPhysicalStorageBuffer64)) { + if ((_.addressing_model() != spv::AddressingModel::Logical) && + (_.addressing_model() != + spv::AddressingModel::PhysicalStorageBuffer64)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4635) << "Addressing model must be Logical or PhysicalStorageBuffer64 " @@ -629,14 +635,14 @@ spv_result_t ValidateMemoryModel(ValidationState_t& _, spv_result_t ModeSettingPass(ValidationState_t& _, const Instruction* inst) { switch (inst->opcode()) { - case SpvOpEntryPoint: + case spv::Op::OpEntryPoint: if (auto error = ValidateEntryPoint(_, inst)) return error; break; - case SpvOpExecutionMode: - case SpvOpExecutionModeId: + case spv::Op::OpExecutionMode: + case spv::Op::OpExecutionModeId: if (auto error = ValidateExecutionMode(_, inst)) return error; break; - case SpvOpMemoryModel: + case spv::Op::OpMemoryModel: if (auto error = ValidateMemoryModel(_, inst)) return error; break; default: diff --git a/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp b/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp index 6d4f8a284..5c5e9bd8b 100644 --- a/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp +++ b/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp @@ -48,11 +48,11 @@ spv_result_t ValidateGroupNonUniformBallotBitCount(ValidationState_t& _, "of integer type scalar"; } - const auto group = inst->GetOperandAs(3); + const auto group = inst->GetOperandAs(3); if (spvIsVulkanEnv(_.context()->target_env)) { - if ((group != SpvGroupOperationReduce) && - (group != SpvGroupOperationInclusiveScan) && - (group != SpvGroupOperationExclusiveScan)) { + if ((group != spv::GroupOperation::Reduce) && + (group != spv::GroupOperation::InclusiveScan) && + (group != spv::GroupOperation::ExclusiveScan)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4685) << "In Vulkan: The OpGroupNonUniformBallotBitCount group " @@ -120,7 +120,7 @@ spv_result_t ValidateGroupNonUniformRotateKHR(ValidationState_t& _, // Validates correctness of non-uniform group instructions. spv_result_t NonUniformPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); if (spvOpcodeIsNonUniformGroupOperation(opcode)) { const uint32_t execution_scope = inst->word(3); @@ -130,9 +130,9 @@ spv_result_t NonUniformPass(ValidationState_t& _, const Instruction* inst) { } switch (opcode) { - case SpvOpGroupNonUniformBallotBitCount: + case spv::Op::OpGroupNonUniformBallotBitCount: return ValidateGroupNonUniformBallotBitCount(_, inst); - case SpvOpGroupNonUniformRotateKHR: + case spv::Op::OpGroupNonUniformRotateKHR: return ValidateGroupNonUniformRotateKHR(_, inst); default: break; diff --git a/3rdparty/spirv-tools/source/val/validate_primitives.cpp b/3rdparty/spirv-tools/source/val/validate_primitives.cpp index 7d11f2e7a..5e598c3ae 100644 --- a/3rdparty/spirv-tools/source/val/validate_primitives.cpp +++ b/3rdparty/spirv-tools/source/val/validate_primitives.cpp @@ -28,16 +28,16 @@ namespace val { // Validates correctness of primitive instructions. spv_result_t PrimitivesPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); switch (opcode) { - case SpvOpEmitVertex: - case SpvOpEndPrimitive: - case SpvOpEmitStreamVertex: - case SpvOpEndStreamPrimitive: + case spv::Op::OpEmitVertex: + case spv::Op::OpEndPrimitive: + case spv::Op::OpEmitStreamVertex: + case spv::Op::OpEndStreamPrimitive: _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - SpvExecutionModelGeometry, + spv::ExecutionModel::Geometry, std::string(spvOpcodeString(opcode)) + " instructions require Geometry execution model"); break; @@ -46,8 +46,8 @@ spv_result_t PrimitivesPass(ValidationState_t& _, const Instruction* inst) { } switch (opcode) { - case SpvOpEmitStreamVertex: - case SpvOpEndStreamPrimitive: { + case spv::Op::OpEmitStreamVertex: + case spv::Op::OpEndStreamPrimitive: { const uint32_t stream_id = inst->word(1); const uint32_t stream_type = _.GetTypeId(stream_id); if (!_.IsIntScalarType(stream_type)) { @@ -56,7 +56,7 @@ spv_result_t PrimitivesPass(ValidationState_t& _, const Instruction* inst) { << ": expected Stream to be int scalar"; } - const SpvOp stream_opcode = _.GetIdOpcode(stream_id); + const spv::Op stream_opcode = _.GetIdOpcode(stream_id); if (!spvOpcodeIsConstant(stream_opcode)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) diff --git a/3rdparty/spirv-tools/source/val/validate_ray_query.cpp b/3rdparty/spirv-tools/source/val/validate_ray_query.cpp index b553449d0..9b67fc922 100644 --- a/3rdparty/spirv-tools/source/val/validate_ray_query.cpp +++ b/3rdparty/spirv-tools/source/val/validate_ray_query.cpp @@ -29,19 +29,19 @@ spv_result_t ValidateRayQueryPointer(ValidationState_t& _, const uint32_t ray_query_id = inst->GetOperandAs(ray_query_index); auto variable = _.FindDef(ray_query_id); const auto var_opcode = variable->opcode(); - if (!variable || - (var_opcode != SpvOpVariable && var_opcode != SpvOpFunctionParameter && - var_opcode != SpvOpAccessChain)) { + if (!variable || (var_opcode != spv::Op::OpVariable && + var_opcode != spv::Op::OpFunctionParameter && + var_opcode != spv::Op::OpAccessChain)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Ray Query must be a memory object declaration"; } auto pointer = _.FindDef(variable->GetOperandAs(0)); - if (!pointer || pointer->opcode() != SpvOpTypePointer) { + if (!pointer || pointer->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Ray Query must be a pointer"; } auto type = _.FindDef(pointer->GetOperandAs(2)); - if (!type || type->opcode() != SpvOpTypeRayQueryKHR) { + if (!type || type->opcode() != spv::Op::OpTypeRayQueryKHR) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Ray Query must be a pointer to OpTypeRayQueryKHR"; } @@ -54,7 +54,7 @@ spv_result_t ValidateIntersectionId(ValidationState_t& _, const uint32_t intersection_id = inst->GetOperandAs(intersection_index); const uint32_t intersection_type = _.GetTypeId(intersection_id); - const SpvOp intersection_opcode = _.GetIdOpcode(intersection_id); + const spv::Op intersection_opcode = _.GetIdOpcode(intersection_id); if (!_.IsIntScalarType(intersection_type) || _.GetBitWidth(intersection_type) != 32 || !spvOpcodeIsConstant(intersection_opcode)) { @@ -68,15 +68,15 @@ spv_result_t ValidateIntersectionId(ValidationState_t& _, } // namespace spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpRayQueryInitializeKHR: { + case spv::Op::OpRayQueryInitializeKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 0)) return error; if (_.GetIdOpcode(_.GetOperandTypeId(inst, 1)) != - SpvOpTypeAccelerationStructureKHR) { + spv::Op::OpTypeAccelerationStructureKHR) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Acceleration Structure to be of type " "OpTypeAccelerationStructureKHR"; @@ -123,13 +123,13 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpRayQueryTerminateKHR: - case SpvOpRayQueryConfirmIntersectionKHR: { + case spv::Op::OpRayQueryTerminateKHR: + case spv::Op::OpRayQueryConfirmIntersectionKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 0)) return error; break; } - case SpvOpRayQueryGenerateIntersectionKHR: { + case spv::Op::OpRayQueryGenerateIntersectionKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 0)) return error; const uint32_t hit_t_id = _.GetOperandTypeId(inst, 1); @@ -141,9 +141,9 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpRayQueryGetIntersectionFrontFaceKHR: - case SpvOpRayQueryProceedKHR: - case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: { + case spv::Op::OpRayQueryGetIntersectionFrontFaceKHR: + case spv::Op::OpRayQueryProceedKHR: + case spv::Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error; if (!_.IsBoolScalarType(result_type)) { @@ -151,15 +151,15 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { << "expected Result Type to be bool scalar type"; } - if (opcode == SpvOpRayQueryGetIntersectionFrontFaceKHR) { + if (opcode == spv::Op::OpRayQueryGetIntersectionFrontFaceKHR) { if (auto error = ValidateIntersectionId(_, inst, 3)) return error; } break; } - case SpvOpRayQueryGetIntersectionTKHR: - case SpvOpRayQueryGetRayTMinKHR: { + case spv::Op::OpRayQueryGetIntersectionTKHR: + case spv::Op::OpRayQueryGetRayTMinKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error; if (!_.IsFloatScalarType(result_type) || @@ -168,20 +168,21 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { << "expected Result Type to be 32-bit float scalar type"; } - if (opcode == SpvOpRayQueryGetIntersectionTKHR) { + if (opcode == spv::Op::OpRayQueryGetIntersectionTKHR) { if (auto error = ValidateIntersectionId(_, inst, 3)) return error; } break; } - case SpvOpRayQueryGetIntersectionTypeKHR: - case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR: - case SpvOpRayQueryGetIntersectionInstanceIdKHR: - case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: - case SpvOpRayQueryGetIntersectionGeometryIndexKHR: - case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR: - case SpvOpRayQueryGetRayFlagsKHR: { + case spv::Op::OpRayQueryGetIntersectionTypeKHR: + case spv::Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: + case spv::Op::OpRayQueryGetIntersectionInstanceIdKHR: + case spv::Op:: + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: + case spv::Op::OpRayQueryGetIntersectionGeometryIndexKHR: + case spv::Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: + case spv::Op::OpRayQueryGetRayFlagsKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error; if (!_.IsIntScalarType(result_type) || _.GetBitWidth(result_type) != 32) { @@ -189,17 +190,17 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { << "expected Result Type to be 32-bit int scalar type"; } - if (opcode != SpvOpRayQueryGetRayFlagsKHR) { + if (opcode != spv::Op::OpRayQueryGetRayFlagsKHR) { if (auto error = ValidateIntersectionId(_, inst, 3)) return error; } break; } - case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR: - case SpvOpRayQueryGetIntersectionObjectRayOriginKHR: - case SpvOpRayQueryGetWorldRayDirectionKHR: - case SpvOpRayQueryGetWorldRayOriginKHR: { + case spv::Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: + case spv::Op::OpRayQueryGetIntersectionObjectRayOriginKHR: + case spv::Op::OpRayQueryGetWorldRayDirectionKHR: + case spv::Op::OpRayQueryGetWorldRayOriginKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error; if (!_.IsFloatVectorType(result_type) || @@ -210,15 +211,15 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { "vector type"; } - if (opcode == SpvOpRayQueryGetIntersectionObjectRayDirectionKHR || - opcode == SpvOpRayQueryGetIntersectionObjectRayOriginKHR) { + if (opcode == spv::Op::OpRayQueryGetIntersectionObjectRayDirectionKHR || + opcode == spv::Op::OpRayQueryGetIntersectionObjectRayOriginKHR) { if (auto error = ValidateIntersectionId(_, inst, 3)) return error; } break; } - case SpvOpRayQueryGetIntersectionBarycentricsKHR: { + case spv::Op::OpRayQueryGetIntersectionBarycentricsKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error; if (auto error = ValidateIntersectionId(_, inst, 3)) return error; @@ -233,8 +234,8 @@ spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpRayQueryGetIntersectionObjectToWorldKHR: - case SpvOpRayQueryGetIntersectionWorldToObjectKHR: { + case spv::Op::OpRayQueryGetIntersectionObjectToWorldKHR: + case spv::Op::OpRayQueryGetIntersectionWorldToObjectKHR: { if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error; if (auto error = ValidateIntersectionId(_, inst, 3)) return error; diff --git a/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp b/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp index 5b5c8da1e..f74e9d4b9 100644 --- a/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp +++ b/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp @@ -23,17 +23,17 @@ namespace spvtools { namespace val { spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); const uint32_t result_type = inst->type_id(); switch (opcode) { - case SpvOpTraceRayKHR: { + case spv::Op::OpTraceRayKHR: { _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelRayGenerationKHR && - model != SpvExecutionModelClosestHitKHR && - model != SpvExecutionModelMissKHR) { + [](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::MissKHR) { if (message) { *message = "OpTraceRayKHR requires RayGenerationKHR, " @@ -45,7 +45,7 @@ spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst) { }); if (_.GetIdOpcode(_.GetOperandTypeId(inst, 0)) != - SpvOpTypeAccelerationStructureKHR) { + spv::Op::OpTypeAccelerationStructureKHR) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Acceleration Structure to be of type " "OpTypeAccelerationStructureKHR"; @@ -109,13 +109,13 @@ spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst) { } const Instruction* payload = _.FindDef(inst->GetOperandAs(10)); - if (payload->opcode() != SpvOpVariable) { + if (payload->opcode() != spv::Op::OpVariable) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Payload must be the result of a OpVariable"; - } else if (payload->GetOperandAs(2) != - SpvStorageClassRayPayloadKHR && - payload->GetOperandAs(2) != - SpvStorageClassIncomingRayPayloadKHR) { + } else if (payload->GetOperandAs(2) != + spv::StorageClass::RayPayloadKHR && + payload->GetOperandAs(2) != + spv::StorageClass::IncomingRayPayloadKHR) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Payload must have storage class RayPayloadKHR or " "IncomingRayPayloadKHR"; @@ -123,11 +123,11 @@ spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpReportIntersectionKHR: { + case spv::Op::OpReportIntersectionKHR: { _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelIntersectionKHR) { + [](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::IntersectionKHR) { if (message) { *message = "OpReportIntersectionKHR requires IntersectionKHR " @@ -158,14 +158,14 @@ spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst) { break; } - case SpvOpExecuteCallableKHR: { + case spv::Op::OpExecuteCallableKHR: { _.function(inst->function()->id()) - ->RegisterExecutionModelLimitation([](SpvExecutionModel model, + ->RegisterExecutionModelLimitation([](spv::ExecutionModel model, std::string* message) { - if (model != SpvExecutionModelRayGenerationKHR && - model != SpvExecutionModelClosestHitKHR && - model != SpvExecutionModelMissKHR && - model != SpvExecutionModelCallableKHR) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::MissKHR && + model != spv::ExecutionModel::CallableKHR) { if (message) { *message = "OpExecuteCallableKHR requires RayGenerationKHR, " @@ -184,13 +184,13 @@ spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst) { } const auto callable_data = _.FindDef(inst->GetOperandAs(1)); - if (callable_data->opcode() != SpvOpVariable) { + if (callable_data->opcode() != spv::Op::OpVariable) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Callable Data must be the result of a OpVariable"; - } else if (callable_data->GetOperandAs(2) != - SpvStorageClassCallableDataKHR && - callable_data->GetOperandAs(2) != - SpvStorageClassIncomingCallableDataKHR) { + } else if (callable_data->GetOperandAs(2) != + spv::StorageClass::CallableDataKHR && + callable_data->GetOperandAs(2) != + spv::StorageClass::IncomingCallableDataKHR) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Callable Data must have storage class CallableDataKHR or " "IncomingCallableDataKHR"; diff --git a/3rdparty/spirv-tools/source/val/validate_ray_tracing_reorder.cpp b/3rdparty/spirv-tools/source/val/validate_ray_tracing_reorder.cpp new file mode 100644 index 000000000..cb190f91e --- /dev/null +++ b/3rdparty/spirv-tools/source/val/validate_ray_tracing_reorder.cpp @@ -0,0 +1,625 @@ +// Copyright (c) 2022 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Validates ray tracing instructions from SPV_NV_shader_execution_reorder + +#include "source/opcode.h" +#include "source/val/instruction.h" +#include "source/val/validate.h" +#include "source/val/validation_state.h" + +#include + +namespace spvtools { +namespace val { + +static const uint32_t KRayParamInvalidId = std::numeric_limits::max(); + +spv_result_t ValidateHitObjectPointer(ValidationState_t& _, + const Instruction* inst, + uint32_t hit_object_index) { + const uint32_t hit_object_id = inst->GetOperandAs(hit_object_index); + auto variable = _.FindDef(hit_object_id); + const auto var_opcode = variable->opcode(); + if (!variable || (var_opcode != spv::Op::OpVariable && + var_opcode != spv::Op::OpFunctionParameter && + var_opcode != spv::Op::OpAccessChain)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hit Object must be a memory object declaration"; + } + auto pointer = _.FindDef(variable->GetOperandAs(0)); + if (!pointer || pointer->opcode() != spv::Op::OpTypePointer) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hit Object must be a pointer"; + } + auto type = _.FindDef(pointer->GetOperandAs(2)); + if (!type || type->opcode() != spv::Op::OpTypeHitObjectNV) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Type must be OpTypeHitObjectNV"; + } + return SPV_SUCCESS; +} + +spv_result_t ValidateHitObjectInstructionCommonParameters( + ValidationState_t& _, const Instruction* inst, + uint32_t acceleration_struct_index, uint32_t instance_id_index, + uint32_t primtive_id_index, uint32_t geometry_index, + uint32_t ray_flags_index, uint32_t cull_mask_index, uint32_t hit_kind_index, + uint32_t sbt_index, uint32_t sbt_offset_index, uint32_t sbt_stride_index, + uint32_t sbt_record_offset_index, uint32_t sbt_record_stride_index, + uint32_t miss_index, uint32_t ray_origin_index, uint32_t ray_tmin_index, + uint32_t ray_direction_index, uint32_t ray_tmax_index, + uint32_t payload_index, uint32_t hit_object_attr_index) { + auto isValidId = [](uint32_t spvid) { return spvid < KRayParamInvalidId; }; + if (isValidId(acceleration_struct_index) && + _.GetIdOpcode(_.GetOperandTypeId(inst, acceleration_struct_index)) != + spv::Op::OpTypeAccelerationStructureKHR) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Expected Acceleration Structure to be of type " + "OpTypeAccelerationStructureKHR"; + } + + if (isValidId(instance_id_index)) { + const uint32_t instance_id = _.GetOperandTypeId(inst, instance_id_index); + if (!_.IsIntScalarType(instance_id) || _.GetBitWidth(instance_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Instance Id must be a 32-bit int scalar"; + } + } + + if (isValidId(primtive_id_index)) { + const uint32_t primitive_id = _.GetOperandTypeId(inst, primtive_id_index); + if (!_.IsIntScalarType(primitive_id) || _.GetBitWidth(primitive_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Primitive Id must be a 32-bit int scalar"; + } + } + + if (isValidId(geometry_index)) { + const uint32_t geometry_index_id = _.GetOperandTypeId(inst, geometry_index); + if (!_.IsIntScalarType(geometry_index_id) || + _.GetBitWidth(geometry_index_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Geometry Index must be a 32-bit int scalar"; + } + } + + if (isValidId(miss_index)) { + const uint32_t miss_index_id = _.GetOperandTypeId(inst, miss_index); + if (!_.IsUnsignedIntScalarType(miss_index_id) || + _.GetBitWidth(miss_index_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Miss Index must be a 32-bit int scalar"; + } + } + + if (isValidId(cull_mask_index)) { + const uint32_t cull_mask_id = _.GetOperandTypeId(inst, cull_mask_index); + if (!_.IsUnsignedIntScalarType(cull_mask_id) || + _.GetBitWidth(cull_mask_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Cull mask must be a 32-bit int scalar"; + } + } + + if (isValidId(sbt_index)) { + const uint32_t sbt_index_id = _.GetOperandTypeId(inst, sbt_index); + if (!_.IsUnsignedIntScalarType(sbt_index_id) || + _.GetBitWidth(sbt_index_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "SBT Index must be a 32-bit unsigned int scalar"; + } + } + + if (isValidId(sbt_offset_index)) { + const uint32_t sbt_offset_id = _.GetOperandTypeId(inst, sbt_offset_index); + if (!_.IsUnsignedIntScalarType(sbt_offset_id) || + _.GetBitWidth(sbt_offset_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "SBT Offset must be a 32-bit unsigned int scalar"; + } + } + + if (isValidId(sbt_stride_index)) { + const uint32_t sbt_stride_index_id = + _.GetOperandTypeId(inst, sbt_stride_index); + if (!_.IsUnsignedIntScalarType(sbt_stride_index_id) || + _.GetBitWidth(sbt_stride_index_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "SBT Stride must be a 32-bit unsigned int scalar"; + } + } + + if (isValidId(sbt_record_offset_index)) { + const uint32_t sbt_record_offset_index_id = + _.GetOperandTypeId(inst, sbt_record_offset_index); + if (!_.IsUnsignedIntScalarType(sbt_record_offset_index_id) || + _.GetBitWidth(sbt_record_offset_index_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "SBT record offset must be a 32-bit unsigned int scalar"; + } + } + + if (isValidId(sbt_record_stride_index)) { + const uint32_t sbt_record_stride_index_id = + _.GetOperandTypeId(inst, sbt_record_stride_index); + if (!_.IsUnsignedIntScalarType(sbt_record_stride_index_id) || + _.GetBitWidth(sbt_record_stride_index_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "SBT record stride must be a 32-bit unsigned int scalar"; + } + } + + if (isValidId(ray_origin_index)) { + const uint32_t ray_origin_id = _.GetOperandTypeId(inst, ray_origin_index); + if (!_.IsFloatVectorType(ray_origin_id) || + _.GetDimension(ray_origin_id) != 3 || + _.GetBitWidth(ray_origin_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray Origin must be a 32-bit float 3-component vector"; + } + } + + if (isValidId(ray_tmin_index)) { + const uint32_t ray_tmin_id = _.GetOperandTypeId(inst, ray_tmin_index); + if (!_.IsFloatScalarType(ray_tmin_id) || _.GetBitWidth(ray_tmin_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray TMin must be a 32-bit float scalar"; + } + } + + if (isValidId(ray_direction_index)) { + const uint32_t ray_direction_id = + _.GetOperandTypeId(inst, ray_direction_index); + if (!_.IsFloatVectorType(ray_direction_id) || + _.GetDimension(ray_direction_id) != 3 || + _.GetBitWidth(ray_direction_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray Direction must be a 32-bit float 3-component vector"; + } + } + + if (isValidId(ray_tmax_index)) { + const uint32_t ray_tmax_id = _.GetOperandTypeId(inst, ray_tmax_index); + if (!_.IsFloatScalarType(ray_tmax_id) || _.GetBitWidth(ray_tmax_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray TMax must be a 32-bit float scalar"; + } + } + + if (isValidId(ray_flags_index)) { + const uint32_t ray_flags_id = _.GetOperandTypeId(inst, ray_flags_index); + if (!_.IsIntScalarType(ray_flags_id) || _.GetBitWidth(ray_flags_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray Flags must be a 32-bit int scalar"; + } + } + + if (isValidId(payload_index)) { + const uint32_t payload_id = inst->GetOperandAs(payload_index); + auto variable = _.FindDef(payload_id); + const auto var_opcode = variable->opcode(); + if (!variable || var_opcode != spv::Op::OpVariable || + (variable->GetOperandAs(2) != + spv::StorageClass::RayPayloadKHR && + variable->GetOperandAs(2) != + spv::StorageClass::IncomingRayPayloadKHR)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "payload must be a OpVariable of storage " + "class RayPayloadKHR or IncomingRayPayloadKHR"; + } + } + + if (isValidId(hit_kind_index)) { + const uint32_t hit_kind_id = _.GetOperandTypeId(inst, hit_kind_index); + if (!_.IsUnsignedIntScalarType(hit_kind_id) || + _.GetBitWidth(hit_kind_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hit Kind must be a 32-bit unsigned int scalar"; + } + } + + if (isValidId(hit_object_attr_index)) { + const uint32_t hit_object_attr_id = + inst->GetOperandAs(hit_object_attr_index); + auto variable = _.FindDef(hit_object_attr_id); + const auto var_opcode = variable->opcode(); + if (!variable || var_opcode != spv::Op::OpVariable || + (variable->GetOperandAs(2)) != + spv::StorageClass::HitObjectAttributeNV) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hit Object Attributes id must be a OpVariable of storage " + "class HitObjectAttributeNV"; + } + } + + return SPV_SUCCESS; +} + +spv_result_t RayReorderNVPass(ValidationState_t& _, const Instruction* inst) { + const spv::Op opcode = inst->opcode(); + const uint32_t result_type = inst->type_id(); + + auto RegisterOpcodeForValidModel = [](ValidationState_t& vs, + const Instruction* rtinst) { + std::string opcode_name = spvOpcodeString(rtinst->opcode()); + vs.function(rtinst->function()->id()) + ->RegisterExecutionModelLimitation( + [opcode_name](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::MissKHR) { + if (message) { + *message = opcode_name + + " requires RayGenerationKHR, ClosestHitKHR and " + "MissKHR execution models"; + } + return false; + } + return true; + }); + return; + }; + + switch (opcode) { + case spv::Op::OpHitObjectIsMissNV: + case spv::Op::OpHitObjectIsHitNV: + case spv::Op::OpHitObjectIsEmptyNV: { + RegisterOpcodeForValidModel(_, inst); + if (!_.IsBoolScalarType(result_type)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "expected Result Type to be bool scalar type"; + } + + if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error; + break; + } + + case spv::Op::OpHitObjectGetShaderRecordBufferHandleNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error; + + if (!_.IsIntVectorType(result_type) || + (_.GetDimension(result_type) != 2) || + (_.GetBitWidth(result_type) != 32)) + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Expected 32-bit integer type 2-component vector as Result " + "Type: " + << spvOpcodeString(opcode); + break; + } + + case spv::Op::OpHitObjectGetHitKindNV: + case spv::Op::OpHitObjectGetPrimitiveIndexNV: + case spv::Op::OpHitObjectGetGeometryIndexNV: + case spv::Op::OpHitObjectGetInstanceIdNV: + case spv::Op::OpHitObjectGetInstanceCustomIndexNV: + case spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error; + + if (!_.IsIntScalarType(result_type) || !_.GetBitWidth(result_type)) + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Expected 32-bit integer type scalar as Result Type: " + << spvOpcodeString(opcode); + break; + } + + case spv::Op::OpHitObjectGetCurrentTimeNV: + case spv::Op::OpHitObjectGetRayTMaxNV: + case spv::Op::OpHitObjectGetRayTMinNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error; + + if (!_.IsFloatScalarType(result_type) || _.GetBitWidth(result_type) != 32) + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Expected 32-bit floating-point type scalar as Result Type: " + << spvOpcodeString(opcode); + break; + } + + case spv::Op::OpHitObjectGetObjectToWorldNV: + case spv::Op::OpHitObjectGetWorldToObjectNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error; + + uint32_t num_rows = 0; + uint32_t num_cols = 0; + uint32_t col_type = 0; + uint32_t component_type = 0; + + if (!_.GetMatrixTypeInfo(result_type, &num_rows, &num_cols, &col_type, + &component_type)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "expected matrix type as Result Type: " + << spvOpcodeString(opcode); + } + + if (num_cols != 4) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "expected Result Type matrix to have a Column Count of 4" + << spvOpcodeString(opcode); + } + + if (!_.IsFloatScalarType(component_type) || + _.GetBitWidth(result_type) != 32 || num_rows != 3) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "expected Result Type matrix to have a Column Type of " + "3-component 32-bit float vectors: " + << spvOpcodeString(opcode); + } + break; + } + + case spv::Op::OpHitObjectGetObjectRayOriginNV: + case spv::Op::OpHitObjectGetObjectRayDirectionNV: + case spv::Op::OpHitObjectGetWorldRayDirectionNV: + case spv::Op::OpHitObjectGetWorldRayOriginNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error; + + if (!_.IsFloatVectorType(result_type) || + (_.GetDimension(result_type) != 3) || + (_.GetBitWidth(result_type) != 32)) + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Expected 32-bit floating-point type 3-component vector as " + "Result Type: " + << spvOpcodeString(opcode); + break; + } + + case spv::Op::OpHitObjectGetAttributesNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + const uint32_t hit_object_attr_id = inst->GetOperandAs(1); + auto variable = _.FindDef(hit_object_attr_id); + const auto var_opcode = variable->opcode(); + if (!variable || var_opcode != spv::Op::OpVariable || + variable->GetOperandAs(2) != + spv::StorageClass::HitObjectAttributeNV) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hit Object Attributes id must be a OpVariable of storage " + "class HitObjectAttributeNV"; + } + break; + } + + case spv::Op::OpHitObjectExecuteShaderNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + const uint32_t hit_object_attr_id = inst->GetOperandAs(1); + auto variable = _.FindDef(hit_object_attr_id); + const auto var_opcode = variable->opcode(); + if (!variable || var_opcode != spv::Op::OpVariable || + (variable->GetOperandAs(2)) != + spv::StorageClass::RayPayloadKHR) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hit Object Attributes id must be a OpVariable of storage " + "class RayPayloadKHR"; + } + break; + } + + case spv::Op::OpHitObjectRecordEmptyNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + break; + } + + case spv::Op::OpHitObjectRecordMissNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + const uint32_t miss_index = _.GetOperandTypeId(inst, 1); + if (!_.IsUnsignedIntScalarType(miss_index) || + _.GetBitWidth(miss_index) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Miss Index must be a 32-bit int scalar"; + } + + const uint32_t ray_origin = _.GetOperandTypeId(inst, 2); + if (!_.IsFloatVectorType(ray_origin) || _.GetDimension(ray_origin) != 3 || + _.GetBitWidth(ray_origin) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray Origin must be a 32-bit float 3-component vector"; + } + + const uint32_t ray_tmin = _.GetOperandTypeId(inst, 3); + if (!_.IsFloatScalarType(ray_tmin) || _.GetBitWidth(ray_tmin) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray TMin must be a 32-bit float scalar"; + } + + const uint32_t ray_direction = _.GetOperandTypeId(inst, 4); + if (!_.IsFloatVectorType(ray_direction) || + _.GetDimension(ray_direction) != 3 || + _.GetBitWidth(ray_direction) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray Direction must be a 32-bit float 3-component vector"; + } + + const uint32_t ray_tmax = _.GetOperandTypeId(inst, 5); + if (!_.IsFloatScalarType(ray_tmax) || _.GetBitWidth(ray_tmax) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Ray TMax must be a 32-bit float scalar"; + } + break; + } + + case spv::Op::OpHitObjectRecordHitWithIndexNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + if (auto error = ValidateHitObjectInstructionCommonParameters( + _, inst, 1 /* Acceleration Struct */, 2 /* Instance Id */, + 3 /* Primtive Id */, 4 /* Geometry Index */, + KRayParamInvalidId /* Ray Flags */, + KRayParamInvalidId /* Cull Mask */, 5 /* Hit Kind*/, + 6 /* SBT index */, KRayParamInvalidId /* SBT Offset */, + KRayParamInvalidId /* SBT Stride */, + KRayParamInvalidId /* SBT Record Offset */, + KRayParamInvalidId /* SBT Record Stride */, + KRayParamInvalidId /* Miss Index */, 7 /* Ray Origin */, + 8 /* Ray TMin */, 9 /* Ray Direction */, 10 /* Ray TMax */, + KRayParamInvalidId /* Payload */, 11 /* Hit Object Attribute */)) + return error; + + break; + } + + case spv::Op::OpHitObjectRecordHitNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + if (auto error = ValidateHitObjectInstructionCommonParameters( + _, inst, 1 /* Acceleration Struct */, 2 /* Instance Id */, + 3 /* Primtive Id */, 4 /* Geometry Index */, + KRayParamInvalidId /* Ray Flags */, + KRayParamInvalidId /* Cull Mask */, 5 /* Hit Kind*/, + KRayParamInvalidId /* SBT index */, + KRayParamInvalidId /* SBT Offset */, + KRayParamInvalidId /* SBT Stride */, 6 /* SBT Record Offset */, + 7 /* SBT Record Stride */, KRayParamInvalidId /* Miss Index */, + 8 /* Ray Origin */, 9 /* Ray TMin */, 10 /* Ray Direction */, + 11 /* Ray TMax */, KRayParamInvalidId /* Payload */, + 12 /* Hit Object Attribute */)) + return error; + + break; + } + + case spv::Op::OpHitObjectTraceRayMotionNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + if (auto error = ValidateHitObjectInstructionCommonParameters( + _, inst, 1 /* Acceleration Struct */, + KRayParamInvalidId /* Instance Id */, + KRayParamInvalidId /* Primtive Id */, + KRayParamInvalidId /* Geometry Index */, 2 /* Ray Flags */, + 3 /* Cull Mask */, KRayParamInvalidId /* Hit Kind*/, + KRayParamInvalidId /* SBT index */, 4 /* SBT Offset */, + 5 /* SBT Stride */, KRayParamInvalidId /* SBT Record Offset */, + KRayParamInvalidId /* SBT Record Stride */, 6 /* Miss Index */, + 7 /* Ray Origin */, 8 /* Ray TMin */, 9 /* Ray Direction */, + 10 /* Ray TMax */, 12 /* Payload */, + KRayParamInvalidId /* Hit Object Attribute */)) + return error; + // Current Time + const uint32_t current_time_id = _.GetOperandTypeId(inst, 11); + if (!_.IsFloatScalarType(current_time_id) || + _.GetBitWidth(current_time_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Current Times must be a 32-bit float scalar type"; + } + + break; + } + + case spv::Op::OpHitObjectTraceRayNV: { + RegisterOpcodeForValidModel(_, inst); + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + if (auto error = ValidateHitObjectInstructionCommonParameters( + _, inst, 1 /* Acceleration Struct */, + KRayParamInvalidId /* Instance Id */, + KRayParamInvalidId /* Primtive Id */, + KRayParamInvalidId /* Geometry Index */, 2 /* Ray Flags */, + 3 /* Cull Mask */, KRayParamInvalidId /* Hit Kind*/, + KRayParamInvalidId /* SBT index */, 4 /* SBT Offset */, + 5 /* SBT Stride */, KRayParamInvalidId /* SBT Record Offset */, + KRayParamInvalidId /* SBT Record Stride */, 6 /* Miss Index */, + 7 /* Ray Origin */, 8 /* Ray TMin */, 9 /* Ray Direction */, + 10 /* Ray TMax */, 11 /* Payload */, + KRayParamInvalidId /* Hit Object Attribute */)) + return error; + break; + } + + case spv::Op::OpReorderThreadWithHitObjectNV: { + std::string opcode_name = spvOpcodeString(inst->opcode()); + _.function(inst->function()->id()) + ->RegisterExecutionModelLimitation( + [opcode_name](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR) { + if (message) { + *message = opcode_name + + " requires RayGenerationKHR execution model"; + } + return false; + } + return true; + }); + + if (auto error = ValidateHitObjectPointer(_, inst, 0)) return error; + + if (inst->operands().size() > 1) { + if (inst->operands().size() != 3) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hint and Bits are optional together i.e " + << " Either both Hint and Bits should be provided or neither."; + } + + // Validate the optional opreands Hint and Bits + const uint32_t hint_id = _.GetOperandTypeId(inst, 1); + if (!_.IsIntScalarType(hint_id) || _.GetBitWidth(hint_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hint must be a 32-bit int scalar"; + } + const uint32_t bits_id = _.GetOperandTypeId(inst, 2); + if (!_.IsIntScalarType(bits_id) || _.GetBitWidth(bits_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "bits must be a 32-bit int scalar"; + } + } + break; + } + + case spv::Op::OpReorderThreadWithHintNV: { + std::string opcode_name = spvOpcodeString(inst->opcode()); + _.function(inst->function()->id()) + ->RegisterExecutionModelLimitation( + [opcode_name](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR) { + if (message) { + *message = opcode_name + + " requires RayGenerationKHR execution model"; + } + return false; + } + return true; + }); + + const uint32_t hint_id = _.GetOperandTypeId(inst, 0); + if (!_.IsIntScalarType(hint_id) || _.GetBitWidth(hint_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Hint must be a 32-bit int scalar"; + } + + const uint32_t bits_id = _.GetOperandTypeId(inst, 1); + if (!_.IsIntScalarType(bits_id) || _.GetBitWidth(bits_id) != 32) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "bits must be a 32-bit int scalar"; + } + } + + default: + break; + } + return SPV_SUCCESS; +} +} // namespace val +} // namespace spvtools diff --git a/3rdparty/spirv-tools/source/val/validate_scopes.cpp b/3rdparty/spirv-tools/source/val/validate_scopes.cpp index e9781802c..fa1dad9ec 100644 --- a/3rdparty/spirv-tools/source/val/validate_scopes.cpp +++ b/3rdparty/spirv-tools/source/val/validate_scopes.cpp @@ -25,16 +25,16 @@ namespace val { bool IsValidScope(uint32_t scope) { // Deliberately avoid a default case so we have to update the list when the // scopes list changes. - switch (static_cast(scope)) { - case SpvScopeCrossDevice: - case SpvScopeDevice: - case SpvScopeWorkgroup: - case SpvScopeSubgroup: - case SpvScopeInvocation: - case SpvScopeQueueFamilyKHR: - case SpvScopeShaderCallKHR: + switch (static_cast(scope)) { + case spv::Scope::CrossDevice: + case spv::Scope::Device: + case spv::Scope::Workgroup: + case spv::Scope::Subgroup: + case spv::Scope::Invocation: + case spv::Scope::QueueFamilyKHR: + case spv::Scope::ShaderCallKHR: return true; - case SpvScopeMax: + case spv::Scope::Max: break; } return false; @@ -42,7 +42,7 @@ bool IsValidScope(uint32_t scope) { spv_result_t ValidateScope(ValidationState_t& _, const Instruction* inst, uint32_t scope) { - SpvOp opcode = inst->opcode(); + spv::Op opcode = inst->opcode(); bool is_int32 = false, is_const_int32 = false; uint32_t value = 0; std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(scope); @@ -53,14 +53,14 @@ spv_result_t ValidateScope(ValidationState_t& _, const Instruction* inst, } if (!is_const_int32) { - if (_.HasCapability(SpvCapabilityShader) && - !_.HasCapability(SpvCapabilityCooperativeMatrixNV)) { + if (_.HasCapability(spv::Capability::Shader) && + !_.HasCapability(spv::Capability::CooperativeMatrixNV)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Scope ids must be OpConstant when Shader capability is " << "present"; } - if (_.HasCapability(SpvCapabilityShader) && - _.HasCapability(SpvCapabilityCooperativeMatrixNV) && + if (_.HasCapability(spv::Capability::Shader) && + _.HasCapability(spv::Capability::CooperativeMatrixNV) && !spvOpcodeIsConstant(_.GetIdOpcode(scope))) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Scope ids must be constant or specialization constant when " @@ -78,10 +78,10 @@ spv_result_t ValidateScope(ValidationState_t& _, const Instruction* inst, spv_result_t ValidateExecutionScope(ValidationState_t& _, const Instruction* inst, uint32_t scope) { - SpvOp opcode = inst->opcode(); + spv::Op opcode = inst->opcode(); bool is_int32 = false, is_const_int32 = false; - uint32_t value = 0; - std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(scope); + uint32_t tmp_value = 0; + std::tie(is_int32, is_const_int32, tmp_value) = _.EvalInt32IfConst(scope); if (auto error = ValidateScope(_, inst, scope)) { return error; @@ -91,13 +91,15 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, return SPV_SUCCESS; } + spv::Scope value = spv::Scope(tmp_value); + // Vulkan specific rules if (spvIsVulkanEnv(_.context()->target_env)) { // Vulkan 1.1 specific rules if (_.context()->target_env != SPV_ENV_VULKAN_1_0) { // Scope for Non Uniform Group Operations must be limited to Subgroup if (spvOpcodeIsNonUniformGroupOperation(opcode) && - value != SpvScopeSubgroup) { + value != spv::Scope::Subgroup) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4642) << spvOpcodeString(opcode) << ": in Vulkan environment Execution scope is limited to " @@ -107,21 +109,21 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, // OpControlBarrier must only use Subgroup execution scope for a subset of // execution models. - if (opcode == SpvOpControlBarrier && value != SpvScopeSubgroup) { + if (opcode == spv::Op::OpControlBarrier && value != spv::Scope::Subgroup) { std::string errorVUID = _.VkErrorID(4682); _.function(inst->function()->id()) ->RegisterExecutionModelLimitation([errorVUID]( - SpvExecutionModel model, + spv::ExecutionModel model, std::string* message) { - if (model == SpvExecutionModelFragment || - model == SpvExecutionModelVertex || - model == SpvExecutionModelGeometry || - model == SpvExecutionModelTessellationEvaluation || - model == SpvExecutionModelRayGenerationKHR || - model == SpvExecutionModelIntersectionKHR || - model == SpvExecutionModelAnyHitKHR || - model == SpvExecutionModelClosestHitKHR || - model == SpvExecutionModelMissKHR) { + if (model == spv::ExecutionModel::Fragment || + model == spv::ExecutionModel::Vertex || + model == spv::ExecutionModel::Geometry || + model == spv::ExecutionModel::TessellationEvaluation || + model == spv::ExecutionModel::RayGenerationKHR || + model == spv::ExecutionModel::IntersectionKHR || + model == spv::ExecutionModel::AnyHitKHR || + model == spv::ExecutionModel::ClosestHitKHR || + model == spv::ExecutionModel::MissKHR) { if (message) { *message = errorVUID + @@ -137,17 +139,17 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, } // Only subset of execution models support Workgroup. - if (value == SpvScopeWorkgroup) { + if (value == spv::Scope::Workgroup) { std::string errorVUID = _.VkErrorID(4637); _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelTaskNV && - model != SpvExecutionModelMeshNV && - model != SpvExecutionModelTaskEXT && - model != SpvExecutionModelMeshEXT && - model != SpvExecutionModelTessellationControl && - model != SpvExecutionModelGLCompute) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::TaskNV && + model != spv::ExecutionModel::MeshNV && + model != spv::ExecutionModel::TaskEXT && + model != spv::ExecutionModel::MeshEXT && + model != spv::ExecutionModel::TessellationControl && + model != spv::ExecutionModel::GLCompute) { if (message) { *message = errorVUID + @@ -163,7 +165,7 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, // Vulkan generic rules // Scope for execution must be limited to Workgroup or Subgroup - if (value != SpvScopeWorkgroup && value != SpvScopeSubgroup) { + if (value != spv::Scope::Workgroup && value != spv::Scope::Subgroup) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4636) << spvOpcodeString(opcode) << ": in Vulkan environment Execution Scope is limited to " @@ -177,7 +179,7 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, // Scope for execution must be limited to Workgroup or Subgroup for // non-uniform operations if (spvOpcodeIsNonUniformGroupOperation(opcode) && - value != SpvScopeSubgroup && value != SpvScopeWorkgroup) { + value != spv::Scope::Subgroup && value != spv::Scope::Workgroup) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << spvOpcodeString(opcode) << ": Execution scope is limited to Subgroup or Workgroup"; @@ -188,10 +190,10 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _, spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, uint32_t scope) { - const SpvOp opcode = inst->opcode(); + const spv::Op opcode = inst->opcode(); bool is_int32 = false, is_const_int32 = false; - uint32_t value = 0; - std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(scope); + uint32_t tmp_value = 0; + std::tie(is_int32, is_const_int32, tmp_value) = _.EvalInt32IfConst(scope); if (auto error = ValidateScope(_, inst, scope)) { return error; @@ -201,8 +203,10 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, return SPV_SUCCESS; } - if (value == SpvScopeQueueFamilyKHR) { - if (_.HasCapability(SpvCapabilityVulkanMemoryModelKHR)) { + spv::Scope value = spv::Scope(tmp_value); + + if (value == spv::Scope::QueueFamilyKHR) { + if (_.HasCapability(spv::Capability::VulkanMemoryModelKHR)) { return SPV_SUCCESS; } else { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -212,9 +216,9 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, } } - if (value == SpvScopeDevice && - _.HasCapability(SpvCapabilityVulkanMemoryModelKHR) && - !_.HasCapability(SpvCapabilityVulkanMemoryModelDeviceScopeKHR)) { + if (value == spv::Scope::Device && + _.HasCapability(spv::Capability::VulkanMemoryModelKHR) && + !_.HasCapability(spv::Capability::VulkanMemoryModelDeviceScopeKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Use of device scope with VulkanKHR memory model requires the " << "VulkanMemoryModelDeviceScopeKHR capability"; @@ -222,18 +226,19 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, // Vulkan Specific rules if (spvIsVulkanEnv(_.context()->target_env)) { - if (value != SpvScopeDevice && value != SpvScopeWorkgroup && - value != SpvScopeSubgroup && value != SpvScopeInvocation && - value != SpvScopeShaderCallKHR && value != SpvScopeQueueFamily) { + if (value != spv::Scope::Device && value != spv::Scope::Workgroup && + value != spv::Scope::Subgroup && value != spv::Scope::Invocation && + value != spv::Scope::ShaderCallKHR && + value != spv::Scope::QueueFamily) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4638) << spvOpcodeString(opcode) << ": in Vulkan environment Memory Scope is limited to Device, " "QueueFamily, Workgroup, ShaderCallKHR, Subgroup, or " "Invocation"; } else if (_.context()->target_env == SPV_ENV_VULKAN_1_0 && - value == SpvScopeSubgroup && - !_.HasCapability(SpvCapabilitySubgroupBallotKHR) && - !_.HasCapability(SpvCapabilitySubgroupVoteKHR)) { + value == spv::Scope::Subgroup && + !_.HasCapability(spv::Capability::SubgroupBallotKHR) && + !_.HasCapability(spv::Capability::SubgroupVoteKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(6997) << spvOpcodeString(opcode) << ": in Vulkan 1.0 environment Memory Scope is can not be " @@ -241,17 +246,17 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, "declared"; } - if (value == SpvScopeShaderCallKHR) { + if (value == spv::Scope::ShaderCallKHR) { std::string errorVUID = _.VkErrorID(4640); _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelRayGenerationKHR && - model != SpvExecutionModelIntersectionKHR && - model != SpvExecutionModelAnyHitKHR && - model != SpvExecutionModelClosestHitKHR && - model != SpvExecutionModelMissKHR && - model != SpvExecutionModelCallableKHR) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::IntersectionKHR && + model != spv::ExecutionModel::AnyHitKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::MissKHR && + model != spv::ExecutionModel::CallableKHR) { if (message) { *message = errorVUID + @@ -264,17 +269,17 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, }); } - if (value == SpvScopeWorkgroup) { + if (value == spv::Scope::Workgroup) { std::string errorVUID = _.VkErrorID(7321); _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelGLCompute && - model != SpvExecutionModelTessellationControl && - model != SpvExecutionModelTaskNV && - model != SpvExecutionModelMeshNV && - model != SpvExecutionModelTaskEXT && - model != SpvExecutionModelMeshEXT) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::GLCompute && + model != spv::ExecutionModel::TessellationControl && + model != spv::ExecutionModel::TaskNV && + model != spv::ExecutionModel::MeshNV && + model != spv::ExecutionModel::TaskEXT && + model != spv::ExecutionModel::MeshEXT) { if (message) { *message = errorVUID + "Workgroup Memory Scope is limited to MeshNV, " @@ -286,12 +291,12 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, return true; }); - if (_.memory_model() == SpvMemoryModelGLSL450) { + if (_.memory_model() == spv::MemoryModel::GLSL450) { errorVUID = _.VkErrorID(7320); _.function(inst->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model == SpvExecutionModelTessellationControl) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model == spv::ExecutionModel::TessellationControl) { if (message) { *message = errorVUID + diff --git a/3rdparty/spirv-tools/source/val/validate_small_type_uses.cpp b/3rdparty/spirv-tools/source/val/validate_small_type_uses.cpp index 9db82e7c7..69f61ee4f 100644 --- a/3rdparty/spirv-tools/source/val/validate_small_type_uses.cpp +++ b/3rdparty/spirv-tools/source/val/validate_small_type_uses.cpp @@ -22,7 +22,7 @@ namespace val { spv_result_t ValidateSmallTypeUses(ValidationState_t& _, const Instruction* inst) { - if (!_.HasCapability(SpvCapabilityShader) || inst->type_id() == 0 || + if (!_.HasCapability(spv::Capability::Shader) || inst->type_id() == 0 || !_.ContainsLimitedUseIntOrFloatType(inst->type_id())) { return SPV_SUCCESS; } @@ -36,13 +36,13 @@ spv_result_t ValidateSmallTypeUses(ValidationState_t& _, for (auto use : inst->uses()) { const auto* user = use.first; switch (user->opcode()) { - case SpvOpDecorate: - case SpvOpDecorateId: - case SpvOpCopyObject: - case SpvOpStore: - case SpvOpFConvert: - case SpvOpUConvert: - case SpvOpSConvert: + case spv::Op::OpDecorate: + case spv::Op::OpDecorateId: + case spv::Op::OpCopyObject: + case spv::Op::OpStore: + case spv::Op::OpFConvert: + case spv::Op::OpUConvert: + case spv::Op::OpSConvert: break; default: return _.diag(SPV_ERROR_INVALID_ID, user) diff --git a/3rdparty/spirv-tools/source/val/validate_type.cpp b/3rdparty/spirv-tools/source/val/validate_type.cpp index 6b0881cf8..e7adab80f 100644 --- a/3rdparty/spirv-tools/source/val/validate_type.cpp +++ b/3rdparty/spirv-tools/source/val/validate_type.cpp @@ -19,7 +19,6 @@ #include "source/val/instruction.h" #include "source/val/validate.h" #include "source/val/validation_state.h" -#include "spirv/unified1/spirv.h" namespace spvtools { namespace val { @@ -50,8 +49,8 @@ spv_result_t ValidateUniqueness(ValidationState_t& _, const Instruction* inst) { return SPV_SUCCESS; const auto opcode = inst->opcode(); - if (opcode != SpvOpTypeArray && opcode != SpvOpTypeRuntimeArray && - opcode != SpvOpTypeStruct && opcode != SpvOpTypePointer && + if (opcode != spv::Op::OpTypeArray && opcode != spv::Op::OpTypeRuntimeArray && + opcode != spv::Op::OpTypeStruct && opcode != spv::Op::OpTypePointer && !_.RegisterUniqueTypeDeclaration(inst)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Duplicate non-aggregate type declarations are not allowed. " @@ -84,7 +83,7 @@ spv_result_t ValidateTypeInt(ValidationState_t& _, const Instruction* inst) { << "Using a 16-bit integer type requires the Int16 capability," " or an extension that explicitly enables 16-bit integers."; } else if (num_bits == 64) { - if (_.HasCapability(SpvCapabilityInt64)) { + if (_.HasCapability(spv::Capability::Int64)) { return SPV_SUCCESS; } return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -105,7 +104,8 @@ spv_result_t ValidateTypeInt(ValidationState_t& _, const Instruction* inst) { // SPIR-V Spec 2.16.3: Validation Rules for Kernel Capabilities: The // Signedness in OpTypeInt must always be 0. - if (SpvOpTypeInt == inst->opcode() && _.HasCapability(SpvCapabilityKernel) && + if (spv::Op::OpTypeInt == inst->opcode() && + _.HasCapability(spv::Capability::Kernel) && inst->GetOperandAs(2) != 0u) { return _.diag(SPV_ERROR_INVALID_BINARY, inst) << "The Signedness in OpTypeInt " @@ -135,7 +135,7 @@ spv_result_t ValidateTypeFloat(ValidationState_t& _, const Instruction* inst) { " or an extension that explicitly enables 16-bit floating point."; } if (num_bits == 64) { - if (_.HasCapability(SpvCapabilityFloat64)) { + if (_.HasCapability(spv::Capability::Float64)) { return SPV_SUCCESS; } return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -163,7 +163,7 @@ spv_result_t ValidateTypeVector(ValidationState_t& _, const Instruction* inst) { if (num_components == 2 || num_components == 3 || num_components == 4) { return SPV_SUCCESS; } else if (num_components == 8 || num_components == 16) { - if (_.HasCapability(SpvCapabilityVector16)) { + if (_.HasCapability(spv::Capability::Vector16)) { return SPV_SUCCESS; } return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -183,7 +183,7 @@ spv_result_t ValidateTypeMatrix(ValidationState_t& _, const Instruction* inst) { const auto column_type_index = 1; const auto column_type_id = inst->GetOperandAs(column_type_index); const auto column_type = _.FindDef(column_type_id); - if (!column_type || SpvOpTypeVector != column_type->opcode()) { + if (!column_type || spv::Op::OpTypeVector != column_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Columns in a matrix must be of type vector."; } @@ -192,7 +192,7 @@ spv_result_t ValidateTypeMatrix(ValidationState_t& _, const Instruction* inst) { // Operand 1 is the of the type of data in the vector. const auto comp_type_id = column_type->GetOperandAs(1); auto comp_type_instruction = _.FindDef(comp_type_id); - if (comp_type_instruction->opcode() != SpvOpTypeFloat) { + if (comp_type_instruction->opcode() != spv::Op::OpTypeFloat) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Matrix types can only be " "parameterized with " "floating-point types."; @@ -219,14 +219,14 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) { << " is not a type."; } - if (element_type->opcode() == SpvOpTypeVoid) { + if (element_type->opcode() == spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpTypeArray Element Type " << _.getIdName(element_type_id) << " is a void type."; } if (spvIsVulkanEnv(_.context()->target_env) && - element_type->opcode() == SpvOpTypeRuntimeArray) { + element_type->opcode() == spv::Op::OpTypeRuntimeArray) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4680) << "OpTypeArray Element Type " << _.getIdName(element_type_id) << " is not valid in " @@ -246,15 +246,15 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) { const auto const_inst = length->words(); const auto const_result_type_index = 1; const auto const_result_type = _.FindDef(const_inst[const_result_type_index]); - if (!const_result_type || SpvOpTypeInt != const_result_type->opcode()) { + if (!const_result_type || spv::Op::OpTypeInt != const_result_type->opcode()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpTypeArray Length " << _.getIdName(length_id) << " is not a constant integer type."; } switch (length->opcode()) { - case SpvOpSpecConstant: - case SpvOpConstant: { + case spv::Op::OpSpecConstant: + case spv::Op::OpConstant: { auto& type_words = const_result_type->words(); const bool is_signed = type_words[3] > 0; const uint32_t width = type_words[2]; @@ -265,11 +265,11 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) { << " default value must be at least 1: found " << ivalue; } } break; - case SpvOpConstantNull: + case spv::Op::OpConstantNull: return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpTypeArray Length " << _.getIdName(length_id) << " default value must be at least 1."; - case SpvOpSpecConstantOp: + case spv::Op::OpSpecConstantOp: // Assume it's OK, rather than try to evaluate the operation. break; default: @@ -289,14 +289,14 @@ spv_result_t ValidateTypeRuntimeArray(ValidationState_t& _, << " is not a type."; } - if (element_type->opcode() == SpvOpTypeVoid) { + if (element_type->opcode() == spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpTypeRuntimeArray Element Type " << _.getIdName(element_id) << " is a void type."; } if (spvIsVulkanEnv(_.context()->target_env) && - element_type->opcode() == SpvOpTypeRuntimeArray) { + element_type->opcode() == spv::Op::OpTypeRuntimeArray) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4680) << "OpTypeRuntimeArray Element Type " << _.getIdName(element_id) << " is not valid in " @@ -322,11 +322,11 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) { << "OpTypeStruct Member Type " << _.getIdName(member_type_id) << " is not a type."; } - if (member_type->opcode() == SpvOpTypeVoid) { + if (member_type->opcode() == spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Structures cannot contain a void type."; } - if (SpvOpTypeStruct == member_type->opcode() && + if (spv::Op::OpTypeStruct == member_type->opcode() && _.IsStructTypeWithBuiltInMember(member_type_id)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Structure " << _.getIdName(member_type_id) @@ -339,7 +339,7 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) { } if (spvIsVulkanEnv(_.context()->target_env) && - member_type->opcode() == SpvOpTypeRuntimeArray) { + member_type->opcode() == spv::Op::OpTypeRuntimeArray) { const bool is_last_member = member_type_index == inst->operands().size() - 1; if (!is_last_member) { @@ -357,9 +357,10 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) { for (size_t word_i = 2; word_i < inst->words().size(); ++word_i) { auto member = inst->word(word_i); auto memberTypeInstr = _.FindDef(member); - if (memberTypeInstr && SpvOpTypeStruct == memberTypeInstr->opcode()) { - if (_.HasDecoration(memberTypeInstr->id(), SpvDecorationBlock) || - _.HasDecoration(memberTypeInstr->id(), SpvDecorationBufferBlock) || + if (memberTypeInstr && spv::Op::OpTypeStruct == memberTypeInstr->opcode()) { + if (_.HasDecoration(memberTypeInstr->id(), spv::Decoration::Block) || + _.HasDecoration(memberTypeInstr->id(), + spv::Decoration::BufferBlock) || _.GetHasNestedBlockOrBufferBlockStruct(memberTypeInstr->id())) has_nested_blockOrBufferBlock_struct = true; } @@ -368,8 +369,8 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) { _.SetHasNestedBlockOrBufferBlockStruct(inst->id(), has_nested_blockOrBufferBlock_struct); if (_.GetHasNestedBlockOrBufferBlockStruct(inst->id()) && - (_.HasDecoration(inst->id(), SpvDecorationBufferBlock) || - _.HasDecoration(inst->id(), SpvDecorationBlock))) { + (_.HasDecoration(inst->id(), spv::Decoration::BufferBlock) || + _.HasDecoration(inst->id(), spv::Decoration::Block))) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "rules: A Block or BufferBlock cannot be nested within another " "Block or BufferBlock. "; @@ -377,7 +378,7 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) { std::unordered_set built_in_members; for (auto decoration : _.id_decorations(struct_id)) { - if (decoration.dec_type() == SpvDecorationBuiltIn && + if (decoration.dec_type() == spv::Decoration::BuiltIn && decoration.struct_member_index() != Decoration::kInvalidMember) { built_in_members.insert(decoration.struct_member_index()); } @@ -398,9 +399,9 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) { const auto isOpaqueType = [&_](const Instruction* opaque_inst) { auto opcode = opaque_inst->opcode(); - if (_.HasCapability(SpvCapabilityBindlessTextureNV) && - (opcode == SpvOpTypeImage || opcode == SpvOpTypeSampler || - opcode == SpvOpTypeSampledImage)) { + if (_.HasCapability(spv::Capability::BindlessTextureNV) && + (opcode == spv::Op::OpTypeImage || opcode == spv::Op::OpTypeSampler || + opcode == spv::Op::OpTypeSampledImage)) { return false; } else if (spvOpcodeIsBaseOpaqueType(opcode)) { return true; @@ -430,15 +431,15 @@ spv_result_t ValidateTypePointer(ValidationState_t& _, << " is not a type."; } // See if this points to a storage image. - const auto storage_class = inst->GetOperandAs(1); - if (storage_class == SpvStorageClassUniformConstant) { + const auto storage_class = inst->GetOperandAs(1); + if (storage_class == spv::StorageClass::UniformConstant) { // Unpack an optional level of arraying. - if (type->opcode() == SpvOpTypeArray || - type->opcode() == SpvOpTypeRuntimeArray) { + if (type->opcode() == spv::Op::OpTypeArray || + type->opcode() == spv::Op::OpTypeRuntimeArray) { type_id = type->GetOperandAs(1); type = _.FindDef(type_id); } - if (type->opcode() == SpvOpTypeImage) { + if (type->opcode() == spv::Op::OpTypeImage) { const auto sampled = type->GetOperandAs(6); // 2 indicates this image is known to be be used without a sampler, i.e. // a storage image. @@ -475,7 +476,7 @@ spv_result_t ValidateTypeFunction(ValidationState_t& _, << " is not a type."; } - if (param_type->opcode() == SpvOpTypeVoid) { + if (param_type->opcode() == spv::Op::OpTypeVoid) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpTypeFunction Parameter Type " << _.getIdName(param_id) << " cannot be OpTypeVoid."; @@ -495,8 +496,9 @@ spv_result_t ValidateTypeFunction(ValidationState_t& _, // decoration instruction. for (auto& pair : inst->uses()) { const auto* use = pair.first; - if (use->opcode() != SpvOpFunction && !spvOpcodeIsDebug(use->opcode()) && - !use->IsNonSemantic() && !spvOpcodeIsDecoration(use->opcode())) { + if (use->opcode() != spv::Op::OpFunction && + !spvOpcodeIsDebug(use->opcode()) && !use->IsNonSemantic() && + !spvOpcodeIsDecoration(use->opcode())) { return _.diag(SPV_ERROR_INVALID_ID, use) << "Invalid use of function type result id " << _.getIdName(inst->id()) << "."; @@ -510,13 +512,13 @@ spv_result_t ValidateTypeForwardPointer(ValidationState_t& _, const Instruction* inst) { const auto pointer_type_id = inst->GetOperandAs(0); const auto pointer_type_inst = _.FindDef(pointer_type_id); - if (pointer_type_inst->opcode() != SpvOpTypePointer) { + if (pointer_type_inst->opcode() != spv::Op::OpTypePointer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Pointer type in OpTypeForwardPointer is not a pointer type."; } - const auto storage_class = inst->GetOperandAs(1); - if (storage_class != pointer_type_inst->GetOperandAs(1)) { + const auto storage_class = inst->GetOperandAs(1); + if (storage_class != pointer_type_inst->GetOperandAs(1)) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Storage class in OpTypeForwardPointer does not match the " << "pointer definition."; @@ -524,13 +526,13 @@ spv_result_t ValidateTypeForwardPointer(ValidationState_t& _, const auto pointee_type_id = pointer_type_inst->GetOperandAs(2); const auto pointee_type = _.FindDef(pointee_type_id); - if (!pointee_type || pointee_type->opcode() != SpvOpTypeStruct) { + if (!pointee_type || pointee_type->opcode() != spv::Op::OpTypeStruct) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "Forward pointers must point to a structure"; } if (spvIsVulkanEnv(_.context()->target_env)) { - if (storage_class != SpvStorageClassPhysicalStorageBuffer) { + if (storage_class != spv::StorageClass::PhysicalStorageBuffer) { return _.diag(SPV_ERROR_INVALID_ID, inst) << _.VkErrorID(4711) << "In Vulkan, OpTypeForwardPointer must have " @@ -547,8 +549,8 @@ spv_result_t ValidateTypeCooperativeMatrixNV(ValidationState_t& _, const auto component_type_id = inst->GetOperandAs(component_type_index); const auto component_type = _.FindDef(component_type_id); - if (!component_type || (SpvOpTypeFloat != component_type->opcode() && - SpvOpTypeInt != component_type->opcode())) { + if (!component_type || (spv::Op::OpTypeFloat != component_type->opcode() && + spv::Op::OpTypeInt != component_type->opcode())) { return _.diag(SPV_ERROR_INVALID_ID, inst) << "OpTypeCooperativeMatrixNV Component Type " << _.getIdName(component_type_id) @@ -591,44 +593,44 @@ spv_result_t ValidateTypeCooperativeMatrixNV(ValidationState_t& _, spv_result_t TypePass(ValidationState_t& _, const Instruction* inst) { if (!spvOpcodeGeneratesType(inst->opcode()) && - inst->opcode() != SpvOpTypeForwardPointer) { + inst->opcode() != spv::Op::OpTypeForwardPointer) { return SPV_SUCCESS; } if (auto error = ValidateUniqueness(_, inst)) return error; switch (inst->opcode()) { - case SpvOpTypeInt: + case spv::Op::OpTypeInt: if (auto error = ValidateTypeInt(_, inst)) return error; break; - case SpvOpTypeFloat: + case spv::Op::OpTypeFloat: if (auto error = ValidateTypeFloat(_, inst)) return error; break; - case SpvOpTypeVector: + case spv::Op::OpTypeVector: if (auto error = ValidateTypeVector(_, inst)) return error; break; - case SpvOpTypeMatrix: + case spv::Op::OpTypeMatrix: if (auto error = ValidateTypeMatrix(_, inst)) return error; break; - case SpvOpTypeArray: + case spv::Op::OpTypeArray: if (auto error = ValidateTypeArray(_, inst)) return error; break; - case SpvOpTypeRuntimeArray: + case spv::Op::OpTypeRuntimeArray: if (auto error = ValidateTypeRuntimeArray(_, inst)) return error; break; - case SpvOpTypeStruct: + case spv::Op::OpTypeStruct: if (auto error = ValidateTypeStruct(_, inst)) return error; break; - case SpvOpTypePointer: + case spv::Op::OpTypePointer: if (auto error = ValidateTypePointer(_, inst)) return error; break; - case SpvOpTypeFunction: + case spv::Op::OpTypeFunction: if (auto error = ValidateTypeFunction(_, inst)) return error; break; - case SpvOpTypeForwardPointer: + case spv::Op::OpTypeForwardPointer: if (auto error = ValidateTypeForwardPointer(_, inst)) return error; break; - case SpvOpTypeCooperativeMatrixNV: + case spv::Op::OpTypeCooperativeMatrixNV: if (auto error = ValidateTypeCooperativeMatrixNV(_, inst)) return error; break; default: diff --git a/3rdparty/spirv-tools/source/val/validation_state.cpp b/3rdparty/spirv-tools/source/val/validation_state.cpp index 64a0a1a37..c95eec366 100644 --- a/3rdparty/spirv-tools/source/val/validation_state.cpp +++ b/3rdparty/spirv-tools/source/val/validation_state.cpp @@ -31,66 +31,66 @@ namespace val { namespace { ModuleLayoutSection InstructionLayoutSection( - ModuleLayoutSection current_section, SpvOp op) { + ModuleLayoutSection current_section, spv::Op op) { // See Section 2.4 if (spvOpcodeGeneratesType(op) || spvOpcodeIsConstant(op)) return kLayoutTypes; switch (op) { - case SpvOpCapability: + case spv::Op::OpCapability: return kLayoutCapabilities; - case SpvOpExtension: + case spv::Op::OpExtension: return kLayoutExtensions; - case SpvOpExtInstImport: + case spv::Op::OpExtInstImport: return kLayoutExtInstImport; - case SpvOpMemoryModel: + case spv::Op::OpMemoryModel: return kLayoutMemoryModel; - case SpvOpEntryPoint: + case spv::Op::OpEntryPoint: return kLayoutEntryPoint; - case SpvOpExecutionMode: - case SpvOpExecutionModeId: + case spv::Op::OpExecutionMode: + case spv::Op::OpExecutionModeId: return kLayoutExecutionMode; - case SpvOpSourceContinued: - case SpvOpSource: - case SpvOpSourceExtension: - case SpvOpString: + case spv::Op::OpSourceContinued: + case spv::Op::OpSource: + case spv::Op::OpSourceExtension: + case spv::Op::OpString: return kLayoutDebug1; - case SpvOpName: - case SpvOpMemberName: + case spv::Op::OpName: + case spv::Op::OpMemberName: return kLayoutDebug2; - case SpvOpModuleProcessed: + case spv::Op::OpModuleProcessed: return kLayoutDebug3; - case SpvOpDecorate: - case SpvOpMemberDecorate: - case SpvOpGroupDecorate: - case SpvOpGroupMemberDecorate: - case SpvOpDecorationGroup: - case SpvOpDecorateId: - case SpvOpDecorateStringGOOGLE: - case SpvOpMemberDecorateStringGOOGLE: + case spv::Op::OpDecorate: + case spv::Op::OpMemberDecorate: + case spv::Op::OpGroupDecorate: + case spv::Op::OpGroupMemberDecorate: + case spv::Op::OpDecorationGroup: + case spv::Op::OpDecorateId: + case spv::Op::OpDecorateStringGOOGLE: + case spv::Op::OpMemberDecorateStringGOOGLE: return kLayoutAnnotations; - case SpvOpTypeForwardPointer: + case spv::Op::OpTypeForwardPointer: return kLayoutTypes; - case SpvOpVariable: + case spv::Op::OpVariable: if (current_section == kLayoutTypes) return kLayoutTypes; return kLayoutFunctionDefinitions; - case SpvOpExtInst: - // SpvOpExtInst is only allowed in types section for certain extended - // instruction sets. This will be checked separately. + case spv::Op::OpExtInst: + // spv::Op::OpExtInst is only allowed in types section for certain + // extended instruction sets. This will be checked separately. if (current_section == kLayoutTypes) return kLayoutTypes; return kLayoutFunctionDefinitions; - case SpvOpLine: - case SpvOpNoLine: - case SpvOpUndef: + case spv::Op::OpLine: + case spv::Op::OpNoLine: + case spv::Op::OpUndef: if (current_section == kLayoutTypes) return kLayoutTypes; return kLayoutFunctionDefinitions; - case SpvOpFunction: - case SpvOpFunctionParameter: - case SpvOpFunctionEnd: + case spv::Op::OpFunction: + case spv::Op::OpFunctionParameter: + case spv::Op::OpFunctionEnd: if (current_section == kLayoutFunctionDeclarations) return kLayoutFunctionDeclarations; return kLayoutFunctionDefinitions; - case SpvOpSamplerImageAddressingModeNV: + case spv::Op::OpSamplerImageAddressingModeNV: return kLayoutSamplerImageAddressMode; default: break; @@ -98,7 +98,7 @@ ModuleLayoutSection InstructionLayoutSection( return kLayoutFunctionDefinitions; } -bool IsInstructionInLayoutSection(ModuleLayoutSection layout, SpvOp op) { +bool IsInstructionInLayoutSection(ModuleLayoutSection layout, spv::Op op) { return layout == InstructionLayoutSection(layout, op); } @@ -106,7 +106,9 @@ bool IsInstructionInLayoutSection(ModuleLayoutSection layout, SpvOp op) { spv_result_t CountInstructions(void* user_data, const spv_parsed_instruction_t* inst) { ValidationState_t& _ = *(reinterpret_cast(user_data)); - if (inst->opcode == SpvOpFunction) _.increment_total_functions(); + if (spv::Op(inst->opcode) == spv::Op::OpFunction) { + _.increment_total_functions(); + } _.increment_total_instructions(); return SPV_SUCCESS; @@ -160,8 +162,8 @@ ValidationState_t::ValidationState_t(const spv_const_context ctx, struct_nesting_depth_(), struct_has_nested_blockorbufferblock_struct_(), grammar_(ctx), - addressing_model_(SpvAddressingModelMax), - memory_model_(SpvMemoryModelMax), + addressing_model_(spv::AddressingModel::Max), + memory_model_(spv::MemoryModel::Max), pointer_size_and_alignment_(0), sampler_image_addressing_mode_(0), in_function_(false), @@ -290,13 +292,13 @@ void ValidationState_t::ProgressToNextLayoutSectionOrder() { } } -bool ValidationState_t::IsOpcodeInPreviousLayoutSection(SpvOp op) { +bool ValidationState_t::IsOpcodeInPreviousLayoutSection(spv::Op op) { ModuleLayoutSection section = InstructionLayoutSection(current_layout_section_, op); return section < current_layout_section_; } -bool ValidationState_t::IsOpcodeInCurrentLayoutSection(SpvOp op) { +bool ValidationState_t::IsOpcodeInCurrentLayoutSection(spv::Op op) { return IsInstructionInLayoutSection(current_layout_section_, op); } @@ -353,7 +355,7 @@ bool ValidationState_t::in_block() const { module_functions_.back().current_block() != nullptr; } -void ValidationState_t::RegisterCapability(SpvCapability cap) { +void ValidationState_t::RegisterCapability(spv::Capability cap) { // Avoid redundant work. Otherwise the recursion could induce work // quadrdatic in the capability dependency depth. (Ok, not much, but // it's something.) @@ -361,51 +363,51 @@ void ValidationState_t::RegisterCapability(SpvCapability cap) { module_capabilities_.Add(cap); spv_operand_desc desc; - if (SPV_SUCCESS == - grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc)) { + if (SPV_SUCCESS == grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, + uint32_t(cap), &desc)) { CapabilitySet(desc->numCapabilities, desc->capabilities) - .ForEach([this](SpvCapability c) { RegisterCapability(c); }); + .ForEach([this](spv::Capability c) { RegisterCapability(c); }); } switch (cap) { - case SpvCapabilityKernel: + case spv::Capability::Kernel: features_.group_ops_reduce_and_scans = true; break; - case SpvCapabilityInt8: + case spv::Capability::Int8: features_.use_int8_type = true; features_.declare_int8_type = true; break; - case SpvCapabilityStorageBuffer8BitAccess: - case SpvCapabilityUniformAndStorageBuffer8BitAccess: - case SpvCapabilityStoragePushConstant8: - case SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: + case spv::Capability::StorageBuffer8BitAccess: + case spv::Capability::UniformAndStorageBuffer8BitAccess: + case spv::Capability::StoragePushConstant8: + case spv::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: features_.declare_int8_type = true; break; - case SpvCapabilityInt16: + case spv::Capability::Int16: features_.declare_int16_type = true; break; - case SpvCapabilityFloat16: - case SpvCapabilityFloat16Buffer: + case spv::Capability::Float16: + case spv::Capability::Float16Buffer: features_.declare_float16_type = true; break; - case SpvCapabilityStorageUniformBufferBlock16: - case SpvCapabilityStorageUniform16: - case SpvCapabilityStoragePushConstant16: - case SpvCapabilityStorageInputOutput16: - case SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: + case spv::Capability::StorageUniformBufferBlock16: + case spv::Capability::StorageUniform16: + case spv::Capability::StoragePushConstant16: + case spv::Capability::StorageInputOutput16: + case spv::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: features_.declare_int16_type = true; features_.declare_float16_type = true; features_.free_fp_rounding_mode = true; break; - case SpvCapabilityVariablePointers: - case SpvCapabilityVariablePointersStorageBuffer: + case spv::Capability::VariablePointers: + case spv::Capability::VariablePointersStorageBuffer: features_.variable_pointers = true; break; default: // TODO(dneto): For now don't validate SPV_NV_ray_tracing, which uses - // capability SpvCapabilityRayTracingNV. - // SpvCapabilityRayTracingProvisionalKHR would need the same treatment. - // One of the differences going from SPV_KHR_ray_tracing from + // capability spv::Capability::RayTracingNV. + // spv::Capability::RayTracingProvisionalKHR would need the same + // treatment. One of the differences going from SPV_KHR_ray_tracing from // provisional to final spec was the provisional spec uses Locations // for variables in certain storage classes, just like the // SPV_NV_ray_tracing extension. So it mimics the NVIDIA extension. @@ -454,30 +456,32 @@ bool ValidationState_t::HasAnyOfExtensions( return module_extensions_.HasAnyOf(extensions); } -void ValidationState_t::set_addressing_model(SpvAddressingModel am) { +void ValidationState_t::set_addressing_model(spv::AddressingModel am) { addressing_model_ = am; switch (am) { - case SpvAddressingModelPhysical32: + case spv::AddressingModel::Physical32: pointer_size_and_alignment_ = 4; break; default: // fall through - case SpvAddressingModelPhysical64: - case SpvAddressingModelPhysicalStorageBuffer64: + case spv::AddressingModel::Physical64: + case spv::AddressingModel::PhysicalStorageBuffer64: pointer_size_and_alignment_ = 8; break; } } -SpvAddressingModel ValidationState_t::addressing_model() const { +spv::AddressingModel ValidationState_t::addressing_model() const { return addressing_model_; } -void ValidationState_t::set_memory_model(SpvMemoryModel mm) { +void ValidationState_t::set_memory_model(spv::MemoryModel mm) { memory_model_ = mm; } -SpvMemoryModel ValidationState_t::memory_model() const { return memory_model_; } +spv::MemoryModel ValidationState_t::memory_model() const { + return memory_model_; +} void ValidationState_t::set_samplerimage_variable_address_mode( uint32_t bit_width) { @@ -489,8 +493,8 @@ uint32_t ValidationState_t::samplerimage_variable_address_mode() const { } spv_result_t ValidationState_t::RegisterFunction( - uint32_t id, uint32_t ret_type_id, SpvFunctionControlMask function_control, - uint32_t function_type_id) { + uint32_t id, uint32_t ret_type_id, + spv::FunctionControlMask function_control, uint32_t function_type_id) { assert(in_function_body() == false && "RegisterFunction can only be called when parsing the binary outside " "of another function"); @@ -526,24 +530,24 @@ Instruction* ValidationState_t::AddOrderedInstruction( // Improves diagnostic messages by collecting names of IDs void ValidationState_t::RegisterDebugInstruction(const Instruction* inst) { switch (inst->opcode()) { - case SpvOpName: { + case spv::Op::OpName: { const auto target = inst->GetOperandAs(0); const std::string str = inst->GetOperandAs(1); AssignNameToId(target, str); break; } - case SpvOpMemberName: { + case spv::Op::OpMemberName: { const auto target = inst->GetOperandAs(0); const std::string str = inst->GetOperandAs(2); AssignNameToId(target, str); break; } - case SpvOpSourceContinued: - case SpvOpSource: - case SpvOpSourceExtension: - case SpvOpString: - case SpvOpLine: - case SpvOpNoLine: + case spv::Op::OpSourceContinued: + case spv::Op::OpSource: + case spv::Op::OpSourceExtension: + case spv::Op::OpString: + case spv::Op::OpLine: + case spv::Op::OpNoLine: default: break; } @@ -567,7 +571,7 @@ void ValidationState_t::RegisterInstruction(Instruction* inst) { // should be recorded. The validator will ensure that all usages of an // OpTypeSampledImage and its definition are in the same basic block. if ((SPV_OPERAND_TYPE_ID == operand.type) && - (SpvOpSampledImage == operand_inst->opcode())) { + (spv::Op::OpSampledImage == operand_inst->opcode())) { RegisterSampledImageConsumer(operand_word, inst); } @@ -577,12 +581,12 @@ void ValidationState_t::RegisterInstruction(Instruction* inst) { // Instead just need to register storage class usage for consumers in a // function block. if (inst->function()) { - if (operand_inst->opcode() == SpvOpTypePointer) { + if (operand_inst->opcode() == spv::Op::OpTypePointer) { RegisterStorageClassConsumer( - operand_inst->GetOperandAs(1), inst); - } else if (operand_inst->opcode() == SpvOpVariable) { + operand_inst->GetOperandAs(1), inst); + } else if (operand_inst->opcode() == spv::Op::OpVariable) { RegisterStorageClassConsumer( - operand_inst->GetOperandAs(2), inst); + operand_inst->GetOperandAs(2), inst); } } } @@ -605,21 +609,21 @@ void ValidationState_t::RegisterSampledImageConsumer(uint32_t sampled_image_id, } void ValidationState_t::RegisterStorageClassConsumer( - SpvStorageClass storage_class, Instruction* consumer) { + spv::StorageClass storage_class, Instruction* consumer) { if (spvIsVulkanEnv(context()->target_env)) { - if (storage_class == SpvStorageClassOutput) { + if (storage_class == spv::StorageClass::Output) { std::string errorVUID = VkErrorID(4644); function(consumer->function()->id()) ->RegisterExecutionModelLimitation([errorVUID]( - SpvExecutionModel model, + spv::ExecutionModel model, std::string* message) { - if (model == SpvExecutionModelGLCompute || - model == SpvExecutionModelRayGenerationKHR || - model == SpvExecutionModelIntersectionKHR || - model == SpvExecutionModelAnyHitKHR || - model == SpvExecutionModelClosestHitKHR || - model == SpvExecutionModelMissKHR || - model == SpvExecutionModelCallableKHR) { + if (model == spv::ExecutionModel::GLCompute || + model == spv::ExecutionModel::RayGenerationKHR || + model == spv::ExecutionModel::IntersectionKHR || + model == spv::ExecutionModel::AnyHitKHR || + model == spv::ExecutionModel::ClosestHitKHR || + model == spv::ExecutionModel::MissKHR || + model == spv::ExecutionModel::CallableKHR) { if (message) { *message = errorVUID + @@ -634,17 +638,17 @@ void ValidationState_t::RegisterStorageClassConsumer( }); } - if (storage_class == SpvStorageClassWorkgroup) { + if (storage_class == spv::StorageClass::Workgroup) { std::string errorVUID = VkErrorID(4645); function(consumer->function()->id()) ->RegisterExecutionModelLimitation([errorVUID]( - SpvExecutionModel model, + spv::ExecutionModel model, std::string* message) { - if (model != SpvExecutionModelGLCompute && - model != SpvExecutionModelTaskNV && - model != SpvExecutionModelMeshNV && - model != SpvExecutionModelTaskEXT && - model != SpvExecutionModelMeshEXT) { + if (model != spv::ExecutionModel::GLCompute && + model != spv::ExecutionModel::TaskNV && + model != spv::ExecutionModel::MeshNV && + model != spv::ExecutionModel::TaskEXT && + model != spv::ExecutionModel::MeshEXT) { if (message) { *message = errorVUID + @@ -658,15 +662,16 @@ void ValidationState_t::RegisterStorageClassConsumer( } } - if (storage_class == SpvStorageClassCallableDataKHR) { + if (storage_class == spv::StorageClass::CallableDataKHR) { std::string errorVUID = VkErrorID(4704); function(consumer->function()->id()) - ->RegisterExecutionModelLimitation([errorVUID](SpvExecutionModel model, - std::string* message) { - if (model != SpvExecutionModelRayGenerationKHR && - model != SpvExecutionModelClosestHitKHR && - model != SpvExecutionModelCallableKHR && - model != SpvExecutionModelMissKHR) { + ->RegisterExecutionModelLimitation([errorVUID]( + spv::ExecutionModel model, + std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::CallableKHR && + model != spv::ExecutionModel::MissKHR) { if (message) { *message = errorVUID + "CallableDataKHR Storage Class is limited to " @@ -677,12 +682,13 @@ void ValidationState_t::RegisterStorageClassConsumer( } return true; }); - } else if (storage_class == SpvStorageClassIncomingCallableDataKHR) { + } else if (storage_class == spv::StorageClass::IncomingCallableDataKHR) { std::string errorVUID = VkErrorID(4705); function(consumer->function()->id()) - ->RegisterExecutionModelLimitation([errorVUID](SpvExecutionModel model, - std::string* message) { - if (model != SpvExecutionModelCallableKHR) { + ->RegisterExecutionModelLimitation([errorVUID]( + spv::ExecutionModel model, + std::string* message) { + if (model != spv::ExecutionModel::CallableKHR) { if (message) { *message = errorVUID + "IncomingCallableDataKHR Storage Class is limited to " @@ -692,14 +698,15 @@ void ValidationState_t::RegisterStorageClassConsumer( } return true; }); - } else if (storage_class == SpvStorageClassRayPayloadKHR) { + } else if (storage_class == spv::StorageClass::RayPayloadKHR) { std::string errorVUID = VkErrorID(4698); function(consumer->function()->id()) - ->RegisterExecutionModelLimitation([errorVUID](SpvExecutionModel model, - std::string* message) { - if (model != SpvExecutionModelRayGenerationKHR && - model != SpvExecutionModelClosestHitKHR && - model != SpvExecutionModelMissKHR) { + ->RegisterExecutionModelLimitation([errorVUID]( + spv::ExecutionModel model, + std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::MissKHR) { if (message) { *message = errorVUID + @@ -710,14 +717,14 @@ void ValidationState_t::RegisterStorageClassConsumer( } return true; }); - } else if (storage_class == SpvStorageClassHitAttributeKHR) { + } else if (storage_class == spv::StorageClass::HitAttributeKHR) { std::string errorVUID = VkErrorID(4701); function(consumer->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelIntersectionKHR && - model != SpvExecutionModelAnyHitKHR && - model != SpvExecutionModelClosestHitKHR) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::IntersectionKHR && + model != spv::ExecutionModel::AnyHitKHR && + model != spv::ExecutionModel::ClosestHitKHR) { if (message) { *message = errorVUID + "HitAttributeKHR Storage Class is limited to " @@ -728,14 +735,14 @@ void ValidationState_t::RegisterStorageClassConsumer( } return true; }); - } else if (storage_class == SpvStorageClassIncomingRayPayloadKHR) { + } else if (storage_class == spv::StorageClass::IncomingRayPayloadKHR) { std::string errorVUID = VkErrorID(4699); function(consumer->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelAnyHitKHR && - model != SpvExecutionModelClosestHitKHR && - model != SpvExecutionModelMissKHR) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::AnyHitKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::MissKHR) { if (message) { *message = errorVUID + @@ -746,17 +753,17 @@ void ValidationState_t::RegisterStorageClassConsumer( } return true; }); - } else if (storage_class == SpvStorageClassShaderRecordBufferKHR) { + } else if (storage_class == spv::StorageClass::ShaderRecordBufferKHR) { std::string errorVUID = VkErrorID(7119); function(consumer->function()->id()) ->RegisterExecutionModelLimitation( - [errorVUID](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelRayGenerationKHR && - model != SpvExecutionModelIntersectionKHR && - model != SpvExecutionModelAnyHitKHR && - model != SpvExecutionModelClosestHitKHR && - model != SpvExecutionModelCallableKHR && - model != SpvExecutionModelMissKHR) { + [errorVUID](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::IntersectionKHR && + model != spv::ExecutionModel::AnyHitKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::CallableKHR && + model != spv::ExecutionModel::MissKHR) { if (message) { *message = errorVUID + @@ -768,12 +775,12 @@ void ValidationState_t::RegisterStorageClassConsumer( } return true; }); - } else if (storage_class == SpvStorageClassTaskPayloadWorkgroupEXT) { + } else if (storage_class == spv::StorageClass::TaskPayloadWorkgroupEXT) { function(consumer->function()->id()) ->RegisterExecutionModelLimitation( - [](SpvExecutionModel model, std::string* message) { - if (model != SpvExecutionModelTaskEXT && - model != SpvExecutionModelMeshEXT) { + [](spv::ExecutionModel model, std::string* message) { + if (model != spv::ExecutionModel::TaskEXT && + model != spv::ExecutionModel::MeshEXT) { if (message) { *message = "TaskPayloadWorkgroupEXT Storage Class is limited to " @@ -783,6 +790,22 @@ void ValidationState_t::RegisterStorageClassConsumer( } return true; }); + } else if (storage_class == spv::StorageClass::HitObjectAttributeNV) { + function(consumer->function()->id()) + ->RegisterExecutionModelLimitation([](spv::ExecutionModel model, + std::string* message) { + if (model != spv::ExecutionModel::RayGenerationKHR && + model != spv::ExecutionModel::ClosestHitKHR && + model != spv::ExecutionModel::MissKHR) { + if (message) { + *message = + "HitObjectAttributeNV Storage Class is limited to " + "RayGenerationKHR, ClosestHitKHR or MissKHR execution model"; + } + return false; + } + return true; + }); } } @@ -814,9 +837,9 @@ uint32_t ValidationState_t::GetTypeId(uint32_t id) const { return inst ? inst->type_id() : 0; } -SpvOp ValidationState_t::GetIdOpcode(uint32_t id) const { +spv::Op ValidationState_t::GetIdOpcode(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst ? inst->opcode() : SpvOpNop; + return inst ? inst->opcode() : spv::Op::OpNop; } uint32_t ValidationState_t::GetComponentType(uint32_t id) const { @@ -824,18 +847,18 @@ uint32_t ValidationState_t::GetComponentType(uint32_t id) const { assert(inst); switch (inst->opcode()) { - case SpvOpTypeFloat: - case SpvOpTypeInt: - case SpvOpTypeBool: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeBool: return id; - case SpvOpTypeVector: + case spv::Op::OpTypeVector: return inst->word(2); - case SpvOpTypeMatrix: + case spv::Op::OpTypeMatrix: return GetComponentType(inst->word(2)); - case SpvOpTypeCooperativeMatrixNV: + case spv::Op::OpTypeCooperativeMatrixNV: return inst->word(2); default: @@ -853,16 +876,16 @@ uint32_t ValidationState_t::GetDimension(uint32_t id) const { assert(inst); switch (inst->opcode()) { - case SpvOpTypeFloat: - case SpvOpTypeInt: - case SpvOpTypeBool: + case spv::Op::OpTypeFloat: + case spv::Op::OpTypeInt: + case spv::Op::OpTypeBool: return 1; - case SpvOpTypeVector: - case SpvOpTypeMatrix: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: return inst->word(3); - case SpvOpTypeCooperativeMatrixNV: + case spv::Op::OpTypeCooperativeMatrixNV: // Actual dimension isn't known, return 0 return 0; @@ -881,10 +904,11 @@ uint32_t ValidationState_t::GetBitWidth(uint32_t id) const { const Instruction* inst = FindDef(component_type_id); assert(inst); - if (inst->opcode() == SpvOpTypeFloat || inst->opcode() == SpvOpTypeInt) + if (inst->opcode() == spv::Op::OpTypeFloat || + inst->opcode() == spv::Op::OpTypeInt) return inst->word(2); - if (inst->opcode() == SpvOpTypeBool) return 1; + if (inst->opcode() == spv::Op::OpTypeBool) return 1; assert(0); return 0; @@ -892,12 +916,12 @@ uint32_t ValidationState_t::GetBitWidth(uint32_t id) const { bool ValidationState_t::IsVoidType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeVoid; + return inst && inst->opcode() == spv::Op::OpTypeVoid; } bool ValidationState_t::IsFloatScalarType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeFloat; + return inst && inst->opcode() == spv::Op::OpTypeFloat; } bool ValidationState_t::IsFloatVectorType(uint32_t id) const { @@ -906,7 +930,7 @@ bool ValidationState_t::IsFloatVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsFloatScalarType(GetComponentType(id)); } @@ -919,11 +943,11 @@ bool ValidationState_t::IsFloatScalarOrVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeFloat) { + if (inst->opcode() == spv::Op::OpTypeFloat) { return true; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsFloatScalarType(GetComponentType(id)); } @@ -932,7 +956,7 @@ bool ValidationState_t::IsFloatScalarOrVectorType(uint32_t id) const { bool ValidationState_t::IsIntScalarType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeInt; + return inst && inst->opcode() == spv::Op::OpTypeInt; } bool ValidationState_t::IsIntVectorType(uint32_t id) const { @@ -941,7 +965,7 @@ bool ValidationState_t::IsIntVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsIntScalarType(GetComponentType(id)); } @@ -954,11 +978,11 @@ bool ValidationState_t::IsIntScalarOrVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeInt) { + if (inst->opcode() == spv::Op::OpTypeInt) { return true; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsIntScalarType(GetComponentType(id)); } @@ -967,7 +991,7 @@ bool ValidationState_t::IsIntScalarOrVectorType(uint32_t id) const { bool ValidationState_t::IsUnsignedIntScalarType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeInt && inst->word(3) == 0; + return inst && inst->opcode() == spv::Op::OpTypeInt && inst->word(3) == 0; } bool ValidationState_t::IsUnsignedIntVectorType(uint32_t id) const { @@ -976,7 +1000,7 @@ bool ValidationState_t::IsUnsignedIntVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsUnsignedIntScalarType(GetComponentType(id)); } @@ -985,7 +1009,7 @@ bool ValidationState_t::IsUnsignedIntVectorType(uint32_t id) const { bool ValidationState_t::IsSignedIntScalarType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeInt && inst->word(3) == 1; + return inst && inst->opcode() == spv::Op::OpTypeInt && inst->word(3) == 1; } bool ValidationState_t::IsSignedIntVectorType(uint32_t id) const { @@ -994,7 +1018,7 @@ bool ValidationState_t::IsSignedIntVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsSignedIntScalarType(GetComponentType(id)); } @@ -1003,7 +1027,7 @@ bool ValidationState_t::IsSignedIntVectorType(uint32_t id) const { bool ValidationState_t::IsBoolScalarType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeBool; + return inst && inst->opcode() == spv::Op::OpTypeBool; } bool ValidationState_t::IsBoolVectorType(uint32_t id) const { @@ -1012,7 +1036,7 @@ bool ValidationState_t::IsBoolVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsBoolScalarType(GetComponentType(id)); } @@ -1025,11 +1049,11 @@ bool ValidationState_t::IsBoolScalarOrVectorType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeBool) { + if (inst->opcode() == spv::Op::OpTypeBool) { return true; } - if (inst->opcode() == SpvOpTypeVector) { + if (inst->opcode() == spv::Op::OpTypeVector) { return IsBoolScalarType(GetComponentType(id)); } @@ -1042,7 +1066,7 @@ bool ValidationState_t::IsFloatMatrixType(uint32_t id) const { return false; } - if (inst->opcode() == SpvOpTypeMatrix) { + if (inst->opcode() == spv::Op::OpTypeMatrix) { return IsFloatScalarType(GetComponentType(id)); } @@ -1057,13 +1081,13 @@ bool ValidationState_t::GetMatrixTypeInfo(uint32_t id, uint32_t* num_rows, const Instruction* mat_inst = FindDef(id); assert(mat_inst); - if (mat_inst->opcode() != SpvOpTypeMatrix) return false; + if (mat_inst->opcode() != spv::Op::OpTypeMatrix) return false; const uint32_t vec_type = mat_inst->word(2); const Instruction* vec_inst = FindDef(vec_type); assert(vec_inst); - if (vec_inst->opcode() != SpvOpTypeVector) { + if (vec_inst->opcode() != spv::Op::OpTypeVector) { assert(0); return false; } @@ -1083,7 +1107,7 @@ bool ValidationState_t::GetStructMemberTypes( const Instruction* inst = FindDef(struct_type_id); assert(inst); - if (inst->opcode() != SpvOpTypeStruct) return false; + if (inst->opcode() != spv::Op::OpTypeStruct) return false; *member_types = std::vector(inst->words().cbegin() + 2, inst->words().cend()); @@ -1095,30 +1119,31 @@ bool ValidationState_t::GetStructMemberTypes( bool ValidationState_t::IsPointerType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypePointer; + return inst && inst->opcode() == spv::Op::OpTypePointer; } -bool ValidationState_t::GetPointerTypeInfo(uint32_t id, uint32_t* data_type, - uint32_t* storage_class) const { +bool ValidationState_t::GetPointerTypeInfo( + uint32_t id, uint32_t* data_type, spv::StorageClass* storage_class) const { + *storage_class = spv::StorageClass::Max; if (!id) return false; const Instruction* inst = FindDef(id); assert(inst); - if (inst->opcode() != SpvOpTypePointer) return false; + if (inst->opcode() != spv::Op::OpTypePointer) return false; - *storage_class = inst->word(2); + *storage_class = spv::StorageClass(inst->word(2)); *data_type = inst->word(3); return true; } bool ValidationState_t::IsAccelerationStructureType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeAccelerationStructureKHR; + return inst && inst->opcode() == spv::Op::OpTypeAccelerationStructureKHR; } bool ValidationState_t::IsCooperativeMatrixType(uint32_t id) const { const Instruction* inst = FindDef(id); - return inst && inst->opcode() == SpvOpTypeCooperativeMatrixNV; + return inst && inst->opcode() == spv::Op::OpTypeCooperativeMatrixNV; } bool ValidationState_t::IsFloatCooperativeMatrixType(uint32_t id) const { @@ -1148,8 +1173,8 @@ spv_result_t ValidationState_t::CooperativeMatrixShapesMatch( const auto m1_type = FindDef(m1); const auto m2_type = FindDef(m2); - if (m1_type->opcode() != SpvOpTypeCooperativeMatrixNV || - m2_type->opcode() != SpvOpTypeCooperativeMatrixNV) { + if (m1_type->opcode() != spv::Op::OpTypeCooperativeMatrixNV || + m2_type->opcode() != spv::Op::OpTypeCooperativeMatrixNV) { return diag(SPV_ERROR_INVALID_DATA, inst) << "Expected cooperative matrix types"; } @@ -1214,7 +1239,8 @@ bool ValidationState_t::GetConstantValUint64(uint32_t id, uint64_t* val) const { return false; } - if (inst->opcode() != SpvOpConstant && inst->opcode() != SpvOpSpecConstant) + if (inst->opcode() != spv::Op::OpConstant && + inst->opcode() != spv::Op::OpSpecConstant) return false; if (!IsIntScalarType(inst->type_id())) return false; @@ -1246,7 +1272,7 @@ std::tuple ValidationState_t::EvalInt32IfConst( return std::make_tuple(true, false, 0); } - if (inst->opcode() == SpvOpConstantNull) { + if (inst->opcode() == spv::Op::OpConstantNull) { return std::make_tuple(true, true, 0); } @@ -1380,7 +1406,7 @@ bool ValidationState_t::LogicallyMatch(const Instruction* lhs, } } - if (lhs->opcode() == SpvOpTypeArray) { + if (lhs->opcode() == spv::Op::OpTypeArray) { // Size operands must match. if (lhs->GetOperandAs(2u) != rhs->GetOperandAs(2u)) { return false; @@ -1399,7 +1425,7 @@ bool ValidationState_t::LogicallyMatch(const Instruction* lhs, return false; } return LogicallyMatch(lhs_ele, rhs_ele, check_decorations); - } else if (lhs->opcode() == SpvOpTypeStruct) { + } else if (lhs->opcode() == spv::Op::OpTypeStruct) { // Number of elements must match. if (lhs->operands().size() != rhs->operands().size()) { return false; @@ -1437,11 +1463,11 @@ bool ValidationState_t::LogicallyMatch(const Instruction* lhs, const Instruction* ValidationState_t::TracePointer( const Instruction* inst) const { auto base_ptr = inst; - while (base_ptr->opcode() == SpvOpAccessChain || - base_ptr->opcode() == SpvOpInBoundsAccessChain || - base_ptr->opcode() == SpvOpPtrAccessChain || - base_ptr->opcode() == SpvOpInBoundsPtrAccessChain || - base_ptr->opcode() == SpvOpCopyObject) { + while (base_ptr->opcode() == spv::Op::OpAccessChain || + base_ptr->opcode() == spv::Op::OpInBoundsAccessChain || + base_ptr->opcode() == spv::Op::OpPtrAccessChain || + base_ptr->opcode() == spv::Op::OpInBoundsPtrAccessChain || + base_ptr->opcode() == spv::Op::OpCopyObject) { base_ptr = FindDef(base_ptr->GetOperandAs(2u)); } return base_ptr; @@ -1456,25 +1482,25 @@ bool ValidationState_t::ContainsType( if (f(inst)) return true; switch (inst->opcode()) { - case SpvOpTypeArray: - case SpvOpTypeRuntimeArray: - case SpvOpTypeVector: - case SpvOpTypeMatrix: - case SpvOpTypeImage: - case SpvOpTypeSampledImage: - case SpvOpTypeCooperativeMatrixNV: + case spv::Op::OpTypeArray: + case spv::Op::OpTypeRuntimeArray: + case spv::Op::OpTypeVector: + case spv::Op::OpTypeMatrix: + case spv::Op::OpTypeImage: + case spv::Op::OpTypeSampledImage: + case spv::Op::OpTypeCooperativeMatrixNV: return ContainsType(inst->GetOperandAs(1u), f, traverse_all_types); - case SpvOpTypePointer: + case spv::Op::OpTypePointer: if (IsForwardPointer(id)) return false; if (traverse_all_types) { return ContainsType(inst->GetOperandAs(2u), f, traverse_all_types); } break; - case SpvOpTypeFunction: - case SpvOpTypeStruct: - if (inst->opcode() == SpvOpTypeFunction && !traverse_all_types) { + case spv::Op::OpTypeFunction: + case spv::Op::OpTypeStruct: + if (inst->opcode() == spv::Op::OpTypeFunction && !traverse_all_types) { return false; } for (uint32_t i = 1; i < inst->operands().size(); ++i) { @@ -1491,9 +1517,9 @@ bool ValidationState_t::ContainsType( return false; } -bool ValidationState_t::ContainsSizedIntOrFloatType(uint32_t id, SpvOp type, +bool ValidationState_t::ContainsSizedIntOrFloatType(uint32_t id, spv::Op type, uint32_t width) const { - if (type != SpvOpTypeInt && type != SpvOpTypeFloat) return false; + if (type != spv::Op::OpTypeInt && type != spv::Op::OpTypeFloat) return false; const auto f = [type, width](const Instruction* inst) { if (inst->opcode() == type) { @@ -1505,12 +1531,12 @@ bool ValidationState_t::ContainsSizedIntOrFloatType(uint32_t id, SpvOp type, } bool ValidationState_t::ContainsLimitedUseIntOrFloatType(uint32_t id) const { - if ((!HasCapability(SpvCapabilityInt16) && - ContainsSizedIntOrFloatType(id, SpvOpTypeInt, 16)) || - (!HasCapability(SpvCapabilityInt8) && - ContainsSizedIntOrFloatType(id, SpvOpTypeInt, 8)) || - (!HasCapability(SpvCapabilityFloat16) && - ContainsSizedIntOrFloatType(id, SpvOpTypeFloat, 16))) { + if ((!HasCapability(spv::Capability::Int16) && + ContainsSizedIntOrFloatType(id, spv::Op::OpTypeInt, 16)) || + (!HasCapability(spv::Capability::Int8) && + ContainsSizedIntOrFloatType(id, spv::Op::OpTypeInt, 8)) || + (!HasCapability(spv::Capability::Float16) && + ContainsSizedIntOrFloatType(id, spv::Op::OpTypeFloat, 16))) { return true; } return false; @@ -1518,33 +1544,34 @@ bool ValidationState_t::ContainsLimitedUseIntOrFloatType(uint32_t id) const { bool ValidationState_t::ContainsRuntimeArray(uint32_t id) const { const auto f = [](const Instruction* inst) { - return inst->opcode() == SpvOpTypeRuntimeArray; + return inst->opcode() == spv::Op::OpTypeRuntimeArray; }; return ContainsType(id, f, /* traverse_all_types = */ false); } bool ValidationState_t::IsValidStorageClass( - SpvStorageClass storage_class) const { + spv::StorageClass storage_class) const { if (spvIsVulkanEnv(context()->target_env)) { switch (storage_class) { - case SpvStorageClassUniformConstant: - case SpvStorageClassUniform: - case SpvStorageClassStorageBuffer: - case SpvStorageClassInput: - case SpvStorageClassOutput: - case SpvStorageClassImage: - case SpvStorageClassWorkgroup: - case SpvStorageClassPrivate: - case SpvStorageClassFunction: - case SpvStorageClassPushConstant: - case SpvStorageClassPhysicalStorageBuffer: - case SpvStorageClassRayPayloadKHR: - case SpvStorageClassIncomingRayPayloadKHR: - case SpvStorageClassHitAttributeKHR: - case SpvStorageClassCallableDataKHR: - case SpvStorageClassIncomingCallableDataKHR: - case SpvStorageClassShaderRecordBufferKHR: - case SpvStorageClassTaskPayloadWorkgroupEXT: + case spv::StorageClass::UniformConstant: + case spv::StorageClass::Uniform: + case spv::StorageClass::StorageBuffer: + case spv::StorageClass::Input: + case spv::StorageClass::Output: + case spv::StorageClass::Image: + case spv::StorageClass::Workgroup: + case spv::StorageClass::Private: + case spv::StorageClass::Function: + case spv::StorageClass::PushConstant: + case spv::StorageClass::PhysicalStorageBuffer: + case spv::StorageClass::RayPayloadKHR: + case spv::StorageClass::IncomingRayPayloadKHR: + case spv::StorageClass::HitAttributeKHR: + case spv::StorageClass::CallableDataKHR: + case spv::StorageClass::IncomingCallableDataKHR: + case spv::StorageClass::ShaderRecordBufferKHR: + case spv::StorageClass::TaskPayloadWorkgroupEXT: + case spv::StorageClass::HitObjectAttributeNV: return true; default: return false; @@ -2150,6 +2177,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-Base-07651); case 7652: return VUID_WRAP(VUID-StandaloneSpirv-Base-07652); + case 7703: + return VUID_WRAP(VUID-StandaloneSpirv-Component-07703); default: return ""; // unknown id } diff --git a/3rdparty/spirv-tools/source/val/validation_state.h b/3rdparty/spirv-tools/source/val/validation_state.h index 1b599ff35..4d5ac0061 100644 --- a/3rdparty/spirv-tools/source/val/validation_state.h +++ b/3rdparty/spirv-tools/source/val/validation_state.h @@ -185,10 +185,10 @@ class ValidationState_t { void ProgressToNextLayoutSectionOrder(); /// Determines if the op instruction is in a previous layout section - bool IsOpcodeInPreviousLayoutSection(SpvOp op); + bool IsOpcodeInPreviousLayoutSection(spv::Op op); /// Determines if the op instruction is part of the current section - bool IsOpcodeInCurrentLayoutSection(SpvOp op); + bool IsOpcodeInCurrentLayoutSection(spv::Op op); DiagnosticStream diag(spv_result_t error_code, const Instruction* inst); @@ -217,7 +217,8 @@ class ValidationState_t { }; /// Registers |id| as an entry point with |execution_model| and |interfaces|. - void RegisterEntryPoint(const uint32_t id, SpvExecutionModel execution_model, + void RegisterEntryPoint(const uint32_t id, + spv::ExecutionModel execution_model, EntryPointDescription&& desc) { entry_points_.push_back(id); entry_point_to_execution_models_[id].insert(execution_model); @@ -235,7 +236,7 @@ class ValidationState_t { /// Registers execution mode for the given entry point. void RegisterExecutionModeForEntryPoint(uint32_t entry_point, - SpvExecutionMode execution_mode) { + spv::ExecutionMode execution_mode) { entry_point_to_execution_modes_[entry_point].insert(execution_mode); } @@ -247,7 +248,7 @@ class ValidationState_t { /// Returns Execution Models for the given Entry Point. /// Returns nullptr if none found (would trigger assertion). - const std::set* GetExecutionModels( + const std::set* GetExecutionModels( uint32_t entry_point) const { const auto it = entry_point_to_execution_models_.find(entry_point); if (it == entry_point_to_execution_models_.end()) { @@ -259,7 +260,7 @@ class ValidationState_t { /// Returns Execution Modes for the given Entry Point. /// Returns nullptr if none found. - const std::set* GetExecutionModes( + const std::set* GetExecutionModes( uint32_t entry_point) const { const auto it = entry_point_to_execution_modes_.find(entry_point); if (it == entry_point_to_execution_modes_.end()) { @@ -300,7 +301,7 @@ class ValidationState_t { return (id_to_function_.find(id) != id_to_function_.end()); } /// Registers the capability and its dependent capabilities - void RegisterCapability(SpvCapability cap); + void RegisterCapability(spv::Capability cap); /// Registers the extension. void RegisterExtension(Extension ext); @@ -308,14 +309,14 @@ class ValidationState_t { /// Registers the function in the module. Subsequent instructions will be /// called against this function spv_result_t RegisterFunction(uint32_t id, uint32_t ret_type_id, - SpvFunctionControlMask function_control, + spv::FunctionControlMask function_control, uint32_t function_type_id); /// Register a function end instruction spv_result_t RegisterFunctionEnd(); /// Returns true if the capability is enabled in the module. - bool HasCapability(SpvCapability cap) const { + bool HasCapability(spv::Capability cap) const { return module_capabilities_.Contains(cap); } @@ -339,16 +340,16 @@ class ValidationState_t { bool HasAnyOfExtensions(const ExtensionSet& extensions) const; /// Sets the addressing model of this module (logical/physical). - void set_addressing_model(SpvAddressingModel am); + void set_addressing_model(spv::AddressingModel am); /// Returns true if the OpMemoryModel was found. bool has_memory_model_specified() const { - return addressing_model_ != SpvAddressingModelMax && - memory_model_ != SpvMemoryModelMax; + return addressing_model_ != spv::AddressingModel::Max && + memory_model_ != spv::MemoryModel::Max; } /// Returns the addressing model of this module, or Logical if uninitialized. - SpvAddressingModel addressing_model() const; + spv::AddressingModel addressing_model() const; /// Returns the addressing model of this module, or Logical if uninitialized. uint32_t pointer_size_and_alignment() const { @@ -356,10 +357,10 @@ class ValidationState_t { } /// Sets the memory model of this module. - void set_memory_model(SpvMemoryModel mm); + void set_memory_model(spv::MemoryModel mm); /// Returns the memory model of this module, or Simple if uninitialized. - SpvMemoryModel memory_model() const; + spv::MemoryModel memory_model() const; /// Sets the bit width for sampler/image type variables. If not set, they are /// considered opaque @@ -432,8 +433,8 @@ class ValidationState_t { // The decorations are sorted by member_index, so this look up will give the // exact range of decorations for this member index. - Decoration min_decoration((SpvDecoration)0, {}, member_index); - Decoration max_decoration(SpvDecorationMax, {}, member_index); + Decoration min_decoration((spv::Decoration)0, {}, member_index); + Decoration max_decoration(spv::Decoration::Max, {}, member_index); FieldDecorationsIter result; result.begin = decorations.lower_bound(min_decoration); @@ -449,7 +450,7 @@ class ValidationState_t { /// Returns true if the given id has the given decoration , /// otherwise returns false. - bool HasDecoration(uint32_t id, SpvDecoration dec) { + bool HasDecoration(uint32_t id, spv::Decoration dec) { const auto& decorations = id_decorations_.find(id); if (decorations == id_decorations_.end()) return false; @@ -485,7 +486,7 @@ class ValidationState_t { Instruction* consumer); // Record a function's storage class consumer instruction - void RegisterStorageClassConsumer(SpvStorageClass storage_class, + void RegisterStorageClassConsumer(spv::StorageClass storage_class, Instruction* consumer); /// Returns the set of Global Variables. @@ -616,7 +617,7 @@ class ValidationState_t { // Returns true if |id| is a type id that contains |type| (or integer or // floating point type) of |width| bits. - bool ContainsSizedIntOrFloatType(uint32_t id, SpvOp type, + bool ContainsSizedIntOrFloatType(uint32_t id, spv::Op type, uint32_t width) const; // Returns true if |id| is a type id that contains a 8- or 16-bit int or // 16-bit float that is not generally enabled for use. @@ -642,7 +643,7 @@ class ValidationState_t { // Returns opcode of the instruction which issued the id or OpNop if the // instruction is not registered. - SpvOp GetIdOpcode(uint32_t id) const; + spv::Op GetIdOpcode(uint32_t id) const; // Returns type_id for given id operand if it has a type or zero otherwise. // |operand_index| is expected to be pointing towards an operand which is an @@ -652,7 +653,7 @@ class ValidationState_t { // Provides information on pointer type. Returns false iff not pointer type. bool GetPointerTypeInfo(uint32_t id, uint32_t* data_type, - uint32_t* storage_class) const; + spv::StorageClass* storage_class) const; // Is the ID the type of a pointer to a uniform block: Block-decorated struct // in uniform storage class? The result is only valid after internal method @@ -732,6 +733,9 @@ class ValidationState_t { } return std::string(desc->name); } + std::string SpvDecorationString(spv::Decoration decoration) { + return SpvDecorationString(uint32_t(decoration)); + } // Returns whether type m1 and type m2 are cooperative matrices with // the same "shape" (matching scope, rows, cols). If any are specialization @@ -764,7 +768,7 @@ class ValidationState_t { const Instruction* TracePointer(const Instruction* inst) const; // Validates the storage class for the target environment. - bool IsValidStorageClass(SpvStorageClass storage_class) const; + bool IsValidStorageClass(spv::StorageClass storage_class) const; // Takes a Vulkan Valid Usage ID (VUID) as |id| and optional |reference| and // will return a non-empty string only if ID is known and targeting Vulkan. @@ -883,8 +887,8 @@ class ValidationState_t { AssemblyGrammar grammar_; - SpvAddressingModel addressing_model_; - SpvMemoryModel memory_model_; + spv::AddressingModel addressing_model_; + spv::MemoryModel memory_model_; // pointer size derived from addressing model. Assumes all storage classes // have the same pointer size (for physical pointer types). uint32_t pointer_size_and_alignment_; @@ -905,11 +909,11 @@ class ValidationState_t { /// Mapping entry point -> execution models. It is presumed that the same /// function could theoretically be used as 'main' by multiple OpEntryPoint /// instructions. - std::unordered_map> + std::unordered_map> entry_point_to_execution_models_; /// Mapping entry point -> execution modes. - std::unordered_map> + std::unordered_map> entry_point_to_execution_modes_; /// Mapping function -> array of entry points inside this From ce55c18a8df530b2ab0222ef6e43474bb107e9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 18:27:49 -0800 Subject: [PATCH 12/86] Updated spirv-cross. --- 3rdparty/spirv-cross/main.cpp | 11 ++- 3rdparty/spirv-cross/spirv_common.hpp | 3 +- 3rdparty/spirv-cross/spirv_cross.cpp | 86 ++++++++++++++----- 3rdparty/spirv-cross/spirv_cross.hpp | 4 +- 3rdparty/spirv-cross/spirv_cross_c.cpp | 7 ++ 3rdparty/spirv-cross/spirv_cross_c.h | 6 +- .../spirv-cross/spirv_cross_containers.hpp | 2 +- 3rdparty/spirv-cross/spirv_glsl.cpp | 78 +++++++++++------ 3rdparty/spirv-cross/spirv_glsl.hpp | 2 +- 3rdparty/spirv-cross/spirv_msl.cpp | 49 +++++------ 3rdparty/spirv-cross/spirv_msl.hpp | 17 +++- 3rdparty/spirv-cross/spirv_parser.cpp | 2 + 12 files changed, 187 insertions(+), 80 deletions(-) diff --git a/3rdparty/spirv-cross/main.cpp b/3rdparty/spirv-cross/main.cpp index 58c7d0eb4..3605a54a2 100644 --- a/3rdparty/spirv-cross/main.cpp +++ b/3rdparty/spirv-cross/main.cpp @@ -645,6 +645,7 @@ struct CLIArguments bool msl_pad_fragment_output = false; bool msl_domain_lower_left = false; bool msl_argument_buffers = false; + uint32_t msl_argument_buffers_tier = 0; // Tier 1 bool msl_texture_buffer_native = false; bool msl_framebuffer_fetch = false; bool msl_invariant_float_math = false; @@ -856,8 +857,11 @@ static void print_help_msl() "\t[--msl-pad-fragment-output]:\n\t\tAlways emit color outputs as 4-component variables.\n" "\t\tIn Metal, the fragment shader must emit at least as many components as the render target format.\n" "\t[--msl-domain-lower-left]:\n\t\tUse a lower-left tessellation domain.\n" - "\t[--msl-argument-buffers]:\n\t\tEmit Indirect Argument buffers instead of plain bindings.\n" + "\t[--msl-argument-buffers]:\n\t\tEmit Metal argument buffers instead of discrete resource bindings.\n" "\t\tRequires MSL 2.0 to be enabled.\n" + "\t[--msl-argument-buffers-tier]:\n\t\tWhen using Metal argument buffers, indicate the Metal argument buffer tier level supported by the Metal platform.\n" + "\t\tUses same values as Metal MTLArgumentBuffersTier enumeration (0 = Tier1, 1 = Tier2).\n" + "\t\tSetting this value also enables msl-argument-buffers.\n" "\t[--msl-texture-buffer-native]:\n\t\tEnable native support for texel buffers. Otherwise, it is emulated as a normal texture.\n" "\t[--msl-framebuffer-fetch]:\n\t\tImplement subpass inputs with frame buffer fetch.\n" "\t\tEmits [[color(N)]] inputs in fragment stage.\n" @@ -1190,6 +1194,7 @@ static string compile_iteration(const CLIArguments &args, std::vector msl_opts.pad_fragment_output_components = args.msl_pad_fragment_output; msl_opts.tess_domain_origin_lower_left = args.msl_domain_lower_left; msl_opts.argument_buffers = args.msl_argument_buffers; + msl_opts.argument_buffers_tier = static_cast(args.msl_argument_buffers_tier); msl_opts.texture_buffer_native = args.msl_texture_buffer_native; msl_opts.multiview = args.msl_multiview; msl_opts.multiview_layered_rendering = args.msl_multiview_layered_rendering; @@ -1621,6 +1626,10 @@ static int main_inner(int argc, char *argv[]) cbs.add("--msl-pad-fragment-output", [&args](CLIParser &) { args.msl_pad_fragment_output = true; }); cbs.add("--msl-domain-lower-left", [&args](CLIParser &) { args.msl_domain_lower_left = true; }); cbs.add("--msl-argument-buffers", [&args](CLIParser &) { args.msl_argument_buffers = true; }); + cbs.add("--msl-argument-buffer-tier", [&args](CLIParser &parser) { + args.msl_argument_buffers_tier = parser.next_uint(); + args.msl_argument_buffers = true; + }); cbs.add("--msl-discrete-descriptor-set", [&args](CLIParser &parser) { args.msl_discrete_descriptor_sets.push_back(parser.next_uint()); }); cbs.add("--msl-device-argument-buffer", diff --git a/3rdparty/spirv-cross/spirv_common.hpp b/3rdparty/spirv-cross/spirv_common.hpp index 71b1eada6..ba420e1db 100644 --- a/3rdparty/spirv-cross/spirv_common.hpp +++ b/3rdparty/spirv-cross/spirv_common.hpp @@ -644,7 +644,8 @@ struct SPIRExtension : IVariant SPV_AMD_shader_trinary_minmax, SPV_AMD_gcn_shader, NonSemanticDebugPrintf, - NonSemanticShaderDebugInfo + NonSemanticShaderDebugInfo, + NonSemanticGeneric }; explicit SPIRExtension(Extension ext_) diff --git a/3rdparty/spirv-cross/spirv_cross.cpp b/3rdparty/spirv-cross/spirv_cross.cpp index 77bb08197..edc98f81e 100644 --- a/3rdparty/spirv-cross/spirv_cross.cpp +++ b/3rdparty/spirv-cross/spirv_cross.cpp @@ -1468,6 +1468,58 @@ bool Compiler::get_binary_offset_for_decoration(VariableID id, spv::Decoration d return true; } +bool Compiler::block_is_noop(const SPIRBlock &block) const +{ + if (block.terminator != SPIRBlock::Direct) + return false; + + auto &child = get(block.next_block); + + // If this block participates in PHI, the block isn't really noop. + for (auto &phi : block.phi_variables) + if (phi.parent == block.self || phi.parent == child.self) + return false; + + for (auto &phi : child.phi_variables) + if (phi.parent == block.self) + return false; + + // Verify all instructions have no semantic impact. + for (auto &i : block.ops) + { + auto op = static_cast(i.op); + + switch (op) + { + // Non-Semantic instructions. + case OpLine: + case OpNoLine: + break; + + case OpExtInst: + { + auto *ops = stream(i); + auto ext = get(ops[2]).ext; + + bool ext_is_nonsemantic_only = + ext == SPIRExtension::NonSemanticShaderDebugInfo || + ext == SPIRExtension::SPV_debug_info || + ext == SPIRExtension::NonSemanticGeneric; + + if (!ext_is_nonsemantic_only) + return false; + + break; + } + + default: + return false; + } + } + + return true; +} + bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method method) const { // Tried and failed. @@ -1525,7 +1577,7 @@ bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method { // Empty loop header that just sets up merge target // and branches to loop body. - bool ret = block.terminator == SPIRBlock::Direct && block.merge == SPIRBlock::MergeLoop && block.ops.empty(); + bool ret = block.terminator == SPIRBlock::Direct && block.merge == SPIRBlock::MergeLoop && block_is_noop(block); if (!ret) return false; @@ -1551,19 +1603,8 @@ bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method ret = child.terminator == SPIRBlock::Select && child.merge == SPIRBlock::MergeNone && (positive_candidate || negative_candidate); - // If we have OpPhi which depends on branches which came from our own block, - // we need to flush phi variables in else block instead of a trivial break, - // so we cannot assume this is a for loop candidate. if (ret) { - for (auto &phi : block.phi_variables) - if (phi.parent == block.self || phi.parent == child.self) - return false; - - for (auto &phi : child.phi_variables) - if (phi.parent == block.self) - return false; - auto *merge = maybe_get(block.merge_block); if (merge) for (auto &phi : merge->phi_variables) @@ -1588,15 +1629,10 @@ bool Compiler::execution_is_noop(const SPIRBlock &from, const SPIRBlock &to) con if (start->self == to.self) return true; - if (!start->ops.empty()) + if (!block_is_noop(*start)) return false; auto &next = get(start->next_block); - // Flushing phi variables does not count as noop. - for (auto &phi : next.phi_variables) - if (phi.parent == start->self) - return false; - start = &next; } } @@ -3213,8 +3249,8 @@ void Compiler::AnalyzeVariableScopeAccessHandler::notify_variable_access(uint32_ return; // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers. - auto itr = access_chain_children.find(id); - if (itr != end(access_chain_children)) + auto itr = rvalue_forward_children.find(id); + if (itr != end(rvalue_forward_children)) for (auto child_id : itr->second) notify_variable_access(child_id, block); @@ -3322,14 +3358,14 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3 if (var) { accessed_variables_to_block[var->self].insert(current_block->self); - access_chain_children[args[1]].insert(var->self); + rvalue_forward_children[args[1]].insert(var->self); } // args[2] might be another access chain we have to track use of. for (uint32_t i = 2; i < length; i++) { notify_variable_access(args[i], current_block->self); - access_chain_children[args[1]].insert(args[i]); + rvalue_forward_children[args[1]].insert(args[i]); } // Also keep track of the access chain pointer itself. @@ -3411,6 +3447,12 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3 // Might be an access chain we have to track use of. notify_variable_access(args[2], current_block->self); + + // If we're loading an opaque type we cannot lower it to a temporary, + // we must defer access of args[2] until it's used. + auto &type = compiler.get(args[0]); + if (compiler.type_is_opaque_value(type)) + rvalue_forward_children[args[1]].insert(args[2]); break; } diff --git a/3rdparty/spirv-cross/spirv_cross.hpp b/3rdparty/spirv-cross/spirv_cross.hpp index 789010faf..ea98ee60d 100644 --- a/3rdparty/spirv-cross/spirv_cross.hpp +++ b/3rdparty/spirv-cross/spirv_cross.hpp @@ -752,6 +752,7 @@ protected: bool is_force_recompile = false; bool is_force_recompile_forward_progress = false; + bool block_is_noop(const SPIRBlock &block) const; bool block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method method) const; bool types_are_logically_equivalent(const SPIRType &a, const SPIRType &b) const; @@ -1015,7 +1016,8 @@ protected: std::unordered_map> partial_write_variables_to_block; std::unordered_set access_chain_expressions; // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers. - std::unordered_map> access_chain_children; + // This is also relevant when forwarding opaque objects since we cannot lower these to temporaries. + std::unordered_map> rvalue_forward_children; const SPIRBlock *current_block = nullptr; }; diff --git a/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/spirv-cross/spirv_cross_c.cpp index 4d8e40759..72614d78e 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.cpp +++ b/3rdparty/spirv-cross/spirv_cross_c.cpp @@ -479,6 +479,9 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c case SPVC_COMPILER_OPTION_RELAX_NAN_CHECKS: options->glsl.relax_nan_checks = value != 0; break; + case SPVC_COMPILER_OPTION_GLSL_ENABLE_ROW_MAJOR_LOAD_WORKAROUND: + options->glsl.enable_row_major_load_workaround = value != 0; + break; #endif #if SPIRV_CROSS_C_API_HLSL @@ -731,6 +734,10 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c case SPVC_COMPILER_OPTION_MSL_CHECK_DISCARDED_FRAG_STORES: options->msl.check_discarded_frag_stores = value != 0; break; + + case SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER: + options->msl.argument_buffers_tier = static_cast(value); + break; #endif default: diff --git a/3rdparty/spirv-cross/spirv_cross_c.h b/3rdparty/spirv-cross/spirv_cross_c.h index 601a6cfb0..826e25a74 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.h +++ b/3rdparty/spirv-cross/spirv_cross_c.h @@ -40,7 +40,7 @@ extern "C" { /* Bumped if ABI or API breaks backwards compatibility. */ #define SPVC_C_API_VERSION_MAJOR 0 /* Bumped if APIs or enumerations are added in a backwards compatible way. */ -#define SPVC_C_API_VERSION_MINOR 52 +#define SPVC_C_API_VERSION_MINOR 54 /* Bumped if internal implementation details change. */ #define SPVC_C_API_VERSION_PATCH 0 @@ -721,6 +721,10 @@ typedef enum spvc_compiler_option SPVC_COMPILER_OPTION_MSL_MANUAL_HELPER_INVOCATION_UPDATES = 81 | SPVC_COMPILER_OPTION_MSL_BIT, SPVC_COMPILER_OPTION_MSL_CHECK_DISCARDED_FRAG_STORES = 82 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_GLSL_ENABLE_ROW_MAJOR_LOAD_WORKAROUND = 83 | SPVC_COMPILER_OPTION_GLSL_BIT, + + SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER = 84 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_INT_MAX = 0x7fffffff } spvc_compiler_option; diff --git a/3rdparty/spirv-cross/spirv_cross_containers.hpp b/3rdparty/spirv-cross/spirv_cross_containers.hpp index 1b32870e5..50513f49e 100644 --- a/3rdparty/spirv-cross/spirv_cross_containers.hpp +++ b/3rdparty/spirv-cross/spirv_cross_containers.hpp @@ -226,7 +226,7 @@ public: } template - SmallVector(const U (&init)[M]) SPIRV_CROSS_NOEXCEPT : SmallVector(init, init + M) + explicit SmallVector(const U (&init)[M]) SPIRV_CROSS_NOEXCEPT : SmallVector(init, init + M) { } diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 079562476..4b22d47ea 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -3181,7 +3181,6 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo Bitset global_builtins; const SPIRVariable *block_var = nullptr; bool emitted_block = false; - bool builtin_array = false; // Need to use declared size in the type. // These variables might have been declared, but not statically used, so we haven't deduced their size yet. @@ -3305,7 +3304,6 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo emitted_builtins = builtins; emitted_block = true; - builtin_array = !type.array.empty(); block_var = &var; }); @@ -3404,12 +3402,23 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo statement("float gl_CullDistance[", cull_distance_size, "];"); } + bool builtin_array = model == ExecutionModelTessellationControl || + (model == ExecutionModelMeshEXT && storage == StorageClassOutput) || + (model == ExecutionModelGeometry && storage == StorageClassInput) || + (model == ExecutionModelTessellationEvaluation && storage == StorageClassInput); + if (builtin_array) { - if (model == ExecutionModelTessellationControl && storage == StorageClassOutput) - end_scope_decl(join(to_name(block_var->self), "[", get_entry_point().output_vertices, "]")); + const char *instance_name; + if (model == ExecutionModelMeshEXT) + instance_name = "gl_MeshVerticesEXT"; // Per primitive is never synthesized. else - end_scope_decl(join(to_name(block_var->self), "[]")); + instance_name = storage == StorageClassInput ? "gl_in" : "gl_out"; + + if (model == ExecutionModelTessellationControl && storage == StorageClassOutput) + end_scope_decl(join(instance_name, "[", get_entry_point().output_vertices, "]")); + else + end_scope_decl(join(instance_name, "[]")); } else end_scope_decl(); @@ -4362,8 +4371,18 @@ void CompilerGLSL::emit_extension_workarounds(spv::ExecutionModel model) for (auto &type_id : workaround_ubo_load_overload_types) { auto &type = get(type_id); - statement(type_to_glsl(type), " spvWorkaroundRowMajor(", type_to_glsl(type), - " wrap) { return wrap; }"); + + if (options.es && is_matrix(type)) + { + // Need both variants. + // GLSL cannot overload on precision, so need to dispatch appropriately. + statement("highp ", type_to_glsl(type), " spvWorkaroundRowMajor(highp ", type_to_glsl(type), " wrap) { return wrap; }"); + statement("mediump ", type_to_glsl(type), " spvWorkaroundRowMajorMP(mediump ", type_to_glsl(type), " wrap) { return wrap; }"); + } + else + { + statement(type_to_glsl(type), " spvWorkaroundRowMajor(", type_to_glsl(type), " wrap) { return wrap; }"); + } } statement(""); } @@ -4955,9 +4974,9 @@ SmallVector CompilerGLSL::get_composite_constant_ids(ConstantID cons if (is_array(type) || type.basetype == SPIRType::Struct) return constant->subconstants; if (is_matrix(type)) - return constant->m.id; + return SmallVector(constant->m.id); if (is_vector(type)) - return constant->m.c[0].id; + return SmallVector(constant->m.c[0].id); SPIRV_CROSS_THROW("Unexpected scalar constant!"); } if (!const_composite_insert_ids.count(const_id)) @@ -7280,8 +7299,14 @@ std::string CompilerGLSL::to_texture_op(const Instruction &i, bool sparse, bool args.grad_x = grad_x; args.grad_y = grad_y; args.lod = lod; - args.coffset = coffset; - args.offset = offset; + + if (coffsets) + args.offset = coffsets; + else if (coffset) + args.offset = coffset; + else + args.offset = offset; + args.bias = bias; args.component = comp; args.sample = sample; @@ -7673,13 +7698,7 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool farg_str += ", 0"; } - if (args.coffset) - { - forward = forward && should_forward(args.coffset); - farg_str += ", "; - farg_str += bitcast_expression(SPIRType::Int, args.coffset); - } - else if (args.offset) + if (args.offset) { forward = forward && should_forward(args.offset); farg_str += ", "; @@ -10082,7 +10101,7 @@ bool CompilerGLSL::should_dereference(uint32_t id) // same type. Can't check type.self, because for some reason that's // usually the base type with pointers stripped off. This check is // complex enough that I've hoisted it out of the while condition. - if (src_type.pointer != type.pointer || src_type.pointer_depth != type.pointer || + if (src_type.pointer != type.pointer || src_type.pointer_depth != type.pointer_depth || src_type.parent_type != type.parent_type) break; if ((var = maybe_get(expr->loaded_from))) @@ -13310,7 +13329,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) emit_spv_amd_gcn_shader_op(ops[0], ops[1], ops[3], &ops[4], length - 4); } else if (ext == SPIRExtension::SPV_debug_info || - ext == SPIRExtension::NonSemanticShaderDebugInfo) + ext == SPIRExtension::NonSemanticShaderDebugInfo || + ext == SPIRExtension::NonSemanticGeneric) { break; // Ignore SPIR-V debug information extended instructions. } @@ -17335,6 +17355,7 @@ void CompilerGLSL::rewrite_load_for_wrapped_row_major(std::string &expr, TypeID auto *type = &get(loaded_type); bool rewrite = false; + bool relaxed = options.es; if (is_matrix(*type)) { @@ -17345,24 +17366,31 @@ void CompilerGLSL::rewrite_load_for_wrapped_row_major(std::string &expr, TypeID // If an access chain occurred, the workaround is not required, so loading vectors or scalars don't need workaround. type = &backing_type; } + else + { + // If we're loading a composite, we don't have overloads like these. + relaxed = false; + } if (type->basetype == SPIRType::Struct) { // If we're loading a struct where any member is a row-major matrix, apply the workaround. for (uint32_t i = 0; i < uint32_t(type->member_types.size()); i++) { - if (combined_decoration_for_member(*type, i).get(DecorationRowMajor)) - { + auto decorations = combined_decoration_for_member(*type, i); + if (decorations.get(DecorationRowMajor)) rewrite = true; - break; - } + + // Since we decide on a per-struct basis, only use mediump wrapper if all candidates are mediump. + if (!decorations.get(DecorationRelaxedPrecision)) + relaxed = false; } } if (rewrite) { request_workaround_wrapper_overload(loaded_type); - expr = join("spvWorkaroundRowMajor(", expr, ")"); + expr = join("spvWorkaroundRowMajor", (relaxed ? "MP" : ""), "(", expr, ")"); } } diff --git a/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/spirv-cross/spirv_glsl.hpp index c3f2bfc87..4dcde5540 100644 --- a/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/3rdparty/spirv-cross/spirv_glsl.hpp @@ -448,7 +448,7 @@ protected: TextureFunctionArguments() = default; TextureFunctionBaseArguments base; uint32_t coord = 0, coord_components = 0, dref = 0; - uint32_t grad_x = 0, grad_y = 0, lod = 0, coffset = 0, offset = 0; + uint32_t grad_x = 0, grad_y = 0, lod = 0, offset = 0; uint32_t bias = 0, component = 0, sample = 0, sparse_texel = 0, min_lod = 0; bool nonuniform_expression = false; }; diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index 6ccbee878..0e67fa1ac 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -10701,25 +10701,24 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool break; } - if (args.base.is_fetch && (args.offset || args.coffset)) + if (args.base.is_fetch && args.offset) { - uint32_t offset_expr = args.offset ? args.offset : args.coffset; // Fetch offsets must be applied directly to the coordinate. - forward = forward && should_forward(offset_expr); - auto &type = expression_type(offset_expr); + forward = forward && should_forward(args.offset); + auto &type = expression_type(args.offset); if (imgtype.image.dim == Dim1D && msl_options.texture_1D_as_2D) { if (type.basetype != SPIRType::UInt) - tex_coords += join(" + uint2(", bitcast_expression(SPIRType::UInt, offset_expr), ", 0)"); + tex_coords += join(" + uint2(", bitcast_expression(SPIRType::UInt, args.offset), ", 0)"); else - tex_coords += join(" + uint2(", to_enclosed_expression(offset_expr), ", 0)"); + tex_coords += join(" + uint2(", to_enclosed_expression(args.offset), ", 0)"); } else { if (type.basetype != SPIRType::UInt) - tex_coords += " + " + bitcast_expression(SPIRType::UInt, offset_expr); + tex_coords += " + " + bitcast_expression(SPIRType::UInt, args.offset); else - tex_coords += " + " + to_enclosed_expression(offset_expr); + tex_coords += " + " + to_enclosed_expression(args.offset); } } @@ -10923,13 +10922,7 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool // Add offsets string offset_expr; const SPIRType *offset_type = nullptr; - if (args.coffset && !args.base.is_fetch) - { - forward = forward && should_forward(args.coffset); - offset_expr = to_expression(args.coffset); - offset_type = &expression_type(args.coffset); - } - else if (args.offset && !args.base.is_fetch) + if (args.offset && !args.base.is_fetch) { forward = forward && should_forward(args.offset); offset_expr = to_expression(args.offset); @@ -11608,11 +11601,14 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_ } } - // Very specifically, image load-store in argument buffers are disallowed on MSL on iOS. - if (msl_options.is_ios() && physical_type.basetype == SPIRType::Image && physical_type.image.sampled == 2) + // iOS Tier 1 argument buffers do not support writable images. + if (physical_type.basetype == SPIRType::Image && + physical_type.image.sampled == 2 && + msl_options.is_ios() && + msl_options.argument_buffers_tier <= Options::ArgumentBuffersTier::Tier1 && + !has_decoration(orig_id, DecorationNonWritable)) { - if (!has_decoration(orig_id, DecorationNonWritable)) - SPIRV_CROSS_THROW("Writable images are not allowed in argument buffers on iOS."); + SPIRV_CROSS_THROW("Writable images are not allowed on Tier1 argument buffers on iOS."); } // Array information is baked into these types. @@ -16953,13 +16949,14 @@ bool CompilerMSL::descriptor_set_is_argument_buffer(uint32_t desc_set) const bool CompilerMSL::is_supported_argument_buffer_type(const SPIRType &type) const { - // Very specifically, image load-store in argument buffers are disallowed on MSL on iOS. - // But we won't know when the argument buffer is encoded whether this image will have - // a NonWritable decoration. So just use discrete arguments for all storage images - // on iOS. - bool is_storage_image = type.basetype == SPIRType::Image && type.image.sampled == 2; - bool is_supported_type = !msl_options.is_ios() || !is_storage_image; - return !type_is_msl_framebuffer_fetch(type) && is_supported_type; + // iOS Tier 1 argument buffers do not support writable images. + // When the argument buffer is encoded, we don't know whether this image will have a + // NonWritable decoration, so just use discrete arguments for all storage images on iOS. + bool is_supported_type = !(type.basetype == SPIRType::Image && + type.image.sampled == 2 && + msl_options.is_ios() && + msl_options.argument_buffers_tier <= Options::ArgumentBuffersTier::Tier1); + return is_supported_type && !type_is_msl_framebuffer_fetch(type); } void CompilerMSL::analyze_argument_buffers() diff --git a/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/spirv-cross/spirv_msl.hpp index 7cd34c73f..737575d49 100644 --- a/3rdparty/spirv-cross/spirv_msl.hpp +++ b/3rdparty/spirv-cross/spirv_msl.hpp @@ -339,10 +339,25 @@ public: bool dispatch_base = false; bool texture_1D_as_2D = false; - // Enable use of MSL 2.0 indirect argument buffers. + // Enable use of Metal argument buffers. // MSL 2.0 must also be enabled. bool argument_buffers = false; + // Defines Metal argument buffer tier levels. + // Uses same values as Metal MTLArgumentBuffersTier enumeration. + enum class ArgumentBuffersTier + { + Tier1 = 0, + Tier2 = 1, + }; + + // When using Metal argument buffers, indicates the Metal argument buffer tier level supported by the Metal platform. + // Ignored when Options::argument_buffers is disabled. + // - Tier1 supports writable images on macOS, but not on iOS. + // - Tier2 supports writable images on macOS and iOS, and higher resource count limits. + // Tier capabilities based on recommendations from Apple engineering. + ArgumentBuffersTier argument_buffers_tier = ArgumentBuffersTier::Tier1; + // Ensures vertex and instance indices start at zero. This reflects the behavior of HLSL with SV_VertexID and SV_InstanceID. bool enable_base_index_zero = false; diff --git a/3rdparty/spirv-cross/spirv_parser.cpp b/3rdparty/spirv-cross/spirv_parser.cpp index 39bd1adf7..01c2e3812 100644 --- a/3rdparty/spirv-cross/spirv_parser.cpp +++ b/3rdparty/spirv-cross/spirv_parser.cpp @@ -295,6 +295,8 @@ void Parser::parse(const Instruction &instruction) spirv_ext = SPIRExtension::NonSemanticDebugPrintf; else if (ext == "NonSemantic.Shader.DebugInfo.100") spirv_ext = SPIRExtension::NonSemanticShaderDebugInfo; + else if (ext.find("NonSemantic.") == 0) + spirv_ext = SPIRExtension::NonSemanticGeneric; set(id, spirv_ext); // Other SPIR-V extensions which have ExtInstrs are currently not supported. From 35996c46cbe78cce10bc88277a4063c439b97750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 18:28:09 -0800 Subject: [PATCH 13/86] Updated shaderc build script. --- scripts/shaderc.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/shaderc.lua b/scripts/shaderc.lua index abdeaba5e..89548c900 100644 --- a/scripts/shaderc.lua +++ b/scripts/shaderc.lua @@ -130,6 +130,7 @@ project "spirv-opt" path.join(SPIRV_TOOLS, "source/val/validate_primitives.cpp"), path.join(SPIRV_TOOLS, "source/val/validate_ray_query.cpp"), path.join(SPIRV_TOOLS, "source/val/validate_ray_tracing.cpp"), + path.join(SPIRV_TOOLS, "source/val/validate_ray_tracing_reorder.cpp"), path.join(SPIRV_TOOLS, "source/val/validate_scopes.cpp"), path.join(SPIRV_TOOLS, "source/val/validate_small_type_uses.cpp"), path.join(SPIRV_TOOLS, "source/val/validate_type.cpp"), From f5297105faa78ceed41910a299d58fae61e0ad66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 18:40:27 -0800 Subject: [PATCH 14/86] shaderc: Simplified build script. --- scripts/shaderc.lua | 48 ++------------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/scripts/shaderc.lua b/scripts/shaderc.lua index 89548c900..92f61f8bd 100644 --- a/scripts/shaderc.lua +++ b/scripts/shaderc.lua @@ -29,6 +29,8 @@ project "spirv-opt" path.join(SPIRV_TOOLS, "source/opt/**.h"), path.join(SPIRV_TOOLS, "source/reduce/**.cpp"), path.join(SPIRV_TOOLS, "source/reduce/**.h"), + path.join(SPIRV_TOOLS, "source/val/**.cpp"), + path.join(SPIRV_TOOLS, "source/val/**.h"), -- libspirv path.join(SPIRV_TOOLS, "source/assembly_grammar.cpp"), @@ -89,52 +91,6 @@ project "spirv-opt" path.join(SPIRV_TOOLS, "source/util/string_utils.cpp"), path.join(SPIRV_TOOLS, "source/util/string_utils.h"), path.join(SPIRV_TOOLS, "source/util/timer.h"), - path.join(SPIRV_TOOLS, "source/val/basic_block.cpp"), - path.join(SPIRV_TOOLS, "source/val/construct.cpp"), - path.join(SPIRV_TOOLS, "source/val/decoration.h"), - path.join(SPIRV_TOOLS, "source/val/function.cpp"), - path.join(SPIRV_TOOLS, "source/val/instruction.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate.h"), - path.join(SPIRV_TOOLS, "source/val/validate_adjacency.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_annotation.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_arithmetics.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_atomics.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_barriers.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_bitwise.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_builtins.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_capability.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_cfg.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_composites.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_constants.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_conversion.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_debug.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_decorations.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_derivatives.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_execution_limitations.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_extensions.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_function.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_id.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_image.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_instruction.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_interfaces.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_layout.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_literals.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_logicals.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_memory.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_memory_semantics.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_mesh_shading.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_misc.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_mode_setting.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_non_uniform.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_primitives.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_ray_query.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_ray_tracing.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_ray_tracing_reorder.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_scopes.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_small_type_uses.cpp"), - path.join(SPIRV_TOOLS, "source/val/validate_type.cpp"), - path.join(SPIRV_TOOLS, "source/val/validation_state.cpp"), } configuration { "vs*" } From db8f0758d06957e8e061eb0a64b3529ac36f0c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 18:41:31 -0800 Subject: [PATCH 15/86] Updated ImGui. --- 3rdparty/dear-imgui/imgui.cpp | 1673 ++++++++++++++----------- 3rdparty/dear-imgui/imgui.h | 63 +- 3rdparty/dear-imgui/imgui_demo.cpp | 219 ++-- 3rdparty/dear-imgui/imgui_draw.cpp | 69 +- 3rdparty/dear-imgui/imgui_internal.h | 68 +- 3rdparty/dear-imgui/imgui_tables.cpp | 30 +- 3rdparty/dear-imgui/imgui_widgets.cpp | 92 +- 7 files changed, 1216 insertions(+), 998 deletions(-) diff --git a/3rdparty/dear-imgui/imgui.cpp b/3rdparty/dear-imgui/imgui.cpp index bd3f95d77..94414cfd2 100644 --- a/3rdparty/dear-imgui/imgui.cpp +++ b/3rdparty/dear-imgui/imgui.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.90 WIP +// dear imgui, v1.89.3 WIP // (main code and documentation) // Help: @@ -69,6 +69,7 @@ CODE // [SECTION] ImGuiListClipper // [SECTION] STYLING // [SECTION] RENDER HELPERS +// [SECTION] INITIALIZATION, SHUTDOWN // [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!) // [SECTION] INPUTS // [SECTION] ERROR CHECKING @@ -395,6 +396,11 @@ CODE the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends. the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions. exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway. + - 2022/09/20 (1.89) - ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. + this will require uses of legacy backend-dependent indices to be casted, e.g. + - with imgui_impl_glfw: IsKeyPressed(GLFW_KEY_A) -> IsKeyPressed((ImGuiKey)GLFW_KEY_A); + - with imgui_impl_win32: IsKeyPressed('A') -> IsKeyPressed((ImGuiKey)'A') + - etc. However if you are upgrading code you might well use the better, backend-agnostic IsKeyPressed(ImGuiKey_A) now! - 2022/09/12 (1.89) - removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)', always pass a pointer value explicitly. NULL/nullptr is ok but require cast, e.g. TreePush((void*)nullptr); - 2022/09/05 (1.89) - commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020): - DragScalar(), DragScalarN(), DragFloat(), DragFloat2(), DragFloat3(), DragFloat4(): For old signatures ending with (..., const char* format, float power = 1.0f) -> use (..., format ImGuiSliderFlags_Logarithmic) if power != 1.0f. @@ -1013,14 +1019,17 @@ static void ErrorCheckEndFrameSanityChecks(); static void UpdateDebugToolItemPicker(); static void UpdateDebugToolStackQueries(); -// Misc -static void UpdateSettings(); +// Inputs static void UpdateKeyboardInputs(); static void UpdateMouseInputs(); static void UpdateMouseWheel(); +static void UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt); + +// Misc +static void UpdateSettings(); static bool UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect); static void RenderWindowOuterBorders(ImGuiWindow* window); -static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size); +static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size); static void RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open); static void RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col); static void RenderDimmedBackgrounds(); @@ -1281,8 +1290,7 @@ void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars) { unsigned int c = 0; utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL); - if (c != 0) - AddInputCharacter(c); + AddInputCharacter(c); } } @@ -1345,6 +1353,7 @@ void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) IM_ASSERT(&g.IO == this && "Can only add events to current context."); IM_ASSERT(ImGui::IsNamedKeyOrModKey(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API. IM_ASSERT(!ImGui::IsAliasKey(key)); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events. + IM_ASSERT(key != ImGuiMod_Shortcut); // We could easily support the translation here but it seems saner to not accept it (TestEngine perform a translation itself) // Verify that backend isn't mixing up using new io.AddKeyEvent() api and old io.KeysDown[] + io.KeyMap[] data. #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO @@ -1959,6 +1968,8 @@ void* ImFileLoadToMemory(const char* filename, const char* mode, size_t* out_f // [SECTION] MISC HELPERS/UTILITIES (ImText* functions) //----------------------------------------------------------------------------- +IM_MSVC_RUNTIME_CHECKS_OFF + // Convert UTF-8 to 32-bit character, process single character input. // A nearly-branchless UTF-8 decoder, based on work of Christopher Wellons (https://github.com/skeeto/branchless-utf8). // We handle UTF-8 decoding error by skipping forward. @@ -1970,7 +1981,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* static const int shiftc[] = { 0, 18, 12, 6, 0 }; static const int shifte[] = { 0, 6, 4, 2, 0 }; int len = lengths[*(const unsigned char*)in_text >> 3]; - int wanted = len + !len; + int wanted = len + (len ? 0 : 1); if (in_text_end == NULL) in_text_end = in_text + wanted; // Max length, nulls will be taken into account. @@ -2022,8 +2033,6 @@ int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const cha { unsigned int c; in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); - if (c == 0) - break; *buf_out++ = (ImWchar)c; } *buf_out = 0; @@ -2039,8 +2048,6 @@ int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) { unsigned int c; in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); - if (c == 0) - break; char_count++; } return char_count; @@ -2134,6 +2141,7 @@ int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_e } return bytes_count; } +IM_MSVC_RUNTIME_CHECKS_RESTORE //----------------------------------------------------------------------------- // [SECTION] MISC HELPERS/UTILITIES (Color functions) @@ -2873,11 +2881,14 @@ bool ImGuiListClipper::Step() if (need_items_height && ItemsHeight > 0.0f) IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): computed ItemsHeight: %.2f.\n", ItemsHeight); if (ret) + { IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): display %d to %d.\n", DisplayStart, DisplayEnd); + } else + { IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): End.\n"); - if (!ret) End(); + } return ret; } @@ -3225,7 +3236,6 @@ void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, cons LogRenderedText(&pos_min, text, text_display_end); } - // Another overly complex function until we reorganize everything into a nice all-in-one helper. // This is made more complex because we have dissociated the layout rectangle (pos_min..pos_max) which define _where_ the ellipsis is, from actual clipping of text and limit of the ellipsis display. // This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move. @@ -3249,30 +3259,12 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con const ImFont* font = draw_list->_Data->Font; const float font_size = draw_list->_Data->FontSize; + const float font_scale = font_size / font->FontSize; const char* text_end_ellipsis = NULL; - - ImWchar ellipsis_char = font->EllipsisChar; - int ellipsis_char_count = 1; - if (ellipsis_char == (ImWchar)-1) - { - ellipsis_char = font->DotChar; - ellipsis_char_count = 3; - } - const ImFontGlyph* glyph = font->FindGlyph(ellipsis_char); - - float ellipsis_glyph_width = glyph->X1; // Width of the glyph with no padding on either side - float ellipsis_total_width = ellipsis_glyph_width; // Full width of entire ellipsis - - if (ellipsis_char_count > 1) - { - // Full ellipsis size without free spacing after it. - const float spacing_between_dots = 1.0f * (draw_list->_Data->FontSize / font->FontSize); - ellipsis_glyph_width = glyph->X1 - glyph->X0 + spacing_between_dots; - ellipsis_total_width = ellipsis_glyph_width * (float)ellipsis_char_count - spacing_between_dots; - } + const float ellipsis_width = font->EllipsisWidth * font_scale; // We can now claim the space between pos_max.x and ellipsis_max.x - const float text_avail_width = ImMax((ImMax(pos_max.x, ellipsis_max_x) - ellipsis_total_width) - pos_min.x, 1.0f); + const float text_avail_width = ImMax((ImMax(pos_max.x, ellipsis_max_x) - ellipsis_width) - pos_min.x, 1.0f); float text_size_clipped_x = font->CalcTextSizeA(font_size, text_avail_width, 0.0f, text, text_end_full, &text_end_ellipsis).x; if (text == text_end_ellipsis && text_end_ellipsis < text_end_full) { @@ -3289,13 +3281,10 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con // Render text, render ellipsis RenderTextClippedEx(draw_list, pos_min, ImVec2(clip_max_x, pos_max.y), text, text_end_ellipsis, &text_size, ImVec2(0.0f, 0.0f)); - float ellipsis_x = pos_min.x + text_size_clipped_x; - if (ellipsis_x + ellipsis_total_width <= ellipsis_max_x) - for (int i = 0; i < ellipsis_char_count; i++) - { - font->RenderChar(draw_list, font_size, ImVec2(ellipsis_x, pos_min.y), GetColorU32(ImGuiCol_Text), ellipsis_char); - ellipsis_x += ellipsis_glyph_width; - } + ImVec2 ellipsis_pos = ImFloor(ImVec2(pos_min.x + text_size_clipped_x, pos_min.y)); + if (ellipsis_pos.x + ellipsis_width <= ellipsis_max_x) + for (int i = 0; i < font->EllipsisCharCount; i++, ellipsis_pos.x += font->EllipsisCharStep * font_scale) + font->RenderChar(draw_list, font_size, ellipsis_pos, GetColorU32(ImGuiCol_Text), font->EllipsisChar); } else { @@ -3389,6 +3378,215 @@ void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCurso } } +//----------------------------------------------------------------------------- +// [SECTION] INITIALIZATION, SHUTDOWN +//----------------------------------------------------------------------------- + +// Internal state access - if you want to share Dear ImGui state between modules (e.g. DLL) or allocate it yourself +// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module +ImGuiContext* ImGui::GetCurrentContext() +{ + return GImGui; +} + +void ImGui::SetCurrentContext(ImGuiContext* ctx) +{ +#ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC + IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have control over this. +#else + GImGui = ctx; +#endif +} + +void ImGui::SetAllocatorFunctions(ImGuiMemAllocFunc alloc_func, ImGuiMemFreeFunc free_func, void* user_data) +{ + GImAllocatorAllocFunc = alloc_func; + GImAllocatorFreeFunc = free_func; + GImAllocatorUserData = user_data; +} + +// This is provided to facilitate copying allocators from one static/DLL boundary to another (e.g. retrieve default allocator of your executable address space) +void ImGui::GetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func, ImGuiMemFreeFunc* p_free_func, void** p_user_data) +{ + *p_alloc_func = GImAllocatorAllocFunc; + *p_free_func = GImAllocatorFreeFunc; + *p_user_data = GImAllocatorUserData; +} + +ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas) +{ + ImGuiContext* prev_ctx = GetCurrentContext(); + ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas); + SetCurrentContext(ctx); + Initialize(); + if (prev_ctx != NULL) + SetCurrentContext(prev_ctx); // Restore previous context if any, else keep new one. + return ctx; +} + +void ImGui::DestroyContext(ImGuiContext* ctx) +{ + ImGuiContext* prev_ctx = GetCurrentContext(); + if (ctx == NULL) //-V1051 + ctx = prev_ctx; + SetCurrentContext(ctx); + Shutdown(); + SetCurrentContext((prev_ctx != ctx) ? prev_ctx : NULL); + IM_DELETE(ctx); +} + +// IMPORTANT: ###xxx suffixes must be same in ALL languages +static const ImGuiLocEntry GLocalizationEntriesEnUS[] = +{ + { ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" }, + { ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" }, + { ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" }, + { ImGuiLocKey_TableResetOrder, "Reset order###ResetOrder" }, + { ImGuiLocKey_WindowingMainMenuBar, "(Main menu bar)" }, + { ImGuiLocKey_WindowingPopup, "(Popup)" }, + { ImGuiLocKey_WindowingUntitled, "(Untitled)" }, +}; + +void ImGui::Initialize() +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(!g.Initialized && !g.SettingsLoaded); + + // Add .ini handle for ImGuiWindow and ImGuiTable types + { + ImGuiSettingsHandler ini_handler; + ini_handler.TypeName = "Window"; + ini_handler.TypeHash = ImHashStr("Window"); + ini_handler.ClearAllFn = WindowSettingsHandler_ClearAll; + ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen; + ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine; + ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll; + ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll; + AddSettingsHandler(&ini_handler); + } + TableSettingsAddSettingsHandler(); + + // Setup default localization table + LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS)); + + // Create default viewport + ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)(); + g.Viewports.push_back(viewport); + g.TempBuffer.resize(1024 * 3 + 1, 0); + +#ifdef IMGUI_HAS_DOCK +#endif + + g.Initialized = true; +} + +// This function is merely here to free heap allocations. +void ImGui::Shutdown() +{ + // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame) + ImGuiContext& g = *GImGui; + if (g.IO.Fonts && g.FontAtlasOwnedByContext) + { + g.IO.Fonts->Locked = false; + IM_DELETE(g.IO.Fonts); + } + g.IO.Fonts = NULL; + g.DrawListSharedData.TempBuffer.clear(); + + // Cleanup of other data are conditional on actually having initialized Dear ImGui. + if (!g.Initialized) + return; + + // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file) + if (g.SettingsLoaded && g.IO.IniFilename != NULL) + SaveIniSettingsToDisk(g.IO.IniFilename); + + CallContextHooks(&g, ImGuiContextHookType_Shutdown); + + // Clear everything else + g.Windows.clear_delete(); + g.WindowsFocusOrder.clear(); + g.WindowsTempSortBuffer.clear(); + g.CurrentWindow = NULL; + g.CurrentWindowStack.clear(); + g.WindowsById.Clear(); + g.NavWindow = NULL; + g.HoveredWindow = g.HoveredWindowUnderMovingWindow = NULL; + g.ActiveIdWindow = g.ActiveIdPreviousFrameWindow = NULL; + g.MovingWindow = NULL; + + g.KeysRoutingTable.Clear(); + + g.ColorStack.clear(); + g.StyleVarStack.clear(); + g.FontStack.clear(); + g.OpenPopupStack.clear(); + g.BeginPopupStack.clear(); + + g.Viewports.clear_delete(); + + g.TabBars.Clear(); + g.CurrentTabBarStack.clear(); + g.ShrinkWidthBuffer.clear(); + + g.ClipperTempData.clear_destruct(); + + g.Tables.Clear(); + g.TablesTempData.clear_destruct(); + g.DrawChannelsTempMergeBuffer.clear(); + + g.ClipboardHandlerData.clear(); + g.MenusIdSubmittedThisFrame.clear(); + g.InputTextState.ClearFreeMemory(); + + g.SettingsWindows.clear(); + g.SettingsHandlers.clear(); + + if (g.LogFile) + { +#ifndef IMGUI_DISABLE_TTY_FUNCTIONS + if (g.LogFile != stdout) +#endif + ImFileClose(g.LogFile); + g.LogFile = NULL; + } + g.LogBuffer.clear(); + g.DebugLogBuf.clear(); + g.DebugLogIndex.clear(); + + g.Initialized = false; +} + +// No specific ordering/dependency support, will see as needed +ImGuiID ImGui::AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook) +{ + ImGuiContext& g = *ctx; + IM_ASSERT(hook->Callback != NULL && hook->HookId == 0 && hook->Type != ImGuiContextHookType_PendingRemoval_); + g.Hooks.push_back(*hook); + g.Hooks.back().HookId = ++g.HookIdNext; + return g.HookIdNext; +} + +// Deferred removal, avoiding issue with changing vector while iterating it +void ImGui::RemoveContextHook(ImGuiContext* ctx, ImGuiID hook_id) +{ + ImGuiContext& g = *ctx; + IM_ASSERT(hook_id != 0); + for (int n = 0; n < g.Hooks.Size; n++) + if (g.Hooks[n].HookId == hook_id) + g.Hooks[n].Type = ImGuiContextHookType_PendingRemoval_; +} + +// Call context hooks (used by e.g. test engine) +// We assume a small number of hooks so all stored in same array +void ImGui::CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType hook_type) +{ + ImGuiContext& g = *ctx; + for (int n = 0; n < g.Hooks.Size; n++) + if (g.Hooks[n].Type == hook_type) + g.Hooks[n].Callback(&g, &g.Hooks[n]); +} + //----------------------------------------------------------------------------- // [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!) @@ -3835,89 +4033,6 @@ const char* ImGui::GetVersion() return IMGUI_VERSION; } -// Internal state access - if you want to share Dear ImGui state between modules (e.g. DLL) or allocate it yourself -// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module -ImGuiContext* ImGui::GetCurrentContext() -{ - return GImGui; -} - -void ImGui::SetCurrentContext(ImGuiContext* ctx) -{ -#ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC - IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have control over this. -#else - GImGui = ctx; -#endif -} - -void ImGui::SetAllocatorFunctions(ImGuiMemAllocFunc alloc_func, ImGuiMemFreeFunc free_func, void* user_data) -{ - GImAllocatorAllocFunc = alloc_func; - GImAllocatorFreeFunc = free_func; - GImAllocatorUserData = user_data; -} - -// This is provided to facilitate copying allocators from one static/DLL boundary to another (e.g. retrieve default allocator of your executable address space) -void ImGui::GetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func, ImGuiMemFreeFunc* p_free_func, void** p_user_data) -{ - *p_alloc_func = GImAllocatorAllocFunc; - *p_free_func = GImAllocatorFreeFunc; - *p_user_data = GImAllocatorUserData; -} - -ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas) -{ - ImGuiContext* prev_ctx = GetCurrentContext(); - ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas); - SetCurrentContext(ctx); - Initialize(); - if (prev_ctx != NULL) - SetCurrentContext(prev_ctx); // Restore previous context if any, else keep new one. - return ctx; -} - -void ImGui::DestroyContext(ImGuiContext* ctx) -{ - ImGuiContext* prev_ctx = GetCurrentContext(); - if (ctx == NULL) //-V1051 - ctx = prev_ctx; - SetCurrentContext(ctx); - Shutdown(); - SetCurrentContext((prev_ctx != ctx) ? prev_ctx : NULL); - IM_DELETE(ctx); -} - -// No specific ordering/dependency support, will see as needed -ImGuiID ImGui::AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook) -{ - ImGuiContext& g = *ctx; - IM_ASSERT(hook->Callback != NULL && hook->HookId == 0 && hook->Type != ImGuiContextHookType_PendingRemoval_); - g.Hooks.push_back(*hook); - g.Hooks.back().HookId = ++g.HookIdNext; - return g.HookIdNext; -} - -// Deferred removal, avoiding issue with changing vector while iterating it -void ImGui::RemoveContextHook(ImGuiContext* ctx, ImGuiID hook_id) -{ - ImGuiContext& g = *ctx; - IM_ASSERT(hook_id != 0); - for (int n = 0; n < g.Hooks.Size; n++) - if (g.Hooks[n].HookId == hook_id) - g.Hooks[n].Type = ImGuiContextHookType_PendingRemoval_; -} - -// Call context hooks (used by e.g. test engine) -// We assume a small number of hooks so all stored in same array -void ImGui::CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType hook_type) -{ - ImGuiContext& g = *ctx; - for (int n = 0; n < g.Hooks.Size; n++) - if (g.Hooks[n].Type == hook_type) - g.Hooks[n].Callback(&g, &g.Hooks[n]); -} - ImGuiIO& ImGui::GetIO() { IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?"); @@ -4111,341 +4226,6 @@ static bool IsWindowActiveAndVisible(ImGuiWindow* window) return (window->Active) && (!window->Hidden); } -static void UpdateAliasKey(ImGuiKey key, bool v, float analog_value) -{ - IM_ASSERT(ImGui::IsAliasKey(key)); - ImGuiKeyData* key_data = ImGui::GetKeyData(key); - key_data->Down = v; - key_data->AnalogValue = analog_value; -} - -// Rewrite routing data buffers to strip old entries + sort by key to make queries not touch scattered data. -// Entries D,A,B,B,A,C,B --> A,A,B,B,B,C,D -// Index A:1 B:2 C:5 D:0 --> A:0 B:2 C:5 D:6 -// See 'Metrics->Key Owners & Shortcut Routing' to visualize the result of that operation. -static void UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt) -{ - ImGuiContext& g = *GImGui; - rt->EntriesNext.resize(0); - for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) - { - const int new_routing_start_idx = rt->EntriesNext.Size; - ImGuiKeyRoutingData* routing_entry; - for (int old_routing_idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; old_routing_idx != -1; old_routing_idx = routing_entry->NextEntryIndex) - { - routing_entry = &rt->Entries[old_routing_idx]; - routing_entry->RoutingCurr = routing_entry->RoutingNext; // Update entry - routing_entry->RoutingNext = ImGuiKeyOwner_None; - routing_entry->RoutingNextScore = 255; - if (routing_entry->RoutingCurr == ImGuiKeyOwner_None) - continue; - rt->EntriesNext.push_back(*routing_entry); // Write alive ones into new buffer - - // Apply routing to owner if there's no owner already (RoutingCurr == None at this point) - if (routing_entry->Mods == g.IO.KeyMods) - { - ImGuiKeyOwnerData* owner_data = ImGui::GetKeyOwnerData(key); - if (owner_data->OwnerCurr == ImGuiKeyOwner_None) - owner_data->OwnerCurr = routing_entry->RoutingCurr; - } - } - - // Rewrite linked-list - rt->Index[key - ImGuiKey_NamedKey_BEGIN] = (ImGuiKeyRoutingIndex)(new_routing_start_idx < rt->EntriesNext.Size ? new_routing_start_idx : -1); - for (int n = new_routing_start_idx; n < rt->EntriesNext.Size; n++) - rt->EntriesNext[n].NextEntryIndex = (ImGuiKeyRoutingIndex)((n + 1 < rt->EntriesNext.Size) ? n + 1 : -1); - } - rt->Entries.swap(rt->EntriesNext); // Swap new and old indexes -} - -// [Internal] Do not use directly (should read io.KeyMods instead) -static ImGuiKeyChord GetMergedModsFromBools() -{ - ImGuiContext& g = *GImGui; - ImGuiKeyChord key_chord = 0; - if (g.IO.KeyCtrl) { key_chord |= ImGuiMod_Ctrl; } - if (g.IO.KeyShift) { key_chord |= ImGuiMod_Shift; } - if (g.IO.KeyAlt) { key_chord |= ImGuiMod_Alt; } - if (g.IO.KeySuper) { key_chord |= ImGuiMod_Super; } - return key_chord; -} - -static void ImGui::UpdateKeyboardInputs() -{ - ImGuiContext& g = *GImGui; - ImGuiIO& io = g.IO; - - // Import legacy keys or verify they are not used -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - if (io.BackendUsingLegacyKeyArrays == 0) - { - // Backend used new io.AddKeyEvent() API: Good! Verify that old arrays are never written to externally. - for (int n = 0; n < ImGuiKey_LegacyNativeKey_END; n++) - IM_ASSERT((io.KeysDown[n] == false || IsKeyDown((ImGuiKey)n)) && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!"); - } - else - { - if (g.FrameCount == 0) - for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++) - IM_ASSERT(g.IO.KeyMap[n] == -1 && "Backend is not allowed to write to io.KeyMap[0..511]!"); - - // Build reverse KeyMap (Named -> Legacy) - for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_NamedKey_END; n++) - if (io.KeyMap[n] != -1) - { - IM_ASSERT(IsLegacyKey((ImGuiKey)io.KeyMap[n])); - io.KeyMap[io.KeyMap[n]] = n; - } - - // Import legacy keys into new ones - for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++) - if (io.KeysDown[n] || io.BackendUsingLegacyKeyArrays == 1) - { - const ImGuiKey key = (ImGuiKey)(io.KeyMap[n] != -1 ? io.KeyMap[n] : n); - IM_ASSERT(io.KeyMap[n] == -1 || IsNamedKey(key)); - io.KeysData[key].Down = io.KeysDown[n]; - if (key != n) - io.KeysDown[key] = io.KeysDown[n]; // Allow legacy code using io.KeysDown[GetKeyIndex()] with old backends - io.BackendUsingLegacyKeyArrays = 1; - } - if (io.BackendUsingLegacyKeyArrays == 1) - { - GetKeyData(ImGuiMod_Ctrl)->Down = io.KeyCtrl; - GetKeyData(ImGuiMod_Shift)->Down = io.KeyShift; - GetKeyData(ImGuiMod_Alt)->Down = io.KeyAlt; - GetKeyData(ImGuiMod_Super)->Down = io.KeySuper; - } - } - -#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO - const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; - if (io.BackendUsingLegacyNavInputArray && nav_gamepad_active) - { - #define MAP_LEGACY_NAV_INPUT_TO_KEY1(_KEY, _NAV1) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f); io.KeysData[_KEY].AnalogValue = io.NavInputs[_NAV1]; } while (0) - #define MAP_LEGACY_NAV_INPUT_TO_KEY2(_KEY, _NAV1, _NAV2) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f) || (io.NavInputs[_NAV2] > 0.0f); io.KeysData[_KEY].AnalogValue = ImMax(io.NavInputs[_NAV1], io.NavInputs[_NAV2]); } while (0) - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceDown, ImGuiNavInput_Activate); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceRight, ImGuiNavInput_Cancel); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceLeft, ImGuiNavInput_Menu); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceUp, ImGuiNavInput_Input); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadLeft, ImGuiNavInput_DpadLeft); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadRight, ImGuiNavInput_DpadRight); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadUp, ImGuiNavInput_DpadUp); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadDown, ImGuiNavInput_DpadDown); - MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadL1, ImGuiNavInput_FocusPrev, ImGuiNavInput_TweakSlow); - MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadR1, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakFast); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickLeft, ImGuiNavInput_LStickLeft); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickRight, ImGuiNavInput_LStickRight); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickUp, ImGuiNavInput_LStickUp); - MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickDown, ImGuiNavInput_LStickDown); - #undef NAV_MAP_KEY - } -#endif - -#endif - - // Synchronize io.KeyMods with individual modifiers io.KeyXXX bools, update aliases - io.KeyMods = GetMergedModsFromBools(); - for (int n = 0; n < ImGuiMouseButton_COUNT; n++) - UpdateAliasKey(MouseButtonToKey(n), io.MouseDown[n], io.MouseDown[n] ? 1.0f : 0.0f); - UpdateAliasKey(ImGuiKey_MouseWheelX, io.MouseWheelH != 0.0f, io.MouseWheelH); - UpdateAliasKey(ImGuiKey_MouseWheelY, io.MouseWheel != 0.0f, io.MouseWheel); - - // Clear gamepad data if disabled - if ((io.BackendFlags & ImGuiBackendFlags_HasGamepad) == 0) - for (int i = ImGuiKey_Gamepad_BEGIN; i < ImGuiKey_Gamepad_END; i++) - { - io.KeysData[i - ImGuiKey_KeysData_OFFSET].Down = false; - io.KeysData[i - ImGuiKey_KeysData_OFFSET].AnalogValue = 0.0f; - } - - // Update keys - for (int i = 0; i < ImGuiKey_KeysData_SIZE; i++) - { - ImGuiKeyData* key_data = &io.KeysData[i]; - key_data->DownDurationPrev = key_data->DownDuration; - key_data->DownDuration = key_data->Down ? (key_data->DownDuration < 0.0f ? 0.0f : key_data->DownDuration + io.DeltaTime) : -1.0f; - } - - // Update keys/input owner (named keys only): one entry per key - for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) - { - ImGuiKeyData* key_data = &io.KeysData[key - ImGuiKey_KeysData_OFFSET]; - ImGuiKeyOwnerData* owner_data = &g.KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; - owner_data->OwnerCurr = owner_data->OwnerNext; - if (!key_data->Down) // Important: ownership is released on the frame after a release. Ensure a 'MouseDown -> CloseWindow -> MouseUp' chain doesn't lead to someone else seeing the MouseUp. - owner_data->OwnerNext = ImGuiKeyOwner_None; - owner_data->LockThisFrame = owner_data->LockUntilRelease = owner_data->LockUntilRelease && key_data->Down; // Clear LockUntilRelease when key is not Down anymore - } - - UpdateKeyRoutingTable(&g.KeysRoutingTable); -} - -static void ImGui::UpdateMouseInputs() -{ - ImGuiContext& g = *GImGui; - ImGuiIO& io = g.IO; - - // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well) - if (IsMousePosValid(&io.MousePos)) - io.MousePos = g.MouseLastValidPos = ImFloorSigned(io.MousePos); - - // If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta - if (IsMousePosValid(&io.MousePos) && IsMousePosValid(&io.MousePosPrev)) - io.MouseDelta = io.MousePos - io.MousePosPrev; - else - io.MouseDelta = ImVec2(0.0f, 0.0f); - - // If mouse moved we re-enable mouse hovering in case it was disabled by gamepad/keyboard. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true. - if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f) - g.NavDisableMouseHover = false; - - io.MousePosPrev = io.MousePos; - for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) - { - io.MouseClicked[i] = io.MouseDown[i] && io.MouseDownDuration[i] < 0.0f; - io.MouseClickedCount[i] = 0; // Will be filled below - io.MouseReleased[i] = !io.MouseDown[i] && io.MouseDownDuration[i] >= 0.0f; - io.MouseDownDurationPrev[i] = io.MouseDownDuration[i]; - io.MouseDownDuration[i] = io.MouseDown[i] ? (io.MouseDownDuration[i] < 0.0f ? 0.0f : io.MouseDownDuration[i] + io.DeltaTime) : -1.0f; - if (io.MouseClicked[i]) - { - bool is_repeated_click = false; - if ((float)(g.Time - io.MouseClickedTime[i]) < io.MouseDoubleClickTime) - { - ImVec2 delta_from_click_pos = IsMousePosValid(&io.MousePos) ? (io.MousePos - io.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); - if (ImLengthSqr(delta_from_click_pos) < io.MouseDoubleClickMaxDist * io.MouseDoubleClickMaxDist) - is_repeated_click = true; - } - if (is_repeated_click) - io.MouseClickedLastCount[i]++; - else - io.MouseClickedLastCount[i] = 1; - io.MouseClickedTime[i] = g.Time; - io.MouseClickedPos[i] = io.MousePos; - io.MouseClickedCount[i] = io.MouseClickedLastCount[i]; - io.MouseDragMaxDistanceSqr[i] = 0.0f; - } - else if (io.MouseDown[i]) - { - // Maintain the maximum distance we reaching from the initial click position, which is used with dragging threshold - float delta_sqr_click_pos = IsMousePosValid(&io.MousePos) ? ImLengthSqr(io.MousePos - io.MouseClickedPos[i]) : 0.0f; - io.MouseDragMaxDistanceSqr[i] = ImMax(io.MouseDragMaxDistanceSqr[i], delta_sqr_click_pos); - } - - // We provide io.MouseDoubleClicked[] as a legacy service - io.MouseDoubleClicked[i] = (io.MouseClickedCount[i] == 2); - - // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation - if (io.MouseClicked[i]) - g.NavDisableMouseHover = false; - } -} - -static void LockWheelingWindow(ImGuiWindow* window, float wheel_amount) -{ - ImGuiContext& g = *GImGui; - if (window) - g.WheelingWindowReleaseTimer = ImMin(g.WheelingWindowReleaseTimer + ImAbs(wheel_amount) * WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER, WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER); - else - g.WheelingWindowReleaseTimer = 0.0f; - if (g.WheelingWindow == window) - return; - IMGUI_DEBUG_LOG_IO("LockWheelingWindow() \"%s\"\n", window ? window->Name : "NULL"); - g.WheelingWindow = window; - g.WheelingWindowRefMousePos = g.IO.MousePos; -} - -void ImGui::UpdateMouseWheel() -{ - ImGuiContext& g = *GImGui; - - // Reset the locked window if we move the mouse or after the timer elapses - if (g.WheelingWindow != NULL) - { - g.WheelingWindowReleaseTimer -= g.IO.DeltaTime; - if (IsMousePosValid() && ImLengthSqr(g.IO.MousePos - g.WheelingWindowRefMousePos) > g.IO.MouseDragThreshold * g.IO.MouseDragThreshold) - g.WheelingWindowReleaseTimer = 0.0f; - if (g.WheelingWindowReleaseTimer <= 0.0f) - LockWheelingWindow(NULL, 0.0f); - } - - ImVec2 wheel; - wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_None) ? g.IO.MouseWheelH : 0.0f; - wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_None) ? g.IO.MouseWheel : 0.0f; - if (wheel.x == 0.0f && wheel.y == 0.0f) - return; - - //IMGUI_DEBUG_LOG("MouseWheel X:%.3f Y:%.3f\n", wheel_x, wheel_y); - ImGuiWindow* mouse_window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow; - if (!mouse_window || mouse_window->Collapsed) - return; - - // Zoom / Scale window - // FIXME-OBSOLETE: This is an old feature, it still works but pretty much nobody is using it and may be best redesigned. - if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling) - { - LockWheelingWindow(mouse_window, wheel.y); - ImGuiWindow* window = mouse_window; - const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f); - const float scale = new_font_scale / window->FontWindowScale; - window->FontWindowScale = new_font_scale; - if (window == window->RootWindow) - { - const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size; - SetWindowPos(window, window->Pos + offset, 0); - window->Size = ImFloor(window->Size * scale); - window->SizeFull = ImFloor(window->SizeFull * scale); - } - return; - } - if (g.IO.KeyCtrl) - return; - - // Mouse wheel scrolling - // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead - // (we avoid doing it on OSX as it the OS input layer handles this already) - const bool swap_axis = g.IO.KeyShift && !g.IO.ConfigMacOSXBehaviors; - if (swap_axis) - { - wheel.x = wheel.y; - wheel.y = 0.0f; - } - - // Vertical Mouse Wheel scrolling - // Bubble up into parent window if: - // - a child window doesn't allow any scrolling. - // - a child window doesn't need scrolling because it is already at the edge for the direction we are going in. - // - a child window has the ImGuiWindowFlags_NoScrollWithMouse flag. - if (wheel.y != 0.0f) - { - ImGuiWindow* window = mouse_window; - while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.y == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)))) - window = window->ParentWindow; - if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)) - { - LockWheelingWindow(mouse_window, wheel.y); - float max_step = window->InnerRect.GetHeight() * 0.67f; - float scroll_step = ImFloor(ImMin(5 * window->CalcFontSize(), max_step)); - SetScrollY(window, window->Scroll.y - wheel.y * scroll_step); - } - } - - // Horizontal Mouse Wheel scrolling, or Vertical Mouse Wheel w/ Shift held - if (wheel.x != 0.0f) - { - ImGuiWindow* window = mouse_window; - while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.x == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)))) - window = window->ParentWindow; - if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)) - { - LockWheelingWindow(mouse_window, wheel.x); - float max_step = window->InnerRect.GetWidth() * 0.67f; - float scroll_step = ImFloor(ImMin(2 * window->CalcFontSize(), max_step)); - SetScrollX(window, window->Scroll.x - wheel.x * scroll_step); - } - } -} - // The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app) void ImGui::UpdateHoveredWindowAndCaptureFlags() { @@ -4775,128 +4555,6 @@ void ImGui::NewFrame() CallContextHooks(&g, ImGuiContextHookType_NewFramePost); } -// IMPORTANT: ###xxx suffixes must be same in ALL languages -static const ImGuiLocEntry GLocalizationEntriesEnUS[] = -{ - { ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" }, - { ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" }, - { ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" }, - { ImGuiLocKey_TableResetOrder, "Reset order###ResetOrder" }, - { ImGuiLocKey_WindowingMainMenuBar, "(Main menu bar)" }, - { ImGuiLocKey_WindowingPopup, "(Popup)" }, - { ImGuiLocKey_WindowingUntitled, "(Untitled)" }, -}; - -void ImGui::Initialize() -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(!g.Initialized && !g.SettingsLoaded); - - // Add .ini handle for ImGuiWindow and ImGuiTable types - { - ImGuiSettingsHandler ini_handler; - ini_handler.TypeName = "Window"; - ini_handler.TypeHash = ImHashStr("Window"); - ini_handler.ClearAllFn = WindowSettingsHandler_ClearAll; - ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen; - ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine; - ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll; - ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll; - AddSettingsHandler(&ini_handler); - } - TableSettingsAddSettingsHandler(); - - // Setup default localization table - LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS)); - - // Create default viewport - ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)(); - g.Viewports.push_back(viewport); - g.TempBuffer.resize(1024 * 3 + 1, 0); - -#ifdef IMGUI_HAS_DOCK -#endif - - g.Initialized = true; -} - -// This function is merely here to free heap allocations. -void ImGui::Shutdown() -{ - // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame) - ImGuiContext& g = *GImGui; - if (g.IO.Fonts && g.FontAtlasOwnedByContext) - { - g.IO.Fonts->Locked = false; - IM_DELETE(g.IO.Fonts); - } - g.IO.Fonts = NULL; - g.DrawListSharedData.TempBuffer.clear(); - - // Cleanup of other data are conditional on actually having initialized Dear ImGui. - if (!g.Initialized) - return; - - // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file) - if (g.SettingsLoaded && g.IO.IniFilename != NULL) - SaveIniSettingsToDisk(g.IO.IniFilename); - - CallContextHooks(&g, ImGuiContextHookType_Shutdown); - - // Clear everything else - g.Windows.clear_delete(); - g.WindowsFocusOrder.clear(); - g.WindowsTempSortBuffer.clear(); - g.CurrentWindow = NULL; - g.CurrentWindowStack.clear(); - g.WindowsById.Clear(); - g.NavWindow = NULL; - g.HoveredWindow = g.HoveredWindowUnderMovingWindow = NULL; - g.ActiveIdWindow = g.ActiveIdPreviousFrameWindow = NULL; - g.MovingWindow = NULL; - - g.KeysRoutingTable.Clear(); - - g.ColorStack.clear(); - g.StyleVarStack.clear(); - g.FontStack.clear(); - g.OpenPopupStack.clear(); - g.BeginPopupStack.clear(); - - g.Viewports.clear_delete(); - - g.TabBars.Clear(); - g.CurrentTabBarStack.clear(); - g.ShrinkWidthBuffer.clear(); - - g.ClipperTempData.clear_destruct(); - - g.Tables.Clear(); - g.TablesTempData.clear_destruct(); - g.DrawChannelsTempMergeBuffer.clear(); - - g.ClipboardHandlerData.clear(); - g.MenusIdSubmittedThisFrame.clear(); - g.InputTextState.ClearFreeMemory(); - - g.SettingsWindows.clear(); - g.SettingsHandlers.clear(); - - if (g.LogFile) - { -#ifndef IMGUI_DISABLE_TTY_FUNCTIONS - if (g.LogFile != stdout) -#endif - ImFileClose(g.LogFile); - g.LogFile = NULL; - } - g.LogBuffer.clear(); - g.DebugLogBuf.clear(); - g.DebugLogIndex.clear(); - - g.Initialized = false; -} - // FIXME: Add a more explicit sort order in the window structure. static int IMGUI_CDECL ChildWindowComparer(const void* lhs, const void* rhs) { @@ -5468,6 +5126,12 @@ void ImGui::SetActiveIdUsingAllKeyboardKeys() NavMoveRequestCancel(); } +ImGuiID ImGui::GetItemID() +{ + ImGuiContext& g = *GImGui; + return g.LastItemData.ID; +} + ImVec2 ImGui::GetItemRectMin() { ImGuiContext& g = *GImGui; @@ -5740,9 +5404,9 @@ static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const ImVec2& s if (!(window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize))) { ImGuiWindow* window_for_height = window; - const float decoration_up_height = window_for_height->TitleBarHeight() + window_for_height->MenuBarHeight(); new_size = ImMax(new_size, g.Style.WindowMinSize); - new_size.y = ImMax(new_size.y, decoration_up_height + ImMax(0.0f, g.Style.WindowRounding - 1.0f)); // Reduce artifacts with very small windows + const float minimum_height = window_for_height->TitleBarHeight() + window_for_height->MenuBarHeight() + ImMax(0.0f, g.Style.WindowRounding - 1.0f); + new_size.y = ImMax(new_size.y, minimum_height); // Reduce artifacts with very small windows } return new_size; } @@ -5771,9 +5435,10 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont { ImGuiContext& g = *GImGui; ImGuiStyle& style = g.Style; - const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight(); + const float decoration_w_without_scrollbars = window->DecoOuterSizeX1 + window->DecoOuterSizeX2 - window->ScrollbarSizes.x; + const float decoration_h_without_scrollbars = window->DecoOuterSizeY1 + window->DecoOuterSizeY2 - window->ScrollbarSizes.y; ImVec2 size_pad = window->WindowPadding * 2.0f; - ImVec2 size_desired = size_contents + size_pad + ImVec2(0.0f, decoration_up_height); + ImVec2 size_desired = size_contents + size_pad + ImVec2(decoration_w_without_scrollbars, decoration_h_without_scrollbars); if (window->Flags & ImGuiWindowFlags_Tooltip) { // Tooltip always resize @@ -5794,8 +5459,8 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont // When the window cannot fit all contents (either because of constraints, either because screen is too small), // we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than ViewportSize-WindowPadding. ImVec2 size_auto_fit_after_constraint = CalcWindowSizeAfterConstraint(window, size_auto_fit); - bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - 0.0f < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar); - bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y - size_pad.y - decoration_up_height < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar); + bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - decoration_w_without_scrollbars < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar); + bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y - size_pad.y - decoration_h_without_scrollbars < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar); if (will_have_scrollbar_x) size_auto_fit.y += style.ScrollbarSize; if (will_have_scrollbar_y) @@ -6005,9 +5670,9 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s { ImVec2 nav_resize_dir; if (g.NavInputSource == ImGuiInputSource_Keyboard && g.IO.KeyShift) - nav_resize_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow); + nav_resize_dir = GetKeyMagnitude2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow); if (g.NavInputSource == ImGuiInputSource_Gamepad) - nav_resize_dir = GetKeyVector2d(ImGuiKey_GamepadDpadLeft, ImGuiKey_GamepadDpadRight, ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadDpadDown); + nav_resize_dir = GetKeyMagnitude2d(ImGuiKey_GamepadDpadLeft, ImGuiKey_GamepadDpadRight, ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadDpadDown); if (nav_resize_dir.x != 0.0f || nav_resize_dir.y != 0.0f) { const float NAV_RESIZE_SPEED = 600.0f; @@ -6078,7 +5743,7 @@ static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window) // Draw background and borders // Draw and handle scrollbars -void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size) +void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size) { ImGuiContext& g = *GImGui; ImGuiStyle& style = g.Style; @@ -6143,7 +5808,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar Scrollbar(ImGuiAxis_Y); // Render resize grips (after their input handling so we don't have a frame of latency) - if (!(flags & ImGuiWindowFlags_NoResize)) + if (handle_borders_and_resize_grips && !(flags & ImGuiWindowFlags_NoResize)) { for (int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++) { @@ -6157,7 +5822,8 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar } // Borders - RenderWindowOuterBorders(window); + if (handle_borders_and_resize_grips) + RenderWindowOuterBorders(window); } } @@ -6557,6 +6223,15 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // SIZE + // Outer Decoration Sizes + // (we need to clear ScrollbarSize immediatly as CalcWindowAutoFitSize() needs it and can be called from other locations). + const ImVec2 scrollbar_sizes_from_last_frame = window->ScrollbarSizes; + window->DecoOuterSizeX1 = 0.0f; + window->DecoOuterSizeX2 = 0.0f; + window->DecoOuterSizeY1 = window->TitleBarHeight() + window->MenuBarHeight(); + window->DecoOuterSizeY2 = 0.0f; + window->ScrollbarSizes = ImVec2(0.0f, 0.0f); + // Calculate auto-fit size, handle automatic resize const ImVec2 size_auto_fit = CalcWindowAutoFitSize(window, window->ContentSizeIdeal); if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window->Collapsed) @@ -6595,9 +6270,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->SizeFull = CalcWindowSizeAfterConstraint(window, window->SizeFull); window->Size = window->Collapsed && !(flags & ImGuiWindowFlags_ChildWindow) ? window->TitleBarRect().GetSize() : window->SizeFull; - // Decoration size - const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight(); - // POSITION // Popup latch its initial position, will position itself when it appears next frame @@ -6704,9 +6376,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) if (!window->Collapsed) { // When reading the current size we need to read it after size constraints have been applied. - // When we use InnerRect here we are intentionally reading last frame size, same for ScrollbarSizes values before we set them again. - ImVec2 avail_size_from_current_frame = ImVec2(window->SizeFull.x, window->SizeFull.y - decoration_up_height); - ImVec2 avail_size_from_last_frame = window->InnerRect.GetSize() + window->ScrollbarSizes; + // Intentionally use previous frame values for InnerRect and ScrollbarSizes. + // And when we use window->DecorationUp here it doesn't have ScrollbarSizes.y applied yet. + ImVec2 avail_size_from_current_frame = ImVec2(window->SizeFull.x, window->SizeFull.y - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2)); + ImVec2 avail_size_from_last_frame = window->InnerRect.GetSize() + scrollbar_sizes_from_last_frame; ImVec2 needed_size_from_last_frame = window_just_created ? ImVec2(0, 0) : window->ContentSize + window->WindowPadding * 2.0f; float size_x_for_scrollbars = use_current_size_for_scrollbar_x ? avail_size_from_current_frame.x : avail_size_from_last_frame.x; float size_y_for_scrollbars = use_current_size_for_scrollbar_y ? avail_size_from_current_frame.y : avail_size_from_last_frame.y; @@ -6716,6 +6389,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) if (window->ScrollbarX && !window->ScrollbarY) window->ScrollbarY = (needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar); window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f); + + // Amend the partially filled window->DecorationXXX values. + window->DecoOuterSizeX2 += window->ScrollbarSizes.x; + window->DecoOuterSizeY2 += window->ScrollbarSizes.y; } // UPDATE RECTANGLES (1- THOSE NOT AFFECTED BY SCROLLING) @@ -6739,10 +6416,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // - ScrollToRectEx() // - NavUpdatePageUpPageDown() // - Scrollbar() - window->InnerRect.Min.x = window->Pos.x; - window->InnerRect.Min.y = window->Pos.y + decoration_up_height; - window->InnerRect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x; - window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->ScrollbarSizes.y; + window->InnerRect.Min.x = window->Pos.x + window->DecoOuterSizeX1; + window->InnerRect.Min.y = window->Pos.y + window->DecoOuterSizeY1; + window->InnerRect.Max.x = window->Pos.x + window->Size.x - window->DecoOuterSizeX2; + window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->DecoOuterSizeY2; // Inner clipping rectangle. // Will extend a little bit outside the normal work region. @@ -6775,6 +6452,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Apply scrolling window->Scroll = CalcNextScrollFromScrollTargetAndClamp(window); window->ScrollTarget = ImVec2(FLT_MAX, FLT_MAX); + window->DecoInnerSizeX1 = window->DecoInnerSizeY1 = 0.0f; // DRAWING @@ -6804,7 +6482,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Handle title bar, scrollbar, resize grips and resize borders const ImGuiWindow* window_to_highlight = g.NavWindowingTarget ? g.NavWindowingTarget : g.NavWindow; const bool title_bar_is_highlight = want_focus || (window_to_highlight && window->RootWindowForTitleBarHighlight == window_to_highlight->RootWindowForTitleBarHighlight); - RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, resize_grip_count, resize_grip_col, resize_grip_draw_size); + const bool handle_borders_and_resize_grips = true; // This exists to facilitate merge with 'docking' branch. + RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, handle_borders_and_resize_grips, resize_grip_count, resize_grip_col, resize_grip_draw_size); if (render_decorations_in_parent) window->DrawList = &window->DrawListInst; @@ -6819,8 +6498,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // - BeginTabBar() for right-most edge const bool allow_scrollbar_x = !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar); const bool allow_scrollbar_y = !(flags & ImGuiWindowFlags_NoScrollbar); - const float work_rect_size_x = (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : ImMax(allow_scrollbar_x ? window->ContentSize.x : 0.0f, window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x)); - const float work_rect_size_y = (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : ImMax(allow_scrollbar_y ? window->ContentSize.y : 0.0f, window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y)); + const float work_rect_size_x = (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : ImMax(allow_scrollbar_x ? window->ContentSize.x : 0.0f, window->Size.x - window->WindowPadding.x * 2.0f - (window->DecoOuterSizeX1 + window->DecoOuterSizeX2))); + const float work_rect_size_y = (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : ImMax(allow_scrollbar_y ? window->ContentSize.y : 0.0f, window->Size.y - window->WindowPadding.y * 2.0f - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2))); window->WorkRect.Min.x = ImFloor(window->InnerRect.Min.x - window->Scroll.x + ImMax(window->WindowPadding.x, window->WindowBorderSize)); window->WorkRect.Min.y = ImFloor(window->InnerRect.Min.y - window->Scroll.y + ImMax(window->WindowPadding.y, window->WindowBorderSize)); window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x; @@ -6831,21 +6510,21 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // FIXME-OBSOLETE: window->ContentRegionRect.Max is currently very misleading / partly faulty, but some BeginChild() patterns relies on it. // Used by: // - Mouse wheel scrolling + many other things - window->ContentRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x; - window->ContentRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + decoration_up_height; - window->ContentRegionRect.Max.x = window->ContentRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x)); - window->ContentRegionRect.Max.y = window->ContentRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y)); + window->ContentRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x + window->DecoOuterSizeX1; + window->ContentRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + window->DecoOuterSizeY1; + window->ContentRegionRect.Max.x = window->ContentRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - (window->DecoOuterSizeX1 + window->DecoOuterSizeX2))); + window->ContentRegionRect.Max.y = window->ContentRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2))); // Setup drawing context // (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.) - window->DC.Indent.x = 0.0f + window->WindowPadding.x - window->Scroll.x; + window->DC.Indent.x = window->DecoOuterSizeX1 + window->WindowPadding.x - window->Scroll.x; window->DC.GroupOffset.x = 0.0f; window->DC.ColumnsOffset.x = 0.0f; // Record the loss of precision of CursorStartPos which can happen due to really large scrolling amount. // This is used by clipper to compensate and fix the most common use case of large scroll area. Easy and cheap, next best thing compared to switching everything to double or ImU64. - double start_pos_highp_x = (double)window->Pos.x + window->WindowPadding.x - (double)window->Scroll.x + window->DC.ColumnsOffset.x; - double start_pos_highp_y = (double)window->Pos.y + window->WindowPadding.y - (double)window->Scroll.y + decoration_up_height; + double start_pos_highp_x = (double)window->Pos.x + window->WindowPadding.x - (double)window->Scroll.x + window->DecoOuterSizeX1 + window->DC.ColumnsOffset.x; + double start_pos_highp_y = (double)window->Pos.y + window->WindowPadding.y - (double)window->Scroll.y + window->DecoOuterSizeY1; window->DC.CursorStartPos = ImVec2((float)start_pos_highp_x, (float)start_pos_highp_y); window->DC.CursorStartPosLossyness = ImVec2((float)(start_pos_highp_x - window->DC.CursorStartPos.x), (float)(start_pos_highp_y - window->DC.CursorStartPos.y)); window->DC.CursorPos = window->DC.CursorStartPos; @@ -7857,25 +7536,65 @@ bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) //----------------------------------------------------------------------------- // [SECTION] INPUTS //----------------------------------------------------------------------------- - -// Test if mouse cursor is hovering given rectangle -// NB- Rectangle is clipped by our current clip setting -// NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding) -bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip) -{ - ImGuiContext& g = *GImGui; - - // Clip - ImRect rect_clipped(r_min, r_max); - if (clip) - rect_clipped.ClipWith(g.CurrentWindow->ClipRect); - - // Expand for touch input - const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding); - if (!rect_for_touch.Contains(g.IO.MousePos)) - return false; - return true; -} +// - GetKeyData() [Internal] +// - GetKeyIndex() [Internal] +// - GetKeyName() +// - GetKeyChordName() [Internal] +// - CalcTypematicRepeatAmount() [Internal] +// - GetTypematicRepeatRate() [Internal] +// - GetKeyPressedAmount() [Internal] +// - GetKeyMagnitude2d() [Internal] +//----------------------------------------------------------------------------- +// - UpdateKeyRoutingTable() [Internal] +// - GetRoutingIdFromOwnerId() [Internal] +// - GetShortcutRoutingData() [Internal] +// - CalcRoutingScore() [Internal] +// - SetShortcutRouting() [Internal] +// - TestShortcutRouting() [Internal] +//----------------------------------------------------------------------------- +// - IsKeyDown() +// - IsKeyPressed() +// - IsKeyReleased() +//----------------------------------------------------------------------------- +// - IsMouseDown() +// - IsMouseClicked() +// - IsMouseReleased() +// - IsMouseDoubleClicked() +// - GetMouseClickedCount() +// - IsMouseHoveringRect() [Internal] +// - IsMouseDragPastThreshold() [Internal] +// - IsMouseDragging() +// - GetMousePos() +// - GetMousePosOnOpeningCurrentPopup() +// - IsMousePosValid() +// - IsAnyMouseDown() +// - GetMouseDragDelta() +// - ResetMouseDragDelta() +// - GetMouseCursor() +// - SetMouseCursor() +//----------------------------------------------------------------------------- +// - UpdateAliasKey() +// - GetMergedModsFromKeys() +// - UpdateKeyboardInputs() +// - UpdateMouseInputs() +//----------------------------------------------------------------------------- +// - LockWheelingWindow [Internal] +// - FindBestWheelingWindow [Internal] +// - UpdateMouseWheel() [Internal] +//----------------------------------------------------------------------------- +// - SetNextFrameWantCaptureKeyboard() +// - SetNextFrameWantCaptureMouse() +//----------------------------------------------------------------------------- +// - GetInputSourceName() [Internal] +// - DebugPrintInputEvent() [Internal] +// - UpdateInputEvents() [Internal] +//----------------------------------------------------------------------------- +// - GetKeyOwner() [Internal] +// - TestKeyOwner() [Internal] +// - SetKeyOwner() [Internal] +// - SetItemKeyOwner() [Internal] +// - Shortcut() [Internal] +//----------------------------------------------------------------------------- ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key) { @@ -7958,9 +7677,12 @@ const char* ImGui::GetKeyName(ImGuiKey key) return GKeyNames[key - ImGuiKey_NamedKey_BEGIN]; } +// ImGuiMod_Shortcut is translated to either Ctrl or Super. void ImGui::GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size) { ImGuiContext& g = *GImGui; + if (key_chord & ImGuiMod_Shortcut) + key_chord = ConvertShortcutMod(key_chord); ImFormatString(out_buf, (size_t)out_buf_size, "%s%s%s%s%s", (key_chord & ImGuiMod_Ctrl) ? "Ctrl+" : "", (key_chord & ImGuiMod_Shift) ? "Shift+" : "", @@ -8011,13 +7733,52 @@ int ImGui::GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float repeat_ra } // Return 2D vector representing the combination of four cardinal direction, with analog value support (for e.g. ImGuiKey_GamepadLStick* values). -ImVec2 ImGui::GetKeyVector2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down) +ImVec2 ImGui::GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down) { return ImVec2( GetKeyData(key_right)->AnalogValue - GetKeyData(key_left)->AnalogValue, GetKeyData(key_down)->AnalogValue - GetKeyData(key_up)->AnalogValue); } +// Rewrite routing data buffers to strip old entries + sort by key to make queries not touch scattered data. +// Entries D,A,B,B,A,C,B --> A,A,B,B,B,C,D +// Index A:1 B:2 C:5 D:0 --> A:0 B:2 C:5 D:6 +// See 'Metrics->Key Owners & Shortcut Routing' to visualize the result of that operation. +static void ImGui::UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt) +{ + ImGuiContext& g = *GImGui; + rt->EntriesNext.resize(0); + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + { + const int new_routing_start_idx = rt->EntriesNext.Size; + ImGuiKeyRoutingData* routing_entry; + for (int old_routing_idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; old_routing_idx != -1; old_routing_idx = routing_entry->NextEntryIndex) + { + routing_entry = &rt->Entries[old_routing_idx]; + routing_entry->RoutingCurr = routing_entry->RoutingNext; // Update entry + routing_entry->RoutingNext = ImGuiKeyOwner_None; + routing_entry->RoutingNextScore = 255; + if (routing_entry->RoutingCurr == ImGuiKeyOwner_None) + continue; + rt->EntriesNext.push_back(*routing_entry); // Write alive ones into new buffer + + // Apply routing to owner if there's no owner already (RoutingCurr == None at this point) + if (routing_entry->Mods == g.IO.KeyMods) + { + ImGuiKeyOwnerData* owner_data = ImGui::GetKeyOwnerData(key); + if (owner_data->OwnerCurr == ImGuiKeyOwner_None) + owner_data->OwnerCurr = routing_entry->RoutingCurr; + } + } + + // Rewrite linked-list + rt->Index[key - ImGuiKey_NamedKey_BEGIN] = (ImGuiKeyRoutingIndex)(new_routing_start_idx < rt->EntriesNext.Size ? new_routing_start_idx : -1); + for (int n = new_routing_start_idx; n < rt->EntriesNext.Size; n++) + rt->EntriesNext[n].NextEntryIndex = (ImGuiKeyRoutingIndex)((n + 1 < rt->EntriesNext.Size) ? n + 1 : -1); + } + rt->Entries.swap(rt->EntriesNext); // Swap new and old indexes +} + // owner_id may be None/Any, but routing_id needs to be always be set, so we default to GetCurrentFocusScope(). static inline ImGuiID GetRoutingIdFromOwnerId(ImGuiID owner_id) { @@ -8036,6 +7797,8 @@ ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord) ImGuiContext& g = *GImGui; ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable; ImGuiKeyRoutingData* routing_data; + if (key_chord & ImGuiMod_Shortcut) + key_chord = ConvertShortcutMod(key_chord); ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); if (key == ImGuiKey_None) @@ -8153,7 +7916,7 @@ bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiI bool ImGui::TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id) { const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id); - ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord); + ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord); // FIXME: Could avoid creating entry. return routing_data->RoutingCurr == routing_id; } @@ -8288,6 +8051,25 @@ int ImGui::GetMouseClickedCount(ImGuiMouseButton button) return g.IO.MouseClickedCount[button]; } +// Test if mouse cursor is hovering given rectangle +// NB- Rectangle is clipped by our current clip setting +// NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding) +bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip) +{ + ImGuiContext& g = *GImGui; + + // Clip + ImRect rect_clipped(r_min, r_max); + if (clip) + rect_clipped.ClipWith(g.CurrentWindow->ClipRect); + + // Expand for touch input + const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding); + if (!rect_for_touch.Contains(g.IO.MousePos)) + return false; + return true; +} + // Return if a mouse click/drag went past the given threshold. Valid to call during the MouseReleased frame. // [Internal] This doesn't test if the button is pressed bool ImGui::IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold) @@ -8384,6 +8166,354 @@ void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type) g.MouseCursor = cursor_type; } +static void UpdateAliasKey(ImGuiKey key, bool v, float analog_value) +{ + IM_ASSERT(ImGui::IsAliasKey(key)); + ImGuiKeyData* key_data = ImGui::GetKeyData(key); + key_data->Down = v; + key_data->AnalogValue = analog_value; +} + +// [Internal] Do not use directly +static ImGuiKeyChord GetMergedModsFromKeys() +{ + ImGuiKeyChord mods = 0; + if (ImGui::IsKeyDown(ImGuiMod_Ctrl)) { mods |= ImGuiMod_Ctrl; } + if (ImGui::IsKeyDown(ImGuiMod_Shift)) { mods |= ImGuiMod_Shift; } + if (ImGui::IsKeyDown(ImGuiMod_Alt)) { mods |= ImGuiMod_Alt; } + if (ImGui::IsKeyDown(ImGuiMod_Super)) { mods |= ImGuiMod_Super; } + return mods; +} + +static void ImGui::UpdateKeyboardInputs() +{ + ImGuiContext& g = *GImGui; + ImGuiIO& io = g.IO; + + // Import legacy keys or verify they are not used +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + if (io.BackendUsingLegacyKeyArrays == 0) + { + // Backend used new io.AddKeyEvent() API: Good! Verify that old arrays are never written to externally. + for (int n = 0; n < ImGuiKey_LegacyNativeKey_END; n++) + IM_ASSERT((io.KeysDown[n] == false || IsKeyDown((ImGuiKey)n)) && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!"); + } + else + { + if (g.FrameCount == 0) + for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++) + IM_ASSERT(g.IO.KeyMap[n] == -1 && "Backend is not allowed to write to io.KeyMap[0..511]!"); + + // Build reverse KeyMap (Named -> Legacy) + for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_NamedKey_END; n++) + if (io.KeyMap[n] != -1) + { + IM_ASSERT(IsLegacyKey((ImGuiKey)io.KeyMap[n])); + io.KeyMap[io.KeyMap[n]] = n; + } + + // Import legacy keys into new ones + for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++) + if (io.KeysDown[n] || io.BackendUsingLegacyKeyArrays == 1) + { + const ImGuiKey key = (ImGuiKey)(io.KeyMap[n] != -1 ? io.KeyMap[n] : n); + IM_ASSERT(io.KeyMap[n] == -1 || IsNamedKey(key)); + io.KeysData[key].Down = io.KeysDown[n]; + if (key != n) + io.KeysDown[key] = io.KeysDown[n]; // Allow legacy code using io.KeysDown[GetKeyIndex()] with old backends + io.BackendUsingLegacyKeyArrays = 1; + } + if (io.BackendUsingLegacyKeyArrays == 1) + { + GetKeyData(ImGuiMod_Ctrl)->Down = io.KeyCtrl; + GetKeyData(ImGuiMod_Shift)->Down = io.KeyShift; + GetKeyData(ImGuiMod_Alt)->Down = io.KeyAlt; + GetKeyData(ImGuiMod_Super)->Down = io.KeySuper; + } + } + +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; + if (io.BackendUsingLegacyNavInputArray && nav_gamepad_active) + { + #define MAP_LEGACY_NAV_INPUT_TO_KEY1(_KEY, _NAV1) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f); io.KeysData[_KEY].AnalogValue = io.NavInputs[_NAV1]; } while (0) + #define MAP_LEGACY_NAV_INPUT_TO_KEY2(_KEY, _NAV1, _NAV2) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f) || (io.NavInputs[_NAV2] > 0.0f); io.KeysData[_KEY].AnalogValue = ImMax(io.NavInputs[_NAV1], io.NavInputs[_NAV2]); } while (0) + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceDown, ImGuiNavInput_Activate); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceRight, ImGuiNavInput_Cancel); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceLeft, ImGuiNavInput_Menu); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceUp, ImGuiNavInput_Input); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadLeft, ImGuiNavInput_DpadLeft); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadRight, ImGuiNavInput_DpadRight); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadUp, ImGuiNavInput_DpadUp); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadDown, ImGuiNavInput_DpadDown); + MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadL1, ImGuiNavInput_FocusPrev, ImGuiNavInput_TweakSlow); + MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadR1, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakFast); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickLeft, ImGuiNavInput_LStickLeft); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickRight, ImGuiNavInput_LStickRight); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickUp, ImGuiNavInput_LStickUp); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickDown, ImGuiNavInput_LStickDown); + #undef NAV_MAP_KEY + } +#endif +#endif + + // Update aliases + for (int n = 0; n < ImGuiMouseButton_COUNT; n++) + UpdateAliasKey(MouseButtonToKey(n), io.MouseDown[n], io.MouseDown[n] ? 1.0f : 0.0f); + UpdateAliasKey(ImGuiKey_MouseWheelX, io.MouseWheelH != 0.0f, io.MouseWheelH); + UpdateAliasKey(ImGuiKey_MouseWheelY, io.MouseWheel != 0.0f, io.MouseWheel); + + // Synchronize io.KeyMods and io.KeyXXX values. + // - New backends (1.87+): send io.AddKeyEvent(ImGuiMod_XXX) -> -> (here) deriving io.KeyMods + io.KeyXXX from key array. + // - Legacy backends: set io.KeyXXX bools -> (above) set key array from io.KeyXXX -> (here) deriving io.KeyMods + io.KeyXXX from key array. + // So with legacy backends the 4 values will do a unnecessary back-and-forth but it makes the code simpler and future facing. + io.KeyMods = GetMergedModsFromKeys(); + io.KeyCtrl = (io.KeyMods & ImGuiMod_Ctrl) != 0; + io.KeyShift = (io.KeyMods & ImGuiMod_Shift) != 0; + io.KeyAlt = (io.KeyMods & ImGuiMod_Alt) != 0; + io.KeySuper = (io.KeyMods & ImGuiMod_Super) != 0; + + // Clear gamepad data if disabled + if ((io.BackendFlags & ImGuiBackendFlags_HasGamepad) == 0) + for (int i = ImGuiKey_Gamepad_BEGIN; i < ImGuiKey_Gamepad_END; i++) + { + io.KeysData[i - ImGuiKey_KeysData_OFFSET].Down = false; + io.KeysData[i - ImGuiKey_KeysData_OFFSET].AnalogValue = 0.0f; + } + + // Update keys + for (int i = 0; i < ImGuiKey_KeysData_SIZE; i++) + { + ImGuiKeyData* key_data = &io.KeysData[i]; + key_data->DownDurationPrev = key_data->DownDuration; + key_data->DownDuration = key_data->Down ? (key_data->DownDuration < 0.0f ? 0.0f : key_data->DownDuration + io.DeltaTime) : -1.0f; + } + + // Update keys/input owner (named keys only): one entry per key + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + { + ImGuiKeyData* key_data = &io.KeysData[key - ImGuiKey_KeysData_OFFSET]; + ImGuiKeyOwnerData* owner_data = &g.KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; + owner_data->OwnerCurr = owner_data->OwnerNext; + if (!key_data->Down) // Important: ownership is released on the frame after a release. Ensure a 'MouseDown -> CloseWindow -> MouseUp' chain doesn't lead to someone else seeing the MouseUp. + owner_data->OwnerNext = ImGuiKeyOwner_None; + owner_data->LockThisFrame = owner_data->LockUntilRelease = owner_data->LockUntilRelease && key_data->Down; // Clear LockUntilRelease when key is not Down anymore + } + + UpdateKeyRoutingTable(&g.KeysRoutingTable); +} + +static void ImGui::UpdateMouseInputs() +{ + ImGuiContext& g = *GImGui; + ImGuiIO& io = g.IO; + + // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well) + if (IsMousePosValid(&io.MousePos)) + io.MousePos = g.MouseLastValidPos = ImFloorSigned(io.MousePos); + + // If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta + if (IsMousePosValid(&io.MousePos) && IsMousePosValid(&io.MousePosPrev)) + io.MouseDelta = io.MousePos - io.MousePosPrev; + else + io.MouseDelta = ImVec2(0.0f, 0.0f); + + // If mouse moved we re-enable mouse hovering in case it was disabled by gamepad/keyboard. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true. + if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f) + g.NavDisableMouseHover = false; + + io.MousePosPrev = io.MousePos; + for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) + { + io.MouseClicked[i] = io.MouseDown[i] && io.MouseDownDuration[i] < 0.0f; + io.MouseClickedCount[i] = 0; // Will be filled below + io.MouseReleased[i] = !io.MouseDown[i] && io.MouseDownDuration[i] >= 0.0f; + io.MouseDownDurationPrev[i] = io.MouseDownDuration[i]; + io.MouseDownDuration[i] = io.MouseDown[i] ? (io.MouseDownDuration[i] < 0.0f ? 0.0f : io.MouseDownDuration[i] + io.DeltaTime) : -1.0f; + if (io.MouseClicked[i]) + { + bool is_repeated_click = false; + if ((float)(g.Time - io.MouseClickedTime[i]) < io.MouseDoubleClickTime) + { + ImVec2 delta_from_click_pos = IsMousePosValid(&io.MousePos) ? (io.MousePos - io.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); + if (ImLengthSqr(delta_from_click_pos) < io.MouseDoubleClickMaxDist * io.MouseDoubleClickMaxDist) + is_repeated_click = true; + } + if (is_repeated_click) + io.MouseClickedLastCount[i]++; + else + io.MouseClickedLastCount[i] = 1; + io.MouseClickedTime[i] = g.Time; + io.MouseClickedPos[i] = io.MousePos; + io.MouseClickedCount[i] = io.MouseClickedLastCount[i]; + io.MouseDragMaxDistanceSqr[i] = 0.0f; + } + else if (io.MouseDown[i]) + { + // Maintain the maximum distance we reaching from the initial click position, which is used with dragging threshold + float delta_sqr_click_pos = IsMousePosValid(&io.MousePos) ? ImLengthSqr(io.MousePos - io.MouseClickedPos[i]) : 0.0f; + io.MouseDragMaxDistanceSqr[i] = ImMax(io.MouseDragMaxDistanceSqr[i], delta_sqr_click_pos); + } + + // We provide io.MouseDoubleClicked[] as a legacy service + io.MouseDoubleClicked[i] = (io.MouseClickedCount[i] == 2); + + // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation + if (io.MouseClicked[i]) + g.NavDisableMouseHover = false; + } +} + +static void LockWheelingWindow(ImGuiWindow* window, float wheel_amount) +{ + ImGuiContext& g = *GImGui; + if (window) + g.WheelingWindowReleaseTimer = ImMin(g.WheelingWindowReleaseTimer + ImAbs(wheel_amount) * WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER, WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER); + else + g.WheelingWindowReleaseTimer = 0.0f; + if (g.WheelingWindow == window) + return; + IMGUI_DEBUG_LOG_IO("LockWheelingWindow() \"%s\"\n", window ? window->Name : "NULL"); + g.WheelingWindow = window; + g.WheelingWindowRefMousePos = g.IO.MousePos; + if (window == NULL) + { + g.WheelingWindowStartFrame = -1; + g.WheelingAxisAvg = ImVec2(0.0f, 0.0f); + } +} + +static ImGuiWindow* FindBestWheelingWindow(const ImVec2& wheel) +{ + // For each axis, find window in the hierarchy that may want to use scrolling + ImGuiContext& g = *GImGui; + ImGuiWindow* windows[2] = { NULL, NULL }; + for (int axis = 0; axis < 2; axis++) + if (wheel[axis] != 0.0f) + for (ImGuiWindow* window = windows[axis] = g.HoveredWindow; window->Flags & ImGuiWindowFlags_ChildWindow; window = windows[axis] = window->ParentWindow) + { + // Bubble up into parent window if: + // - a child window doesn't allow any scrolling. + // - a child window has the ImGuiWindowFlags_NoScrollWithMouse flag. + //// - a child window doesn't need scrolling because it is already at the edge for the direction we are going in (FIXME-WIP) + const bool has_scrolling = (window->ScrollMax[axis] != 0.0f); + const bool inputs_disabled = (window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs); + //const bool scrolling_past_limits = (wheel_v < 0.0f) ? (window->Scroll[axis] <= 0.0f) : (window->Scroll[axis] >= window->ScrollMax[axis]); + if (has_scrolling && !inputs_disabled) // && !scrolling_past_limits) + break; // select this window + } + if (windows[0] == NULL && windows[1] == NULL) + return NULL; + + // If there's only one window or only one axis then there's no ambiguity + if (windows[0] == windows[1] || windows[0] == NULL || windows[1] == NULL) + return windows[1] ? windows[1] : windows[0]; + + // If candidate are different windows we need to decide which one to prioritize + // - First frame: only find a winner if one axis is zero. + // - Subsequent frames: only find a winner when one is more than the other. + if (g.WheelingWindowStartFrame == -1) + g.WheelingWindowStartFrame = g.FrameCount; + if ((g.WheelingWindowStartFrame == g.FrameCount && wheel.x != 0.0f && wheel.y != 0.0f) || (g.WheelingAxisAvg.x == g.WheelingAxisAvg.y)) + { + g.WheelingWindowWheelRemainder = wheel; + return NULL; + } + return (g.WheelingAxisAvg.x > g.WheelingAxisAvg.y) ? windows[0] : windows[1]; +} + +// Called by NewFrame() +void ImGui::UpdateMouseWheel() +{ + // Reset the locked window if we move the mouse or after the timer elapses. + // FIXME: Ideally we could refactor to have one timer for "changing window w/ same axis" and a shorter timer for "changing window or axis w/ other axis" (#3795) + ImGuiContext& g = *GImGui; + if (g.WheelingWindow != NULL) + { + g.WheelingWindowReleaseTimer -= g.IO.DeltaTime; + if (IsMousePosValid() && ImLengthSqr(g.IO.MousePos - g.WheelingWindowRefMousePos) > g.IO.MouseDragThreshold * g.IO.MouseDragThreshold) + g.WheelingWindowReleaseTimer = 0.0f; + if (g.WheelingWindowReleaseTimer <= 0.0f) + LockWheelingWindow(NULL, 0.0f); + } + + ImVec2 wheel; + wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_None) ? g.IO.MouseWheelH : 0.0f; + wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_None) ? g.IO.MouseWheel : 0.0f; + + //IMGUI_DEBUG_LOG("MouseWheel X:%.3f Y:%.3f\n", wheel_x, wheel_y); + ImGuiWindow* mouse_window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow; + if (!mouse_window || mouse_window->Collapsed) + return; + + // Zoom / Scale window + // FIXME-OBSOLETE: This is an old feature, it still works but pretty much nobody is using it and may be best redesigned. + if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling) + { + LockWheelingWindow(mouse_window, wheel.y); + ImGuiWindow* window = mouse_window; + const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f); + const float scale = new_font_scale / window->FontWindowScale; + window->FontWindowScale = new_font_scale; + if (window == window->RootWindow) + { + const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size; + SetWindowPos(window, window->Pos + offset, 0); + window->Size = ImFloor(window->Size * scale); + window->SizeFull = ImFloor(window->SizeFull * scale); + } + return; + } + if (g.IO.KeyCtrl) + return; + + // Mouse wheel scrolling + // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead + // (we avoid doing it on OSX as it the OS input layer handles this already) + const bool swap_axis = g.IO.KeyShift && !g.IO.ConfigMacOSXBehaviors; + if (swap_axis) + { + wheel.x = wheel.y; + wheel.y = 0.0f; + } + + // Maintain a rough average of moving magnitude on both axises + // FIXME: should by based on wall clock time rather than frame-counter + g.WheelingAxisAvg.x = ImExponentialMovingAverage(g.WheelingAxisAvg.x, ImAbs(wheel.x), 30); + g.WheelingAxisAvg.y = ImExponentialMovingAverage(g.WheelingAxisAvg.y, ImAbs(wheel.y), 30); + + // In the rare situation where FindBestWheelingWindow() had to defer first frame of wheeling due to ambiguous main axis, reinject it now. + wheel += g.WheelingWindowWheelRemainder; + g.WheelingWindowWheelRemainder = ImVec2(0.0f, 0.0f); + if (wheel.x == 0.0f && wheel.y == 0.0f) + return; + + // Mouse wheel scrolling: find target and apply + // - don't renew lock if axis doesn't apply on the window. + // - select a main axis when both axises are being moved. + if (ImGuiWindow* window = (g.WheelingWindow ? g.WheelingWindow : FindBestWheelingWindow(wheel))) + if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)) + { + bool do_scroll[2] = { wheel.x != 0.0f && window->ScrollMax.x != 0.0f, wheel.y != 0.0f && window->ScrollMax.y != 0.0f }; + if (do_scroll[ImGuiAxis_X] && do_scroll[ImGuiAxis_Y]) + do_scroll[(g.WheelingAxisAvg.x > g.WheelingAxisAvg.y) ? ImGuiAxis_Y : ImGuiAxis_X] = false; + if (do_scroll[ImGuiAxis_X]) + { + LockWheelingWindow(window, wheel.x); + float max_step = window->InnerRect.GetWidth() * 0.67f; + float scroll_step = ImFloor(ImMin(2 * window->CalcFontSize(), max_step)); + SetScrollX(window, window->Scroll.x - wheel.x * scroll_step); + } + if (do_scroll[ImGuiAxis_Y]) + { + LockWheelingWindow(window, wheel.y); + float max_step = window->InnerRect.GetHeight() * 0.67f; + float scroll_step = ImFloor(ImMin(5 * window->CalcFontSize(), max_step)); + SetScrollY(window, window->Scroll.y - wheel.y * scroll_step); + } + } +} + void ImGui::SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard) { ImGuiContext& g = *GImGui; @@ -8408,7 +8538,7 @@ static void DebugPrintInputEvent(const char* prefix, const ImGuiInputEvent* e) ImGuiContext& g = *GImGui; if (e->Type == ImGuiInputEventType_MousePos) { if (e->MousePos.PosX == -FLT_MAX && e->MousePos.PosY == -FLT_MAX) IMGUI_DEBUG_LOG_IO("%s: MousePos (-FLT_MAX, -FLT_MAX)\n", prefix); else IMGUI_DEBUG_LOG_IO("%s: MousePos (%.1f, %.1f)\n", prefix, e->MousePos.PosX, e->MousePos.PosY); return; } if (e->Type == ImGuiInputEventType_MouseButton) { IMGUI_DEBUG_LOG_IO("%s: MouseButton %d %s\n", prefix, e->MouseButton.Button, e->MouseButton.Down ? "Down" : "Up"); return; } - if (e->Type == ImGuiInputEventType_MouseWheel) { IMGUI_DEBUG_LOG_IO("%s: MouseWheel (%.1f, %.1f)\n", prefix, e->MouseWheel.WheelX, e->MouseWheel.WheelY); return; } + if (e->Type == ImGuiInputEventType_MouseWheel) { IMGUI_DEBUG_LOG_IO("%s: MouseWheel (%.3f, %.3f)\n", prefix, e->MouseWheel.WheelX, e->MouseWheel.WheelY); return; } if (e->Type == ImGuiInputEventType_Key) { IMGUI_DEBUG_LOG_IO("%s: Key \"%s\" %s\n", prefix, ImGui::GetKeyName(e->Key.Key), e->Key.Down ? "Down" : "Up"); return; } if (e->Type == ImGuiInputEventType_Text) { IMGUI_DEBUG_LOG_IO("%s: Text: %c (U+%08X)\n", prefix, e->Text.Char, e->Text.Char); return; } if (e->Type == ImGuiInputEventType_Focus) { IMGUI_DEBUG_LOG_IO("%s: AppFocused %d\n", prefix, e->AppFocused.Focused); return; } @@ -8479,15 +8609,6 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) key_changed = true; key_changed_mask.SetBit(key_data_index); - if (key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super) - { - if (key == ImGuiMod_Ctrl) { io.KeyCtrl = key_data->Down; } - if (key == ImGuiMod_Shift) { io.KeyShift = key_data->Down; } - if (key == ImGuiMod_Alt) { io.KeyAlt = key_data->Down; } - if (key == ImGuiMod_Super) { io.KeySuper = key_data->Down; } - io.KeyMods = GetMergedModsFromBools(); - } - // Allow legacy code using io.KeysDown[GetKeyIndex()] with new backends #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO io.KeysDown[key_data_index] = key_data->Down; @@ -8632,8 +8753,6 @@ void ImGui::SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags) } } -// - Need to decide how to handle shortcut translations for Non-Mac <> Mac -// - Ideas: https://github.com/ocornut/imgui/issues/456#issuecomment-264390864 bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags) { ImGuiContext& g = *GImGui; @@ -8644,16 +8763,18 @@ bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags if (!SetShortcutRouting(key_chord, owner_id, flags)) return false; - ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); + if (key_chord & ImGuiMod_Shortcut) + key_chord = ConvertShortcutMod(key_chord); ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); if (g.IO.KeyMods != mods) return false; // Special storage location for mods + ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); if (key == ImGuiKey_None) key = ConvertSingleModFlagToKey(mods); - if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_)))) + if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | (ImGuiInputFlags)ImGuiInputFlags_RepeatRateMask_)))) return false; IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function! @@ -8765,9 +8886,9 @@ static void ImGui::ErrorCheckEndFrameSanityChecks() // One possible reason leading to this assert is that your backends update inputs _AFTER_ NewFrame(). // It is known that when some modal native windows called mid-frame takes focus away, some backends such as GLFW will // send key release events mid-frame. This would normally trigger this assertion and lead to sheared inputs. - // We silently accommodate for this case by ignoring/ the case where all io.KeyXXX modifiers were released (aka key_mod_flags == 0), + // We silently accommodate for this case by ignoring the case where all io.KeyXXX modifiers were released (aka key_mod_flags == 0), // while still correctly asserting on mid-frame key press events. - const ImGuiKeyChord key_mods = GetMergedModsFromBools(); + const ImGuiKeyChord key_mods = GetMergedModsFromKeys(); IM_ASSERT((key_mods == 0 || g.IO.KeyMods == key_mods) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); IM_UNUSED(key_mods); @@ -8979,7 +9100,7 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y) window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x; window->DC.CursorPosPrevLine.y = line_y1; window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line - window->DC.CursorPos.y = IM_FLOOR(line_y1 + line_height + g.Style.ItemSpacing.y); // Next line + window->DC.CursorPos.y = IM_FLOOR(line_y1 + line_height + g.Style.ItemSpacing.y); // Next line window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x); window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y); //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG] @@ -9453,38 +9574,24 @@ static float CalcScrollEdgeSnap(float target, float snap_min, float snap_max, fl static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window) { ImVec2 scroll = window->Scroll; - if (window->ScrollTarget.x < FLT_MAX) + ImVec2 decoration_size(window->DecoOuterSizeX1 + window->DecoInnerSizeX1 + window->DecoOuterSizeX2, window->DecoOuterSizeY1 + window->DecoInnerSizeY1 + window->DecoOuterSizeY2); + for (int axis = 0; axis < 2; axis++) { - float decoration_total_width = window->ScrollbarSizes.x; - float center_x_ratio = window->ScrollTargetCenterRatio.x; - float scroll_target_x = window->ScrollTarget.x; - if (window->ScrollTargetEdgeSnapDist.x > 0.0f) + if (window->ScrollTarget[axis] < FLT_MAX) { - float snap_x_min = 0.0f; - float snap_x_max = window->ScrollMax.x + window->SizeFull.x - decoration_total_width; - scroll_target_x = CalcScrollEdgeSnap(scroll_target_x, snap_x_min, snap_x_max, window->ScrollTargetEdgeSnapDist.x, center_x_ratio); + float center_ratio = window->ScrollTargetCenterRatio[axis]; + float scroll_target = window->ScrollTarget[axis]; + if (window->ScrollTargetEdgeSnapDist[axis] > 0.0f) + { + float snap_min = 0.0f; + float snap_max = window->ScrollMax[axis] + window->SizeFull[axis] - decoration_size[axis]; + scroll_target = CalcScrollEdgeSnap(scroll_target, snap_min, snap_max, window->ScrollTargetEdgeSnapDist[axis], center_ratio); + } + scroll[axis] = scroll_target - center_ratio * (window->SizeFull[axis] - decoration_size[axis]); } - scroll.x = scroll_target_x - center_x_ratio * (window->SizeFull.x - decoration_total_width); - } - if (window->ScrollTarget.y < FLT_MAX) - { - float decoration_total_height = window->TitleBarHeight() + window->MenuBarHeight() + window->ScrollbarSizes.y; - float center_y_ratio = window->ScrollTargetCenterRatio.y; - float scroll_target_y = window->ScrollTarget.y; - if (window->ScrollTargetEdgeSnapDist.y > 0.0f) - { - float snap_y_min = 0.0f; - float snap_y_max = window->ScrollMax.y + window->SizeFull.y - decoration_total_height; - scroll_target_y = CalcScrollEdgeSnap(scroll_target_y, snap_y_min, snap_y_max, window->ScrollTargetEdgeSnapDist.y, center_y_ratio); - } - scroll.y = scroll_target_y - center_y_ratio * (window->SizeFull.y - decoration_total_height); - } - scroll.x = IM_FLOOR(ImMax(scroll.x, 0.0f)); - scroll.y = IM_FLOOR(ImMax(scroll.y, 0.0f)); - if (!window->Collapsed && !window->SkipItems) - { - scroll.x = ImMin(scroll.x, window->ScrollMax.x); - scroll.y = ImMin(scroll.y, window->ScrollMax.y); + scroll[axis] = IM_FLOOR(ImMax(scroll[axis], 0.0f)); + if (!window->Collapsed && !window->SkipItems) + scroll[axis] = ImMin(scroll[axis], window->ScrollMax[axis]); } return scroll; } @@ -9505,8 +9612,11 @@ void ImGui::ScrollToRect(ImGuiWindow* window, const ImRect& item_rect, ImGuiScro ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rect, ImGuiScrollFlags flags) { ImGuiContext& g = *GImGui; - ImRect window_rect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1)); - //GetForegroundDrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG] + ImRect scroll_rect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1)); + scroll_rect.Min.x = ImMin(scroll_rect.Min.x + window->DecoInnerSizeX1, scroll_rect.Max.x); + scroll_rect.Min.y = ImMin(scroll_rect.Min.y + window->DecoInnerSizeY1, scroll_rect.Max.y); + //GetForegroundDrawList(window)->AddRect(item_rect.Min, item_rect.Max, IM_COL32(255,0,0,255), 0.0f, 0, 5.0f); // [DEBUG] + //GetForegroundDrawList(window)->AddRect(scroll_rect.Min, scroll_rect.Max, IM_COL32_WHITE); // [DEBUG] // Check that only one behavior is selected per axis IM_ASSERT((flags & ImGuiScrollFlags_MaskX_) == 0 || ImIsPowerOfTwo(flags & ImGuiScrollFlags_MaskX_)); @@ -9519,35 +9629,39 @@ ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rect, ImGui if ((flags & ImGuiScrollFlags_MaskY_) == 0) flags |= window->Appearing ? ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeY; - const bool fully_visible_x = item_rect.Min.x >= window_rect.Min.x && item_rect.Max.x <= window_rect.Max.x; - const bool fully_visible_y = item_rect.Min.y >= window_rect.Min.y && item_rect.Max.y <= window_rect.Max.y; - const bool can_be_fully_visible_x = (item_rect.GetWidth() + g.Style.ItemSpacing.x * 2.0f) <= window_rect.GetWidth(); - const bool can_be_fully_visible_y = (item_rect.GetHeight() + g.Style.ItemSpacing.y * 2.0f) <= window_rect.GetHeight(); + const bool fully_visible_x = item_rect.Min.x >= scroll_rect.Min.x && item_rect.Max.x <= scroll_rect.Max.x; + const bool fully_visible_y = item_rect.Min.y >= scroll_rect.Min.y && item_rect.Max.y <= scroll_rect.Max.y; + const bool can_be_fully_visible_x = (item_rect.GetWidth() + g.Style.ItemSpacing.x * 2.0f) <= scroll_rect.GetWidth() || (window->AutoFitFramesX > 0) || (window->Flags & ImGuiWindowFlags_AlwaysAutoResize) != 0; + const bool can_be_fully_visible_y = (item_rect.GetHeight() + g.Style.ItemSpacing.y * 2.0f) <= scroll_rect.GetHeight() || (window->AutoFitFramesY > 0) || (window->Flags & ImGuiWindowFlags_AlwaysAutoResize) != 0; if ((flags & ImGuiScrollFlags_KeepVisibleEdgeX) && !fully_visible_x) { - if (item_rect.Min.x < window_rect.Min.x || !can_be_fully_visible_x) + if (item_rect.Min.x < scroll_rect.Min.x || !can_be_fully_visible_x) SetScrollFromPosX(window, item_rect.Min.x - g.Style.ItemSpacing.x - window->Pos.x, 0.0f); - else if (item_rect.Max.x >= window_rect.Max.x) + else if (item_rect.Max.x >= scroll_rect.Max.x) SetScrollFromPosX(window, item_rect.Max.x + g.Style.ItemSpacing.x - window->Pos.x, 1.0f); } else if (((flags & ImGuiScrollFlags_KeepVisibleCenterX) && !fully_visible_x) || (flags & ImGuiScrollFlags_AlwaysCenterX)) { - float target_x = can_be_fully_visible_x ? ImFloor((item_rect.Min.x + item_rect.Max.x - window->InnerRect.GetWidth()) * 0.5f) : item_rect.Min.x; - SetScrollFromPosX(window, target_x - window->Pos.x, 0.0f); + if (can_be_fully_visible_x) + SetScrollFromPosX(window, ImFloor((item_rect.Min.x + item_rect.Max.x) * 0.5f) - window->Pos.x, 0.5f); + else + SetScrollFromPosX(window, item_rect.Min.x - window->Pos.x, 0.0f); } if ((flags & ImGuiScrollFlags_KeepVisibleEdgeY) && !fully_visible_y) { - if (item_rect.Min.y < window_rect.Min.y || !can_be_fully_visible_y) + if (item_rect.Min.y < scroll_rect.Min.y || !can_be_fully_visible_y) SetScrollFromPosY(window, item_rect.Min.y - g.Style.ItemSpacing.y - window->Pos.y, 0.0f); - else if (item_rect.Max.y >= window_rect.Max.y) + else if (item_rect.Max.y >= scroll_rect.Max.y) SetScrollFromPosY(window, item_rect.Max.y + g.Style.ItemSpacing.y - window->Pos.y, 1.0f); } else if (((flags & ImGuiScrollFlags_KeepVisibleCenterY) && !fully_visible_y) || (flags & ImGuiScrollFlags_AlwaysCenterY)) { - float target_y = can_be_fully_visible_y ? ImFloor((item_rect.Min.y + item_rect.Max.y - window->InnerRect.GetHeight()) * 0.5f) : item_rect.Min.y; - SetScrollFromPosY(window, target_y - window->Pos.y, 0.0f); + if (can_be_fully_visible_y) + SetScrollFromPosY(window, ImFloor((item_rect.Min.y + item_rect.Max.y) * 0.5f) - window->Pos.y, 0.5f); + else + SetScrollFromPosY(window, item_rect.Min.y - window->Pos.y, 0.0f); } ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window); @@ -9630,7 +9744,7 @@ void ImGui::SetScrollY(float scroll_y) void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio) { IM_ASSERT(center_x_ratio >= 0.0f && center_x_ratio <= 1.0f); - window->ScrollTarget.x = IM_FLOOR(local_x + window->Scroll.x); // Convert local position to scroll offset + window->ScrollTarget.x = IM_FLOOR(local_x - window->DecoOuterSizeX1 - window->DecoInnerSizeX1 + window->Scroll.x); // Convert local position to scroll offset window->ScrollTargetCenterRatio.x = center_x_ratio; window->ScrollTargetEdgeSnapDist.x = 0.0f; } @@ -9638,9 +9752,7 @@ void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x void ImGui::SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio) { IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f); - const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight(); // FIXME: Would be nice to have a more standardized access to our scrollable/client rect; - local_y -= decoration_up_height; - window->ScrollTarget.y = IM_FLOOR(local_y + window->Scroll.y); // Convert local position to scroll offset + window->ScrollTarget.y = IM_FLOOR(local_y - window->DecoOuterSizeY1 - window->DecoInnerSizeY1 + window->Scroll.y); // Convert local position to scroll offset window->ScrollTargetCenterRatio.y = center_y_ratio; window->ScrollTargetEdgeSnapDist.y = 0.0f; } @@ -10971,7 +11083,7 @@ static void ImGui::NavUpdate() // Next movement request will clamp the NavId reference rectangle to the visible area, so navigation will resume within those bounds. if (nav_gamepad_active) { - const ImVec2 scroll_dir = GetKeyVector2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown); + const ImVec2 scroll_dir = GetKeyMagnitude2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown); const float tweak_factor = IsKeyDown(ImGuiKey_NavGamepadTweakSlow) ? 1.0f / 10.0f : IsKeyDown(ImGuiKey_NavGamepadTweakFast) ? 10.0f : 1.0f; if (scroll_dir.x != 0.0f && window->ScrollbarX) SetScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed * tweak_factor)); @@ -11048,7 +11160,7 @@ void ImGui::NavUpdateCreateMoveRequest() g.NavMoveScrollFlags = ImGuiScrollFlags_None; if (window && !g.NavWindowingTarget && !(window->Flags & ImGuiWindowFlags_NoNavInputs)) { - const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateNavMove; + const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | (ImGuiInputFlags)ImGuiInputFlags_RepeatRateNavMove; if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadLeft, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_LeftArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Left; } if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadRight, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_RightArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Right; } if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadUp, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_UpArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Up; } @@ -11597,9 +11709,9 @@ static void ImGui::NavUpdateWindowing() { ImVec2 nav_move_dir; if (g.NavInputSource == ImGuiInputSource_Keyboard && !io.KeyShift) - nav_move_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow); + nav_move_dir = GetKeyMagnitude2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow); if (g.NavInputSource == ImGuiInputSource_Gamepad) - nav_move_dir = GetKeyVector2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown); + nav_move_dir = GetKeyMagnitude2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown); if (nav_move_dir.x != 0.0f || nav_move_dir.y != 0.0f) { const float NAV_MOVE_SPEED = 800.0f; @@ -12921,6 +13033,55 @@ static void RenderViewportsThumbnails() ImGui::Dummy(bb_full.GetSize() * SCALE); } +// Draw an arbitrary US keyboard layout to visualize translated keys +void ImGui::DebugRenderKeyboardPreview(ImDrawList* draw_list) +{ + const ImVec2 key_size = ImVec2(35.0f, 35.0f); + const float key_rounding = 3.0f; + const ImVec2 key_face_size = ImVec2(25.0f, 25.0f); + const ImVec2 key_face_pos = ImVec2(5.0f, 3.0f); + const float key_face_rounding = 2.0f; + const ImVec2 key_label_pos = ImVec2(7.0f, 4.0f); + const ImVec2 key_step = ImVec2(key_size.x - 1.0f, key_size.y - 1.0f); + const float key_row_offset = 9.0f; + + ImVec2 board_min = GetCursorScreenPos(); + ImVec2 board_max = ImVec2(board_min.x + 3 * key_step.x + 2 * key_row_offset + 10.0f, board_min.y + 3 * key_step.y + 10.0f); + ImVec2 start_pos = ImVec2(board_min.x + 5.0f - key_step.x, board_min.y); + + struct KeyLayoutData { int Row, Col; const char* Label; ImGuiKey Key; }; + const KeyLayoutData keys_to_display[] = + { + { 0, 0, "", ImGuiKey_Tab }, { 0, 1, "Q", ImGuiKey_Q }, { 0, 2, "W", ImGuiKey_W }, { 0, 3, "E", ImGuiKey_E }, { 0, 4, "R", ImGuiKey_R }, + { 1, 0, "", ImGuiKey_CapsLock }, { 1, 1, "A", ImGuiKey_A }, { 1, 2, "S", ImGuiKey_S }, { 1, 3, "D", ImGuiKey_D }, { 1, 4, "F", ImGuiKey_F }, + { 2, 0, "", ImGuiKey_LeftShift },{ 2, 1, "Z", ImGuiKey_Z }, { 2, 2, "X", ImGuiKey_X }, { 2, 3, "C", ImGuiKey_C }, { 2, 4, "V", ImGuiKey_V } + }; + + // Elements rendered manually via ImDrawList API are not clipped automatically. + // While not strictly necessary, here IsItemVisible() is used to avoid rendering these shapes when they are out of view. + Dummy(board_max - board_min); + if (!IsItemVisible()) + return; + draw_list->PushClipRect(board_min, board_max, true); + for (int n = 0; n < IM_ARRAYSIZE(keys_to_display); n++) + { + const KeyLayoutData* key_data = &keys_to_display[n]; + ImVec2 key_min = ImVec2(start_pos.x + key_data->Col * key_step.x + key_data->Row * key_row_offset, start_pos.y + key_data->Row * key_step.y); + ImVec2 key_max = key_min + key_size; + draw_list->AddRectFilled(key_min, key_max, IM_COL32(204, 204, 204, 255), key_rounding); + draw_list->AddRect(key_min, key_max, IM_COL32(24, 24, 24, 255), key_rounding); + ImVec2 face_min = ImVec2(key_min.x + key_face_pos.x, key_min.y + key_face_pos.y); + ImVec2 face_max = ImVec2(face_min.x + key_face_size.x, face_min.y + key_face_size.y); + draw_list->AddRect(face_min, face_max, IM_COL32(193, 193, 193, 255), key_face_rounding, ImDrawFlags_None, 2.0f); + draw_list->AddRectFilled(face_min, face_max, IM_COL32(252, 252, 252, 255), key_face_rounding); + ImVec2 label_min = ImVec2(key_min.x + key_label_pos.x, key_min.y + key_label_pos.y); + draw_list->AddText(label_min, IM_COL32(64, 64, 64, 255), key_data->Label); + if (ImGui::IsKeyDown(key_data->Key)) + draw_list->AddRectFilled(key_min, key_max, IM_COL32(255, 0, 0, 128), key_rounding); + } + draw_list->PopClipRect(); +} + // Helper tool to diagnose between text encoding issues and font loading issues. Pass your UTF-8 string and verify that there are correct. void ImGui::DebugTextEncoding(const char* str) { @@ -13041,8 +13202,8 @@ void ImGui::ShowMetricsWindow(bool* p_open) else if (rect_type == TRT_ColumnsClipRect) { ImGuiTableColumn* c = &table->Columns[n]; return c->ClipRect; } else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } // Note: y1/y2 not always accurate else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } - else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } - else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); } + else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight); } + else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); } IM_ASSERT(0); return ImRect(); } @@ -13319,41 +13480,95 @@ void ImGui::ShowMetricsWindow(bool* p_open) TreePop(); } - if (TreeNode("Key Owners & Shortcut Routing")) + if (TreeNode("Inputs")) { - TextUnformatted("Key Owners:"); - if (BeginListBox("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8))) + Text("KEYBOARD/GAMEPAD/MOUSE KEYS"); { - for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) - { - ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); - if (owner_data->OwnerCurr == ImGuiKeyOwner_None) - continue; - Text("%s: 0x%08X%s", GetKeyName(key), owner_data->OwnerCurr, - owner_data->LockUntilRelease ? " LockUntilRelease" : owner_data->LockThisFrame ? " LockThisFrame" : ""); - DebugLocateItemOnHover(owner_data->OwnerCurr); - } - EndListBox(); + // We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends. + // User code should never have to go through such hoops: old code may use native keycodes, new code may use ImGuiKey codes. + Indent(); +#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO + struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } }; +#else + struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array + //Text("Legacy raw:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key++) { if (io.KeysDown[key]) { SameLine(); Text("\"%s\" %d", GetKeyName(key), key); } } +#endif + Text("Keys down:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !IsKeyDown(key)) continue; SameLine(); Text(IsNamedKey(key) ? "\"%s\"" : "\"%s\" %d", GetKeyName(key), key); SameLine(); Text("(%.02f)", GetKeyData(key)->DownDuration); } + Text("Keys pressed:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !IsKeyPressed(key)) continue; SameLine(); Text(IsNamedKey(key) ? "\"%s\"" : "\"%s\" %d", GetKeyName(key), key); } + Text("Keys released:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !IsKeyReleased(key)) continue; SameLine(); Text(IsNamedKey(key) ? "\"%s\"" : "\"%s\" %d", GetKeyName(key), key); } + Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); + Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; SameLine(); Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public. + DebugRenderKeyboardPreview(GetWindowDrawList()); + Unindent(); } - TextUnformatted("Shortcut Routing:"); - if (BeginListBox("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8))) + + Text("MOUSE STATE"); { - for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + Indent(); + if (IsMousePosValid()) + Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y); + else + Text("Mouse pos: "); + Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y); + int count = IM_ARRAYSIZE(io.MouseDown); + Text("Mouse down:"); for (int i = 0; i < count; i++) if (IsMouseDown(i)) { SameLine(); Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); } + Text("Mouse clicked:"); for (int i = 0; i < count; i++) if (IsMouseClicked(i)) { SameLine(); Text("b%d (%d)", i, io.MouseClickedCount[i]); } + Text("Mouse released:"); for (int i = 0; i < count; i++) if (IsMouseReleased(i)) { SameLine(); Text("b%d", i); } + Text("Mouse wheel: %.1f", io.MouseWheel); + Text("Pen Pressure: %.1f", io.PenPressure); // Note: currently unused + Unindent(); + } + + Text("MOUSE WHEELING"); + { + Indent(); + Text("WheelingWindow: '%s'", g.WheelingWindow ? g.WheelingWindow->Name : "NULL"); + Text("WheelingWindowReleaseTimer: %.2f", g.WheelingWindowReleaseTimer); + Text("WheelingAxisAvg[] = { %.3f, %.3f }, Main Axis: %s", g.WheelingAxisAvg.x, g.WheelingAxisAvg.y, (g.WheelingAxisAvg.x > g.WheelingAxisAvg.y) ? "X" : (g.WheelingAxisAvg.x < g.WheelingAxisAvg.y) ? "Y" : ""); + Unindent(); + } + + Text("KEY OWNERS"); + { + Indent(); + if (BeginListBox("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 6))) { - ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable; - for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; ) + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { - char key_chord_name[64]; - ImGuiKeyRoutingData* routing_data = &rt->Entries[idx]; - GetKeyChordName(key | routing_data->Mods, key_chord_name, IM_ARRAYSIZE(key_chord_name)); - Text("%s: 0x%08X", key_chord_name, routing_data->RoutingCurr); - DebugLocateItemOnHover(routing_data->RoutingCurr); - idx = routing_data->NextEntryIndex; + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + if (owner_data->OwnerCurr == ImGuiKeyOwner_None) + continue; + Text("%s: 0x%08X%s", GetKeyName(key), owner_data->OwnerCurr, + owner_data->LockUntilRelease ? " LockUntilRelease" : owner_data->LockThisFrame ? " LockThisFrame" : ""); + DebugLocateItemOnHover(owner_data->OwnerCurr); } + EndListBox(); } - EndListBox(); + Unindent(); + } + Text("SHORTCUT ROUTING"); + { + Indent(); + if (BeginListBox("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 6))) + { + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + { + ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable; + for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; ) + { + char key_chord_name[64]; + ImGuiKeyRoutingData* routing_data = &rt->Entries[idx]; + GetKeyChordName(key | routing_data->Mods, key_chord_name, IM_ARRAYSIZE(key_chord_name)); + Text("%s: 0x%08X", key_chord_name, routing_data->RoutingCurr); + DebugLocateItemOnHover(routing_data->RoutingCurr); + idx = routing_data->NextEntryIndex; + } + } + EndListBox(); + } + Text("(ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: 0x%X)", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask); + Unindent(); } - Text("(ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: 0x%X)", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask); TreePop(); } diff --git a/3rdparty/dear-imgui/imgui.h b/3rdparty/dear-imgui/imgui.h index a626c79f4..fea413403 100644 --- a/3rdparty/dear-imgui/imgui.h +++ b/3rdparty/dear-imgui/imgui.h @@ -1,4 +1,4 @@ -// dear imgui, v1.89.1 WIP +// dear imgui, v1.89.3 WIP // (headers) // Help: @@ -22,8 +22,8 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') -#define IMGUI_VERSION "1.89.1 WIP" -#define IMGUI_VERSION_NUM 18903 +#define IMGUI_VERSION "1.89.3 WIP" +#define IMGUI_VERSION_NUM 18921 #define IMGUI_HAS_TABLE /* @@ -255,8 +255,8 @@ struct ImVec2 float x, y; constexpr ImVec2() : x(0.0f), y(0.0f) { } constexpr ImVec2(float _x, float _y) : x(_x), y(_y) { } - float operator[] (size_t idx) const { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. - float& operator[] (size_t idx) { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. + float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. + float& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. #ifdef IM_VEC2_CLASS_EXTRA IM_VEC2_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2. #endif @@ -419,7 +419,7 @@ namespace ImGui IMGUI_API void PopTextWrapPos(); // Style read access - // - Use the style editor (ShowStyleEditor() function) to interactively see what the colors are) + // - Use the ShowStyleEditor() function to interactively see/edit the colors. IMGUI_API ImFont* GetFont(); // get current font IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API @@ -782,6 +782,7 @@ namespace ImGui IMGUI_API int GetColumnsCount(); // Tab Bars, Tabs + // - Note: Tabs are automatically created by the docking system (when in 'docking' branch). Use this to create tab bars/tabs yourself. IMGUI_API bool BeginTabBar(const char* str_id, ImGuiTabBarFlags flags = 0); // create and append into a TabBar IMGUI_API void EndTabBar(); // only call EndTabBar() if BeginTabBar() returns true! IMGUI_API bool BeginTabItem(const char* label, bool* p_open = NULL, ImGuiTabItemFlags flags = 0); // create a Tab. Returns true if the Tab is selected. @@ -845,6 +846,7 @@ namespace ImGui IMGUI_API bool IsAnyItemHovered(); // is any item hovered? IMGUI_API bool IsAnyItemActive(); // is any item active? IMGUI_API bool IsAnyItemFocused(); // is any item focused? + IMGUI_API ImGuiID GetItemID(); // get ID of last item (~~ often same ImGui::GetID(label) beforehand) IMGUI_API ImVec2 GetItemRectMin(); // get upper-left bounding rectangle of the last item (screen space) IMGUI_API ImVec2 GetItemRectMax(); // get lower-right bounding rectangle of the last item (screen space) IMGUI_API ImVec2 GetItemRectSize(); // get size of last item @@ -881,12 +883,11 @@ namespace ImGui IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v); IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b); - // Inputs Utilities: Keyboard - // Without IMGUI_DISABLE_OBSOLETE_KEYIO: (legacy support) - // - For 'ImGuiKey key' you can still use your legacy native/user indices according to how your backend/engine stored them in io.KeysDown[]. - // With IMGUI_DISABLE_OBSOLETE_KEYIO: (this is the way forward) - // - Any use of 'ImGuiKey' will assert when key < 512 will be passed, previously reserved as native/user keys indices - // - GetKeyIndex() is pass-through and therefore deprecated (gone if IMGUI_DISABLE_OBSOLETE_KEYIO is defined) + // Inputs Utilities: Keyboard/Mouse/Gamepad + // - the ImGuiKey enum contains all possible keyboard, mouse and gamepad inputs (e.g. ImGuiKey_A, ImGuiKey_MouseLeft, ImGuiKey_GamepadDpadUp...). + // - before v1.87, we used ImGuiKey to carry native/user indices as defined by each backends. About use of those legacy ImGuiKey values: + // - without IMGUI_DISABLE_OBSOLETE_KEYIO (legacy support): you can still use your legacy native/user indices (< 512) according to how your backend/engine stored them in io.KeysDown[], but need to cast them to ImGuiKey. + // - with IMGUI_DISABLE_OBSOLETE_KEYIO (this is the way forward): any use of ImGuiKey will assert with key < 512. GetKeyIndex() is pass-through and therefore deprecated (gone if IMGUI_DISABLE_OBSOLETE_KEYIO is defined). IMGUI_API bool IsKeyDown(ImGuiKey key); // is key being held. IMGUI_API bool IsKeyPressed(ImGuiKey key, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate IMGUI_API bool IsKeyReleased(ImGuiKey key); // was key released (went from Down to !Down)? @@ -894,7 +895,7 @@ namespace ImGui IMGUI_API const char* GetKeyName(ImGuiKey key); // [DEBUG] returns English name of the key. Those names a provided for debugging purpose and are not meant to be saved persistently not compared. IMGUI_API void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard); // Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call. - // Inputs Utilities: Mouse + // Inputs Utilities: Mouse specific // - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right. // - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle. // - Dragging operations are only reported after mouse has moved a certain distance away from the initial clicking position (see 'lock_threshold' and 'io.MouseDraggingThreshold') @@ -1011,7 +1012,7 @@ enum ImGuiInputTextFlags_ ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input) ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) ImGuiInputTextFlags_CallbackEdit = 1 << 19, // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) - ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (constrast to default behavior of Escape to revert) + ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert) // Obsolete names (will be removed soon) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS @@ -1295,7 +1296,7 @@ enum ImGuiDragDropFlags_ { ImGuiDragDropFlags_None = 0, // BeginDragDropSource() flags - ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior. + ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // Disable preview tooltip. By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior. ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call IsItemHovered() on the source item. ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. @@ -1347,9 +1348,10 @@ enum ImGuiSortDirection_ ImGuiSortDirection_Descending = 2 // Descending = 9->0, Z->A etc. }; -// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value) -// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87) +// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value): can represent Keyboard, Mouse and Gamepad values. +// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87). // Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey. +// Read details about the 1.87 and 1.89 transition : https://github.com/ocornut/imgui/issues/4921 enum ImGuiKey : int { // Keyboard @@ -1404,7 +1406,7 @@ enum ImGuiKey : int ImGuiKey_KeypadEnter, ImGuiKey_KeypadEqual, - // Gamepad (some of those are analog values, 0.0f to 1.0f) // GAME NAVIGATION ACTION + // Gamepad (some of those are analog values, 0.0f to 1.0f) // NAVIGATION ACTION // (download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets) ImGuiKey_GamepadStart, // Menu (Xbox) + (Switch) Start/Options (PS) ImGuiKey_GamepadBack, // View (Xbox) - (Switch) Share (PS) @@ -1431,7 +1433,7 @@ enum ImGuiKey : int ImGuiKey_GamepadRStickUp, // [Analog] ImGuiKey_GamepadRStickDown, // [Analog] - // Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls) + // Aliases: Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls) // - This is mirroring the data also written to io.MouseDown[], io.MouseWheel, in a format allowing them to be accessed via standard key API. ImGuiKey_MouseLeft, ImGuiKey_MouseRight, ImGuiKey_MouseMiddle, ImGuiKey_MouseX1, ImGuiKey_MouseX2, ImGuiKey_MouseWheelX, ImGuiKey_MouseWheelY, @@ -1448,16 +1450,12 @@ enum ImGuiKey : int // In practice: it's complicated; mods are often provided from different sources. Keyboard layout, IME, sticky keys and // backends tend to interfere and break that equivalence. The safer decision is to relay that ambiguity down to the end-user... ImGuiMod_None = 0, - ImGuiMod_Ctrl = 1 << 12, - ImGuiMod_Shift = 1 << 13, + ImGuiMod_Ctrl = 1 << 12, // Ctrl + ImGuiMod_Shift = 1 << 13, // Shift ImGuiMod_Alt = 1 << 14, // Option/Menu ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows - ImGuiMod_Mask_ = 0xF000, -#if defined(__APPLE__) - ImGuiMod_Shortcut = ImGuiMod_Super, -#else - ImGuiMod_Shortcut = ImGuiMod_Ctrl, -#endif + ImGuiMod_Shortcut = 1 << 11, // Alias for Ctrl (non-macOS) _or_ Super (macOS). + ImGuiMod_Mask_ = 0xF800, // 5-bits // [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array. // We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE) @@ -1915,7 +1913,7 @@ struct ImGuiIO float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds. float HoverDelayNormal; // = 0.30 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayNormal) returns true. float HoverDelayShort; // = 0.10 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayShort) returns true. - void* UserData; // = NULL // Store your own data for retrieval by callbacks. + void* UserData; // = NULL // Store your own data. ImFontAtlas*Fonts; // // Font atlas: load, rasterize and pack one or more fonts into a single texture. float FontGlobalScale; // = 1.0f // Global scale all fonts @@ -2028,7 +2026,7 @@ struct ImGuiIO bool KeySuper; // Keyboard modifier down: Cmd/Super/Windows // Other state maintained from data above + IO function calls - ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags). Read-only, updated by NewFrame() + ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags. DOES NOT CONTAINS ImGuiMod_Shortcut which is pretranslated). Read-only, updated by NewFrame() ImGuiKeyData KeysData[ImGuiKey_KeysData_SIZE]; // Key state for all known keys. Use IsKeyXXX() functions to access this. bool WantCaptureMouseUnlessPopupClose; // Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup. ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid) @@ -2812,6 +2810,7 @@ struct ImFontAtlas int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height. int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false). bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert. + void* UserData; // Store your own atlas related user-data (if e.g. you have multiple font atlas). // [Internal] // NB: Access texture data via GetTexData*() calls! Which will setup a default font for you. @@ -2860,8 +2859,10 @@ struct ImFont const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont. ImWchar FallbackChar; // 2 // out // = FFFD/'?' // Character used if a glyph isn't found. - ImWchar EllipsisChar; // 2 // out // = '...' // Character used for ellipsis rendering. - ImWchar DotChar; // 2 // out // = '.' // Character used for ellipsis rendering (if a single '...' character isn't found) + ImWchar EllipsisChar; // 2 // out // = '...'/'.'// Character used for ellipsis rendering. + short EllipsisCharCount; // 1 // out // 1 or 3 + float EllipsisWidth; // 4 // out // Width + float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0 bool DirtyLookupTables; // 1 // out // float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale() float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] diff --git a/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/dear-imgui/imgui_demo.cpp index 560586933..4827e694f 100644 --- a/3rdparty/dear-imgui/imgui_demo.cpp +++ b/3rdparty/dear-imgui/imgui_demo.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.1 WIP +// dear imgui, v1.89.3 WIP // (demo code) // Help: @@ -3438,11 +3438,14 @@ static void ShowDemoWindowPopups() // and BeginPopupContextItem() will use the last item ID as the popup ID. { const char* names[5] = { "Label1", "Label2", "Label3", "Label4", "Label5" }; + static int selected = -1; for (int n = 0; n < 5; n++) { - ImGui::Selectable(names[n]); + if (ImGui::Selectable(names[n], selected == n)) + selected = n; if (ImGui::BeginPopupContextItem()) // <-- use last item id as popup id { + selected = n; ImGui::Text("This a popup for \"%s\"!", names[n]); if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); @@ -5043,18 +5046,23 @@ static void ShowDemoWindowTables() if (ImGui::TreeNode("Synced instances")) { HelpMarker("Multiple tables with the same identifier will share their settings, width, visibility, order etc."); + + static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoSavedSettings; + ImGui::CheckboxFlags("ImGuiTableFlags_ScrollY", &flags, ImGuiTableFlags_ScrollY); + ImGui::CheckboxFlags("ImGuiTableFlags_SizingFixedFit", &flags, ImGuiTableFlags_SizingFixedFit); for (int n = 0; n < 3; n++) { char buf[32]; sprintf(buf, "Synced Table %d", n); bool open = ImGui::CollapsingHeader(buf, ImGuiTreeNodeFlags_DefaultOpen); - if (open && ImGui::BeginTable("Table", 3, ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoSavedSettings)) + if (open && ImGui::BeginTable("Table", 3, flags, ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 5))) { ImGui::TableSetupColumn("One"); ImGui::TableSetupColumn("Two"); ImGui::TableSetupColumn("Three"); ImGui::TableHeadersRow(); - for (int cell = 0; cell < 9; cell++) + const int cell_count = (n == 1) ? 27 : 9; // Make second table have a scrollbar to verify that additional decoration is not affecting column positions. + for (int cell = 0; cell < cell_count; cell++) { ImGui::TableNextColumn(); ImGui::Text("this cell %d", cell); @@ -5686,46 +5694,89 @@ namespace ImGui { extern ImGuiKeyData* GetKeyData(ImGuiKey key); } static void ShowDemoWindowInputs() { - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus"); - if (ImGui::CollapsingHeader("Inputs, Navigation & Focus")) + IMGUI_DEMO_MARKER("Inputs & Focus"); + if (ImGui::CollapsingHeader("Inputs & Focus")) { ImGuiIO& io = ImGui::GetIO(); - // Display ImGuiIO output flags - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Output"); + // Display inputs submitted to ImGuiIO + IMGUI_DEMO_MARKER("Inputs & Focus/Inputs"); ImGui::SetNextItemOpen(true, ImGuiCond_Once); - if (ImGui::TreeNode("Output")) + if (ImGui::TreeNode("Inputs")) { + HelpMarker( + "This is a simplified view. See more detailed input state:\n" + "- in 'Tools->Metrics/Debugger->Inputs'.\n" + "- in 'Tools->Debug Log->IO'."); + if (ImGui::IsMousePosValid()) + ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y); + else + ImGui::Text("Mouse pos: "); + ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y); + ImGui::Text("Mouse down:"); + for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); } + ImGui::Text("Mouse wheel: %.1f", io.MouseWheel); + + // We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends. + // User code should never have to go through such hoops: old code may use native keycodes, new code may use ImGuiKey codes. +#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO + struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } }; +#else + struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array +#endif + ImGui::Text("Keys down:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); ImGui::SameLine(); ImGui::Text("(%.02f)", ImGui::GetKeyData(key)->DownDuration); } + ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); + ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public. + + ImGui::TreePop(); + } + + // Display ImGuiIO output flags + IMGUI_DEMO_MARKER("Inputs & Focus/Outputs"); + ImGui::SetNextItemOpen(true, ImGuiCond_Once); + if (ImGui::TreeNode("Outputs")) + { + HelpMarker( + "The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui " + "to instruct your application of how to route inputs. Typically, when a value is true, it means " + "Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n" + "The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, " + "and underlying application should ignore mouse inputs (in practice there are many and more subtle " + "rules leading to how those flags are set)."); ImGui::Text("io.WantCaptureMouse: %d", io.WantCaptureMouse); ImGui::Text("io.WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose); ImGui::Text("io.WantCaptureKeyboard: %d", io.WantCaptureKeyboard); ImGui::Text("io.WantTextInput: %d", io.WantTextInput); ImGui::Text("io.WantSetMousePos: %d", io.WantSetMousePos); ImGui::Text("io.NavActive: %d, io.NavVisible: %d", io.NavActive, io.NavVisible); - ImGui::TreePop(); - } - // Display Mouse state - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Mouse State"); - if (ImGui::TreeNode("Mouse State")) - { - if (ImGui::IsMousePosValid()) - ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y); - else - ImGui::Text("Mouse pos: "); - ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y); + IMGUI_DEMO_MARKER("Inputs & Focus/Outputs/WantCapture override"); + if (ImGui::TreeNode("WantCapture override")) + { + HelpMarker( + "Hovering the colored canvas will override io.WantCaptureXXX fields.\n" + "Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering and true when clicking."); + static int capture_override_mouse = -1; + static int capture_override_keyboard = -1; + const char* capture_override_desc[] = { "None", "Set to false", "Set to true" }; + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); + ImGui::SliderInt("SetNextFrameWantCaptureMouse() on hover", &capture_override_mouse, -1, +1, capture_override_desc[capture_override_mouse + 1], ImGuiSliderFlags_AlwaysClamp); + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); + ImGui::SliderInt("SetNextFrameWantCaptureKeyboard() on hover", &capture_override_keyboard, -1, +1, capture_override_desc[capture_override_keyboard + 1], ImGuiSliderFlags_AlwaysClamp); - int count = IM_ARRAYSIZE(io.MouseDown); - ImGui::Text("Mouse down:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); } - ImGui::Text("Mouse clicked:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d (%d)", i, ImGui::GetMouseClickedCount(i)); } - ImGui::Text("Mouse released:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } - ImGui::Text("Mouse wheel: %.1f", io.MouseWheel); - ImGui::Text("Pen Pressure: %.1f", io.PenPressure); // Note: currently unused + ImGui::ColorButton("##panel", ImVec4(0.7f, 0.1f, 0.7f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, ImVec2(128.0f, 96.0f)); // Dummy item + if (ImGui::IsItemHovered() && capture_override_mouse != -1) + ImGui::SetNextFrameWantCaptureMouse(capture_override_mouse == 1); + if (ImGui::IsItemHovered() && capture_override_keyboard != -1) + ImGui::SetNextFrameWantCaptureKeyboard(capture_override_keyboard == 1); + + ImGui::TreePop(); + } ImGui::TreePop(); } // Display mouse cursors - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Mouse Cursors"); + IMGUI_DEMO_MARKER("Inputs & Focus/Mouse Cursors"); if (ImGui::TreeNode("Mouse Cursors")) { const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" }; @@ -5753,113 +5804,7 @@ static void ShowDemoWindowInputs() ImGui::TreePop(); } - // Display Keyboard/Mouse state - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Keyboard, Gamepad & Navigation State"); - if (ImGui::TreeNode("Keyboard, Gamepad & Navigation State")) - { - // We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends. - // User code should never have to go through such hoops: old code may use native keycodes, new code may use ImGuiKey codes. -#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO - struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } }; - const ImGuiKey key_first = (ImGuiKey)ImGuiKey_NamedKey_BEGIN; -#else - struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array - const ImGuiKey key_first = (ImGuiKey)0; - //ImGui::Text("Legacy raw:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key++) { if (io.KeysDown[key]) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } } -#endif - ImGui::Text("Keys down:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyDown(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d (%.02f)", ImGui::GetKeyName(key), key, ImGui::GetKeyData(key)->DownDuration); } } - ImGui::Text("Keys pressed:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyPressed(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } } - ImGui::Text("Keys released:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyReleased(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } } - ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); - ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public. - - // Draw an arbitrary US keyboard layout to visualize translated keys - { - const ImVec2 key_size = ImVec2(35.0f, 35.0f); - const float key_rounding = 3.0f; - const ImVec2 key_face_size = ImVec2(25.0f, 25.0f); - const ImVec2 key_face_pos = ImVec2(5.0f, 3.0f); - const float key_face_rounding = 2.0f; - const ImVec2 key_label_pos = ImVec2(7.0f, 4.0f); - const ImVec2 key_step = ImVec2(key_size.x - 1.0f, key_size.y - 1.0f); - const float key_row_offset = 9.0f; - - ImVec2 board_min = ImGui::GetCursorScreenPos(); - ImVec2 board_max = ImVec2(board_min.x + 3 * key_step.x + 2 * key_row_offset + 10.0f, board_min.y + 3 * key_step.y + 10.0f); - ImVec2 start_pos = ImVec2(board_min.x + 5.0f - key_step.x, board_min.y); - - struct KeyLayoutData { int Row, Col; const char* Label; ImGuiKey Key; }; - const KeyLayoutData keys_to_display[] = - { - { 0, 0, "", ImGuiKey_Tab }, { 0, 1, "Q", ImGuiKey_Q }, { 0, 2, "W", ImGuiKey_W }, { 0, 3, "E", ImGuiKey_E }, { 0, 4, "R", ImGuiKey_R }, - { 1, 0, "", ImGuiKey_CapsLock }, { 1, 1, "A", ImGuiKey_A }, { 1, 2, "S", ImGuiKey_S }, { 1, 3, "D", ImGuiKey_D }, { 1, 4, "F", ImGuiKey_F }, - { 2, 0, "", ImGuiKey_LeftShift },{ 2, 1, "Z", ImGuiKey_Z }, { 2, 2, "X", ImGuiKey_X }, { 2, 3, "C", ImGuiKey_C }, { 2, 4, "V", ImGuiKey_V } - }; - - // Elements rendered manually via ImDrawList API are not clipped automatically. - // While not strictly necessary, here IsItemVisible() is used to avoid rendering these shapes when they are out of view. - ImGui::Dummy(ImVec2(board_max.x - board_min.x, board_max.y - board_min.y)); - if (ImGui::IsItemVisible()) - { - ImDrawList* draw_list = ImGui::GetWindowDrawList(); - draw_list->PushClipRect(board_min, board_max, true); - for (int n = 0; n < IM_ARRAYSIZE(keys_to_display); n++) - { - const KeyLayoutData* key_data = &keys_to_display[n]; - ImVec2 key_min = ImVec2(start_pos.x + key_data->Col * key_step.x + key_data->Row * key_row_offset, start_pos.y + key_data->Row * key_step.y); - ImVec2 key_max = ImVec2(key_min.x + key_size.x, key_min.y + key_size.y); - draw_list->AddRectFilled(key_min, key_max, IM_COL32(204, 204, 204, 255), key_rounding); - draw_list->AddRect(key_min, key_max, IM_COL32(24, 24, 24, 255), key_rounding); - ImVec2 face_min = ImVec2(key_min.x + key_face_pos.x, key_min.y + key_face_pos.y); - ImVec2 face_max = ImVec2(face_min.x + key_face_size.x, face_min.y + key_face_size.y); - draw_list->AddRect(face_min, face_max, IM_COL32(193, 193, 193, 255), key_face_rounding, ImDrawFlags_None, 2.0f); - draw_list->AddRectFilled(face_min, face_max, IM_COL32(252, 252, 252, 255), key_face_rounding); - ImVec2 label_min = ImVec2(key_min.x + key_label_pos.x, key_min.y + key_label_pos.y); - draw_list->AddText(label_min, IM_COL32(64, 64, 64, 255), key_data->Label); - if (ImGui::IsKeyDown(key_data->Key)) - draw_list->AddRectFilled(key_min, key_max, IM_COL32(255, 0, 0, 128), key_rounding); - } - draw_list->PopClipRect(); - } - } - ImGui::TreePop(); - } - - if (ImGui::TreeNode("Capture override")) - { - HelpMarker( - "The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui " - "to instruct your application of how to route inputs. Typically, when a value is true, it means " - "Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n" - "The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, " - "and underlying application should ignore mouse inputs (in practice there are many and more subtle " - "rules leading to how those flags are set)."); - - ImGui::Text("io.WantCaptureMouse: %d", io.WantCaptureMouse); - ImGui::Text("io.WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose); - ImGui::Text("io.WantCaptureKeyboard: %d", io.WantCaptureKeyboard); - - HelpMarker( - "Hovering the colored canvas will override io.WantCaptureXXX fields.\n" - "Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering and true when clicking."); - static int capture_override_mouse = -1; - static int capture_override_keyboard = -1; - const char* capture_override_desc[] = { "None", "Set to false", "Set to true" }; - ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); - ImGui::SliderInt("SetNextFrameWantCaptureMouse()", &capture_override_mouse, -1, +1, capture_override_desc[capture_override_mouse + 1], ImGuiSliderFlags_AlwaysClamp); - ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); - ImGui::SliderInt("SetNextFrameWantCaptureKeyboard()", &capture_override_keyboard, -1, +1, capture_override_desc[capture_override_keyboard + 1], ImGuiSliderFlags_AlwaysClamp); - - ImGui::ColorButton("##panel", ImVec4(0.7f, 0.1f, 0.7f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, ImVec2(256.0f, 192.0f)); // Dummy item - if (ImGui::IsItemHovered() && capture_override_mouse != -1) - ImGui::SetNextFrameWantCaptureMouse(capture_override_mouse == 1); - if (ImGui::IsItemHovered() && capture_override_keyboard != -1) - ImGui::SetNextFrameWantCaptureKeyboard(capture_override_keyboard == 1); - - ImGui::TreePop(); - } - - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Tabbing"); + IMGUI_DEMO_MARKER("Inputs & Focus/Tabbing"); if (ImGui::TreeNode("Tabbing")) { ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields."); @@ -5875,7 +5820,7 @@ static void ShowDemoWindowInputs() ImGui::TreePop(); } - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Focus from code"); + IMGUI_DEMO_MARKER("Inputs & Focus/Focus from code"); if (ImGui::TreeNode("Focus from code")) { bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine(); @@ -5917,7 +5862,7 @@ static void ShowDemoWindowInputs() ImGui::TreePop(); } - IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Dragging"); + IMGUI_DEMO_MARKER("Inputs & Focus/Dragging"); if (ImGui::TreeNode("Dragging")) { ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget."); @@ -7087,7 +7032,7 @@ static void ShowExampleAppLayout(bool* p_open) { if (ImGui::BeginMenu("File")) { - if (ImGui::MenuItem("Close")) *p_open = false; + if (ImGui::MenuItem("Close", "Ctrl+W")) { *p_open = false; } ImGui::EndMenu(); } ImGui::EndMenuBar(); diff --git a/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/dear-imgui/imgui_draw.cpp index 859b62e7e..25493df3a 100644 --- a/3rdparty/dear-imgui/imgui_draw.cpp +++ b/3rdparty/dear-imgui/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.1 WIP +// dear imgui, v1.89.3 WIP // (drawing and font code) /* @@ -447,11 +447,13 @@ void ImDrawList::AddDrawCmd() // Note that this leaves the ImDrawList in a state unfit for further commands, as most code assume that CmdBuffer.Size > 0 && CmdBuffer.back().UserCallback == NULL void ImDrawList::_PopUnusedDrawCmd() { - if (CmdBuffer.Size == 0) - return; - ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1]; - if (curr_cmd->ElemCount == 0 && curr_cmd->UserCallback == NULL) + while (CmdBuffer.Size > 0) + { + ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1]; + if (curr_cmd->ElemCount != 0 || curr_cmd->UserCallback != NULL) + return;// break; CmdBuffer.pop_back(); + } } void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data) @@ -2935,19 +2937,19 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese() // 2999 ideograms code points for Japanese // - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points // - 863 Jinmeiyo (meaning "for personal name") Kanji code points - // - Sourced from the character information database of the Information-technology Promotion Agency, Japan - // - https://mojikiban.ipa.go.jp/mji/ - // - Available under the terms of the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP). - // - https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en - // - https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode - // - You can generate this code by the script at: - // - https://github.com/vaiorabbit/everyday_use_kanji + // - Sourced from official information provided by the government agencies of Japan: + // - List of Joyo Kanji by the Agency for Cultural Affairs + // - https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kijun/naikaku/kanji/ + // - List of Jinmeiyo Kanji by the Ministry of Justice + // - http://www.moj.go.jp/MINJI/minji86.html + // - Available under the terms of the Creative Commons Attribution 4.0 International (CC BY 4.0). + // - https://creativecommons.org/licenses/by/4.0/legalcode + // - You can generate this code by the script at: + // - https://github.com/vaiorabbit/everyday_use_kanji // - References: // - List of Joyo Kanji - // - (Official list by the Agency for Cultural Affairs) https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kakuki/14/tosin02/index.html // - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji // - List of Jinmeiyo Kanji - // - (Official list by the Ministry of Justice) http://www.moj.go.jp/MINJI/minji86.html // - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji // - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details. // You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters. @@ -3110,7 +3112,8 @@ ImFont::ImFont() FallbackAdvanceX = 0.0f; FallbackChar = (ImWchar)-1; EllipsisChar = (ImWchar)-1; - DotChar = (ImWchar)-1; + EllipsisWidth = EllipsisCharStep = 0.0f; + EllipsisCharCount = 0; FallbackGlyph = NULL; ContainerAtlas = NULL; ConfigData = NULL; @@ -3198,8 +3201,20 @@ void ImFont::BuildLookupTable() const ImWchar dots_chars[] = { (ImWchar)'.', (ImWchar)0xFF0E }; if (EllipsisChar == (ImWchar)-1) EllipsisChar = FindFirstExistingGlyph(this, ellipsis_chars, IM_ARRAYSIZE(ellipsis_chars)); - if (DotChar == (ImWchar)-1) - DotChar = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars)); + const ImWchar dot_char = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars)); + if (EllipsisChar != (ImWchar)-1) + { + EllipsisCharCount = 1; + EllipsisWidth = EllipsisCharStep = FindGlyph(EllipsisChar)->X1; + } + else if (dot_char != (ImWchar)-1) + { + const ImFontGlyph* glyph = FindGlyph(dot_char); + EllipsisChar = dot_char; + EllipsisCharCount = 3; + EllipsisCharStep = (glyph->X1 - glyph->X0) + 1.0f; + EllipsisWidth = EllipsisCharStep * 3.0f - 1.0f; + } // Setup fallback character const ImWchar fallback_chars[] = { (ImWchar)IM_UNICODE_CODEPOINT_INVALID, (ImWchar)'?', (ImWchar)' ' }; @@ -3367,6 +3382,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c bool inside_word = true; const char* s = text; + IM_ASSERT(text_end != NULL); while (s < text_end) { unsigned int c = (unsigned int)*s; @@ -3375,8 +3391,6 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c next_s = s + 1; else next_s = s + ImTextCharFromUtf8(&c, s, text_end); - if (c == 0) - break; if (c < 32) { @@ -3482,15 +3496,9 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons const char* prev_s = s; unsigned int c = (unsigned int)*s; if (c < 0x80) - { s += 1; - } else - { s += ImTextCharFromUtf8(&c, s, text_end); - if (c == 0) // Malformed UTF-8? - break; - } if (c < 32) { @@ -3565,17 +3573,18 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im while (y + line_height < clip_rect.y && s < text_end) { const char* line_end = (const char*)memchr(s, '\n', text_end - s); + const char* line_next = line_end ? line_end + 1 : text_end; if (word_wrap_enabled) { // FIXME-OPT: This is not optimal as do first do a search for \n before calling CalcWordWrapPositionA(). // If the specs for CalcWordWrapPositionA() were reworked to optionally return on \n we could combine both. // However it is still better than nothing performing the fast-forward! - s = CalcWordWrapPositionA(scale, s, line_end, wrap_width); + s = CalcWordWrapPositionA(scale, s, line_next, wrap_width); s = CalcWordWrapNextLineStartA(s, text_end); } else { - s = line_end ? line_end + 1 : text_end; + s = line_next; } y += line_height; } @@ -3631,15 +3640,9 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im // Decode and advance source unsigned int c = (unsigned int)*s; if (c < 0x80) - { s += 1; - } else - { s += ImTextCharFromUtf8(&c, s, text_end); - if (c == 0) // Malformed UTF-8? - break; - } if (c < 32) { diff --git a/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/dear-imgui/imgui_internal.h index 015f6b657..987a215b5 100644 --- a/3rdparty/dear-imgui/imgui_internal.h +++ b/3rdparty/dear-imgui/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.89.1 WIP +// dear imgui, v1.89.3 WIP // (internal structures/api) // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! @@ -56,7 +56,7 @@ Index of this file: #include // INT_MIN, INT_MAX // Enable SSE intrinsics if available -#if (defined __SSE__ || defined __x86_64__ || defined _M_X64) && !defined(IMGUI_DISABLE_SSE) +#if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE) #define IMGUI_ENABLE_SSE #include #endif @@ -206,12 +206,16 @@ namespace ImStb #ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS #define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__) #else -#define IMGUI_DEBUG_PRINTF(_FMT,...) +#define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0) #endif #endif // Debug Logging for ShowDebugLogWindow(). This is designed for relatively rare events so please don't spam. +#ifndef IMGUI_DISABLE_DEBUG_TOOLS #define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__) +#else +#define IMGUI_DEBUG_LOG(...) ((void)0) +#endif #define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) #define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) #define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) @@ -473,6 +477,7 @@ static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; } static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); } static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f) { return f <= -16777216 || f >= 16777216; } +static inline float ImExponentialMovingAverage(float avg, float sample, int n) { avg -= avg / n; avg += sample / n; return avg; } IM_MSVC_RUNTIME_CHECKS_RESTORE // Helpers: Geometry @@ -886,10 +891,9 @@ enum ImGuiSelectableFlagsPrivate_ ImGuiSelectableFlags_SelectOnClick = 1 << 22, // Override button behavior to react on Click (default is Click+Release) ImGuiSelectableFlags_SelectOnRelease = 1 << 23, // Override button behavior to react on Release (default is Click+Release) ImGuiSelectableFlags_SpanAvailWidth = 1 << 24, // Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus) - ImGuiSelectableFlags_DrawHoveredWhenHeld = 1 << 25, // Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow. - ImGuiSelectableFlags_SetNavIdOnHover = 1 << 26, // Set Nav/Focus ID on mouse hover (used by MenuItem) - ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 27, // Disable padding each side with ItemSpacing * 0.5f - ImGuiSelectableFlags_NoSetKeyOwner = 1 << 28, // Don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!) + ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25, // Set Nav/Focus ID on mouse hover (used by MenuItem) + ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26, // Disable padding each side with ItemSpacing * 0.5f + ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27, // Don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!) }; // Extend ImGuiTreeNodeFlags_ @@ -1046,6 +1050,7 @@ struct IMGUI_API ImGuiMenuColumns // For a given item ID, access with ImGui::GetInputTextState() struct IMGUI_API ImGuiInputTextState { + ImGuiContext* Ctx; // parent dear imgui context ImGuiID ID; // widget id owning the text state int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not. ImVector TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer. @@ -1061,7 +1066,7 @@ struct IMGUI_API ImGuiInputTextState bool Edited; // edited this frame ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set. - ImGuiInputTextState() { memset(this, 0, sizeof(*this)); } + ImGuiInputTextState(ImGuiContext* ctx) { memset(this, 0, sizeof(*this)); Ctx = ctx;} void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); } void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); } int GetUndoAvailCount() const { return Stb.undostate.undo_point; } @@ -1291,7 +1296,7 @@ typedef ImS16 ImGuiKeyRoutingIndex; struct ImGuiKeyRoutingData { ImGuiKeyRoutingIndex NextEntryIndex; - ImU16 Mods; // Technically we'd only need 4 bits but for simplify we store ImGuiMod_ values which need 16 bits. + ImU16 Mods; // Technically we'd only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits. ImGuiMod_Shortcut is already translated to Ctrl/Super. ImU8 RoutingNextScore; // Lower is better (0: perfect score) ImGuiID RoutingCurr; ImGuiID RoutingNext; @@ -1760,7 +1765,10 @@ struct ImGuiContext ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow. ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window. ImVec2 WheelingWindowRefMousePos; + int WheelingWindowStartFrame; // This may be set one frame before WheelingWindow is != NULL float WheelingWindowReleaseTimer; + ImVec2 WheelingWindowWheelRemainder; + ImVec2 WheelingAxisAvg; // Item/widgets state and tracking information ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line] @@ -2006,6 +2014,7 @@ struct ImGuiContext ImVector TempBuffer; // Temporary text buffer ImGuiContext(ImFontAtlas* shared_font_atlas) + : InputTextState(this) { Initialized = false; FontAtlasOwnedByContext = shared_font_atlas ? false : true; @@ -2026,6 +2035,7 @@ struct ImGuiContext HoveredWindowUnderMovingWindow = NULL; MovingWindow = NULL; WheelingWindow = NULL; + WheelingWindowStartFrame = -1; WheelingWindowReleaseTimer = 0.0f; DebugHookIdInfo = 0; @@ -2237,6 +2247,9 @@ struct IMGUI_API ImGuiWindow ImVec2 WindowPadding; // Window padding at the time of Begin(). float WindowRounding; // Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc. float WindowBorderSize; // Window border size at the time of Begin(). + float DecoOuterSizeX1, DecoOuterSizeY1; // Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0f. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin(). + float DecoOuterSizeX2, DecoOuterSizeY2; // Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y). + float DecoInnerSizeX1, DecoInnerSizeY1; // Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes). int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)! ImGuiID MoveId; // == window->GetID("#MOVE") ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window) @@ -2505,13 +2518,14 @@ struct ImGuiTableCellData // Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs, does that needs they could be moved to ImGuiTableTempData ?) struct ImGuiTableInstanceData { - float LastOuterHeight; // Outer height from last frame // FIXME: multi-instance issue (#3955) - float LastFirstRowHeight; // Height of first row from last frame // FIXME: possible multi-instance issue? + float LastOuterHeight; // Outer height from last frame + float LastFirstRowHeight; // Height of first row from last frame (FIXME: this is used as "header height" and may be reworked) + float LastFrozenHeight; // Height of frozen section from last frame - ImGuiTableInstanceData() { LastOuterHeight = LastFirstRowHeight = 0.0f; } + ImGuiTableInstanceData() { LastOuterHeight = LastFirstRowHeight = LastFrozenHeight = 0.0f; } }; -// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData +// FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs, incoming RowData struct IMGUI_API ImGuiTable { ImGuiID ID; @@ -2616,6 +2630,8 @@ struct IMGUI_API ImGuiTable bool IsResetDisplayOrderRequest; bool IsUnfrozenRows; // Set when we got past the frozen row. bool IsDefaultSizingPolicy; // Set if user didn't explicitly set a sizing policy in BeginTable() + bool HasScrollbarYCurr; // Whether ANY instance of this table had a vertical scrollbar during the current frame. + bool HasScrollbarYPrev; // Whether ANY instance of this table had a vertical scrollbar during the previous. bool MemoryCompacted; bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis @@ -2779,7 +2795,6 @@ namespace ImGui //#endif // Basic Accessors - inline ImGuiID GetItemID() { ImGuiContext& g = *GImGui; return g.LastItemData.ID; } // Get ID of last item (~~ often same ImGui::GetID(label) beforehand) inline ImGuiItemStatusFlags GetItemStatusFlags(){ ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; } inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; } inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; } @@ -2860,18 +2875,21 @@ namespace ImGui // Inputs // FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions. inline bool IsNamedKey(ImGuiKey key) { return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; } - inline bool IsNamedKeyOrModKey(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super; } + inline bool IsNamedKeyOrModKey(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super || key == ImGuiMod_Shortcut; } inline bool IsLegacyKey(ImGuiKey key) { return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; } inline bool IsKeyboardKey(ImGuiKey key) { return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; } inline bool IsGamepadKey(ImGuiKey key) { return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; } inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; } inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; } + inline ImGuiKeyChord ConvertShortcutMod(ImGuiKeyChord key_chord) { ImGuiContext& g = *GImGui; IM_ASSERT_PARANOID(key_chord & ImGuiMod_Shortcut); return (key_chord & ~ImGuiMod_Shortcut) | (g.IO.ConfigMacOSXBehaviors ? ImGuiMod_Super : ImGuiMod_Ctrl); } inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key) { + ImGuiContext& g = *GImGui; if (key == ImGuiMod_Ctrl) return ImGuiKey_ReservedForModCtrl; if (key == ImGuiMod_Shift) return ImGuiKey_ReservedForModShift; if (key == ImGuiMod_Alt) return ImGuiKey_ReservedForModAlt; if (key == ImGuiMod_Super) return ImGuiKey_ReservedForModSuper; + if (key == ImGuiMod_Shortcut) return (g.IO.ConfigMacOSXBehaviors ? ImGuiKey_ReservedForModSuper : ImGuiKey_ReservedForModCtrl); return key; } @@ -2879,7 +2897,7 @@ namespace ImGui IMGUI_API void GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size); inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); return (ImGuiKey)(ImGuiKey_MouseLeft + button); } IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f); - IMGUI_API ImVec2 GetKeyVector2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down); + IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down); IMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis); IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate); IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate); @@ -3023,8 +3041,9 @@ namespace ImGui IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int offset); IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, ImVec2 mouse_pos); IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar); - IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags); + IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window); IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker); + IMGUI_API ImVec2 TabItemCalcSize(ImGuiWindow* window); IMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col); IMGUI_API void TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id, bool is_contents_visible, bool* out_just_closed, bool* out_text_clipped); @@ -3054,25 +3073,27 @@ namespace ImGui // Widgets IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0); IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0); + IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0); + IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col); + IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags); + IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value); + IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value); + + // Widgets: Window Decorations IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos); IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos); - IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0); IMGUI_API void Scrollbar(ImGuiAxis axis); IMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags); - IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col); IMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis); IMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis); IMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow* window, int n); // 0..3: corners IMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir); - IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags); - IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value); - IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value); // Widgets low-level behaviors IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0); IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags); IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb); - IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f); + IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f, ImU32 bg_col = 0); IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL); IMGUI_API void TreePushOverrideID(ImGuiID id); IMGUI_API void TreeNodeSetOpen(ImGuiID id, bool open); @@ -3150,6 +3171,7 @@ namespace ImGui IMGUI_API void DebugNodeWindowsList(ImVector* windows, const char* label); IMGUI_API void DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows, int windows_size, ImGuiWindow* parent_in_begin_stack); IMGUI_API void DebugNodeViewport(ImGuiViewportP* viewport); + IMGUI_API void DebugRenderKeyboardPreview(ImDrawList* draw_list); IMGUI_API void DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb); // Obsolete functions diff --git a/3rdparty/dear-imgui/imgui_tables.cpp b/3rdparty/dear-imgui/imgui_tables.cpp index 66a46573b..b6e367039 100644 --- a/3rdparty/dear-imgui/imgui_tables.cpp +++ b/3rdparty/dear-imgui/imgui_tables.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.1 WIP +// dear imgui, v1.89.3 WIP // (tables and columns code) /* @@ -395,6 +395,14 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG table->OuterRect = table->InnerWindow->Rect(); table->InnerRect = table->InnerWindow->InnerRect; IM_ASSERT(table->InnerWindow->WindowPadding.x == 0.0f && table->InnerWindow->WindowPadding.y == 0.0f && table->InnerWindow->WindowBorderSize == 0.0f); + + // When using multiple instances, ensure they have the same amount of horizontal decorations (aka vertical scrollbar) so stretched columns can be aligned) + if (instance_no == 0) + { + table->HasScrollbarYPrev = table->HasScrollbarYCurr; + table->HasScrollbarYCurr = false; + } + table->HasScrollbarYCurr |= (table->InnerWindow->ScrollMax.y > 0.0f); } else { @@ -893,7 +901,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // [Part 4] Apply final widths based on requested widths const ImRect work_rect = table->WorkRect; const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1); - const float width_avail = ((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth(); + const float width_removed = (table->HasScrollbarYPrev && !table->InnerWindow->ScrollbarY) ? g.Style.ScrollbarSize : 0.0f; // To synchronize decoration width of synched tables with mismatching scrollbar state (#5920) + const float width_avail = ImMax(1.0f, (((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth()) - width_removed); const float width_avail_for_stretched_columns = width_avail - width_spacings - sum_width_requests; float width_remaining_for_stretched_columns = width_avail_for_stretched_columns; table->ColumnsGivenWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount; @@ -964,7 +973,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) const int column_n = table->DisplayOrderToIndex[order_n]; ImGuiTableColumn* column = &table->Columns[column_n]; - column->NavLayerCurrent = (ImS8)((table->FreezeRowsCount > 0 || column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main); + column->NavLayerCurrent = (ImS8)(table->FreezeRowsCount > 0 ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main); // Use Count NOT request so Header line changes layer when frozen if (offset_x_frozen && table->FreezeColumnsCount == visible_n) { @@ -1124,6 +1133,13 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) if (table->IsSortSpecsDirty && (table->Flags & ImGuiTableFlags_Sortable)) TableSortSpecsBuild(table); + // [Part 14] Setup inner window decoration size (for scrolling / nav tracking to properly take account of frozen rows/columns) + if (table->FreezeColumnsRequest > 0) + table->InnerWindow->DecoInnerSizeX1 = table->Columns[table->DisplayOrderToIndex[table->FreezeColumnsRequest - 1]].MaxX - table->OuterRect.Min.x; + if (table->FreezeRowsRequest > 0) + table->InnerWindow->DecoInnerSizeY1 = table_instance->LastFrozenHeight; + table_instance->LastFrozenHeight = 0.0f; + // Initial state ImGuiWindow* inner_window = table->InnerWindow; if (table->Flags & ImGuiTableFlags_NoClip) @@ -1839,17 +1855,15 @@ void ImGui::TableEndRow(ImGuiTable* table) // get the new cursor position. if (unfreeze_rows_request) for (int column_n = 0; column_n < table->ColumnsCount; column_n++) - { - ImGuiTableColumn* column = &table->Columns[column_n]; - column->NavLayerCurrent = (ImS8)((column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main); - } + table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main; if (unfreeze_rows_actual) { IM_ASSERT(table->IsUnfrozenRows == false); + const float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y); table->IsUnfrozenRows = true; + TableGetInstanceData(table, table->InstanceCurrent)->LastFrozenHeight = y0 - table->OuterRect.Min.y; // BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect - float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y); table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y); table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y; table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen; diff --git a/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/dear-imgui/imgui_widgets.cpp index 3b8be01e7..2cfac8f61 100644 --- a/3rdparty/dear-imgui/imgui_widgets.cpp +++ b/3rdparty/dear-imgui/imgui_widgets.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.1 WIP +// dear imgui, v1.89.3 WIP // (widgets code) /* @@ -126,7 +126,7 @@ static const ImU64 IM_U64_MAX = (2ULL * 9223372036854775807LL + 1); // For InputTextEx() static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, ImGuiInputSource input_source); static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end); -static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false); +static ImVec2 InputTextCalcTextSizeW(ImGuiContext* ctx, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false); //------------------------------------------------------------------------- // [SECTION] Widgets: Text, etc. @@ -544,13 +544,21 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool const ImGuiID test_owner_id = (flags & ImGuiButtonFlags_NoTestKeyOwner) ? ImGuiKeyOwner_Any : id; if (hovered) { + // Poll mouse buttons + // - 'mouse_button_clicked' is generally carried into ActiveIdMouseButton when setting ActiveId. + // - Technically we only need some values in one code path, but since this is gated by hovered test this is fine. + int mouse_button_clicked = -1; + int mouse_button_released = -1; + for (int button = 0; button < 3; button++) + if (flags & (ImGuiButtonFlags_MouseButtonLeft << button)) // Handle ImGuiButtonFlags_MouseButtonRight and ImGuiButtonFlags_MouseButtonMiddle here. + { + if (IsMouseClicked(button, test_owner_id) && mouse_button_clicked == -1) { mouse_button_clicked = button; } + if (IsMouseReleased(button, test_owner_id) && mouse_button_released == -1) { mouse_button_released = button; } + } + + // Process initial action if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt)) { - // Poll buttons - int mouse_button_clicked = -1; - if ((flags & ImGuiButtonFlags_MouseButtonLeft) && IsMouseClicked(0, test_owner_id)) { mouse_button_clicked = 0; } - else if ((flags & ImGuiButtonFlags_MouseButtonRight) && IsMouseClicked(1, test_owner_id)) { mouse_button_clicked = 1; } - else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && IsMouseClicked(2, test_owner_id)) { mouse_button_clicked = 2; } if (mouse_button_clicked != -1 && g.ActiveId != id) { if (!(flags & ImGuiButtonFlags_NoSetKeyOwner)) @@ -578,10 +586,6 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool } if (flags & ImGuiButtonFlags_PressedOnRelease) { - int mouse_button_released = -1; - if ((flags & ImGuiButtonFlags_MouseButtonLeft) && IsMouseReleased(0, test_owner_id)) { mouse_button_released = 0; } - else if ((flags & ImGuiButtonFlags_MouseButtonRight) && IsMouseReleased(1, test_owner_id)) { mouse_button_released = 1; } - else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && IsMouseReleased(2, test_owner_id)) { mouse_button_released = 2; } if (mouse_button_released != -1) { const bool has_repeated_at_least_once = (flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[mouse_button_released] >= g.IO.KeyRepeatDelay; // Repeat mode trumps on release behavior @@ -1473,7 +1477,7 @@ void ImGui::Separator() } // Using 'hover_visibility_delay' allows us to hide the highlight and mouse cursor for a short time, which can be convenient to reduce visual noise. -bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend, float hover_visibility_delay) +bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend, float hover_visibility_delay, ImU32 bg_col) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; @@ -1521,7 +1525,9 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float } } - // Render + // Render at new position + if (bg_col & IM_COL32_A_MASK) + window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, bg_col, 0.0f); const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : (hovered && g.HoveredIdTimer >= hover_visibility_delay) ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator); window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, 0.0f); @@ -3578,9 +3584,9 @@ static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** return line_count; } -static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line) +static ImVec2 InputTextCalcTextSizeW(ImGuiContext* ctx, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *ctx; ImFont* font = g.Font; const float line_height = g.FontSize; const float scale = line_height / font->FontSize; @@ -3629,14 +3635,14 @@ namespace ImStb static int STB_TEXTEDIT_STRINGLEN(const ImGuiInputTextState* obj) { return obj->CurLenW; } static ImWchar STB_TEXTEDIT_GETCHAR(const ImGuiInputTextState* obj, int idx) { return obj->TextW[idx]; } -static float STB_TEXTEDIT_GETWIDTH(ImGuiInputTextState* obj, int line_start_idx, int char_idx) { ImWchar c = obj->TextW[line_start_idx + char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *GImGui; return g.Font->GetCharAdvance(c) * (g.FontSize / g.Font->FontSize); } +static float STB_TEXTEDIT_GETWIDTH(ImGuiInputTextState* obj, int line_start_idx, int char_idx) { ImWchar c = obj->TextW[line_start_idx + char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *obj->Ctx; return g.Font->GetCharAdvance(c) * (g.FontSize / g.Font->FontSize); } static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x200000 ? 0 : key; } static ImWchar STB_TEXTEDIT_NEWLINE = '\n'; static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTextState* obj, int line_start_idx) { const ImWchar* text = obj->TextW.Data; const ImWchar* text_remaining = NULL; - const ImVec2 size = InputTextCalcTextSizeW(text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true); + const ImVec2 size = InputTextCalcTextSizeW(obj->Ctx, text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true); r->x0 = 0.0f; r->x1 = size.x; r->baseline_y_delta = size.y; @@ -3652,7 +3658,7 @@ static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; } static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; } static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; } -static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(ImGuiInputTextState* obj, int idx) { if (ImGui::GetIO().ConfigMacOSXBehaviors) return STB_TEXTEDIT_MOVEWORDRIGHT_MAC(obj, idx); else return STB_TEXTEDIT_MOVEWORDRIGHT_WIN(obj, idx); } +static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(ImGuiInputTextState* obj, int idx) { ImGuiContext& g = *obj->Ctx; if (g.IO.ConfigMacOSXBehaviors) return STB_TEXTEDIT_MOVEWORDRIGHT_MAC(obj, idx); else return STB_TEXTEDIT_MOVEWORDRIGHT_WIN(obj, idx); } #define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h #define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL @@ -4416,12 +4422,10 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ const int clipboard_len = (int)strlen(clipboard); ImWchar* clipboard_filtered = (ImWchar*)IM_ALLOC((clipboard_len + 1) * sizeof(ImWchar)); int clipboard_filtered_len = 0; - for (const char* s = clipboard; *s; ) + for (const char* s = clipboard; *s != 0; ) { unsigned int c; s += ImTextCharFromUtf8(&c, s, NULL); - if (c == 0) - break; if (!InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Clipboard)) continue; clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c; @@ -4690,11 +4694,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ searches_result_line_no[1] = line_count; // Calculate 2d position by finding the beginning of the line and measuring distance - cursor_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[0], text_begin), searches_input_ptr[0]).x; + cursor_offset.x = InputTextCalcTextSizeW(&g, ImStrbolW(searches_input_ptr[0], text_begin), searches_input_ptr[0]).x; cursor_offset.y = searches_result_line_no[0] * g.FontSize; if (searches_result_line_no[1] >= 0) { - select_start_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[1], text_begin), searches_input_ptr[1]).x; + select_start_offset.x = InputTextCalcTextSizeW(&g, ImStrbolW(searches_input_ptr[1], text_begin), searches_input_ptr[1]).x; select_start_offset.y = searches_result_line_no[1] * g.FontSize; } @@ -4763,7 +4767,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } else { - ImVec2 rect_size = InputTextCalcTextSizeW(p, text_selected_end, &p, NULL, true); + ImVec2 rect_size = InputTextCalcTextSizeW(&g, p, text_selected_end, &p, NULL, true); if (rect_size.x <= 0.0f) rect_size.x = IM_FLOOR(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos + ImVec2(rect_size.x, bg_offy_dn)); rect.ClipWith(clip_rect); @@ -4871,6 +4875,7 @@ void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state) Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId); DebugLocateItemOnHover(state->ID); Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenA, state->CurLenW, stb_state->cursor, stb_state->select_start, stb_state->select_end); + Text("has_preferred_x: %d (%.2f)", stb_state->has_preferred_x, stb_state->preferred_x); Text("undo_point: %d, redo_point: %d, undo_char_point: %d, redo_char_point: %d", undo_state->undo_point, undo_state->redo_point, undo_state->undo_char_point, undo_state->redo_char_point); if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 15), true)) // Visualize undo state { @@ -6382,8 +6387,6 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_ToggledSelection; // Render - if (held && (flags & ImGuiSelectableFlags_DrawHoveredWhenHeld)) - hovered = true; if (hovered || selected) { const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); @@ -7318,7 +7321,7 @@ struct ImGuiTabBarSection namespace ImGui { static void TabBarLayout(ImGuiTabBar* tab_bar); - static ImU32 TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label); + static ImU32 TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label, ImGuiWindow* docked_window); static float TabBarCalcMaxTabWidth(); static float TabBarScrollClamp(ImGuiTabBar* tab_bar, float scrolling); static void TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGuiTabBarSection* sections); @@ -7711,9 +7714,11 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) window->DC.IdealMaxPos.x = ImMax(window->DC.IdealMaxPos.x, tab_bar->BarRect.Min.x + tab_bar->WidthAllTabsIdeal); } -// Dockables uses Name/ID in the global namespace. Non-dockable items use the ID stack. -static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label) +// Dockable windows uses Name/ID in the global namespace. Non-dockable items use the ID stack. +static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label, ImGuiWindow* docked_window) { + IM_ASSERT(docked_window == NULL); // master branch only + IM_UNUSED(docked_window); if (tab_bar->Flags & ImGuiTabBarFlags_DockNode) { ImGuiID id = ImHashStr(label); @@ -8020,7 +8025,7 @@ bool ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags f } IM_ASSERT(!(flags & ImGuiTabItemFlags_Button)); // BeginTabItem() Can't be used with button flags, use TabItemButton() instead! - bool ret = TabItemEx(tab_bar, label, p_open, flags); + bool ret = TabItemEx(tab_bar, label, p_open, flags, NULL); if (ret && !(flags & ImGuiTabItemFlags_NoPushId)) { ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx]; @@ -8061,10 +8066,10 @@ bool ImGui::TabItemButton(const char* label, ImGuiTabItemFlags flags) IM_ASSERT_USER_ERROR(tab_bar != NULL, "Needs to be called between BeginTabBar() and EndTabBar()!"); return false; } - return TabItemEx(tab_bar, label, NULL, flags | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder); + return TabItemEx(tab_bar, label, NULL, flags | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder, NULL); } -bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags) +bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window) { // Layout whole tab bar if not already done ImGuiContext& g = *GImGui; @@ -8079,7 +8084,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, return false; const ImGuiStyle& style = g.Style; - const ImGuiID id = TabBarCalcTabID(tab_bar, label); + const ImGuiID id = TabBarCalcTabID(tab_bar, label, docked_window); // If the user called us with *p_open == false, we early out and don't render. // We make a call to ItemAdd() so that attempts to use a contextual popup menu with an implicit ID won't use an older ID. @@ -8129,9 +8134,16 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, tab->LastFrameVisible = g.FrameCount; tab->Flags = flags; - // Append name with zero-terminator - tab->NameOffset = (ImS32)tab_bar->TabsNames.size(); - tab_bar->TabsNames.append(label, label + strlen(label) + 1); + // Append name _WITH_ the zero-terminator + if (docked_window != NULL) + { + IM_ASSERT(docked_window == NULL); // master branch only + } + else + { + tab->NameOffset = (ImS32)tab_bar->TabsNames.size(); + tab_bar->TabsNames.append(label, label + strlen(label) + 1); + } // Update selected tab if (!is_tab_button) @@ -8294,7 +8306,7 @@ void ImGui::SetTabItemClosed(const char* label) if (is_within_manual_tab_bar) { ImGuiTabBar* tab_bar = g.CurrentTabBar; - ImGuiID tab_id = TabBarCalcTabID(tab_bar, label); + ImGuiID tab_id = TabBarCalcTabID(tab_bar, label, NULL); if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id)) tab->WantClose = true; // Will be processed by next call to TabBarLayout() } @@ -8312,6 +8324,12 @@ ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button_or_unsave return ImVec2(ImMin(size.x, TabBarCalcMaxTabWidth()), size.y); } +ImVec2 ImGui::TabItemCalcSize(ImGuiWindow*) +{ + IM_ASSERT(0); // This function exists to facilitate merge with 'docking' branch. + return ImVec2(0.0f, 0.0f); +} + void ImGui::TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col) { // While rendering tabs, we trim 1 pixel off the top of our bounding box so they can fit within a regular frame height while looking "detached" from it. From 43612983390d248b0ed1a764b9f8c7b16194ed32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 14 Jan 2023 20:57:53 -0800 Subject: [PATCH 16/86] Updated Vulkan headers. --- 3rdparty/khronos/vulkan-local/vk_icd.h | 24 +- 3rdparty/khronos/vulkan-local/vk_layer.h | 11 +- .../khronos/vulkan-local/vk_sdk_platform.h | 24 +- 3rdparty/khronos/vulkan-local/vulkan_beta.h | 461 ------------ 3rdparty/khronos/vulkan-local/vulkan_core.h | 661 ++++++++++++++---- 3rdparty/khronos/vulkan-local/vulkan_win32.h | 18 + 6 files changed, 569 insertions(+), 630 deletions(-) diff --git a/3rdparty/khronos/vulkan-local/vk_icd.h b/3rdparty/khronos/vulkan-local/vk_icd.h index 44b15277f..1133fa367 100644 --- a/3rdparty/khronos/vulkan-local/vk_icd.h +++ b/3rdparty/khronos/vulkan-local/vk_icd.h @@ -2,9 +2,9 @@ // File: vk_icd.h // /* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. + * Copyright (c) 2015-2023 LunarG, Inc. + * Copyright (c) 2015-2023 The Khronos Group Inc. + * Copyright (c) 2015-2023 Valve Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,7 @@ * limitations under the License. * */ - -#ifndef VKICD_H -#define VKICD_H +#pragma once #include "vulkan.h" #include @@ -42,7 +40,17 @@ // call for any API version > 1.0. Otherwise, the loader will // manually determine if it can support the expected version. // Version 6 - Add support for vk_icdEnumerateAdapterPhysicalDevices. -#define CURRENT_LOADER_ICD_INTERFACE_VERSION 6 +// Version 7 - If an ICD supports any of the following functions, they must be +// queryable with vk_icdGetInstanceProcAddr: +// vk_icdNegotiateLoaderICDInterfaceVersion +// vk_icdGetPhysicalDeviceProcAddr +// vk_icdEnumerateAdapterPhysicalDevices (Windows only) +// In addition, these functions no longer need to be exported directly. +// This version allows drivers provided through the extension +// VK_LUNARG_direct_driver_loading be able to support the entire +// Driver-Loader interface. + +#define CURRENT_LOADER_ICD_INTERFACE_VERSION 7 #define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0 #define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4 @@ -248,5 +256,3 @@ typedef struct { VkIcdSurfaceBase base; } VkIcdSurfaceImagePipe; #endif // VK_USE_PLATFORM_FUCHSIA - -#endif // VKICD_H diff --git a/3rdparty/khronos/vulkan-local/vk_layer.h b/3rdparty/khronos/vulkan-local/vk_layer.h index 0651870c7..6bd1c9a03 100644 --- a/3rdparty/khronos/vulkan-local/vk_layer.h +++ b/3rdparty/khronos/vulkan-local/vk_layer.h @@ -2,9 +2,9 @@ // File: vk_layer.h // /* - * Copyright (c) 2015-2017 The Khronos Group Inc. - * Copyright (c) 2015-2017 Valve Corporation - * Copyright (c) 2015-2017 LunarG, Inc. + * Copyright (c) 2015-2023 LunarG, Inc. + * Copyright (c) 2015-2023 The Khronos Group Inc. + * Copyright (c) 2015-2023 Valve Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,15 @@ * limitations under the License. * */ +#pragma once /* Need to define dispatch table * Core struct can then have ptr to dispatch table at the top * Along with object ptrs for current and next OBJ */ -#pragma once -#include "vulkan.h" +#include "vulkan_core.h" + #if defined(__GNUC__) && __GNUC__ >= 4 #define VK_LAYER_EXPORT __attribute__((visibility("default"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) diff --git a/3rdparty/khronos/vulkan-local/vk_sdk_platform.h b/3rdparty/khronos/vulkan-local/vk_sdk_platform.h index f192c1c61..3bdf5057b 100644 --- a/3rdparty/khronos/vulkan-local/vk_sdk_platform.h +++ b/3rdparty/khronos/vulkan-local/vk_sdk_platform.h @@ -2,9 +2,9 @@ // File: vk_sdk_platform.h // /* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. + * Copyright (c) 2015-2023 LunarG, Inc. + * Copyright (c) 2015-2023 The Khronos Group Inc. + * Copyright (c) 2015-2023 Valve Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#pragma once -#ifndef VK_SDK_PLATFORM_H -#define VK_SDK_PLATFORM_H +// Allow users to suppress warnings generated by this header file by defining VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING +#ifndef VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING + +#if defined(__GNUC__) && __GNUC__ >= 4 +#warning "vk_sdk_platform.h is deprecated and will be removed in future release! Use VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING to suppress warning!" +#endif + +// MSVC doesn't support warning directive +#if defined(_MSC_VER) +#pragma message("vk_sdk_platform.h is deprecated and will be removed in future release! Use VK_SDK_PLATFORM_SUPRRESS_DEPRECATION_WARNING to suppress warning!") +#endif + +#endif #if defined(_WIN32) #ifndef NOMINMAX @@ -67,5 +79,3 @@ #define NOEXCEPT #endif #endif - -#endif // VK_SDK_PLATFORM_H diff --git a/3rdparty/khronos/vulkan-local/vulkan_beta.h b/3rdparty/khronos/vulkan-local/vulkan_beta.h index db511024f..cfeda0eb3 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_beta.h +++ b/3rdparty/khronos/vulkan-local/vulkan_beta.h @@ -19,356 +19,6 @@ extern "C" { -#define VK_KHR_video_queue 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) -#define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 7 -#define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue" - -typedef enum VkQueryResultStatusKHR { - VK_QUERY_RESULT_STATUS_ERROR_KHR = -1, - VK_QUERY_RESULT_STATUS_NOT_READY_KHR = 0, - VK_QUERY_RESULT_STATUS_COMPLETE_KHR = 1, - VK_QUERY_RESULT_STATUS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkQueryResultStatusKHR; - -typedef enum VkVideoCodecOperationFlagBitsKHR { - VK_VIDEO_CODEC_OPERATION_NONE_KHR = 0, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT = 0x00010000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT = 0x00020000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_EXT = 0x00000001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_EXT = 0x00000002, -#endif - VK_VIDEO_CODEC_OPERATION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoCodecOperationFlagBitsKHR; -typedef VkFlags VkVideoCodecOperationFlagsKHR; - -typedef enum VkVideoChromaSubsamplingFlagBitsKHR { - VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR = 0, - VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR = 0x00000001, - VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR = 0x00000002, - VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR = 0x00000004, - VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR = 0x00000008, - VK_VIDEO_CHROMA_SUBSAMPLING_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoChromaSubsamplingFlagBitsKHR; -typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; - -typedef enum VkVideoComponentBitDepthFlagBitsKHR { - VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR = 0, - VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR = 0x00000001, - VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR = 0x00000004, - VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR = 0x00000010, - VK_VIDEO_COMPONENT_BIT_DEPTH_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoComponentBitDepthFlagBitsKHR; -typedef VkFlags VkVideoComponentBitDepthFlagsKHR; - -typedef enum VkVideoCapabilityFlagBitsKHR { - VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR = 0x00000001, - VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR = 0x00000002, - VK_VIDEO_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoCapabilityFlagBitsKHR; -typedef VkFlags VkVideoCapabilityFlagsKHR; - -typedef enum VkVideoSessionCreateFlagBitsKHR { - VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0x00000001, - VK_VIDEO_SESSION_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoSessionCreateFlagBitsKHR; -typedef VkFlags VkVideoSessionCreateFlagsKHR; -typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; -typedef VkFlags VkVideoBeginCodingFlagsKHR; -typedef VkFlags VkVideoEndCodingFlagsKHR; - -typedef enum VkVideoCodingControlFlagBitsKHR { - VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR = 0x00000001, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0x00000002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_LAYER_BIT_KHR = 0x00000004, -#endif - VK_VIDEO_CODING_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoCodingControlFlagBitsKHR; -typedef VkFlags VkVideoCodingControlFlagsKHR; -typedef struct VkQueueFamilyQueryResultStatusPropertiesKHR { - VkStructureType sType; - void* pNext; - VkBool32 queryResultStatusSupport; -} VkQueueFamilyQueryResultStatusPropertiesKHR; - -typedef struct VkQueueFamilyVideoPropertiesKHR { - VkStructureType sType; - void* pNext; - VkVideoCodecOperationFlagsKHR videoCodecOperations; -} VkQueueFamilyVideoPropertiesKHR; - -typedef struct VkVideoProfileInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoCodecOperationFlagBitsKHR videoCodecOperation; - VkVideoChromaSubsamplingFlagsKHR chromaSubsampling; - VkVideoComponentBitDepthFlagsKHR lumaBitDepth; - VkVideoComponentBitDepthFlagsKHR chromaBitDepth; -} VkVideoProfileInfoKHR; - -typedef struct VkVideoProfileListInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t profileCount; - const VkVideoProfileInfoKHR* pProfiles; -} VkVideoProfileListInfoKHR; - -typedef struct VkVideoCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkVideoCapabilityFlagsKHR flags; - VkDeviceSize minBitstreamBufferOffsetAlignment; - VkDeviceSize minBitstreamBufferSizeAlignment; - VkExtent2D pictureAccessGranularity; - VkExtent2D minCodedExtent; - VkExtent2D maxCodedExtent; - uint32_t maxDpbSlots; - uint32_t maxActiveReferencePictures; - VkExtensionProperties stdHeaderVersion; -} VkVideoCapabilitiesKHR; - -typedef struct VkPhysicalDeviceVideoFormatInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageUsageFlags imageUsage; -} VkPhysicalDeviceVideoFormatInfoKHR; - -typedef struct VkVideoFormatPropertiesKHR { - VkStructureType sType; - void* pNext; - VkFormat format; - VkComponentMapping componentMapping; - VkImageCreateFlags imageCreateFlags; - VkImageType imageType; - VkImageTiling imageTiling; - VkImageUsageFlags imageUsageFlags; -} VkVideoFormatPropertiesKHR; - -typedef struct VkVideoPictureResourceInfoKHR { - VkStructureType sType; - const void* pNext; - VkOffset2D codedOffset; - VkExtent2D codedExtent; - uint32_t baseArrayLayer; - VkImageView imageViewBinding; -} VkVideoPictureResourceInfoKHR; - -typedef struct VkVideoReferenceSlotInfoKHR { - VkStructureType sType; - const void* pNext; - int32_t slotIndex; - const VkVideoPictureResourceInfoKHR* pPictureResource; -} VkVideoReferenceSlotInfoKHR; - -typedef struct VkVideoSessionMemoryRequirementsKHR { - VkStructureType sType; - void* pNext; - uint32_t memoryBindIndex; - VkMemoryRequirements memoryRequirements; -} VkVideoSessionMemoryRequirementsKHR; - -typedef struct VkBindVideoSessionMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t memoryBindIndex; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkDeviceSize memorySize; -} VkBindVideoSessionMemoryInfoKHR; - -typedef struct VkVideoSessionCreateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t queueFamilyIndex; - VkVideoSessionCreateFlagsKHR flags; - const VkVideoProfileInfoKHR* pVideoProfile; - VkFormat pictureFormat; - VkExtent2D maxCodedExtent; - VkFormat referencePictureFormat; - uint32_t maxDpbSlots; - uint32_t maxActiveReferencePictures; - const VkExtensionProperties* pStdHeaderVersion; -} VkVideoSessionCreateInfoKHR; - -typedef struct VkVideoSessionParametersCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoSessionParametersCreateFlagsKHR flags; - VkVideoSessionParametersKHR videoSessionParametersTemplate; - VkVideoSessionKHR videoSession; -} VkVideoSessionParametersCreateInfoKHR; - -typedef struct VkVideoSessionParametersUpdateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t updateSequenceCount; -} VkVideoSessionParametersUpdateInfoKHR; - -typedef struct VkVideoBeginCodingInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoBeginCodingFlagsKHR flags; - VkVideoSessionKHR videoSession; - VkVideoSessionParametersKHR videoSessionParameters; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR* pReferenceSlots; -} VkVideoBeginCodingInfoKHR; - -typedef struct VkVideoEndCodingInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEndCodingFlagsKHR flags; -} VkVideoEndCodingInfoKHR; - -typedef struct VkVideoCodingControlInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoCodingControlFlagsKHR flags; -} VkVideoCodingControlInfoKHR; - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR)(VkPhysicalDevice physicalDevice, const VkVideoProfileInfoKHR* pVideoProfile, VkVideoCapabilitiesKHR* pCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties); -typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionKHR)(VkDevice device, const VkVideoSessionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionKHR* pVideoSession); -typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionKHR)(VkDevice device, VkVideoSessionKHR videoSession, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetVideoSessionMemoryRequirementsKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); -typedef VkResult (VKAPI_PTR *PFN_vkBindVideoSessionMemoryKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t bindSessionMemoryInfoCount, const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); -typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionParametersKHR)(VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters); -typedef VkResult (VKAPI_PTR *PFN_vkUpdateVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); -typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkCmdBeginVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR* pBeginInfo); -typedef void (VKAPI_PTR *PFN_vkCmdEndVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR* pEndCodingInfo); -typedef void (VKAPI_PTR *PFN_vkCmdControlVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR* pCodingControlInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoCapabilitiesKHR( - VkPhysicalDevice physicalDevice, - const VkVideoProfileInfoKHR* pVideoProfile, - VkVideoCapabilitiesKHR* pCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoFormatPropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, - uint32_t* pVideoFormatPropertyCount, - VkVideoFormatPropertiesKHR* pVideoFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionKHR( - VkDevice device, - const VkVideoSessionCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkVideoSessionKHR* pVideoSession); - -VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionKHR( - VkDevice device, - VkVideoSessionKHR videoSession, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetVideoSessionMemoryRequirementsKHR( - VkDevice device, - VkVideoSessionKHR videoSession, - uint32_t* pMemoryRequirementsCount, - VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); - -VKAPI_ATTR VkResult VKAPI_CALL vkBindVideoSessionMemoryKHR( - VkDevice device, - VkVideoSessionKHR videoSession, - uint32_t bindSessionMemoryInfoCount, - const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionParametersKHR( - VkDevice device, - const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkVideoSessionParametersKHR* pVideoSessionParameters); - -VKAPI_ATTR VkResult VKAPI_CALL vkUpdateVideoSessionParametersKHR( - VkDevice device, - VkVideoSessionParametersKHR videoSessionParameters, - const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); - -VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionParametersKHR( - VkDevice device, - VkVideoSessionParametersKHR videoSessionParameters, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkCmdBeginVideoCodingKHR( - VkCommandBuffer commandBuffer, - const VkVideoBeginCodingInfoKHR* pBeginInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdEndVideoCodingKHR( - VkCommandBuffer commandBuffer, - const VkVideoEndCodingInfoKHR* pEndCodingInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdControlVideoCodingKHR( - VkCommandBuffer commandBuffer, - const VkVideoCodingControlInfoKHR* pCodingControlInfo); -#endif - - -#define VK_KHR_video_decode_queue 1 -#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 6 -#define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue" - -typedef enum VkVideoDecodeCapabilityFlagBitsKHR { - VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0x00000001, - VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0x00000002, - VK_VIDEO_DECODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoDecodeCapabilityFlagBitsKHR; -typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; - -typedef enum VkVideoDecodeUsageFlagBitsKHR { - VK_VIDEO_DECODE_USAGE_DEFAULT_KHR = 0, - VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, - VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR = 0x00000002, - VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR = 0x00000004, - VK_VIDEO_DECODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoDecodeUsageFlagBitsKHR; -typedef VkFlags VkVideoDecodeUsageFlagsKHR; -typedef VkFlags VkVideoDecodeFlagsKHR; -typedef struct VkVideoDecodeCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkVideoDecodeCapabilityFlagsKHR flags; -} VkVideoDecodeCapabilitiesKHR; - -typedef struct VkVideoDecodeUsageInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoDecodeUsageFlagsKHR videoUsageHints; -} VkVideoDecodeUsageInfoKHR; - -typedef struct VkVideoDecodeInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoDecodeFlagsKHR flags; - VkBuffer srcBuffer; - VkDeviceSize srcBufferOffset; - VkDeviceSize srcBufferRange; - VkVideoPictureResourceInfoKHR dstPictureResource; - const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR* pReferenceSlots; -} VkVideoDecodeInfoKHR; - -typedef void (VKAPI_PTR *PFN_vkCmdDecodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pDecodeInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdDecodeVideoKHR( - VkCommandBuffer commandBuffer, - const VkVideoDecodeInfoKHR* pDecodeInfo); -#endif - - #define VK_KHR_portability_subset 1 #define VK_KHR_PORTABILITY_SUBSET_SPEC_VERSION 1 #define VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME "VK_KHR_portability_subset" @@ -896,117 +546,6 @@ typedef struct VkVideoEncodeH265RateControlLayerInfoEXT { } VkVideoEncodeH265RateControlLayerInfoEXT; - -#define VK_EXT_video_decode_h264 1 -#include "vk_video/vulkan_video_codec_h264std_decode.h" -#define VK_EXT_VIDEO_DECODE_H264_SPEC_VERSION 7 -#define VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME "VK_EXT_video_decode_h264" - -typedef enum VkVideoDecodeH264PictureLayoutFlagBitsEXT { - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_EXT = 0, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_EXT = 0x00000001, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_EXT = 0x00000002, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoDecodeH264PictureLayoutFlagBitsEXT; -typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsEXT; -typedef struct VkVideoDecodeH264ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH264ProfileIdc stdProfileIdc; - VkVideoDecodeH264PictureLayoutFlagBitsEXT pictureLayout; -} VkVideoDecodeH264ProfileInfoEXT; - -typedef struct VkVideoDecodeH264CapabilitiesEXT { - VkStructureType sType; - void* pNext; - StdVideoH264LevelIdc maxLevelIdc; - VkOffset2D fieldOffsetGranularity; -} VkVideoDecodeH264CapabilitiesEXT; - -typedef struct VkVideoDecodeH264SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t stdSPSCount; - const StdVideoH264SequenceParameterSet* pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH264PictureParameterSet* pStdPPSs; -} VkVideoDecodeH264SessionParametersAddInfoEXT; - -typedef struct VkVideoDecodeH264SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoDecodeH264SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoDecodeH264SessionParametersCreateInfoEXT; - -typedef struct VkVideoDecodeH264PictureInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoDecodeH264PictureInfo* pStdPictureInfo; - uint32_t sliceCount; - const uint32_t* pSliceOffsets; -} VkVideoDecodeH264PictureInfoEXT; - -typedef struct VkVideoDecodeH264DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoDecodeH264ReferenceInfo* pStdReferenceInfo; -} VkVideoDecodeH264DpbSlotInfoEXT; - - - -#define VK_EXT_video_decode_h265 1 -#include "vk_video/vulkan_video_codec_h265std_decode.h" -#define VK_EXT_VIDEO_DECODE_H265_SPEC_VERSION 5 -#define VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME "VK_EXT_video_decode_h265" -typedef struct VkVideoDecodeH265ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoDecodeH265ProfileInfoEXT; - -typedef struct VkVideoDecodeH265CapabilitiesEXT { - VkStructureType sType; - void* pNext; - StdVideoH265LevelIdc maxLevelIdc; -} VkVideoDecodeH265CapabilitiesEXT; - -typedef struct VkVideoDecodeH265SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t stdVPSCount; - const StdVideoH265VideoParameterSet* pStdVPSs; - uint32_t stdSPSCount; - const StdVideoH265SequenceParameterSet* pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH265PictureParameterSet* pStdPPSs; -} VkVideoDecodeH265SessionParametersAddInfoEXT; - -typedef struct VkVideoDecodeH265SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxStdVPSCount; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoDecodeH265SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoDecodeH265SessionParametersCreateInfoEXT; - -typedef struct VkVideoDecodeH265PictureInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoDecodeH265PictureInfo* pStdPictureInfo; - uint32_t sliceCount; - const uint32_t* pSliceOffsets; -} VkVideoDecodeH265PictureInfoEXT; - -typedef struct VkVideoDecodeH265DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoDecodeH265ReferenceInfo* pStdReferenceInfo; -} VkVideoDecodeH265DpbSlotInfoEXT; - - #ifdef __cplusplus } #endif diff --git a/3rdparty/khronos/vulkan-local/vulkan_core.h b/3rdparty/khronos/vulkan-local/vulkan_core.h index b9c5e254d..b2da59953 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_core.h +++ b/3rdparty/khronos/vulkan-local/vulkan_core.h @@ -72,7 +72,7 @@ extern "C" { #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 235 +#define VK_HEADER_VERSION 238 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) @@ -168,24 +168,12 @@ typedef enum VkResult { VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, VK_ERROR_INVALID_SHADER_NV = -1000012000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR = -1000023000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR = -1000023001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR = -1000023002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR = -1000023003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR = -1000023004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR = -1000023005, -#endif VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = -1000158000, VK_ERROR_NOT_PERMITTED_KHR = -1000174001, VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT = -1000255000, @@ -443,66 +431,26 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR = 1000023000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR = 1000023001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR = 1000023002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR = 1000023003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR = 1000023004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR = 1000023005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000023006, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR = 1000023007, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR = 1000023008, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR = 1000023009, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR = 1000023010, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR = 1000023011, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR = 1000023012, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR = 1000023013, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR = 1000023014, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR = 1000023015, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR = 1000023016, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR = 1000024000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR = 1000024001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR = 1000024002, -#endif VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, @@ -580,24 +528,12 @@ typedef enum VkStructureType { #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT = 1000039010, #endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT = 1000040000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT = 1000040001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_EXT = 1000040003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000040004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT = 1000040005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT = 1000040006, -#endif + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR = 1000040000, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR = 1000040001, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR = 1000040003, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000040004, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR = 1000040005, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR = 1000040006, VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000044006, VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT = 1000044007, @@ -760,24 +696,12 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = 1000183000, VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT = 1000187000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000187001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT = 1000187002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_EXT = 1000187003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT = 1000187004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT = 1000187005, -#endif + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR = 1000187000, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000187001, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR = 1000187002, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR = 1000187003, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR = 1000187004, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR = 1000187005, VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR = 1000174000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR = 1000388000, VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR = 1000388001, @@ -854,6 +778,15 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR = 1000269004, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR = 1000269005, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT = 1000273000, + VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT = 1000274000, + VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT = 1000274001, + VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT = 1000274002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT = 1000275000, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT = 1000275001, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT = 1000275002, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT = 1000275003, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT = 1000275004, + VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT = 1000275005, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV = 1000277000, VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV = 1000277001, VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV = 1000277002, @@ -1039,6 +972,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT = 1000458001, VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT = 1000458002, VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT = 1000458003, + VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_INFO_LUNARG = 1000459000, + VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_LIST_LUNARG = 1000459001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT = 1000462000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT = 1000462001, VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT = 1000462002, @@ -1057,6 +992,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM = 1000484001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC = 1000485000, VK_STRUCTURE_TYPE_AMIGO_PROFILING_SUBMIT_INFO_SEC = 1000485001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM = 1000488000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV = 1000490000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV = 1000490001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT = 1000351000, @@ -1263,15 +1199,9 @@ typedef enum VkImageLayout { VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL = 1000314000, VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL = 1000314001, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR = 1000024000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR = 1000024001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR = 1000024002, -#endif VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT = 1000218000, VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR = 1000164003, @@ -1332,12 +1262,8 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_OBJECT_TYPE_VIDEO_SESSION_KHR = 1000023000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR = 1000023001, -#endif VK_OBJECT_TYPE_CU_MODULE_NVX = 1000029000, VK_OBJECT_TYPE_CU_FUNCTION_NVX = 1000029001, VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000, @@ -1713,9 +1639,7 @@ typedef enum VkQueryType { VK_QUERY_TYPE_OCCLUSION = 0, VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, VK_QUERY_TYPE_TIMESTAMP = 2, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR = 1000023000, -#endif VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004, VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR = 1000116000, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR = 1000150000, @@ -2196,12 +2120,8 @@ typedef enum VkFormatFeatureFlagBits { VK_FORMAT_FEATURE_DISJOINT_BIT = 0x00400000, VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 0x00800000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR = 0x02000000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR = 0x04000000, -#endif VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000, VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000, @@ -2278,15 +2198,9 @@ typedef enum VkImageUsageFlagBits { VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR = 0x00000400, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR = 0x00000800, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR = 0x00001000, -#endif VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x00000200, VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00000100, #ifdef VK_ENABLE_BETA_EXTENSIONS @@ -2341,9 +2255,7 @@ typedef enum VkQueueFlagBits { VK_QUEUE_TRANSFER_BIT = 0x00000004, VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, VK_QUEUE_PROTECTED_BIT = 0x00000010, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUEUE_VIDEO_DECODE_BIT_KHR = 0x00000020, -#endif #ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUEUE_VIDEO_ENCODE_BIT_KHR = 0x00000040, #endif @@ -2450,9 +2362,7 @@ typedef enum VkQueryResultFlagBits { VK_QUERY_RESULT_WAIT_BIT = 0x00000002, VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUERY_RESULT_WITH_STATUS_BIT_KHR = 0x00000010, -#endif VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkQueryResultFlagBits; typedef VkFlags VkQueryResultFlags; @@ -2481,12 +2391,8 @@ typedef enum VkBufferUsageFlagBits { VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT = 0x00020000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR = 0x00002000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR = 0x00004000, -#endif VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800, VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000, VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200, @@ -6547,9 +6453,7 @@ static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR = 0x2000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT = 0x4000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR = 0x4000000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR = 0x04000000ULL; -#endif #ifdef VK_ENABLE_BETA_EXTENSIONS static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR = 0x08000000ULL; #endif @@ -6619,12 +6523,8 @@ static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT = 0x200000000 static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR = 0x200000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT = 0x400000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR = 0x400000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR = 0x800000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR = 0x1000000000ULL; -#endif #ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR = 0x2000000000ULL; #endif @@ -6730,12 +6630,8 @@ static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_ static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR = 0x100000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT = 0x200000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR = 0x200000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR = 0x02000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR = 0x04000000ULL; -#endif static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000ULL; @@ -7629,6 +7525,7 @@ typedef enum VkSwapchainCreateFlagBitsKHR { VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0x00000001, VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR = 0x00000004, + VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT = 0x00000008, VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkSwapchainCreateFlagBitsKHR; typedef VkFlags VkSwapchainCreateFlagsKHR; @@ -7932,6 +7829,352 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR( #define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" +#define VK_KHR_video_queue 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) +#define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 8 +#define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue" + +typedef enum VkQueryResultStatusKHR { + VK_QUERY_RESULT_STATUS_ERROR_KHR = -1, + VK_QUERY_RESULT_STATUS_NOT_READY_KHR = 0, + VK_QUERY_RESULT_STATUS_COMPLETE_KHR = 1, + VK_QUERY_RESULT_STATUS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkQueryResultStatusKHR; + +typedef enum VkVideoCodecOperationFlagBitsKHR { + VK_VIDEO_CODEC_OPERATION_NONE_KHR = 0, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT = 0x00010000, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT = 0x00020000, +#endif + VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR = 0x00000001, + VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR = 0x00000002, + VK_VIDEO_CODEC_OPERATION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoCodecOperationFlagBitsKHR; +typedef VkFlags VkVideoCodecOperationFlagsKHR; + +typedef enum VkVideoChromaSubsamplingFlagBitsKHR { + VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR = 0, + VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR = 0x00000001, + VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR = 0x00000002, + VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR = 0x00000004, + VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR = 0x00000008, + VK_VIDEO_CHROMA_SUBSAMPLING_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoChromaSubsamplingFlagBitsKHR; +typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; + +typedef enum VkVideoComponentBitDepthFlagBitsKHR { + VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR = 0, + VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR = 0x00000001, + VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR = 0x00000004, + VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR = 0x00000010, + VK_VIDEO_COMPONENT_BIT_DEPTH_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoComponentBitDepthFlagBitsKHR; +typedef VkFlags VkVideoComponentBitDepthFlagsKHR; + +typedef enum VkVideoCapabilityFlagBitsKHR { + VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR = 0x00000001, + VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR = 0x00000002, + VK_VIDEO_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoCapabilityFlagBitsKHR; +typedef VkFlags VkVideoCapabilityFlagsKHR; + +typedef enum VkVideoSessionCreateFlagBitsKHR { + VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0x00000001, + VK_VIDEO_SESSION_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoSessionCreateFlagBitsKHR; +typedef VkFlags VkVideoSessionCreateFlagsKHR; +typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; +typedef VkFlags VkVideoBeginCodingFlagsKHR; +typedef VkFlags VkVideoEndCodingFlagsKHR; + +typedef enum VkVideoCodingControlFlagBitsKHR { + VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR = 0x00000001, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0x00000002, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_LAYER_BIT_KHR = 0x00000004, +#endif + VK_VIDEO_CODING_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoCodingControlFlagBitsKHR; +typedef VkFlags VkVideoCodingControlFlagsKHR; +typedef struct VkQueueFamilyQueryResultStatusPropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 queryResultStatusSupport; +} VkQueueFamilyQueryResultStatusPropertiesKHR; + +typedef struct VkQueueFamilyVideoPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoCodecOperationFlagsKHR videoCodecOperations; +} VkQueueFamilyVideoPropertiesKHR; + +typedef struct VkVideoProfileInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoCodecOperationFlagBitsKHR videoCodecOperation; + VkVideoChromaSubsamplingFlagsKHR chromaSubsampling; + VkVideoComponentBitDepthFlagsKHR lumaBitDepth; + VkVideoComponentBitDepthFlagsKHR chromaBitDepth; +} VkVideoProfileInfoKHR; + +typedef struct VkVideoProfileListInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t profileCount; + const VkVideoProfileInfoKHR* pProfiles; +} VkVideoProfileListInfoKHR; + +typedef struct VkVideoCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoCapabilityFlagsKHR flags; + VkDeviceSize minBitstreamBufferOffsetAlignment; + VkDeviceSize minBitstreamBufferSizeAlignment; + VkExtent2D pictureAccessGranularity; + VkExtent2D minCodedExtent; + VkExtent2D maxCodedExtent; + uint32_t maxDpbSlots; + uint32_t maxActiveReferencePictures; + VkExtensionProperties stdHeaderVersion; +} VkVideoCapabilitiesKHR; + +typedef struct VkPhysicalDeviceVideoFormatInfoKHR { + VkStructureType sType; + const void* pNext; + VkImageUsageFlags imageUsage; +} VkPhysicalDeviceVideoFormatInfoKHR; + +typedef struct VkVideoFormatPropertiesKHR { + VkStructureType sType; + void* pNext; + VkFormat format; + VkComponentMapping componentMapping; + VkImageCreateFlags imageCreateFlags; + VkImageType imageType; + VkImageTiling imageTiling; + VkImageUsageFlags imageUsageFlags; +} VkVideoFormatPropertiesKHR; + +typedef struct VkVideoPictureResourceInfoKHR { + VkStructureType sType; + const void* pNext; + VkOffset2D codedOffset; + VkExtent2D codedExtent; + uint32_t baseArrayLayer; + VkImageView imageViewBinding; +} VkVideoPictureResourceInfoKHR; + +typedef struct VkVideoReferenceSlotInfoKHR { + VkStructureType sType; + const void* pNext; + int32_t slotIndex; + const VkVideoPictureResourceInfoKHR* pPictureResource; +} VkVideoReferenceSlotInfoKHR; + +typedef struct VkVideoSessionMemoryRequirementsKHR { + VkStructureType sType; + void* pNext; + uint32_t memoryBindIndex; + VkMemoryRequirements memoryRequirements; +} VkVideoSessionMemoryRequirementsKHR; + +typedef struct VkBindVideoSessionMemoryInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t memoryBindIndex; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkDeviceSize memorySize; +} VkBindVideoSessionMemoryInfoKHR; + +typedef struct VkVideoSessionCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t queueFamilyIndex; + VkVideoSessionCreateFlagsKHR flags; + const VkVideoProfileInfoKHR* pVideoProfile; + VkFormat pictureFormat; + VkExtent2D maxCodedExtent; + VkFormat referencePictureFormat; + uint32_t maxDpbSlots; + uint32_t maxActiveReferencePictures; + const VkExtensionProperties* pStdHeaderVersion; +} VkVideoSessionCreateInfoKHR; + +typedef struct VkVideoSessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoSessionParametersCreateFlagsKHR flags; + VkVideoSessionParametersKHR videoSessionParametersTemplate; + VkVideoSessionKHR videoSession; +} VkVideoSessionParametersCreateInfoKHR; + +typedef struct VkVideoSessionParametersUpdateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t updateSequenceCount; +} VkVideoSessionParametersUpdateInfoKHR; + +typedef struct VkVideoBeginCodingInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoBeginCodingFlagsKHR flags; + VkVideoSessionKHR videoSession; + VkVideoSessionParametersKHR videoSessionParameters; + uint32_t referenceSlotCount; + const VkVideoReferenceSlotInfoKHR* pReferenceSlots; +} VkVideoBeginCodingInfoKHR; + +typedef struct VkVideoEndCodingInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEndCodingFlagsKHR flags; +} VkVideoEndCodingInfoKHR; + +typedef struct VkVideoCodingControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoCodingControlFlagsKHR flags; +} VkVideoCodingControlInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR)(VkPhysicalDevice physicalDevice, const VkVideoProfileInfoKHR* pVideoProfile, VkVideoCapabilitiesKHR* pCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionKHR)(VkDevice device, const VkVideoSessionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionKHR* pVideoSession); +typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionKHR)(VkDevice device, VkVideoSessionKHR videoSession, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetVideoSessionMemoryRequirementsKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); +typedef VkResult (VKAPI_PTR *PFN_vkBindVideoSessionMemoryKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t bindSessionMemoryInfoCount, const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); +typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionParametersKHR)(VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters); +typedef VkResult (VKAPI_PTR *PFN_vkUpdateVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); +typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkCmdBeginVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR* pBeginInfo); +typedef void (VKAPI_PTR *PFN_vkCmdEndVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR* pEndCodingInfo); +typedef void (VKAPI_PTR *PFN_vkCmdControlVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR* pCodingControlInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoCapabilitiesKHR( + VkPhysicalDevice physicalDevice, + const VkVideoProfileInfoKHR* pVideoProfile, + VkVideoCapabilitiesKHR* pCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoFormatPropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, + uint32_t* pVideoFormatPropertyCount, + VkVideoFormatPropertiesKHR* pVideoFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionKHR( + VkDevice device, + const VkVideoSessionCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkVideoSessionKHR* pVideoSession); + +VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionKHR( + VkDevice device, + VkVideoSessionKHR videoSession, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetVideoSessionMemoryRequirementsKHR( + VkDevice device, + VkVideoSessionKHR videoSession, + uint32_t* pMemoryRequirementsCount, + VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindVideoSessionMemoryKHR( + VkDevice device, + VkVideoSessionKHR videoSession, + uint32_t bindSessionMemoryInfoCount, + const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionParametersKHR( + VkDevice device, + const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkVideoSessionParametersKHR* pVideoSessionParameters); + +VKAPI_ATTR VkResult VKAPI_CALL vkUpdateVideoSessionParametersKHR( + VkDevice device, + VkVideoSessionParametersKHR videoSessionParameters, + const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); + +VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionParametersKHR( + VkDevice device, + VkVideoSessionParametersKHR videoSessionParameters, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginVideoCodingKHR( + VkCommandBuffer commandBuffer, + const VkVideoBeginCodingInfoKHR* pBeginInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndVideoCodingKHR( + VkCommandBuffer commandBuffer, + const VkVideoEndCodingInfoKHR* pEndCodingInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdControlVideoCodingKHR( + VkCommandBuffer commandBuffer, + const VkVideoCodingControlInfoKHR* pCodingControlInfo); +#endif + + +#define VK_KHR_video_decode_queue 1 +#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 7 +#define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue" + +typedef enum VkVideoDecodeCapabilityFlagBitsKHR { + VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0x00000001, + VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0x00000002, + VK_VIDEO_DECODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoDecodeCapabilityFlagBitsKHR; +typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; + +typedef enum VkVideoDecodeUsageFlagBitsKHR { + VK_VIDEO_DECODE_USAGE_DEFAULT_KHR = 0, + VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, + VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR = 0x00000002, + VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR = 0x00000004, + VK_VIDEO_DECODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoDecodeUsageFlagBitsKHR; +typedef VkFlags VkVideoDecodeUsageFlagsKHR; +typedef VkFlags VkVideoDecodeFlagsKHR; +typedef struct VkVideoDecodeCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoDecodeCapabilityFlagsKHR flags; +} VkVideoDecodeCapabilitiesKHR; + +typedef struct VkVideoDecodeUsageInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoDecodeUsageFlagsKHR videoUsageHints; +} VkVideoDecodeUsageInfoKHR; + +typedef struct VkVideoDecodeInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoDecodeFlagsKHR flags; + VkBuffer srcBuffer; + VkDeviceSize srcBufferOffset; + VkDeviceSize srcBufferRange; + VkVideoPictureResourceInfoKHR dstPictureResource; + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; + uint32_t referenceSlotCount; + const VkVideoReferenceSlotInfoKHR* pReferenceSlots; +} VkVideoDecodeInfoKHR; + +typedef void (VKAPI_PTR *PFN_vkCmdDecodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pDecodeInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDecodeVideoKHR( + VkCommandBuffer commandBuffer, + const VkVideoDecodeInfoKHR* pDecodeInfo); +#endif + + #define VK_KHR_dynamic_rendering 1 #define VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION 1 #define VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME "VK_KHR_dynamic_rendering" @@ -13109,6 +13352,105 @@ typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT { +#define VK_EXT_surface_maintenance1 1 +#define VK_EXT_SURFACE_MAINTENANCE_1_SPEC_VERSION 1 +#define VK_EXT_SURFACE_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_surface_maintenance1" + +typedef enum VkPresentScalingFlagBitsEXT { + VK_PRESENT_SCALING_ONE_TO_ONE_BIT_EXT = 0x00000001, + VK_PRESENT_SCALING_ASPECT_RATIO_STRETCH_BIT_EXT = 0x00000002, + VK_PRESENT_SCALING_STRETCH_BIT_EXT = 0x00000004, + VK_PRESENT_SCALING_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkPresentScalingFlagBitsEXT; +typedef VkFlags VkPresentScalingFlagsEXT; + +typedef enum VkPresentGravityFlagBitsEXT { + VK_PRESENT_GRAVITY_MIN_BIT_EXT = 0x00000001, + VK_PRESENT_GRAVITY_MAX_BIT_EXT = 0x00000002, + VK_PRESENT_GRAVITY_CENTERED_BIT_EXT = 0x00000004, + VK_PRESENT_GRAVITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkPresentGravityFlagBitsEXT; +typedef VkFlags VkPresentGravityFlagsEXT; +typedef struct VkSurfacePresentModeEXT { + VkStructureType sType; + void* pNext; + VkPresentModeKHR presentMode; +} VkSurfacePresentModeEXT; + +typedef struct VkSurfacePresentScalingCapabilitiesEXT { + VkStructureType sType; + void* pNext; + VkPresentScalingFlagsEXT supportedPresentScaling; + VkPresentGravityFlagsEXT supportedPresentGravityX; + VkPresentGravityFlagsEXT supportedPresentGravityY; + VkExtent2D minScaledImageExtent; + VkExtent2D maxScaledImageExtent; +} VkSurfacePresentScalingCapabilitiesEXT; + +typedef struct VkSurfacePresentModeCompatibilityEXT { + VkStructureType sType; + void* pNext; + uint32_t presentModeCount; + VkPresentModeKHR* pPresentModes; +} VkSurfacePresentModeCompatibilityEXT; + + + +#define VK_EXT_swapchain_maintenance1 1 +#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION 1 +#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_swapchain_maintenance1" +typedef struct VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 swapchainMaintenance1; +} VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT; + +typedef struct VkSwapchainPresentFenceInfoEXT { + VkStructureType sType; + void* pNext; + uint32_t swapchainCount; + const VkFence* pFences; +} VkSwapchainPresentFenceInfoEXT; + +typedef struct VkSwapchainPresentModesCreateInfoEXT { + VkStructureType sType; + void* pNext; + uint32_t presentModeCount; + const VkPresentModeKHR* pPresentModes; +} VkSwapchainPresentModesCreateInfoEXT; + +typedef struct VkSwapchainPresentModeInfoEXT { + VkStructureType sType; + void* pNext; + uint32_t swapchainCount; + const VkPresentModeKHR* pPresentModes; +} VkSwapchainPresentModeInfoEXT; + +typedef struct VkSwapchainPresentScalingCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPresentScalingFlagsEXT scalingBehavior; + VkPresentGravityFlagsEXT presentGravityX; + VkPresentGravityFlagsEXT presentGravityY; +} VkSwapchainPresentScalingCreateInfoEXT; + +typedef struct VkReleaseSwapchainImagesInfoEXT { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint32_t imageIndexCount; + const uint32_t* pImageIndices; +} VkReleaseSwapchainImagesInfoEXT; + +typedef VkResult (VKAPI_PTR *PFN_vkReleaseSwapchainImagesEXT)(VkDevice device, const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkReleaseSwapchainImagesEXT( + VkDevice device, + const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo); +#endif + + #define VK_EXT_shader_demote_to_helper_invocation 1 #define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_SPEC_VERSION 1 #define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME "VK_EXT_shader_demote_to_helper_invocation" @@ -13667,7 +14009,7 @@ typedef union VkDescriptorDataEXT { const VkDescriptorAddressInfoEXT* pStorageTexelBuffer; const VkDescriptorAddressInfoEXT* pUniformBuffer; const VkDescriptorAddressInfoEXT* pStorageBuffer; - VkDeviceAddress accelerationStructure; + VkDeviceAddress accelerationStructure; } VkDescriptorDataEXT; typedef struct VkDescriptorGetInfoEXT { @@ -14243,24 +14585,6 @@ typedef struct VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT { -#define VK_NV_acquire_winrt_display 1 -#define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1 -#define VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME "VK_NV_acquire_winrt_display" -typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); -typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV( - VkPhysicalDevice physicalDevice, - uint32_t deviceRelativeId, - VkDisplayKHR* pDisplay); -#endif - - #define VK_VALVE_mutable_descriptor_type 1 #define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 #define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_VALVE_mutable_descriptor_type" @@ -15547,6 +15871,36 @@ typedef struct VkRenderPassSubpassFeedbackCreateInfoEXT { +#define VK_LUNARG_direct_driver_loading 1 +#define VK_LUNARG_DIRECT_DRIVER_LOADING_SPEC_VERSION 1 +#define VK_LUNARG_DIRECT_DRIVER_LOADING_EXTENSION_NAME "VK_LUNARG_direct_driver_loading" + +typedef enum VkDirectDriverLoadingModeLUNARG { + VK_DIRECT_DRIVER_LOADING_MODE_EXCLUSIVE_LUNARG = 0, + VK_DIRECT_DRIVER_LOADING_MODE_INCLUSIVE_LUNARG = 1, + VK_DIRECT_DRIVER_LOADING_MODE_MAX_ENUM_LUNARG = 0x7FFFFFFF +} VkDirectDriverLoadingModeLUNARG; +typedef VkFlags VkDirectDriverLoadingFlagsLUNARG; +typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddrLUNARG)( + VkInstance instance, const char* pName); + +typedef struct VkDirectDriverLoadingInfoLUNARG { + VkStructureType sType; + void* pNext; + VkDirectDriverLoadingFlagsLUNARG flags; + PFN_vkGetInstanceProcAddrLUNARG pfnGetInstanceProcAddr; +} VkDirectDriverLoadingInfoLUNARG; + +typedef struct VkDirectDriverLoadingListLUNARG { + VkStructureType sType; + void* pNext; + VkDirectDriverLoadingModeLUNARG mode; + uint32_t driverCount; + const VkDirectDriverLoadingInfoLUNARG* pDrivers; +} VkDirectDriverLoadingListLUNARG; + + + #define VK_EXT_shader_module_identifier 1 #define VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT 32U #define VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION 1 @@ -15836,6 +16190,17 @@ typedef struct VkAmigoProfilingSubmitInfoSEC { +#define VK_QCOM_multiview_per_view_viewports 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_SPEC_VERSION 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_EXTENSION_NAME "VK_QCOM_multiview_per_view_viewports" +typedef struct VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 multiviewPerViewViewports; +} VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM; + + + #define VK_NV_ray_tracing_invocation_reorder 1 #define VK_NV_RAY_TRACING_INVOCATION_REORDER_SPEC_VERSION 1 #define VK_NV_RAY_TRACING_INVOCATION_REORDER_EXTENSION_NAME "VK_NV_ray_tracing_invocation_reorder" diff --git a/3rdparty/khronos/vulkan-local/vulkan_win32.h b/3rdparty/khronos/vulkan-local/vulkan_win32.h index affe0c02a..a8e46c89b 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_win32.h +++ b/3rdparty/khronos/vulkan-local/vulkan_win32.h @@ -308,6 +308,24 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT( VkDeviceGroupPresentModeFlagsKHR* pModes); #endif + +#define VK_NV_acquire_winrt_display 1 +#define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1 +#define VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME "VK_NV_acquire_winrt_display" +typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); +typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + uint32_t deviceRelativeId, + VkDisplayKHR* pDisplay); +#endif + #ifdef __cplusplus } #endif From b1f9fdf449f127ae91fbca72e356aa856a4c48be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 15 Jan 2023 08:40:46 -0800 Subject: [PATCH 17/86] Updated Khronos headers. (#3023) --- 3rdparty/khronos/EGL/egl.h | 85 +- 3rdparty/khronos/EGL/eglext.h | 203 ++++- 3rdparty/khronos/EGL/eglplatform.h | 55 +- 3rdparty/khronos/GLES2/gl2.h | 29 +- 3rdparty/khronos/GLES2/gl2ext.h | 398 ++++++++- 3rdparty/khronos/GLES2/gl2platform.h | 15 +- 3rdparty/khronos/GLES3/gl3.h | 37 +- 3rdparty/khronos/GLES3/gl31.h | 39 +- 3rdparty/khronos/GLES3/gl32.h | 39 +- 3rdparty/khronos/GLES3/gl3ext.h | 24 - 3rdparty/khronos/GLES3/gl3platform.h | 15 +- 3rdparty/khronos/KHR/khrplatform.h | 37 +- 3rdparty/khronos/gl/GRemedyGLExtensions.h | 67 -- 3rdparty/khronos/gl/glcorearb.h | 219 +++-- 3rdparty/khronos/gl/glext.h | 386 ++++++--- 3rdparty/khronos/glx/glxext.h | 190 ++++- 3rdparty/khronos/wgl/wgl.h | 936 ++++++++++++++++++++++ 3rdparty/khronos/wgl/wglext.h | 82 +- 18 files changed, 2278 insertions(+), 578 deletions(-) delete mode 100644 3rdparty/khronos/GLES3/gl3ext.h delete mode 100644 3rdparty/khronos/gl/GRemedyGLExtensions.h create mode 100644 3rdparty/khronos/wgl/wgl.h diff --git a/3rdparty/khronos/EGL/egl.h b/3rdparty/khronos/EGL/egl.h index 3e2f7e768..97d0878cc 100644 --- a/3rdparty/khronos/EGL/egl.h +++ b/3rdparty/khronos/EGL/egl.h @@ -6,39 +6,24 @@ extern "C" { #endif /* -** Copyright (c) 2013-2017 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: Apache-2.0 ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos EGL XML API Registry. ** The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** -** Khronos $Git commit SHA1: 726475c203 $ on $Git commit date: 2018-10-03 23:51:49 -0700 $ +** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $ */ #include -/* Generated on date 20181204 */ +#ifndef EGL_EGL_PROTOTYPES +#define EGL_EGL_PROTOTYPES 1 +#endif + +/* Generated on date 20220525 */ /* Generated C header for: * API: egl @@ -118,6 +103,31 @@ typedef void (*__eglMustCastToProperFunctionPointerType)(void); #define EGL_VERSION 0x3054 #define EGL_WIDTH 0x3057 #define EGL_WINDOW_BIT 0x0004 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETCURRENTDISPLAYPROC) (void); +typedef EGLSurface (EGLAPIENTRYP PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw); +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id); +typedef EGLint (EGLAPIENTRYP PFNEGLGETERRORPROC) (void); +typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC) (const char *procname); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint *major, EGLint *minor); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLTERMINATEPROC) (EGLDisplay dpy); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITGLPROC) (void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITNATIVEPROC) (EGLint engine); +#if EGL_EGL_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); @@ -142,6 +152,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); +#endif #endif /* EGL_VERSION_1_0 */ #ifndef EGL_VERSION_1_1 @@ -160,10 +171,16 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); #define EGL_TEXTURE_RGB 0x305D #define EGL_TEXTURE_RGBA 0x305E #define EGL_TEXTURE_TARGET 0x3081 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval); +#if EGL_EGL_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); +#endif #endif /* EGL_VERSION_1_1 */ #ifndef EGL_VERSION_1_2 @@ -199,11 +216,18 @@ typedef void *EGLClientBuffer; #define EGL_SWAP_BEHAVIOR 0x3093 #define EGL_UNKNOWN EGL_CAST(EGLint,-1) #define EGL_VERTICAL_RESOLUTION 0x3091 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDAPIPROC) (EGLenum api); +typedef EGLenum (EGLAPIENTRYP PFNEGLQUERYAPIPROC) (void); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETHREADPROC) (void); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITCLIENTPROC) (void); +#if EGL_EGL_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); +#endif #endif /* EGL_VERSION_1_2 */ #ifndef EGL_VERSION_1_3 @@ -232,7 +256,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); #define EGL_OPENGL_API 0x30A2 #define EGL_OPENGL_BIT 0x0008 #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +typedef EGLContext (EGLAPIENTRYP PFNEGLGETCURRENTCONTEXTPROC) (void); +#if EGL_EGL_PROTOTYPES EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); +#endif #endif /* EGL_VERSION_1_4 */ #ifndef EGL_VERSION_1_5 @@ -284,6 +311,17 @@ typedef void *EGLImage; #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 #define EGL_IMAGE_PRESERVED 0x30D2 #define EGL_NO_IMAGE EGL_CAST(EGLImage,0) +typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); +typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); +#if EGL_EGL_PROTOTYPES EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); @@ -294,6 +332,7 @@ EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *nat EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); +#endif #endif /* EGL_VERSION_1_5 */ #ifdef __cplusplus diff --git a/3rdparty/khronos/EGL/eglext.h b/3rdparty/khronos/EGL/eglext.h index 82d018684..d58da70e6 100644 --- a/3rdparty/khronos/EGL/eglext.h +++ b/3rdparty/khronos/EGL/eglext.h @@ -6,39 +6,20 @@ extern "C" { #endif /* -** Copyright (c) 2013-2017 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: Apache-2.0 ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos EGL XML API Registry. ** The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** -** Khronos $Git commit SHA1: 7866a17153 $ on $Git commit date: 2019-01-25 23:06:48 -0800 $ +** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $ */ #include -#define EGL_EGLEXT_VERSION 20190125 +#define EGL_EGLEXT_VERSION 20220525 /* Generated C header for: * API: egl @@ -443,9 +424,9 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, #ifndef EGL_KHR_swap_buffers_with_damage #define EGL_KHR_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #endif #endif /* EGL_KHR_swap_buffers_with_damage */ @@ -462,6 +443,10 @@ EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLin #endif #endif /* EGL_KHR_wait_sync */ +#ifndef EGL_ANDROID_GLES_layers +#define EGL_ANDROID_GLES_layers 1 +#endif /* EGL_ANDROID_GLES_layers */ + #ifndef EGL_ANDROID_blob_cache #define EGL_ANDROID_blob_cache 1 typedef khronos_ssize_t EGLsizeiANDROID; @@ -589,11 +574,25 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu #define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 #endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ +#ifndef EGL_ANGLE_sync_control_rate +#define EGL_ANGLE_sync_control_rate 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator); +#endif +#endif /* EGL_ANGLE_sync_control_rate */ + #ifndef EGL_ANGLE_window_fixed_size #define EGL_ANGLE_window_fixed_size 1 #define EGL_FIXED_SIZE_ANGLE 0x3201 #endif /* EGL_ANGLE_window_fixed_size */ +#ifndef EGL_ARM_image_format +#define EGL_ARM_image_format 1 +#define EGL_COLOR_COMPONENT_TYPE_UNSIGNED_INTEGER_ARM 0x3287 +#define EGL_COLOR_COMPONENT_TYPE_INTEGER_ARM 0x3288 +#endif /* EGL_ARM_image_format */ + #ifndef EGL_ARM_implicit_external_sync #define EGL_ARM_implicit_external_sync 1 #define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A @@ -652,6 +651,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSwapPolicyEXT (EGLint external_win_id #endif #endif /* EGL_EXT_compositor */ +#ifndef EGL_EXT_config_select_group +#define EGL_EXT_config_select_group 1 +#define EGL_CONFIG_SELECT_GROUP_EXT 0x34C0 +#endif /* EGL_EXT_config_select_group */ + #ifndef EGL_EXT_create_context_robustness #define EGL_EXT_create_context_robustness 1 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF @@ -684,6 +688,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a #define EGL_DRM_MASTER_FD_EXT 0x333C #endif /* EGL_EXT_device_drm */ +#ifndef EGL_EXT_device_drm_render_node +#define EGL_EXT_device_drm_render_node 1 +#define EGL_DRM_RENDER_NODE_FILE_EXT 0x3377 +#endif /* EGL_EXT_device_drm_render_node */ + #ifndef EGL_EXT_device_enumeration #define EGL_EXT_device_enumeration 1 #endif /* EGL_EXT_device_enumeration */ @@ -691,12 +700,33 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a #ifndef EGL_EXT_device_openwf #define EGL_EXT_device_openwf 1 #define EGL_OPENWF_DEVICE_ID_EXT 0x3237 +#define EGL_OPENWF_DEVICE_EXT 0x333D #endif /* EGL_EXT_device_openwf */ +#ifndef EGL_EXT_device_persistent_id +#define EGL_EXT_device_persistent_id 1 +#define EGL_DEVICE_UUID_EXT 0x335C +#define EGL_DRIVER_UUID_EXT 0x335D +#define EGL_DRIVER_NAME_EXT 0x335E +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEBINARYEXTPROC) (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size); +#endif +#endif /* EGL_EXT_device_persistent_id */ + #ifndef EGL_EXT_device_query #define EGL_EXT_device_query 1 #endif /* EGL_EXT_device_query */ +#ifndef EGL_EXT_device_query_name +#define EGL_EXT_device_query_name 1 +#define EGL_RENDERER_EXT 0x335F +#endif /* EGL_EXT_device_query_name */ + +#ifndef EGL_EXT_explicit_device +#define EGL_EXT_explicit_device 1 +#endif /* EGL_EXT_explicit_device */ + #ifndef EGL_EXT_gl_colorspace_bt2020_linear #define EGL_EXT_gl_colorspace_bt2020_linear 1 #define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F @@ -873,6 +903,17 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, #define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 #endif /* EGL_EXT_platform_x11 */ +#ifndef EGL_EXT_platform_xcb +#define EGL_EXT_platform_xcb 1 +#define EGL_PLATFORM_XCB_EXT 0x31DC +#define EGL_PLATFORM_XCB_SCREEN_EXT 0x31DE +#endif /* EGL_EXT_platform_xcb */ + +#ifndef EGL_EXT_present_opaque +#define EGL_EXT_present_opaque 1 +#define EGL_PRESENT_OPAQUE_EXT 0x31DF +#endif /* EGL_EXT_present_opaque */ + #ifndef EGL_EXT_protected_content #define EGL_EXT_protected_content 1 #define EGL_PROTECTED_CONTENT_EXT 0x32C0 @@ -911,11 +952,36 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr #define EGL_METADATA_SCALING_EXT 50000 #endif /* EGL_EXT_surface_SMPTE2086_metadata */ +#ifndef EGL_EXT_surface_compression +#define EGL_EXT_surface_compression 1 +#define EGL_SURFACE_COMPRESSION_EXT 0x34B0 +#define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E +#define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9 +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE +#define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates); +#endif +#endif /* EGL_EXT_surface_compression */ + #ifndef EGL_EXT_swap_buffers_with_damage #define EGL_EXT_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #endif #endif /* EGL_EXT_swap_buffers_with_damage */ @@ -1129,11 +1195,34 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur #endif #endif /* EGL_NV_post_sub_buffer */ +#ifndef EGL_NV_quadruple_buffer +#define EGL_NV_quadruple_buffer 1 +#define EGL_QUADRUPLE_BUFFER_NV 0x3231 +#endif /* EGL_NV_quadruple_buffer */ + #ifndef EGL_NV_robustness_video_memory_purge #define EGL_NV_robustness_video_memory_purge 1 #define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C #endif /* EGL_NV_robustness_video_memory_purge */ +#ifndef EGL_NV_stream_consumer_eglimage +#define EGL_NV_stream_consumer_eglimage 1 +#define EGL_STREAM_CONSUMER_IMAGE_NV 0x3373 +#define EGL_STREAM_IMAGE_ADD_NV 0x3374 +#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375 +#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list); +typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list); +EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync); +#endif +#endif /* EGL_NV_stream_consumer_eglimage */ + #ifndef EGL_NV_stream_consumer_gltexture_yuv #define EGL_NV_stream_consumer_gltexture_yuv 1 #define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C @@ -1170,6 +1259,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV (EGLDi #define EGL_STREAM_CROSS_SYSTEM_NV 0x334F #endif /* EGL_NV_stream_cross_system */ +#ifndef EGL_NV_stream_dma +#define EGL_NV_stream_dma 1 +#define EGL_STREAM_DMA_NV 0x3371 +#define EGL_STREAM_DMA_SERVER_NV 0x3372 +#endif /* EGL_NV_stream_dma */ + #ifndef EGL_NV_stream_fifo_next #define EGL_NV_stream_fifo_next 1 #define EGL_PENDING_FRAME_NV 0x3329 @@ -1221,6 +1316,21 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamMetadataNV (EGLDisplay dpy, EGLStrea #endif #endif /* EGL_NV_stream_metadata */ +#ifndef EGL_NV_stream_origin +#define EGL_NV_stream_origin 1 +#define EGL_STREAM_FRAME_ORIGIN_X_NV 0x3366 +#define EGL_STREAM_FRAME_ORIGIN_Y_NV 0x3367 +#define EGL_STREAM_FRAME_MAJOR_AXIS_NV 0x3368 +#define EGL_CONSUMER_AUTO_ORIENTATION_NV 0x3369 +#define EGL_PRODUCER_AUTO_ORIENTATION_NV 0x336A +#define EGL_LEFT_NV 0x336B +#define EGL_RIGHT_NV 0x336C +#define EGL_TOP_NV 0x336D +#define EGL_BOTTOM_NV 0x336E +#define EGL_X_AXIS_NV 0x336F +#define EGL_Y_AXIS_NV 0x3370 +#endif /* EGL_NV_stream_origin */ + #ifndef EGL_NV_stream_remote #define EGL_NV_stream_remote 1 #define EGL_STREAM_STATE_INITIALIZING_NV 0x3240 @@ -1317,6 +1427,11 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); #endif /* KHRONOS_SUPPORT_INT64 */ #endif /* EGL_NV_system_time */ +#ifndef EGL_NV_triple_buffer +#define EGL_NV_triple_buffer 1 +#define EGL_TRIPLE_BUFFER_NV 0x3230 +#endif /* EGL_NV_triple_buffer */ + #ifndef EGL_TIZEN_image_native_buffer #define EGL_TIZEN_image_native_buffer 1 #define EGL_NATIVE_BUFFER_TIZEN 0x32A0 @@ -1327,6 +1442,40 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); #define EGL_NATIVE_SURFACE_TIZEN 0x32A1 #endif /* EGL_TIZEN_image_native_surface */ +#ifndef EGL_WL_bind_wayland_display +#define EGL_WL_bind_wayland_display 1 +#define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC +#define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC +#define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC +struct wl_display; +struct wl_resource; +#define EGL_WAYLAND_BUFFER_WL 0x31D5 +#define EGL_WAYLAND_PLANE_WL 0x31D6 +#define EGL_TEXTURE_Y_U_V_WL 0x31D7 +#define EGL_TEXTURE_Y_UV_WL 0x31D8 +#define EGL_TEXTURE_Y_XUXV_WL 0x31D9 +#define EGL_TEXTURE_EXTERNAL_WL 0x31DA +#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB +typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); +EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); +#endif +#endif /* EGL_WL_bind_wayland_display */ + +#ifndef EGL_WL_create_wayland_buffer_from_image +#define EGL_WL_create_wayland_buffer_from_image 1 +#define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC +struct wl_buffer; +typedef struct wl_buffer *(EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC) (EGLDisplay dpy, EGLImageKHR image); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDisplay dpy, EGLImageKHR image); +#endif +#endif /* EGL_WL_create_wayland_buffer_from_image */ + #ifdef __cplusplus } #endif diff --git a/3rdparty/khronos/EGL/eglplatform.h b/3rdparty/khronos/EGL/eglplatform.h index 6d0d8db2e..99362a23d 100644 --- a/3rdparty/khronos/EGL/eglplatform.h +++ b/3rdparty/khronos/EGL/eglplatform.h @@ -2,36 +2,17 @@ #define __eglplatform_h_ /* -** Copyright (c) 2007-2016 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +** Copyright 2007-2020 The Khronos Group Inc. +** SPDX-License-Identifier: Apache-2.0 */ /* Platform-specific types and definitions for egl.h - * $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $ * * Adopters may modify khrplatform.h and this file to suit their platform. * You are encouraged to submit all modifications to the Khronos group so that * they can be included in future versions of this file. Please submit changes - * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) - * by filing a bug against product "EGL" component "Registry". + * by filing an issue or pull request on the public Khronos EGL Registry, at + * https://www.github.com/KhronosGroup/EGL-Registry/ */ #include @@ -67,7 +48,13 @@ * implementations. */ -#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ +#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES) + +typedef void *EGLNativeDisplayType; +typedef void *EGLNativePixmapType; +typedef void *EGLNativeWindowType; + +#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif @@ -77,6 +64,12 @@ typedef HDC EGLNativeDisplayType; typedef HBITMAP EGLNativePixmapType; typedef HWND EGLNativeWindowType; +#elif defined(__EMSCRIPTEN__) + +typedef int EGLNativeDisplayType; +typedef int EGLNativePixmapType; +typedef int EGLNativeWindowType; + #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ typedef int EGLNativeDisplayType; @@ -110,7 +103,7 @@ typedef intptr_t EGLNativeDisplayType; typedef intptr_t EGLNativePixmapType; typedef intptr_t EGLNativeWindowType; -#elif defined(__unix__) || defined(USE_X11) +#elif defined(USE_X11) /* X11 (tentative) */ #include @@ -120,6 +113,12 @@ typedef Display *EGLNativeDisplayType; typedef Pixmap EGLNativePixmapType; typedef Window EGLNativeWindowType; +#elif defined(__unix__) + +typedef void *EGLNativeDisplayType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; + #elif defined(__APPLE__) typedef int EGLNativeDisplayType; @@ -134,6 +133,12 @@ typedef void *EGLNativeDisplayType; typedef khronos_uintptr_t EGLNativePixmapType; typedef khronos_uintptr_t EGLNativeWindowType; +#elif defined(__Fuchsia__) + +typedef void *EGLNativeDisplayType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; + #else #error "Platform not recognized" #endif diff --git a/3rdparty/khronos/GLES2/gl2.h b/3rdparty/khronos/GLES2/gl2.h index a48067d73..af244a70c 100644 --- a/3rdparty/khronos/GLES2/gl2.h +++ b/3rdparty/khronos/GLES2/gl2.h @@ -6,28 +6,9 @@ extern "C" { #endif /* -** Copyright (c) 2013-2018 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at @@ -44,7 +25,7 @@ extern "C" { #define GL_GLES_PROTOTYPES 1 #endif -/* Generated on date 20190228 */ +/* Generated on date 20220530 */ /* Generated C header for: * API: gles2 @@ -477,7 +458,7 @@ typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); @@ -620,7 +601,7 @@ GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); diff --git a/3rdparty/khronos/GLES2/gl2ext.h b/3rdparty/khronos/GLES2/gl2ext.h index 00f116b10..9448ce09f 100644 --- a/3rdparty/khronos/GLES2/gl2ext.h +++ b/3rdparty/khronos/GLES2/gl2ext.h @@ -6,28 +6,9 @@ extern "C" { #endif /* -** Copyright (c) 2013-2018 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at @@ -38,7 +19,7 @@ extern "C" { #define GL_APIENTRYP GL_APIENTRY* #endif -/* Generated on date 20190228 */ +/* Generated on date 20220530 */ /* Generated C header for: * API: gles2 @@ -197,6 +178,22 @@ GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, #endif #endif /* GL_KHR_robustness */ +#ifndef GL_KHR_shader_subgroup +#define GL_KHR_shader_subgroup 1 +#define GL_SUBGROUP_SIZE_KHR 0x9532 +#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 +#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 +#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 +#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 +#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 +#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 +#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 +#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 +#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 +#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 +#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 +#endif /* GL_KHR_shader_subgroup */ + #ifndef GL_KHR_texture_compression_astc_hdr #define GL_KHR_texture_compression_astc_hdr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 @@ -334,12 +331,12 @@ GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex); +GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); #endif #endif /* GL_OES_draw_elements_base_vertex */ @@ -930,9 +927,9 @@ GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint div #ifndef GL_ANGLE_translated_shader_source #define GL_ANGLE_translated_shader_source 1 #define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 -typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); +typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); +GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); #endif #endif /* GL_ANGLE_translated_shader_source */ @@ -1010,7 +1007,7 @@ typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); @@ -1018,7 +1015,7 @@ GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); #endif #endif /* GL_APPLE_sync */ @@ -1065,6 +1062,11 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei #define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 #endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ +#ifndef GL_ARM_texture_unnormalized_coordinates +#define GL_ARM_texture_unnormalized_coordinates 1 +#define GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A +#endif /* GL_ARM_texture_unnormalized_coordinates */ + #ifndef GL_DMP_program_binary #define GL_DMP_program_binary 1 #define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251 @@ -1091,6 +1093,13 @@ GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, G #endif #endif /* GL_EXT_EGL_image_storage */ +#ifndef GL_EXT_EGL_image_storage_compression +#define GL_EXT_EGL_image_storage_compression 1 +#define GL_SURFACE_COMPRESSION_EXT 0x96C0 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x96C1 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x96C2 +#endif /* GL_EXT_EGL_image_storage_compression */ + #ifndef GL_EXT_YUV_target #define GL_EXT_YUV_target 1 #define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 @@ -1282,6 +1291,7 @@ typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pnam typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); +typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTPROC) (GLenum pname, GLint64 *data); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); @@ -1294,6 +1304,7 @@ GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLin GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); +GL_APICALL void GL_APIENTRY glGetInteger64vEXT (GLenum pname, GLint64 *data); #endif #endif /* GL_EXT_disjoint_timer_query */ @@ -1408,6 +1419,46 @@ GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLin #define GL_EXT_float_blend 1 #endif /* GL_EXT_float_blend */ +#ifndef GL_EXT_fragment_shading_rate +#define GL_EXT_fragment_shading_rate 1 +#define GL_SHADING_RATE_1X1_PIXELS_EXT 0x96A6 +#define GL_SHADING_RATE_1X2_PIXELS_EXT 0x96A7 +#define GL_SHADING_RATE_2X1_PIXELS_EXT 0x96A8 +#define GL_SHADING_RATE_2X2_PIXELS_EXT 0x96A9 +#define GL_SHADING_RATE_1X4_PIXELS_EXT 0x96AA +#define GL_SHADING_RATE_4X1_PIXELS_EXT 0x96AB +#define GL_SHADING_RATE_4X2_PIXELS_EXT 0x96AC +#define GL_SHADING_RATE_2X4_PIXELS_EXT 0x96AD +#define GL_SHADING_RATE_4X4_PIXELS_EXT 0x96AE +#define GL_SHADING_RATE_EXT 0x96D0 +#define GL_SHADING_RATE_ATTACHMENT_EXT 0x96D1 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_EXT 0x96D2 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_EXT 0x96D3 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_EXT 0x96D4 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_EXT 0x96D5 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_EXT 0x96D6 +#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D7 +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D8 +#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96D9 +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96DA +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_ASPECT_RATIO_EXT 0x96DB +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_LAYERS_EXT 0x96DC +#define GL_FRAGMENT_SHADING_RATE_WITH_SHADER_DEPTH_STENCIL_WRITES_SUPPORTED_EXT 0x96DD +#define GL_FRAGMENT_SHADING_RATE_WITH_SAMPLE_MASK_SUPPORTED_EXT 0x96DE +#define GL_FRAGMENT_SHADING_RATE_ATTACHMENT_WITH_DEFAULT_FRAMEBUFFER_SUPPORTED_EXT 0x96DF +#define GL_FRAGMENT_SHADING_RATE_NON_TRIVIAL_COMBINERS_SUPPORTED_EXT 0x8F6F +typedef void (GL_APIENTRYP PFNGLGETFRAGMENTSHADINGRATESEXTPROC) (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates); +typedef void (GL_APIENTRYP PFNGLSHADINGRATEEXTPROC) (GLenum rate); +typedef void (GL_APIENTRYP PFNGLSHADINGRATECOMBINEROPSEXTPROC) (GLenum combinerOp0, GLenum combinerOp1); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSHADINGRATEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetFragmentShadingRatesEXT (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates); +GL_APICALL void GL_APIENTRY glShadingRateEXT (GLenum rate); +GL_APICALL void GL_APIENTRY glShadingRateCombinerOpsEXT (GLenum combinerOp0, GLenum combinerOp1); +GL_APICALL void GL_APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight); +#endif +#endif /* GL_EXT_fragment_shading_rate */ + #ifndef GL_EXT_geometry_point_size #define GL_EXT_geometry_point_size 1 #endif /* GL_EXT_geometry_point_size */ @@ -1601,6 +1652,10 @@ GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, #endif #endif /* GL_EXT_multisampled_render_to_texture */ +#ifndef GL_EXT_multisampled_render_to_texture2 +#define GL_EXT_multisampled_render_to_texture2 1 +#endif /* GL_EXT_multisampled_render_to_texture2 */ + #ifndef GL_EXT_multiview_draw_buffers #define GL_EXT_multiview_draw_buffers 1 #define GL_COLOR_ATTACHMENT_EXT 0x90F0 @@ -1618,6 +1673,18 @@ GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLi #endif #endif /* GL_EXT_multiview_draw_buffers */ +#ifndef GL_EXT_multiview_tessellation_geometry_shader +#define GL_EXT_multiview_tessellation_geometry_shader 1 +#endif /* GL_EXT_multiview_tessellation_geometry_shader */ + +#ifndef GL_EXT_multiview_texture_multisample +#define GL_EXT_multiview_texture_multisample 1 +#endif /* GL_EXT_multiview_texture_multisample */ + +#ifndef GL_EXT_multiview_timer_query +#define GL_EXT_multiview_timer_query 1 +#endif /* GL_EXT_multiview_timer_query */ + #ifndef GL_EXT_occlusion_query_boolean #define GL_EXT_occlusion_query_boolean 1 #define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F @@ -1775,6 +1842,10 @@ GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLe #endif #endif /* GL_EXT_semaphore_win32 */ +#ifndef GL_EXT_separate_depth_stencil +#define GL_EXT_separate_depth_stencil 1 +#endif /* GL_EXT_separate_depth_stencil */ + #ifndef GL_EXT_separate_shader_objects #define GL_EXT_separate_shader_objects 1 #define GL_ACTIVE_PROGRAM_EXT 0x8259 @@ -1930,6 +2001,10 @@ GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsiz #endif #endif /* GL_EXT_shader_pixel_local_storage2 */ +#ifndef GL_EXT_shader_samples_identical +#define GL_EXT_shader_samples_identical 1 +#endif /* GL_EXT_shader_samples_identical */ + #ifndef GL_EXT_shader_texture_lod #define GL_EXT_shader_texture_lod 1 #endif /* GL_EXT_shader_texture_lod */ @@ -2188,6 +2263,10 @@ GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalf #define GL_SKIP_DECODE_EXT 0x8A4A #endif /* GL_EXT_texture_sRGB_decode */ +#ifndef GL_EXT_texture_shadow_lod +#define GL_EXT_texture_shadow_lod 1 +#endif /* GL_EXT_texture_shadow_lod */ + #ifndef GL_EXT_texture_storage #define GL_EXT_texture_storage 1 #define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F @@ -2220,6 +2299,29 @@ GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target #endif #endif /* GL_EXT_texture_storage */ +#ifndef GL_EXT_texture_storage_compression +#define GL_EXT_texture_storage_compression 1 +#define GL_NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT 0x8F6E +#define GL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x96C4 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x96C5 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x96C6 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x96C7 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x96C8 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x96C9 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x96CA +#define GL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x96CB +#define GL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x96CC +#define GL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x96CD +#define GL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x96CE +#define GL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x96CF +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexStorageAttribs2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list); +GL_APICALL void GL_APIENTRY glTexStorageAttribs3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list); +#endif +#endif /* GL_EXT_texture_storage_compression */ + #ifndef GL_EXT_texture_type_2_10_10_10_REV #define GL_EXT_texture_type_2_10_10_10_REV 1 #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 @@ -2420,11 +2522,32 @@ GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint quer #endif #endif /* GL_INTEL_performance_query */ +#ifndef GL_MESA_bgra +#define GL_MESA_bgra 1 +#define GL_BGR_EXT 0x80E0 +#endif /* GL_MESA_bgra */ + +#ifndef GL_MESA_framebuffer_flip_x +#define GL_MESA_framebuffer_flip_x 1 +#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC +#endif /* GL_MESA_framebuffer_flip_x */ + #ifndef GL_MESA_framebuffer_flip_y #define GL_MESA_framebuffer_flip_y 1 #define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); +#endif #endif /* GL_MESA_framebuffer_flip_y */ +#ifndef GL_MESA_framebuffer_swap_xy +#define GL_MESA_framebuffer_swap_xy 1 +#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD +#endif /* GL_MESA_framebuffer_swap_xy */ + #ifndef GL_MESA_program_binary_formats #define GL_MESA_program_binary_formats 1 #define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F @@ -2746,6 +2869,10 @@ GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color); #endif #endif /* GL_NV_fragment_coverage_to_color */ +#ifndef GL_NV_fragment_shader_barycentric +#define GL_NV_fragment_shader_barycentric 1 +#endif /* GL_NV_fragment_shader_barycentric */ + #ifndef GL_NV_fragment_shader_interlock #define GL_NV_fragment_shader_interlock 1 #endif /* GL_NV_fragment_shader_interlock */ @@ -2773,11 +2900,11 @@ GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v); +typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); -GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v); +GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components); #endif #endif /* GL_NV_framebuffer_mixed_samples */ @@ -2925,9 +3052,9 @@ GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint diviso #define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 #define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 #define GL_CONFORMANT_NV 0x9374 -typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); +GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); #endif #endif /* GL_NV_internalformat_sample_query */ @@ -2959,6 +3086,82 @@ GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint m #endif #endif /* GL_NV_memory_attachment */ +#ifndef GL_NV_memory_object_sparse +#define GL_NV_memory_object_sparse 1 +typedef void (GL_APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (GL_APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GL_APICALL void GL_APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +GL_APICALL void GL_APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GL_APICALL void GL_APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#endif +#endif /* GL_NV_memory_object_sparse */ + +#ifndef GL_NV_mesh_shader +#define GL_NV_mesh_shader 1 +#define GL_MESH_SHADER_NV 0x9559 +#define GL_TASK_SHADER_NV 0x955A +#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60 +#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61 +#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62 +#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63 +#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64 +#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65 +#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66 +#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67 +#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68 +#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69 +#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A +#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B +#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C +#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D +#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E +#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F +#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2 +#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3 +#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536 +#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537 +#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538 +#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539 +#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A +#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D +#define GL_MAX_MESH_VIEWS_NV 0x9557 +#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF +#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543 +#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B +#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C +#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E +#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F +#define GL_MESH_VERTICES_OUT_NV 0x9579 +#define GL_MESH_PRIMITIVES_OUT_NV 0x957A +#define GL_MESH_OUTPUT_TYPE_NV 0x957B +#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D +#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 +#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 +#define GL_MESH_SHADER_BIT_NV 0x00000040 +#define GL_TASK_SHADER_BIT_NV 0x00000080 +#define GL_MESH_SUBROUTINE_NV 0x957C +#define GL_TASK_SUBROUTINE_NV 0x957D +#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E +#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F +typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); +typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count); +GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect); +GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride); +GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#endif +#endif /* GL_NV_mesh_shader */ + #ifndef GL_NV_non_square_matrices #define GL_NV_non_square_matrices 1 #define GL_FLOAT_MAT2x3_NV 0x8B65 @@ -3191,11 +3394,11 @@ typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GL typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); @@ -3268,11 +3471,11 @@ GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fi GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode); GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); @@ -3322,6 +3525,12 @@ GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode); #endif #endif /* GL_NV_polygon_mode */ +#ifndef GL_NV_primitive_shading_rate +#define GL_NV_primitive_shading_rate 1 +#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 +#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 +#endif /* GL_NV_primitive_shading_rate */ + #ifndef GL_NV_read_buffer #define GL_NV_read_buffer 1 #define GL_READ_BUFFER_NV 0x0C02 @@ -3347,6 +3556,11 @@ GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); #define GL_NV_read_stencil 1 #endif /* GL_NV_read_stencil */ +#ifndef GL_NV_representative_fragment_test +#define GL_NV_representative_fragment_test 1 +#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F +#endif /* GL_NV_representative_fragment_test */ + #ifndef GL_NV_sRGB_formats #define GL_NV_sRGB_formats 1 #define GL_SLUMINANCE_NV 0x8C46 @@ -3405,6 +3619,56 @@ GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei co #define GL_NV_shader_noperspective_interpolation 1 #endif /* GL_NV_shader_noperspective_interpolation */ +#ifndef GL_NV_shader_subgroup_partitioned +#define GL_NV_shader_subgroup_partitioned 1 +#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 +#endif /* GL_NV_shader_subgroup_partitioned */ + +#ifndef GL_NV_shader_texture_footprint +#define GL_NV_shader_texture_footprint 1 +#endif /* GL_NV_shader_texture_footprint */ + +#ifndef GL_NV_shading_rate_image +#define GL_NV_shading_rate_image 1 +#define GL_SHADING_RATE_IMAGE_NV 0x9563 +#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564 +#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565 +#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569 +#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A +#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B +#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C +#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D +#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E +#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F +#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B +#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C +#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D +#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E +#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F +#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE +#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF +#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0 +typedef void (GL_APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture); +typedef void (GL_APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate); +typedef void (GL_APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location); +typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize); +typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); +typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order); +typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindShadingRateImageNV (GLuint texture); +GL_APICALL void GL_APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate); +GL_APICALL void GL_APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location); +GL_APICALL void GL_APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize); +GL_APICALL void GL_APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); +GL_APICALL void GL_APIENTRY glShadingRateSampleOrderNV (GLenum order); +GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations); +#endif +#endif /* GL_NV_shading_rate_image */ + #ifndef GL_NV_shadow_samplers_array #define GL_NV_shadow_samplers_array 1 #define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 @@ -3433,6 +3697,23 @@ GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei co #define GL_NV_texture_npot_2D_mipmap 1 #endif /* GL_NV_texture_npot_2D_mipmap */ +#ifndef GL_NV_timeline_semaphore +#define GL_NV_timeline_semaphore 1 +#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595 +#define GL_SEMAPHORE_TYPE_NV 0x95B3 +#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4 +#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5 +#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6 +typedef void (GL_APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores); +typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores); +GL_APICALL void GL_APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params); +#endif +#endif /* GL_NV_timeline_semaphore */ + #ifndef GL_NV_viewport_array #define GL_NV_viewport_array 1 #define GL_MAX_VIEWPORTS_NV 0x825B @@ -3599,6 +3880,14 @@ GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLe #endif #endif /* GL_QCOM_extended_get2 */ +#ifndef GL_QCOM_frame_extrapolation +#define GL_QCOM_frame_extrapolation 1 +typedef void (GL_APIENTRYP PFNGLEXTRAPOLATETEX2DQCOMPROC) (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtrapolateTex2DQCOM (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); +#endif +#endif /* GL_QCOM_frame_extrapolation */ + #ifndef GL_QCOM_framebuffer_foveated #define GL_QCOM_framebuffer_foveated 1 #define GL_FOVEATION_ENABLE_BIT_QCOM 0x00000001 @@ -3611,11 +3900,27 @@ GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebu #endif #endif /* GL_QCOM_framebuffer_foveated */ +#ifndef GL_QCOM_motion_estimation +#define GL_QCOM_motion_estimation 1 +#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_X_QCOM 0x8C90 +#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_Y_QCOM 0x8C91 +typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONQCOMPROC) (GLuint ref, GLuint target, GLuint output); +typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONREGIONSQCOMPROC) (GLuint ref, GLuint target, GLuint output, GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexEstimateMotionQCOM (GLuint ref, GLuint target, GLuint output); +GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint target, GLuint output, GLuint mask); +#endif +#endif /* GL_QCOM_motion_estimation */ + #ifndef GL_QCOM_perfmon_global_mode #define GL_QCOM_perfmon_global_mode 1 #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 #endif /* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_render_shared_exponent +#define GL_QCOM_render_shared_exponent 1 +#endif /* GL_QCOM_render_shared_exponent */ + #ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent #define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 #define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 @@ -3629,6 +3934,22 @@ GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void); #define GL_QCOM_shader_framebuffer_fetch_rate 1 #endif /* GL_QCOM_shader_framebuffer_fetch_rate */ +#ifndef GL_QCOM_shading_rate +#define GL_QCOM_shading_rate 1 +#define GL_SHADING_RATE_QCOM 0x96A4 +#define GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM 0x96A5 +#define GL_SHADING_RATE_1X1_PIXELS_QCOM 0x96A6 +#define GL_SHADING_RATE_1X2_PIXELS_QCOM 0x96A7 +#define GL_SHADING_RATE_2X1_PIXELS_QCOM 0x96A8 +#define GL_SHADING_RATE_2X2_PIXELS_QCOM 0x96A9 +#define GL_SHADING_RATE_4X2_PIXELS_QCOM 0x96AC +#define GL_SHADING_RATE_4X4_PIXELS_QCOM 0x96AE +typedef void (GL_APIENTRYP PFNGLSHADINGRATEQCOMPROC) (GLenum rate); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glShadingRateQCOM (GLenum rate); +#endif +#endif /* GL_QCOM_shading_rate */ + #ifndef GL_QCOM_texture_foveated #define GL_QCOM_texture_foveated 1 #define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB @@ -3642,6 +3963,11 @@ GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GL #endif #endif /* GL_QCOM_texture_foveated */ +#ifndef GL_QCOM_texture_foveated2 +#define GL_QCOM_texture_foveated2 1 +#define GL_TEXTURE_FOVEATED_CUTOFF_DENSITY_QCOM 0x96A0 +#endif /* GL_QCOM_texture_foveated2 */ + #ifndef GL_QCOM_texture_foveated_subsampled_layout #define GL_QCOM_texture_foveated_subsampled_layout 1 #define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004 diff --git a/3rdparty/khronos/GLES2/gl2platform.h b/3rdparty/khronos/GLES2/gl2platform.h index eb318dc3a..5bcce6d89 100644 --- a/3rdparty/khronos/GLES2/gl2platform.h +++ b/3rdparty/khronos/GLES2/gl2platform.h @@ -2,19 +2,8 @@ #define __gl2platform_h_ /* -** Copyright (c) 2017 The Khronos Group Inc. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. +** Copyright 2017-2020 The Khronos Group Inc. +** SPDX-License-Identifier: Apache-2.0 */ /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h diff --git a/3rdparty/khronos/GLES3/gl3.h b/3rdparty/khronos/GLES3/gl3.h index b84acdc2f..eaf5efdfe 100644 --- a/3rdparty/khronos/GLES3/gl3.h +++ b/3rdparty/khronos/GLES3/gl3.h @@ -6,28 +6,9 @@ extern "C" { #endif /* -** Copyright (c) 2013-2018 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at @@ -44,7 +25,7 @@ extern "C" { #define GL_GLES_PROTOTYPES 1 #endif -/* Generated on date 20190228 */ +/* Generated on date 20220530 */ /* Generated C header for: * API: gles2 @@ -477,7 +458,7 @@ typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); @@ -620,7 +601,7 @@ GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); @@ -1068,7 +1049,7 @@ typedef void (GL_APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); @@ -1095,7 +1076,7 @@ typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsiz typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); #if GL_GLES_PROTOTYPES GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src); GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); @@ -1173,7 +1154,7 @@ GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync); GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); -GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); @@ -1200,7 +1181,7 @@ GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numA GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); #endif #endif /* GL_ES_VERSION_3_0 */ diff --git a/3rdparty/khronos/GLES3/gl31.h b/3rdparty/khronos/GLES3/gl31.h index 4806181e0..502d6feec 100644 --- a/3rdparty/khronos/GLES3/gl31.h +++ b/3rdparty/khronos/GLES3/gl31.h @@ -1,39 +1,18 @@ -#ifndef __gl31_h_ -#define __gl31_h_ 1 +#ifndef __gles2_gl31_h_ +#define __gles2_gl31_h_ 1 #ifdef __cplusplus extern "C" { #endif /* -** Copyright (c) 2013-2016 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision$ on $Date$ +** https://github.com/KhronosGroup/OpenGL-Registry */ #include @@ -46,7 +25,7 @@ extern "C" { #define GL_GLES_PROTOTYPES 1 #endif -/* Generated on date 20161024 */ +/* Generated on date 20191013 */ /* Generated C header for: * API: gles2 @@ -64,8 +43,8 @@ extern "C" { typedef khronos_int8_t GLbyte; typedef khronos_float_t GLclampf; typedef khronos_int32_t GLfixed; -typedef short GLshort; -typedef unsigned short GLushort; +typedef khronos_int16_t GLshort; +typedef khronos_uint16_t GLushort; typedef void GLvoid; typedef struct __GLsync *GLsync; typedef khronos_int64_t GLint64; @@ -672,7 +651,7 @@ GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei #ifndef GL_ES_VERSION_3_0 #define GL_ES_VERSION_3_0 1 -typedef unsigned short GLhalf; +typedef khronos_uint16_t GLhalf; #define GL_READ_BUFFER 0x0C02 #define GL_UNPACK_ROW_LENGTH 0x0CF2 #define GL_UNPACK_SKIP_ROWS 0x0CF3 diff --git a/3rdparty/khronos/GLES3/gl32.h b/3rdparty/khronos/GLES3/gl32.h index a1af7c697..ae56b0e95 100644 --- a/3rdparty/khronos/GLES3/gl32.h +++ b/3rdparty/khronos/GLES3/gl32.h @@ -1,39 +1,18 @@ -#ifndef __gl32_h_ -#define __gl32_h_ 1 +#ifndef __gles2_gl32_h_ +#define __gles2_gl32_h_ 1 #ifdef __cplusplus extern "C" { #endif /* -** Copyright (c) 2013-2016 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision$ on $Date$ +** https://github.com/KhronosGroup/OpenGL-Registry */ #include @@ -46,7 +25,7 @@ extern "C" { #define GL_GLES_PROTOTYPES 1 #endif -/* Generated on date 20161024 */ +/* Generated on date 20191013 */ /* Generated C header for: * API: gles2 @@ -64,8 +43,8 @@ extern "C" { typedef khronos_int8_t GLbyte; typedef khronos_float_t GLclampf; typedef khronos_int32_t GLfixed; -typedef short GLshort; -typedef unsigned short GLushort; +typedef khronos_int16_t GLshort; +typedef khronos_uint16_t GLushort; typedef void GLvoid; typedef struct __GLsync *GLsync; typedef khronos_int64_t GLint64; @@ -672,7 +651,7 @@ GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei #ifndef GL_ES_VERSION_3_0 #define GL_ES_VERSION_3_0 1 -typedef unsigned short GLhalf; +typedef khronos_uint16_t GLhalf; #define GL_READ_BUFFER 0x0C02 #define GL_UNPACK_ROW_LENGTH 0x0CF2 #define GL_UNPACK_SKIP_ROWS 0x0CF3 diff --git a/3rdparty/khronos/GLES3/gl3ext.h b/3rdparty/khronos/GLES3/gl3ext.h deleted file mode 100644 index 4d4ea96c4..000000000 --- a/3rdparty/khronos/GLES3/gl3ext.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __gl3ext_h_ -#define __gl3ext_h_ - -/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */ - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -/* OpenGL ES 3 Extensions - * - * After an OES extension's interactions with OpenGl ES 3.0 have been documented, - * its tokens and function definitions should be added to this file in a manner - * that does not conflict with gl2ext.h or gl3.h. - * - * Tokens and function definitions for extensions that have become standard - * features in OpenGL ES 3.0 will not be added to this file. - * - * Applications using OpenGL-ES-2-only extensions should include gl2ext.h - */ - -#endif /* __gl3ext_h_ */ - diff --git a/3rdparty/khronos/GLES3/gl3platform.h b/3rdparty/khronos/GLES3/gl3platform.h index ca9d7a6de..8699212de 100644 --- a/3rdparty/khronos/GLES3/gl3platform.h +++ b/3rdparty/khronos/GLES3/gl3platform.h @@ -2,19 +2,8 @@ #define __gl3platform_h_ /* -** Copyright (c) 2017 The Khronos Group Inc. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. +** Copyright 2017-2020 The Khronos Group Inc. +** SPDX-License-Identifier: Apache-2.0 */ /* Platform-specific types and definitions for OpenGL ES 3.X gl3.h diff --git a/3rdparty/khronos/KHR/khrplatform.h b/3rdparty/khronos/KHR/khrplatform.h index 975bbffed..01646449c 100644 --- a/3rdparty/khronos/KHR/khrplatform.h +++ b/3rdparty/khronos/KHR/khrplatform.h @@ -90,12 +90,20 @@ * int arg2) KHRONOS_APIATTRIBUTES; */ +#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) +# define KHRONOS_STATIC 1 +#endif + /*------------------------------------------------------------------------- * Definition of KHRONOS_APICALL *------------------------------------------------------------------------- * This precedes the return type of the function in the function prototype. */ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +#if defined(KHRONOS_STATIC) + /* If the preprocessor constant KHRONOS_STATIC is defined, make the + * header compatible with static linking. */ +# define KHRONOS_APICALL +#elif defined(_WIN32) # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C @@ -145,6 +153,20 @@ typedef int64_t khronos_int64_t; typedef uint64_t khronos_uint64_t; #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 +/* + * To support platform where unsigned long cannot be used interchangeably with + * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. + * Ideally, we could just use (u)intptr_t everywhere, but this could result in + * ABI breakage if khronos_uintptr_t is changed from unsigned long to + * unsigned long long or similar (this results in different C++ name mangling). + * To avoid changes for existing platforms, we restrict usage of intptr_t to + * platforms where the size of a pointer is larger than the size of long. + */ +#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) +#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ +#define KHRONOS_USE_INTPTR_T +#endif +#endif #elif defined(__VMS ) || defined(__sgi) @@ -227,14 +249,21 @@ typedef unsigned short int khronos_uint16_t; * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears * to be the only LLP64 architecture in current use. */ -#ifdef _WIN64 +#ifdef KHRONOS_USE_INTPTR_T +typedef intptr_t khronos_intptr_t; +typedef uintptr_t khronos_uintptr_t; +#elif defined(_WIN64) typedef signed long long int khronos_intptr_t; typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; #else typedef signed long int khronos_intptr_t; typedef unsigned long int khronos_uintptr_t; +#endif + +#if defined(_WIN64) +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else typedef signed long int khronos_ssize_t; typedef unsigned long int khronos_usize_t; #endif diff --git a/3rdparty/khronos/gl/GRemedyGLExtensions.h b/3rdparty/khronos/gl/GRemedyGLExtensions.h deleted file mode 100644 index 9777b0c8d..000000000 --- a/3rdparty/khronos/gl/GRemedyGLExtensions.h +++ /dev/null @@ -1,67 +0,0 @@ -// ------------------------------ GRemdeyGLExtensions.h ------------------------------ - -// ----------------------------------------------------------------- -// © 2004 - 2012 Advanced Micro Devices, Inc. All rights reserved. -// ----------------------------------------------------------------- - -#ifndef __GREMDEYGLEXTENSIONS -#define __GREMDEYGLEXTENSIONS - - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif - -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -#ifndef GLAPI -#define GLAPI extern -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* ----------------------- GL_GREMEDY_string_marker ----------------------- */ - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 - -#ifdef GL_GLEXT_PROTOTYPES - GLAPI void APIENTRY glStringMarkerGREMEDY(GLsizei len, const GLvoid *string); -#endif /* GL_GLEXT_PROTOTYPES */ - - typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC)(GLsizei len, const GLvoid *string); - -#endif /* GL_GREMEDY_string_marker */ - - - - /* ----------------------- GL_GREMEDY_frame_terminator ----------------------- */ - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 - -#ifdef GL_GLEXT_PROTOTYPES - GLAPI void APIENTRY glFrameTerminatorGREMEDY(void); -#endif /* GL_GLEXT_PROTOTYPES */ - - typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC)(void); - -#endif /* GL_GREMEDY_frame_terminator */ - - -#ifdef __cplusplus -} -#endif - - -#endif /* __GREMDEYGLEXTENSIONS */ diff --git a/3rdparty/khronos/gl/glcorearb.h b/3rdparty/khronos/gl/glcorearb.h index a95bbb802..07517e7e5 100644 --- a/3rdparty/khronos/gl/glcorearb.h +++ b/3rdparty/khronos/gl/glcorearb.h @@ -6,28 +6,9 @@ extern "C" { #endif /* -** Copyright (c) 2013-2018 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at @@ -1573,7 +1554,7 @@ typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); -typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); @@ -1593,7 +1574,7 @@ GLAPI void APIENTRY glDeleteSync (GLsync sync); GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); -GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); @@ -1789,8 +1770,8 @@ typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); @@ -1836,8 +1817,8 @@ GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *pa GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); @@ -1895,7 +1876,7 @@ GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pna #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F #define GL_UNDEFINED_VERTEX 0x8260 typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); @@ -1984,7 +1965,7 @@ typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfl typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glReleaseShaderCompiler (void); -GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); GLAPI void APIENTRY glClearDepthf (GLfloat d); @@ -2191,7 +2172,7 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data) typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); @@ -2204,7 +2185,7 @@ typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum m GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); @@ -2484,7 +2465,7 @@ typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); @@ -2496,7 +2477,7 @@ typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); @@ -2528,7 +2509,7 @@ GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); @@ -2540,7 +2521,7 @@ GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); @@ -3838,6 +3819,12 @@ GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint #ifndef GL_ARB_viewport_array #define GL_ARB_viewport_array 1 +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f); +#endif #endif /* GL_ARB_viewport_array */ #ifndef GL_KHR_blend_equation_advanced @@ -3900,6 +3887,22 @@ GLAPI void APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); #define GL_CONTEXT_ROBUST_ACCESS 0x90F3 #endif /* GL_KHR_robustness */ +#ifndef GL_KHR_shader_subgroup +#define GL_KHR_shader_subgroup 1 +#define GL_SUBGROUP_SIZE_KHR 0x9532 +#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 +#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 +#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 +#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 +#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 +#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 +#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 +#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 +#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 +#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 +#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 +#endif /* GL_KHR_shader_subgroup */ + #ifndef GL_KHR_texture_compression_astc_hdr #define GL_KHR_texture_compression_astc_hdr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 @@ -4010,6 +4013,10 @@ GLAPI void APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImag #endif #endif /* GL_EXT_EGL_image_storage */ +#ifndef GL_EXT_EGL_sync +#define GL_EXT_EGL_sync 1 +#endif /* GL_EXT_EGL_sync */ + #ifndef GL_EXT_debug_label #define GL_EXT_debug_label 1 #define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F @@ -4567,6 +4574,18 @@ GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLen #endif #endif /* GL_EXT_draw_instanced */ +#ifndef GL_EXT_multiview_tessellation_geometry_shader +#define GL_EXT_multiview_tessellation_geometry_shader 1 +#endif /* GL_EXT_multiview_tessellation_geometry_shader */ + +#ifndef GL_EXT_multiview_texture_multisample +#define GL_EXT_multiview_texture_multisample 1 +#endif /* GL_EXT_multiview_texture_multisample */ + +#ifndef GL_EXT_multiview_timer_query +#define GL_EXT_multiview_timer_query 1 +#endif /* GL_EXT_multiview_timer_query */ + #ifndef GL_EXT_polygon_offset_clamp #define GL_EXT_polygon_offset_clamp 1 #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B @@ -4643,6 +4662,11 @@ GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void); #define GL_SR8_EXT 0x8FBD #endif /* GL_EXT_texture_sRGB_R8 */ +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 +#define GL_SRG8_EXT 0x8FBE +#endif /* GL_EXT_texture_sRGB_RG8 */ + #ifndef GL_EXT_texture_sRGB_decode #define GL_EXT_texture_sRGB_decode 1 #define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 @@ -4650,6 +4674,45 @@ GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void); #define GL_SKIP_DECODE_EXT 0x8A4A #endif /* GL_EXT_texture_sRGB_decode */ +#ifndef GL_EXT_texture_shadow_lod +#define GL_EXT_texture_shadow_lod 1 +#endif /* GL_EXT_texture_shadow_lod */ + +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGB10_EXT 0x8052 +#define GL_BGRA8_EXT 0x93A1 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R32F_EXT 0x822E +#define GL_RG32F_EXT 0x8230 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +typedef void (APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* GL_EXT_texture_storage */ + #ifndef GL_EXT_window_rectangles #define GL_EXT_window_rectangles 1 #define GL_INCLUSIVE_EXT 0x8F10 @@ -4728,6 +4791,27 @@ GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLen #endif #endif /* GL_INTEL_performance_query */ +#ifndef GL_MESA_framebuffer_flip_x +#define GL_MESA_framebuffer_flip_x 1 +#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC +#endif /* GL_MESA_framebuffer_flip_x */ + +#ifndef GL_MESA_framebuffer_flip_y +#define GL_MESA_framebuffer_flip_y 1 +#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); +#endif +#endif /* GL_MESA_framebuffer_flip_y */ + +#ifndef GL_MESA_framebuffer_swap_xy +#define GL_MESA_framebuffer_swap_xy 1 +#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD +#endif /* GL_MESA_framebuffer_swap_xy */ + #ifndef GL_NV_bindless_multi_draw_indirect #define GL_NV_bindless_multi_draw_indirect 1 typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); @@ -4981,6 +5065,22 @@ GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param) #define GL_NV_conservative_raster_underestimation 1 #endif /* GL_NV_conservative_raster_underestimation */ +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); +#endif +#endif /* GL_NV_depth_buffer_float */ + #ifndef GL_NV_draw_vulkan_image #define GL_NV_draw_vulkan_image 1 typedef void (APIENTRY *GLVULKANPROCNV)(void); @@ -5032,11 +5132,11 @@ GLAPI void APIENTRY glFragmentCoverageColorNV (GLuint color); #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); -typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); -GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v); +GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); GLAPI void APIENTRY glCoverageModulationNV (GLenum components); #endif #endif /* GL_NV_framebuffer_mixed_samples */ @@ -5164,9 +5264,9 @@ GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GL #define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 #define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 #define GL_CONFORMANT_NV 0x9374 -typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); #endif #endif /* GL_NV_internalformat_sample_query */ @@ -5198,6 +5298,20 @@ GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, G #endif #endif /* GL_NV_memory_attachment */ +#ifndef GL_NV_memory_object_sparse +#define GL_NV_memory_object_sparse 1 +typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GLAPI void APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +GLAPI void APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GLAPI void APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#endif +#endif /* GL_NV_memory_object_sparse */ + #ifndef GL_NV_mesh_shader #define GL_NV_mesh_shader 1 #define GL_MESH_SHADER_NV 0x9559 @@ -5238,16 +5352,16 @@ GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, G #define GL_MESH_OUTPUT_TYPE_NV 0x957B #define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C #define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F #define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 #define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 +#define GL_MESH_SHADER_BIT_NV 0x00000040 +#define GL_TASK_SHADER_BIT_NV 0x00000080 #define GL_MESH_SUBROUTINE_NV 0x957C #define GL_TASK_SUBROUTINE_NV 0x957D #define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E #define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F -#define GL_MESH_SHADER_BIT_NV 0x00000040 -#define GL_TASK_SHADER_BIT_NV 0x00000080 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F typedef void (APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); @@ -5467,11 +5581,11 @@ typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenu typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); @@ -5525,11 +5639,11 @@ GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); #endif #endif /* GL_NV_path_rendering */ @@ -5538,6 +5652,12 @@ GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInte #define GL_SHARED_EDGE_NV 0xC0 #endif /* GL_NV_path_rendering_shared_edge */ +#ifndef GL_NV_primitive_shading_rate +#define GL_NV_primitive_shading_rate 1 +#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 +#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 +#endif /* GL_NV_primitive_shading_rate */ + #ifndef GL_NV_representative_fragment_test #define GL_NV_representative_fragment_test 1 #define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F @@ -5641,6 +5761,11 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs #define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 #endif /* GL_NV_shader_buffer_store */ +#ifndef GL_NV_shader_subgroup_partitioned +#define GL_NV_shader_subgroup_partitioned 1 +#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 +#endif /* GL_NV_shader_subgroup_partitioned */ + #ifndef GL_NV_shader_texture_footprint #define GL_NV_shader_texture_footprint 1 #endif /* GL_NV_shader_texture_footprint */ diff --git a/3rdparty/khronos/gl/glext.h b/3rdparty/khronos/gl/glext.h index 6be78f982..61ff1b070 100644 --- a/3rdparty/khronos/gl/glext.h +++ b/3rdparty/khronos/gl/glext.h @@ -6,28 +6,9 @@ extern "C" { #endif /* -** Copyright (c) 2013-2018 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at @@ -51,7 +32,7 @@ extern "C" { #define GLAPI extern #endif -#define GL_GLEXT_VERSION 20190228 +#define GL_GLEXT_VERSION 20220530 #include @@ -1461,7 +1442,7 @@ typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); -typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); @@ -1481,7 +1462,7 @@ GLAPI void APIENTRY glDeleteSync (GLsync sync); GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); -GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); @@ -1737,8 +1718,8 @@ typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); @@ -1784,8 +1765,8 @@ GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *pa GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); @@ -1843,7 +1824,7 @@ GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pna #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F #define GL_UNDEFINED_VERTEX 0x8260 typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); @@ -1932,7 +1913,7 @@ typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfl typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glReleaseShaderCompiler (void); -GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); GLAPI void APIENTRY glClearDepthf (GLfloat d); @@ -2139,7 +2120,7 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data) typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); @@ -2152,7 +2133,7 @@ typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum m GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); @@ -2433,7 +2414,7 @@ typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); @@ -2445,7 +2426,7 @@ typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); @@ -2477,7 +2458,7 @@ GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); @@ -2489,7 +2470,7 @@ GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); @@ -2581,6 +2562,18 @@ GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLui #define GL_LOSE_CONTEXT_ON_RESET 0x8252 #define GL_NO_RESET_NOTIFICATION 0x8261 #define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_MINMAX 0x802E #define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); @@ -3470,9 +3463,6 @@ typedef khronos_uint16_t GLhalfARB; #ifndef GL_ARB_imaging #define GL_ARB_imaging 1 -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 #define GL_CONVOLUTION_BORDER_MODE 0x8013 #define GL_CONVOLUTION_FILTER_SCALE 0x8014 #define GL_CONVOLUTION_FILTER_BIAS 0x8015 @@ -3490,8 +3480,6 @@ typedef khronos_uint16_t GLhalfARB; #define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 #define GL_HISTOGRAM_WIDTH 0x8026 #define GL_HISTOGRAM_FORMAT 0x8027 #define GL_HISTOGRAM_RED_SIZE 0x8028 @@ -3500,7 +3488,6 @@ typedef khronos_uint16_t GLhalfARB; #define GL_HISTOGRAM_ALPHA_SIZE 0x802B #define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C #define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E #define GL_MINMAX_FORMAT 0x802F #define GL_MINMAX_SINK 0x8030 #define GL_TABLE_TOO_LARGE 0x8031 @@ -3515,12 +3502,6 @@ typedef khronos_uint16_t GLhalfARB; #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA #define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 #define GL_COLOR_TABLE_SCALE 0x80D6 #define GL_COLOR_TABLE_BIAS 0x80D7 #define GL_COLOR_TABLE_FORMAT 0x80D8 @@ -4892,6 +4873,12 @@ GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcha #ifndef GL_ARB_viewport_array #define GL_ARB_viewport_array 1 +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f); +#endif #endif /* GL_ARB_viewport_array */ #ifndef GL_ARB_window_pos @@ -4992,6 +4979,22 @@ GLAPI void APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); #define GL_CONTEXT_ROBUST_ACCESS 0x90F3 #endif /* GL_KHR_robustness */ +#ifndef GL_KHR_shader_subgroup +#define GL_KHR_shader_subgroup 1 +#define GL_SUBGROUP_SIZE_KHR 0x9532 +#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 +#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 +#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 +#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 +#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 +#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 +#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 +#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 +#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 +#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 +#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 +#endif /* GL_KHR_shader_subgroup */ + #ifndef GL_KHR_texture_compression_astc_hdr #define GL_KHR_texture_compression_astc_hdr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 @@ -5394,12 +5397,12 @@ typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severi typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); #endif #endif /* GL_AMD_debug_output */ @@ -6465,6 +6468,10 @@ GLAPI void APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImag #endif #endif /* GL_EXT_EGL_image_storage */ +#ifndef GL_EXT_EGL_sync +#define GL_EXT_EGL_sync 1 +#endif /* GL_EXT_EGL_sync */ + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #define GL_ABGR_EXT 0x8000 @@ -7517,7 +7524,6 @@ GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, #ifndef GL_EXT_gpu_shader4 #define GL_EXT_gpu_shader4 1 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD #define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 #define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 #define GL_SAMPLER_BUFFER_EXT 0x8DC2 @@ -7545,6 +7551,7 @@ GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, #define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 #define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 #define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); @@ -7556,6 +7563,29 @@ typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); @@ -7568,6 +7598,29 @@ GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuin GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); #endif #endif /* GL_EXT_gpu_shader4 */ @@ -7794,6 +7847,18 @@ GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); #endif #endif /* GL_EXT_multisample */ +#ifndef GL_EXT_multiview_tessellation_geometry_shader +#define GL_EXT_multiview_tessellation_geometry_shader 1 +#endif /* GL_EXT_multiview_tessellation_geometry_shader */ + +#ifndef GL_EXT_multiview_texture_multisample +#define GL_EXT_multiview_texture_multisample 1 +#endif /* GL_EXT_multiview_texture_multisample */ + +#ifndef GL_EXT_multiview_timer_query +#define GL_EXT_multiview_timer_query 1 +#endif /* GL_EXT_multiview_timer_query */ + #ifndef GL_EXT_packed_depth_stencil #define GL_EXT_packed_depth_stencil 1 #define GL_DEPTH_STENCIL_EXT 0x84F9 @@ -8149,6 +8214,10 @@ GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); #define GL_EXT_shader_integer_mix 1 #endif /* GL_EXT_shader_integer_mix */ +#ifndef GL_EXT_shader_samples_identical +#define GL_EXT_shader_samples_identical 1 +#endif /* GL_EXT_shader_samples_identical */ + #ifndef GL_EXT_shadow_funcs #define GL_EXT_shadow_funcs 1 #endif /* GL_EXT_shadow_funcs */ @@ -8517,6 +8586,11 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); #define GL_SR8_EXT 0x8FBD #endif /* GL_EXT_texture_sRGB_R8 */ +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 +#define GL_SRG8_EXT 0x8FBE +#endif /* GL_EXT_texture_sRGB_RG8 */ + #ifndef GL_EXT_texture_sRGB_decode #define GL_EXT_texture_sRGB_decode 1 #define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 @@ -8524,6 +8598,10 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); #define GL_SKIP_DECODE_EXT 0x8A4A #endif /* GL_EXT_texture_sRGB_decode */ +#ifndef GL_EXT_texture_shadow_lod +#define GL_EXT_texture_shadow_lod 1 +#endif /* GL_EXT_texture_shadow_lod */ + #ifndef GL_EXT_texture_shared_exponent #define GL_EXT_texture_shared_exponent 1 #define GL_RGB9_E5_EXT 0x8C3D @@ -8551,6 +8629,36 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); #define GL_RGBA_SNORM 0x8F93 #endif /* GL_EXT_texture_snorm */ +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_BGRA8_EXT 0x93A1 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R32F_EXT 0x822E +#define GL_RG32F_EXT 0x8230 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +typedef void (APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* GL_EXT_texture_storage */ + #ifndef GL_EXT_texture_swizzle #define GL_EXT_texture_swizzle 1 #define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 @@ -9243,6 +9351,27 @@ GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLen #define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E #endif /* GL_MESAX_texture_stack */ +#ifndef GL_MESA_framebuffer_flip_x +#define GL_MESA_framebuffer_flip_x 1 +#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC +#endif /* GL_MESA_framebuffer_flip_x */ + +#ifndef GL_MESA_framebuffer_flip_y +#define GL_MESA_framebuffer_flip_y 1 +#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); +#endif +#endif /* GL_MESA_framebuffer_flip_y */ + +#ifndef GL_MESA_framebuffer_swap_xy +#define GL_MESA_framebuffer_swap_xy 1 +#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD +#endif /* GL_MESA_framebuffer_swap_xy */ + #ifndef GL_MESA_pack_invert #define GL_MESA_pack_invert 1 #define GL_PACK_INVERT_MESA 0x8758 @@ -9356,6 +9485,25 @@ GLAPI void APIENTRY glEndConditionalRenderNVX (void); #define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B #endif /* GL_NVX_gpu_memory_info */ +#ifndef GL_NVX_gpu_multicast2 +#define GL_NVX_gpu_multicast2 1 +#define GL_UPLOAD_GPU_MASK_NVX 0x954A +typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); +typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); +GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); +GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); +GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +#endif +#endif /* GL_NVX_gpu_multicast2 */ + #ifndef GL_NVX_linked_gpu_multicast #define GL_NVX_linked_gpu_multicast 1 #define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 @@ -9370,6 +9518,20 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void); #endif #endif /* GL_NVX_linked_gpu_multicast */ +#ifndef GL_NVX_progress_fence +#define GL_NVX_progress_fence 1 +typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); +GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +#endif +#endif /* GL_NVX_progress_fence */ + #ifndef GL_NV_alpha_to_coverage_dither_control #define GL_NV_alpha_to_coverage_dither_control 1 #define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D @@ -9903,11 +10065,11 @@ GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, cons #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); -typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); -GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v); +GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); GLAPI void APIENTRY glCoverageModulationNV (GLenum components); #endif #endif /* GL_NV_framebuffer_mixed_samples */ @@ -10160,9 +10322,9 @@ GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfN #define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 #define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 #define GL_CONFORMANT_NV 0x9374 -typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); #endif #endif /* GL_NV_internalformat_sample_query */ @@ -10200,6 +10362,20 @@ GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, G #endif #endif /* GL_NV_memory_attachment */ +#ifndef GL_NV_memory_object_sparse +#define GL_NV_memory_object_sparse 1 +typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GLAPI void APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +GLAPI void APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GLAPI void APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#endif +#endif /* GL_NV_memory_object_sparse */ + #ifndef GL_NV_mesh_shader #define GL_NV_mesh_shader 1 #define GL_MESH_SHADER_NV 0x9559 @@ -10240,16 +10416,16 @@ GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, G #define GL_MESH_OUTPUT_TYPE_NV 0x957B #define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C #define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F #define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 #define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 +#define GL_MESH_SHADER_BIT_NV 0x00000040 +#define GL_TASK_SHADER_BIT_NV 0x00000080 #define GL_MESH_SUBROUTINE_NV 0x957C #define GL_TASK_SUBROUTINE_NV 0x957D #define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E #define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F -#define GL_MESH_SHADER_BIT_NV 0x00000040 -#define GL_TASK_SHADER_BIT_NV 0x00000080 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F typedef void (APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); @@ -10539,11 +10715,11 @@ typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenu typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); @@ -10604,11 +10780,11 @@ GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); @@ -10689,6 +10865,12 @@ GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); #endif #endif /* GL_NV_primitive_restart */ +#ifndef GL_NV_primitive_shading_rate +#define GL_NV_primitive_shading_rate 1 +#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 +#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 +#endif /* GL_NV_primitive_shading_rate */ + #ifndef GL_NV_query_resource #define GL_NV_query_resource 1 #define GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV 0x9540 @@ -10697,9 +10879,9 @@ GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); #define GL_QUERY_RESOURCE_TEXTURE_NV 0x9545 #define GL_QUERY_RESOURCE_RENDERBUFFER_NV 0x9546 #define GL_QUERY_RESOURCE_BUFFEROBJECT_NV 0x9547 -typedef GLint (APIENTRYP PFNGLQUERYRESOURCENVPROC) (GLenum queryType, GLint tagId, GLuint bufSize, GLint *buffer); +typedef GLint (APIENTRYP PFNGLQUERYRESOURCENVPROC) (GLenum queryType, GLint tagId, GLuint count, GLint *buffer); #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glQueryResourceNV (GLenum queryType, GLint tagId, GLuint bufSize, GLint *buffer); +GLAPI GLint APIENTRY glQueryResourceNV (GLenum queryType, GLint tagId, GLuint count, GLint *buffer); #endif #endif /* GL_NV_query_resource */ @@ -10917,6 +11099,11 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs #define GL_NV_shader_storage_buffer_object 1 #endif /* GL_NV_shader_storage_buffer_object */ +#ifndef GL_NV_shader_subgroup_partitioned +#define GL_NV_shader_subgroup_partitioned 1 +#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 +#endif /* GL_NV_shader_subgroup_partitioned */ + #ifndef GL_NV_shader_texture_footprint #define GL_NV_shader_texture_footprint 1 #endif /* GL_NV_shader_texture_footprint */ @@ -11160,6 +11347,23 @@ GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenu #define GL_FORCE_BLUE_TO_ONE_NV 0x8860 #endif /* GL_NV_texture_shader3 */ +#ifndef GL_NV_timeline_semaphore +#define GL_NV_timeline_semaphore 1 +#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595 +#define GL_SEMAPHORE_TYPE_NV 0x95B3 +#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4 +#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5 +#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6 +typedef void (APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores); +typedef void (APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores); +GLAPI void APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params); +#endif +#endif /* GL_NV_timeline_semaphore */ + #ifndef GL_NV_transform_feedback #define GL_NV_transform_feedback 1 #define GL_BACK_PRIMARY_COLOR_NV 0x8C77 @@ -11265,7 +11469,7 @@ typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values); typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); @@ -11276,7 +11480,7 @@ GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSu GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values); GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); @@ -11646,54 +11850,6 @@ GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GL #ifndef GL_NV_vertex_program4 #define GL_NV_vertex_program4 1 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); -#endif #endif /* GL_NV_vertex_program4 */ #ifndef GL_NV_video_capture diff --git a/3rdparty/khronos/glx/glxext.h b/3rdparty/khronos/glx/glxext.h index c81ab4d5c..b918317fb 100644 --- a/3rdparty/khronos/glx/glxext.h +++ b/3rdparty/khronos/glx/glxext.h @@ -1,42 +1,21 @@ -#ifndef __glxext_h_ -#define __glxext_h_ 1 +#ifndef __glx_glxext_h_ +#define __glx_glxext_h_ 1 #ifdef __cplusplus extern "C" { #endif /* -** Copyright (c) 2013 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 23730 $ on $Date: 2013-10-28 15:16:34 -0700 (Mon, 28 Oct 2013) $ +** https://github.com/KhronosGroup/OpenGL-Registry */ -#define GLX_GLXEXT_VERSION 20131028 +#define GLX_GLXEXT_VERSION 20220530 /* Generated C header for: * API: glx @@ -49,6 +28,7 @@ extern "C" { #ifndef GLX_VERSION_1_3 #define GLX_VERSION_1_3 1 +typedef XID GLXContextID; typedef struct __GLXFBConfigRec *GLXFBConfig; typedef XID GLXWindow; typedef XID GLXPbuffer; @@ -157,6 +137,13 @@ __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName); #endif #endif /* GLX_VERSION_1_4 */ +#ifndef GLX_ARB_context_flush_control +#define GLX_ARB_context_flush_control 1 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#endif /* GLX_ARB_context_flush_control */ + #ifndef GLX_ARB_create_context #define GLX_ARB_create_context 1 #define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 @@ -170,6 +157,11 @@ GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXCont #endif #endif /* GLX_ARB_create_context */ +#ifndef GLX_ARB_create_context_no_error +#define GLX_ARB_create_context_no_error 1 +#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 +#endif /* GLX_ARB_create_context_no_error */ + #ifndef GLX_ARB_create_context_profile #define GLX_ARB_create_context_profile 1 #define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 @@ -242,6 +234,26 @@ __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName); #define GLX_GPU_NUM_SIMD_AMD 0x21A6 #define GLX_GPU_NUM_RB_AMD 0x21A7 #define GLX_GPU_NUM_SPI_AMD 0x21A8 +typedef unsigned int ( *PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int *ids); +typedef int ( *PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void *data); +typedef unsigned int ( *PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); +typedef GLXContext ( *PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); +typedef GLXContext ( *PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int *attribList); +typedef Bool ( *PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); +typedef Bool ( *PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); +typedef GLXContext ( *PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef void ( *PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#ifdef GLX_GLXEXT_PROTOTYPES +unsigned int glXGetGPUIDsAMD (unsigned int maxCount, unsigned int *ids); +int glXGetGPUInfoAMD (unsigned int id, int property, GLenum dataType, unsigned int size, void *data); +unsigned int glXGetContextGPUIDAMD (GLXContext ctx); +GLXContext glXCreateAssociatedContextAMD (unsigned int id, GLXContext share_list); +GLXContext glXCreateAssociatedContextAttribsAMD (unsigned int id, GLXContext share_context, const int *attribList); +Bool glXDeleteAssociatedContextAMD (GLXContext ctx); +Bool glXMakeAssociatedContextCurrentAMD (GLXContext ctx); +GLXContext glXGetCurrentAssociatedContextAMD (void); +void glXBlitContextFramebufferAMD (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif #endif /* GLX_AMD_gpu_association */ #ifndef GLX_EXT_buffer_age @@ -249,6 +261,14 @@ __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName); #define GLX_BACK_BUFFER_AGE_EXT 0x20F4 #endif /* GLX_EXT_buffer_age */ +#ifndef GLX_EXT_context_priority +#define GLX_EXT_context_priority 1 +#define GLX_CONTEXT_PRIORITY_LEVEL_EXT 0x3100 +#define GLX_CONTEXT_PRIORITY_HIGH_EXT 0x3101 +#define GLX_CONTEXT_PRIORITY_MEDIUM_EXT 0x3102 +#define GLX_CONTEXT_PRIORITY_LOW_EXT 0x3103 +#endif /* GLX_EXT_context_priority */ + #ifndef GLX_EXT_create_context_es2_profile #define GLX_EXT_create_context_es2_profile 1 #define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 @@ -270,9 +290,12 @@ __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName); #define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 #endif /* GLX_EXT_framebuffer_sRGB */ +#ifndef GLX_EXT_get_drawable_type +#define GLX_EXT_get_drawable_type 1 +#endif /* GLX_EXT_get_drawable_type */ + #ifndef GLX_EXT_import_context #define GLX_EXT_import_context 1 -typedef XID GLXContextID; #define GLX_SHARE_CONTEXT_EXT 0x800A #define GLX_VISUAL_ID_EXT 0x800B #define GLX_SCREEN_EXT 0x800C @@ -290,6 +313,32 @@ void glXFreeContextEXT (Display *dpy, GLXContext context); #endif #endif /* GLX_EXT_import_context */ +#ifndef GLX_EXT_libglvnd +#define GLX_EXT_libglvnd 1 +#define GLX_VENDOR_NAMES_EXT 0x20F6 +#endif /* GLX_EXT_libglvnd */ + +#ifndef GLX_EXT_no_config_context +#define GLX_EXT_no_config_context 1 +#endif /* GLX_EXT_no_config_context */ + +#ifndef GLX_EXT_stereo_tree +#define GLX_EXT_stereo_tree 1 +typedef struct { + int type; + unsigned long serial; + Bool send_event; + Display *display; + int extension; + int evtype; + GLXDrawable window; + Bool stereo_tree; +} GLXStereoNotifyEventEXT; +#define GLX_STEREO_TREE_EXT 0x20F5 +#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 +#define GLX_STEREO_NOTIFY_EXT 0x00000000 +#endif /* GLX_EXT_stereo_tree */ + #ifndef GLX_EXT_swap_control #define GLX_EXT_swap_control 1 #define GLX_SWAP_INTERVAL_EXT 0x20F1 @@ -407,6 +456,31 @@ GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixm #endif #endif /* GLX_MESA_pixmap_colormap */ +#ifndef GLX_MESA_query_renderer +#define GLX_MESA_query_renderer 1 +#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 +#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 +#define GLX_RENDERER_VERSION_MESA 0x8185 +#define GLX_RENDERER_ACCELERATED_MESA 0x8186 +#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 +#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 +#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 +#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A +#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B +#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C +#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D +typedef Bool ( *PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value); +typedef const char *( *PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); +typedef Bool ( *PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value); +typedef const char *( *PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); +#ifdef GLX_GLXEXT_PROTOTYPES +Bool glXQueryCurrentRendererIntegerMESA (int attribute, unsigned int *value); +const char *glXQueryCurrentRendererStringMESA (int attribute); +Bool glXQueryRendererIntegerMESA (Display *dpy, int screen, int renderer, int attribute, unsigned int *value); +const char *glXQueryRendererStringMESA (Display *dpy, int screen, int renderer, int attribute); +#endif +#endif /* GLX_MESA_query_renderer */ + #ifndef GLX_MESA_release_buffers #define GLX_MESA_release_buffers 1 typedef Bool ( *PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable); @@ -419,12 +493,32 @@ Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable); #define GLX_MESA_set_3dfx_mode 1 #define GLX_3DFX_WINDOW_MODE_MESA 0x1 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 -typedef Bool ( *PFNGLXSET3DFXMODEMESAPROC) (int mode); +typedef GLboolean ( *PFNGLXSET3DFXMODEMESAPROC) (GLint mode); #ifdef GLX_GLXEXT_PROTOTYPES -Bool glXSet3DfxModeMESA (int mode); +GLboolean glXSet3DfxModeMESA (GLint mode); #endif #endif /* GLX_MESA_set_3dfx_mode */ +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 +typedef int ( *PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( *PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); +#ifdef GLX_GLXEXT_PROTOTYPES +int glXGetSwapIntervalMESA (void); +int glXSwapIntervalMESA (unsigned int interval); +#endif +#endif /* GLX_MESA_swap_control */ + +#ifndef GLX_NV_copy_buffer +#define GLX_NV_copy_buffer 1 +typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#ifdef GLX_GLXEXT_PROTOTYPES +void glXCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +void glXNamedCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif +#endif /* GLX_NV_copy_buffer */ + #ifndef GLX_NV_copy_image #define GLX_NV_copy_image 1 typedef void ( *PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); @@ -433,11 +527,28 @@ void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLe #endif #endif /* GLX_NV_copy_image */ +#ifndef GLX_NV_delay_before_swap +#define GLX_NV_delay_before_swap 1 +typedef Bool ( *PFNGLXDELAYBEFORESWAPNVPROC) (Display *dpy, GLXDrawable drawable, GLfloat seconds); +#ifdef GLX_GLXEXT_PROTOTYPES +Bool glXDelayBeforeSwapNV (Display *dpy, GLXDrawable drawable, GLfloat seconds); +#endif +#endif /* GLX_NV_delay_before_swap */ + #ifndef GLX_NV_float_buffer #define GLX_NV_float_buffer 1 #define GLX_FLOAT_COMPONENTS_NV 0x20B0 #endif /* GLX_NV_float_buffer */ +#ifndef GLX_NV_multigpu_context +#define GLX_NV_multigpu_context 1 +#define GLX_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA +#define GLX_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB +#define GLX_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC +#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD +#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE +#endif /* GLX_NV_multigpu_context */ + #ifndef GLX_NV_multisample_coverage #define GLX_NV_multisample_coverage 1 #define GLX_COVERAGE_SAMPLES_NV 100001 @@ -455,6 +566,11 @@ int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int vi #endif #endif /* GLX_NV_present_video */ +#ifndef GLX_NV_robustness_video_memory_purge +#define GLX_NV_robustness_video_memory_purge 1 +#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7 +#endif /* GLX_NV_robustness_video_memory_purge */ + #ifndef GLX_NV_swap_group #define GLX_NV_swap_group 1 typedef Bool ( *PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group); @@ -493,8 +609,8 @@ void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV devic #endif #endif /* GLX_NV_video_capture */ -#ifndef GLX_NV_video_output -#define GLX_NV_video_output 1 +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 typedef unsigned int GLXVideoDeviceNV; #define GLX_VIDEO_OUT_COLOR_NV 0x20C3 #define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 @@ -520,7 +636,7 @@ int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf); int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); #endif -#endif /* GLX_NV_video_output */ +#endif /* GLX_NV_video_out */ #ifndef GLX_OML_swap_method #define GLX_OML_swap_method 1 @@ -721,13 +837,13 @@ int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int si #define GLX_PBUFFER_SGIX 0x8023 typedef GLXPbufferSGIX ( *PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); typedef void ( *PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf); -typedef int ( *PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +typedef void ( *PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); typedef void ( *PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask); typedef void ( *PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask); #ifdef GLX_GLXEXT_PROTOTYPES GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf); -int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +void glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask); void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask); #endif @@ -825,9 +941,9 @@ int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count); #ifndef GLX_SUN_get_transparent_index #define GLX_SUN_get_transparent_index 1 -typedef Status ( *PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +typedef Status ( *PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); #ifdef GLX_GLXEXT_PROTOTYPES -Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); #endif #endif /* GLX_SUN_get_transparent_index */ diff --git a/3rdparty/khronos/wgl/wgl.h b/3rdparty/khronos/wgl/wgl.h new file mode 100644 index 000000000..60371ac20 --- /dev/null +++ b/3rdparty/khronos/wgl/wgl.h @@ -0,0 +1,936 @@ +#ifndef __wgl_wgl_h_ +#define __wgl_wgl_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT +** +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** https://github.com/KhronosGroup/OpenGL-Registry +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +/* Generated on date 20220530 */ + +/* Generated C header for: + * API: wgl + * Versions considered: .* + * Versions emitted: .* + * Default extensions included: wgl + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef WGL_VERSION_1_0 +#define WGL_VERSION_1_0 1 +#define WGL_FONT_LINES 0 +#define WGL_FONT_POLYGONS 1 +#define WGL_SWAP_MAIN_PLANE 0x00000001 +#define WGL_SWAP_OVERLAY1 0x00000002 +#define WGL_SWAP_OVERLAY2 0x00000004 +#define WGL_SWAP_OVERLAY3 0x00000008 +#define WGL_SWAP_OVERLAY4 0x00000010 +#define WGL_SWAP_OVERLAY5 0x00000020 +#define WGL_SWAP_OVERLAY6 0x00000040 +#define WGL_SWAP_OVERLAY7 0x00000080 +#define WGL_SWAP_OVERLAY8 0x00000100 +#define WGL_SWAP_OVERLAY9 0x00000200 +#define WGL_SWAP_OVERLAY10 0x00000400 +#define WGL_SWAP_OVERLAY11 0x00000800 +#define WGL_SWAP_OVERLAY12 0x00001000 +#define WGL_SWAP_OVERLAY13 0x00002000 +#define WGL_SWAP_OVERLAY14 0x00004000 +#define WGL_SWAP_OVERLAY15 0x00008000 +#define WGL_SWAP_UNDERLAY1 0x00010000 +#define WGL_SWAP_UNDERLAY2 0x00020000 +#define WGL_SWAP_UNDERLAY3 0x00040000 +#define WGL_SWAP_UNDERLAY4 0x00080000 +#define WGL_SWAP_UNDERLAY5 0x00100000 +#define WGL_SWAP_UNDERLAY6 0x00200000 +#define WGL_SWAP_UNDERLAY7 0x00400000 +#define WGL_SWAP_UNDERLAY8 0x00800000 +#define WGL_SWAP_UNDERLAY9 0x01000000 +#define WGL_SWAP_UNDERLAY10 0x02000000 +#define WGL_SWAP_UNDERLAY11 0x04000000 +#define WGL_SWAP_UNDERLAY12 0x08000000 +#define WGL_SWAP_UNDERLAY13 0x10000000 +#define WGL_SWAP_UNDERLAY14 0x20000000 +#define WGL_SWAP_UNDERLAY15 0x40000000 +typedef int (WINAPI * PFNCHOOSEPIXELFORMATPROC) (HDC hDc, const PIXELFORMATDESCRIPTOR *pPfd); +typedef int (WINAPI * PFNDESCRIBEPIXELFORMATPROC) (HDC hdc, int ipfd, UINT cjpfd, const PIXELFORMATDESCRIPTOR *ppfd); +typedef UINT (WINAPI * PFNGETENHMETAFILEPIXELFORMATPROC) (HENHMETAFILE hemf, const PIXELFORMATDESCRIPTOR *ppfd); +typedef int (WINAPI * PFNGETPIXELFORMATPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNSETPIXELFORMATPROC) (HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR *ppfd); +typedef BOOL (WINAPI * PFNSWAPBUFFERSPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLCOPYCONTEXTPROC) (HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask); +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTPROC) (HDC hDc); +typedef HGLRC (WINAPI * PFNWGLCREATELAYERCONTEXTPROC) (HDC hDc, int level); +typedef BOOL (WINAPI * PFNWGLDELETECONTEXTPROC) (HGLRC oldContext); +typedef BOOL (WINAPI * PFNWGLDESCRIBELAYERPLANEPROC) (HDC hDc, int pixelFormat, int layerPlane, UINT nBytes, const LAYERPLANEDESCRIPTOR *plpd); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTCONTEXTPROC) (void); +typedef HDC (WINAPI * PFNWGLGETCURRENTDCPROC) (void); +typedef int (WINAPI * PFNWGLGETLAYERPALETTEENTRIESPROC) (HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF *pcr); +typedef PROC (WINAPI * PFNWGLGETPROCADDRESSPROC) (LPCSTR lpszProc); +typedef BOOL (WINAPI * PFNWGLMAKECURRENTPROC) (HDC hDc, HGLRC newContext); +typedef BOOL (WINAPI * PFNWGLREALIZELAYERPALETTEPROC) (HDC hdc, int iLayerPlane, BOOL bRealize); +typedef int (WINAPI * PFNWGLSETLAYERPALETTEENTRIESPROC) (HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF *pcr); +typedef BOOL (WINAPI * PFNWGLSHARELISTSPROC) (HGLRC hrcSrvShare, HGLRC hrcSrvSource); +typedef BOOL (WINAPI * PFNWGLSWAPLAYERBUFFERSPROC) (HDC hdc, UINT fuFlags); +typedef BOOL (WINAPI * PFNWGLUSEFONTBITMAPSPROC) (HDC hDC, DWORD first, DWORD count, DWORD listBase); +typedef BOOL (WINAPI * PFNWGLUSEFONTBITMAPSAPROC) (HDC hDC, DWORD first, DWORD count, DWORD listBase); +typedef BOOL (WINAPI * PFNWGLUSEFONTBITMAPSWPROC) (HDC hDC, DWORD first, DWORD count, DWORD listBase); +typedef BOOL (WINAPI * PFNWGLUSEFONTOUTLINESPROC) (HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf); +typedef BOOL (WINAPI * PFNWGLUSEFONTOUTLINESAPROC) (HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf); +typedef BOOL (WINAPI * PFNWGLUSEFONTOUTLINESWPROC) (HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf); +#ifdef WGL_WGLEXT_PROTOTYPES +int WINAPI ChoosePixelFormat (HDC hDc, const PIXELFORMATDESCRIPTOR *pPfd); +int WINAPI DescribePixelFormat (HDC hdc, int ipfd, UINT cjpfd, const PIXELFORMATDESCRIPTOR *ppfd); +UINT WINAPI GetEnhMetaFilePixelFormat (HENHMETAFILE hemf, const PIXELFORMATDESCRIPTOR *ppfd); +int WINAPI GetPixelFormat (HDC hdc); +BOOL WINAPI SetPixelFormat (HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR *ppfd); +BOOL WINAPI SwapBuffers (HDC hdc); +BOOL WINAPI wglCopyContext (HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask); +HGLRC WINAPI wglCreateContext (HDC hDc); +HGLRC WINAPI wglCreateLayerContext (HDC hDc, int level); +BOOL WINAPI wglDeleteContext (HGLRC oldContext); +BOOL WINAPI wglDescribeLayerPlane (HDC hDc, int pixelFormat, int layerPlane, UINT nBytes, const LAYERPLANEDESCRIPTOR *plpd); +HGLRC WINAPI wglGetCurrentContext (void); +HDC WINAPI wglGetCurrentDC (void); +int WINAPI wglGetLayerPaletteEntries (HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF *pcr); +PROC WINAPI wglGetProcAddress (LPCSTR lpszProc); +BOOL WINAPI wglMakeCurrent (HDC hDc, HGLRC newContext); +BOOL WINAPI wglRealizeLayerPalette (HDC hdc, int iLayerPlane, BOOL bRealize); +int WINAPI wglSetLayerPaletteEntries (HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF *pcr); +BOOL WINAPI wglShareLists (HGLRC hrcSrvShare, HGLRC hrcSrvSource); +BOOL WINAPI wglSwapLayerBuffers (HDC hdc, UINT fuFlags); +BOOL WINAPI wglUseFontBitmaps (HDC hDC, DWORD first, DWORD count, DWORD listBase); +BOOL WINAPI wglUseFontBitmapsA (HDC hDC, DWORD first, DWORD count, DWORD listBase); +BOOL WINAPI wglUseFontBitmapsW (HDC hDC, DWORD first, DWORD count, DWORD listBase); +BOOL WINAPI wglUseFontOutlines (HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf); +BOOL WINAPI wglUseFontOutlinesA (HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf); +BOOL WINAPI wglUseFontOutlinesW (HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf); +#endif +#endif /* WGL_VERSION_1_0 */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#ifdef WGL_WGLEXT_PROTOTYPES +HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType); +VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion); +BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height); +BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#endif +#endif /* WGL_ARB_buffer_region */ + +#ifndef WGL_ARB_context_flush_control +#define WGL_ARB_context_flush_control 1 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#endif /* WGL_ARB_context_flush_control */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList); +#ifdef WGL_WGLEXT_PROTOTYPES +HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList); +#endif +#endif /* WGL_ARB_create_context */ + +#ifndef WGL_ARB_create_context_no_error +#define WGL_ARB_create_context_no_error 1 +#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 +#endif /* WGL_ARB_create_context_no_error */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#endif /* WGL_ARB_create_context_profile */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif /* WGL_ARB_create_context_robustness */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 +typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); +#ifdef WGL_WGLEXT_PROTOTYPES +const char *WINAPI wglGetExtensionsStringARB (HDC hdc); +#endif +#endif /* WGL_ARB_extensions_string */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 +#endif /* WGL_ARB_framebuffer_sRGB */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +HDC WINAPI wglGetCurrentReadDCARB (void); +#endif +#endif /* WGL_ARB_make_current_read */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 +#endif /* WGL_ARB_multisample */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 +DECLARE_HANDLE(HPBUFFERARB); +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#ifdef WGL_WGLEXT_PROTOTYPES +HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer); +int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC); +BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer); +BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#endif +#endif /* WGL_ARB_pbuffer */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif +#endif /* WGL_ARB_pixel_format */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 +#endif /* WGL_ARB_pixel_format_float */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList); +#endif +#endif /* WGL_ARB_render_texture */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 +#endif /* WGL_ARB_robustness_application_isolation */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 +#endif /* WGL_ARB_robustness_share_group_isolation */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 +#endif /* WGL_3DFX_multisample */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState); +#endif +#endif /* WGL_3DL_stereo_control */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void *data); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#ifdef WGL_WGLEXT_PROTOTYPES +UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids); +INT WINAPI wglGetGPUInfoAMD (UINT id, INT property, GLenum dataType, UINT size, void *data); +UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc); +HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id); +HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList); +BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc); +BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc); +HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void); +VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +#endif /* WGL_AMD_gpu_association */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#endif /* WGL_ATI_pixel_format_float */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 +#endif /* WGL_ATI_render_texture_rectangle */ + +#ifndef WGL_EXT_colorspace +#define WGL_EXT_colorspace 1 +#define WGL_COLORSPACE_EXT 0x309D +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define WGL_COLORSPACE_LINEAR_EXT 0x308A +#endif /* WGL_EXT_colorspace */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 +#endif /* WGL_EXT_create_context_es2_profile */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 +#endif /* WGL_EXT_create_context_es_profile */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 +#define WGL_DEPTH_FLOAT_EXT 0x2040 +#endif /* WGL_EXT_depth_float */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length); +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +#ifdef WGL_WGLEXT_PROTOTYPES +GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id); +GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length); +GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id); +VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id); +#endif +#endif /* WGL_EXT_display_color_table */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 +typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); +#ifdef WGL_WGLEXT_PROTOTYPES +const char *WINAPI wglGetExtensionsStringEXT (void); +#endif +#endif /* WGL_EXT_extensions_string */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 +#endif /* WGL_EXT_framebuffer_sRGB */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +HDC WINAPI wglGetCurrentReadDCEXT (void); +#endif +#endif /* WGL_EXT_make_current_read */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 +#endif /* WGL_EXT_multisample */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 +DECLARE_HANDLE(HPBUFFEREXT); +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#ifdef WGL_WGLEXT_PROTOTYPES +HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer); +int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC); +BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer); +BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#endif +#endif /* WGL_EXT_pbuffer */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif +#endif /* WGL_EXT_pixel_format */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 +#endif /* WGL_EXT_pixel_format_packed_float */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglSwapIntervalEXT (int interval); +int WINAPI wglGetSwapIntervalEXT (void); +#endif +#endif /* WGL_EXT_swap_control */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 +#endif /* WGL_EXT_swap_control_tear */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue); +BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue); +#endif +#endif /* WGL_I3D_digital_video_control */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue); +BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue); +BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#endif +#endif /* WGL_I3D_gamma */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglEnableGenlockI3D (HDC hDC); +BOOL WINAPI wglDisableGenlockI3D (HDC hDC); +BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag); +BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource); +BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource); +BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge); +BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge); +BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate); +BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate); +BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay); +BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay); +BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#endif +#endif /* WGL_I3D_genlock */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count); +#ifdef WGL_WGLEXT_PROTOTYPES +LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags); +BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress); +BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count); +#endif +#endif /* WGL_I3D_image_buffer */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglEnableFrameLockI3D (void); +BOOL WINAPI wglDisableFrameLockI3D (void); +BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag); +BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag); +#endif +#endif /* WGL_I3D_swap_frame_lock */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage); +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglGetFrameUsageI3D (float *pUsage); +BOOL WINAPI wglBeginFrameTrackingI3D (void); +BOOL WINAPI wglEndFrameTrackingI3D (void); +BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#endif +#endif /* WGL_I3D_swap_frame_usage */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 +#define WGL_ACCESS_READ_ONLY_NV 0x00000000 +#define WGL_ACCESS_READ_WRITE_NV 0x00000001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002 +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice); +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle); +HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice); +BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice); +HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access); +BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject); +BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access); +BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects); +BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects); +#endif +#endif /* WGL_NV_DX_interop */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 +#endif /* WGL_NV_DX_interop2 */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* WGL_NV_copy_image */ + +#ifndef WGL_NV_delay_before_swap +#define WGL_NV_delay_before_swap 1 +typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds); +#endif +#endif /* WGL_NV_delay_before_swap */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 +#endif /* WGL_NV_float_buffer */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 +DECLARE_HANDLE(HGPUNV); +struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +}; +typedef struct _GPU_DEVICE *PGPU_DEVICE; +#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu); +BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList); +BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +BOOL WINAPI wglDeleteDCNV (HDC hdc); +#endif +#endif /* WGL_NV_gpu_affinity */ + +#ifndef WGL_NV_multigpu_context +#define WGL_NV_multigpu_context 1 +#define WGL_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA +#define WGL_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB +#define WGL_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC +#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD +#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE +#endif /* WGL_NV_multigpu_context */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 +#endif /* WGL_NV_multisample_coverage */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue); +#ifdef WGL_WGLEXT_PROTOTYPES +int WINAPI wglEnumerateVideoDevicesNV (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList); +BOOL WINAPI wglBindVideoDeviceNV (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue); +#endif +#endif /* WGL_NV_present_video */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 +#endif /* WGL_NV_render_depth_texture */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 +#endif /* WGL_NV_render_texture_rectangle */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group); +BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier); +BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier); +BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count); +BOOL WINAPI wglResetFrameCountNV (HDC hDC); +#endif +#endif /* WGL_NV_swap_group */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 +typedef void *(WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); +#ifdef WGL_WGLEXT_PROTOTYPES +void *WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +void WINAPI wglFreeMemoryNV (void *pointer); +#endif +#endif /* WGL_NV_vertex_array_range */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#endif +#endif /* WGL_NV_video_capture */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 +DECLARE_HANDLE(HPVIDEODEV); +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice); +BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer); +BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif +#endif /* WGL_NV_video_output */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#ifdef WGL_WGLEXT_PROTOTYPES +BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator); +INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#endif +#endif /* WGL_OML_sync_control */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/wgl/wglext.h b/3rdparty/khronos/wgl/wglext.h index 783e53d84..cbb374e56 100644 --- a/3rdparty/khronos/wgl/wglext.h +++ b/3rdparty/khronos/wgl/wglext.h @@ -1,39 +1,18 @@ -#ifndef __wglext_h_ -#define __wglext_h_ 1 +#ifndef __wgl_wglext_h_ +#define __wgl_wglext_h_ 1 #ifdef __cplusplus extern "C" { #endif /* -** Copyright (c) 2013 The Khronos Group Inc. +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT ** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 23730 $ on $Date: 2013-10-28 15:16:34 -0700 (Mon, 28 Oct 2013) $ +** https://github.com/KhronosGroup/OpenGL-Registry */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -41,7 +20,7 @@ extern "C" { #include #endif -#define WGL_WGLEXT_VERSION 20131028 +#define WGL_WGLEXT_VERSION 20220530 /* Generated C header for: * API: wgl @@ -70,6 +49,13 @@ BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, #endif #endif /* WGL_ARB_buffer_region */ +#ifndef WGL_ARB_context_flush_control +#define WGL_ARB_context_flush_control 1 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#endif /* WGL_ARB_context_flush_control */ + #ifndef WGL_ARB_create_context #define WGL_ARB_create_context 1 #define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 @@ -85,6 +71,11 @@ HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int #endif #endif /* WGL_ARB_create_context */ +#ifndef WGL_ARB_create_context_no_error +#define WGL_ARB_create_context_no_error 1 +#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 +#endif /* WGL_ARB_create_context_no_error */ + #ifndef WGL_ARB_create_context_profile #define WGL_ARB_create_context_profile 1 #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 @@ -308,7 +299,7 @@ BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState); #define WGL_GPU_NUM_RB_AMD 0x21A7 #define WGL_GPU_NUM_SPI_AMD 0x21A8 typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids); -typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void *data); typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList); @@ -318,7 +309,7 @@ typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #ifdef WGL_WGLEXT_PROTOTYPES UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids); -INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data); +INT WINAPI wglGetGPUInfoAMD (UINT id, INT property, GLenum dataType, UINT size, void *data); UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc); HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id); HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList); @@ -334,6 +325,18 @@ VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0 #define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 #endif /* WGL_ATI_pixel_format_float */ +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 +#endif /* WGL_ATI_render_texture_rectangle */ + +#ifndef WGL_EXT_colorspace +#define WGL_EXT_colorspace 1 +#define WGL_COLORSPACE_EXT 0x309D +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define WGL_COLORSPACE_LINEAR_EXT 0x308A +#endif /* WGL_EXT_colorspace */ + #ifndef WGL_EXT_create_context_es2_profile #define WGL_EXT_create_context_es2_profile 1 #define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 @@ -693,6 +696,15 @@ BOOL WINAPI wglDeleteDCNV (HDC hdc); #endif #endif /* WGL_NV_gpu_affinity */ +#ifndef WGL_NV_multigpu_context +#define WGL_NV_multigpu_context 1 +#define WGL_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA +#define WGL_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB +#define WGL_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC +#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD +#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE +#endif /* WGL_NV_multigpu_context */ + #ifndef WGL_NV_multisample_coverage #define WGL_NV_multisample_coverage 1 #define WGL_COVERAGE_SAMPLES_NV 0x2042 @@ -703,12 +715,12 @@ BOOL WINAPI wglDeleteDCNV (HDC hdc); #define WGL_NV_present_video 1 DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); #define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 -typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); -typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue); #ifdef WGL_WGLEXT_PROTOTYPES -int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); -BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +int WINAPI wglEnumerateVideoDevicesNV (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList); +BOOL WINAPI wglBindVideoDeviceNV (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue); #endif #endif /* WGL_NV_present_video */ @@ -813,14 +825,14 @@ BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCount typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator); typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); -typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); #ifdef WGL_WGLEXT_PROTOTYPES BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator); INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); -INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); #endif From f449f139f12e32b1b227f2891f27146ca555902a Mon Sep 17 00:00:00 2001 From: HumanBean4 <101287097+HumanBean4@users.noreply.github.com> Date: Thu, 19 Jan 2023 10:16:04 -0500 Subject: [PATCH 18/86] Fixed texture side iterator being too small (#3025) --- src/renderer_vk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index a3c8aa243..e7aa9de66 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -5968,7 +5968,7 @@ VK_DESTROY bx::memSet(imageInfos, 0, sizeof(ImageInfo) * numSrd); uint32_t alignment = 1; // tightly aligned buffer - for (uint8_t side = 0; side < numSides; ++side) + for (uint16_t side = 0; side < numSides; ++side) { for (uint8_t lod = 0; lod < ti.numMips; ++lod) { From 9cc4d85b6961dba97e73ec13201b7cc8f9217478 Mon Sep 17 00:00:00 2001 From: HumanBean4 <101287097+HumanBean4@users.noreply.github.com> Date: Thu, 19 Jan 2023 10:16:28 -0500 Subject: [PATCH 19/86] Fixed texture side iterator being too small (#3026) --- src/renderer_d3d12.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 47b72f82a..d27136791 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -5099,7 +5099,7 @@ namespace bgfx { namespace d3d12 , swizzle ? " (swizzle BGRA8 -> RGBA8)" : "" ); - for (uint8_t side = 0; side < numSides; ++side) + for (uint16_t side = 0; side < numSides; ++side) { for (uint8_t lod = 0; lod < ti.numMips; ++lod) { From adb0f893a3c5e95ad4a57edbba91007e78cf19a2 Mon Sep 17 00:00:00 2001 From: ShuangLiu1992 Date: Thu, 19 Jan 2023 16:45:51 +0000 Subject: [PATCH 20/86] fix ios entry (#3027) When initWithFrame is being called s_ctx has not been created yet. Fix with correct assign order. --- examples/common/entry/entry_ios.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/common/entry/entry_ios.mm b/examples/common/entry/entry_ios.mm index ee5f39674..aa4a9b8e6 100644 --- a/examples/common/entry/entry_ios.mm +++ b/examples/common/entry/entry_ios.mm @@ -212,8 +212,6 @@ using namespace entry; return nil; } - s_ctx->m_window = self.layer; - return self; } @@ -335,6 +333,7 @@ using namespace entry; [m_view setContentScaleFactor: scaleFactor ]; s_ctx = new Context((uint32_t)(scaleFactor*rect.size.width), (uint32_t)(scaleFactor*rect.size.height)); + s_ctx->m_window = m_view.layer; return YES; } From bea82a13436a42a339e26354c8106dc28dedc178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 21 Jan 2023 08:51:44 -0800 Subject: [PATCH 21/86] GLES3+: Fix headers. --- src/renderer_gl.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 24a963820..784d57899 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -140,8 +140,14 @@ typedef uint64_t GLuint64; # define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES # elif BGFX_CONFIG_RENDERER_OPENGLES >= 30 # include -# include -# include +# if BGFX_CONFIG_RENDERER_OPENGLES >= 32 +# include +# elif BGFX_CONFIG_RENDERER_OPENGLES >= 31 +# include +# else +# include +# endif // BGFX_CONFIG_RENDERER_OPENGLES +# include # endif // BGFX_CONFIG_RENDERER_ # if BGFX_USE_EGL From c645acdc032e2ce3e71f80b943301cdcc32cb393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 25 Jan 2023 20:27:08 -0800 Subject: [PATCH 22/86] shaderc: Fixed textureSize overloads. Issue #3020. --- src/bgfx_shader.sh | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/bgfx_shader.sh b/src/bgfx_shader.sh index 3dd755682..48dbfd073 100644 --- a/src/bgfx_shader.sh +++ b/src/bgfx_shader.sh @@ -235,11 +235,28 @@ float bgfxShadow2DProj(BgfxSampler2DShadow _sampler, vec4 _coord) return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, coord.xy, coord.z); } +vec2 bgfxTextureSize(BgfxSampler2DShadow _sampler, int _lod) +{ + vec2 result; + float numberOfMipMapLevels; + _sampler.m_texture.GetDimensions(_lod, result.x, result.y, numberOfMipMapLevels); + return result; +} + vec4 bgfxShadow2DArray(BgfxSampler2DArrayShadow _sampler, vec4 _coord) { return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xyz, _coord.w); } +vec2 bgfxTextureSize(BgfxSampler2DArrayShadow _sampler, int _lod) +{ + vec2 result; + float numberOfMipMapLevels; + float numberOfElements; + _sampler.m_texture.GetDimensions(_lod, result.x, result.y, numberOfElements, numberOfMipMapLevels); + return result; +} + vec4 bgfxTexture3D(BgfxSampler3D _sampler, vec3 _coord) { return _sampler.m_texture.Sample(_sampler.m_sampler, _coord); @@ -297,21 +314,24 @@ vec4 bgfxTexelFetchOffset(BgfxSampler2D _sampler, ivec2 _coord, int _lod, ivec2 vec2 bgfxTextureSize(BgfxSampler2D _sampler, int _lod) { vec2 result; - _sampler.m_texture.GetDimensions(result.x, result.y); + float numberOfMipMapLevels; + _sampler.m_texture.GetDimensions(_lod, result.x, result.y, numberOfMipMapLevels); return result; } vec2 bgfxTextureSize(BgfxISampler2D _sampler, int _lod) { vec2 result; - _sampler.m_texture.GetDimensions(result.x, result.y); + float numberOfMipMapLevels; + _sampler.m_texture.GetDimensions(_lod, result.x, result.y, numberOfMipMapLevels); return result; } vec2 bgfxTextureSize(BgfxUSampler2D _sampler, int _lod) { vec2 result; - _sampler.m_texture.GetDimensions(result.x, result.y); + float numberOfMipMapLevels; + _sampler.m_texture.GetDimensions(_lod, result.x, result.y, numberOfMipMapLevels); return result; } @@ -319,14 +339,17 @@ vec4 bgfxTextureGather0(BgfxSampler2D _sampler, vec2 _coord) { return _sampler.m_texture.GatherRed(_sampler.m_sampler, _coord); } + vec4 bgfxTextureGather1(BgfxSampler2D _sampler, vec2 _coord) { return _sampler.m_texture.GatherGreen(_sampler.m_sampler, _coord); } + vec4 bgfxTextureGather2(BgfxSampler2D _sampler, vec2 _coord) { return _sampler.m_texture.GatherBlue(_sampler.m_sampler, _coord); } + vec4 bgfxTextureGather3(BgfxSampler2D _sampler, vec2 _coord) { return _sampler.m_texture.GatherAlpha(_sampler.m_sampler, _coord); @@ -336,14 +359,17 @@ vec4 bgfxTextureGatherOffset0(BgfxSampler2D _sampler, vec2 _coord, ivec2 _offset { return _sampler.m_texture.GatherRed(_sampler.m_sampler, _coord, _offset); } + vec4 bgfxTextureGatherOffset1(BgfxSampler2D _sampler, vec2 _coord, ivec2 _offset) { return _sampler.m_texture.GatherGreen(_sampler.m_sampler, _coord, _offset); } + vec4 bgfxTextureGatherOffset2(BgfxSampler2D _sampler, vec2 _coord, ivec2 _offset) { return _sampler.m_texture.GatherBlue(_sampler.m_sampler, _coord, _offset); } + vec4 bgfxTextureGatherOffset3(BgfxSampler2D _sampler, vec2 _coord, ivec2 _offset) { return _sampler.m_texture.GatherAlpha(_sampler.m_sampler, _coord, _offset); @@ -353,14 +379,17 @@ vec4 bgfxTextureGather0(BgfxSampler2DArray _sampler, vec3 _coord) { return _sampler.m_texture.GatherRed(_sampler.m_sampler, _coord); } + vec4 bgfxTextureGather1(BgfxSampler2DArray _sampler, vec3 _coord) { return _sampler.m_texture.GatherGreen(_sampler.m_sampler, _coord); } + vec4 bgfxTextureGather2(BgfxSampler2DArray _sampler, vec3 _coord) { return _sampler.m_texture.GatherBlue(_sampler.m_sampler, _coord); } + vec4 bgfxTextureGather3(BgfxSampler2DArray _sampler, vec3 _coord) { return _sampler.m_texture.GatherAlpha(_sampler.m_sampler, _coord); @@ -394,7 +423,8 @@ vec4 bgfxTexelFetch(BgfxSampler3D _sampler, ivec3 _coord, int _lod) vec3 bgfxTextureSize(BgfxSampler3D _sampler, int _lod) { vec3 result; - _sampler.m_texture.GetDimensions(result.x, result.y, result.z); + float numberOfMipMapLevels; + _sampler.m_texture.GetDimensions(_lod, result.x, result.y, result.z, numberOfMipMapLevels); return result; } From 6f36b4fb3a0d76090eb2727ecf11abac46eef8aa Mon Sep 17 00:00:00 2001 From: issam3105 <67145992+issam3105@users.noreply.github.com> Date: Wed, 1 Feb 2023 16:26:55 +0100 Subject: [PATCH 23/86] Fix shader preprocessor constructor call (#3030) Co-authored-by: Issam --- tools/shaderc/shaderc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index 05c8b6325..99fc68834 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -1105,7 +1105,7 @@ namespace bgfx const Profile *profile = &s_profiles[profile_id]; - Preprocessor preprocessor(_options.inputFilePath.c_str(), profile->lang != ShadingLang::ESSL); + Preprocessor preprocessor(_options.inputFilePath.c_str(), profile->lang == ShadingLang::ESSL); for (size_t ii = 0; ii < _options.includeDirs.size(); ++ii) { From 10ec8e8882612fb2a267a11f8c4c2da3f113c562 Mon Sep 17 00:00:00 2001 From: issam3105 <67145992+issam3105@users.noreply.github.com> Date: Thu, 2 Feb 2023 18:14:22 +0100 Subject: [PATCH 24/86] Removed useless precision highp sampler2DArray (#3031) Co-authored-by: Issam --- tools/shaderc/shaderc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index 99fc68834..24823c0d4 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -2375,7 +2375,7 @@ namespace bgfx bx::stringPrintf(code, "precision highp int;\n"); } - if (glsl_profile >= 300) + if (glsl_profile >= 300 && usesTextureArray) { bx::stringPrintf(code, "precision highp sampler2DArray;\n"); } From cd3a1ea7f8045a54c06fe7b4420afb7a25d64fe7 Mon Sep 17 00:00:00 2001 From: Christophe Dehais Date: Thu, 2 Feb 2023 18:16:32 +0100 Subject: [PATCH 25/86] [GL] Fix sRGB framebuffer write (#3032) --- src/renderer_gl.cpp | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index a289fc4ce..6b2e16e2d 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3821,18 +3821,6 @@ namespace bgfx { namespace gl m_needPresent |= true; m_currentFbo = m_msaaBackBufferFbo; - - if (m_srgbWriteControlSupport) - { - if (0 != (m_resolution.reset & BGFX_RESET_SRGB_BACKBUFFER) ) - { - GL_CHECK(glEnable(GL_FRAMEBUFFER_SRGB) ); - } - else - { - GL_CHECK(glDisable(GL_FRAMEBUFFER_SRGB) ); - } - } } else { @@ -3853,6 +3841,26 @@ namespace bgfx { namespace gl } } + if (m_srgbWriteControlSupport) + { + if (0 == m_currentFbo) + { + if (0 != (m_resolution.reset & BGFX_RESET_SRGB_BACKBUFFER) ) + { + GL_CHECK(glEnable(GL_FRAMEBUFFER_SRGB) ); + } + else + { + GL_CHECK(glDisable(GL_FRAMEBUFFER_SRGB) ); + } + } + else + { + // actual sRGB write/blending determined by FBO's color attachments format + GL_CHECK(glEnable(GL_FRAMEBUFFER_SRGB) ); + } + } + GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_currentFbo) ); m_fbh = _fbh; @@ -8579,6 +8587,12 @@ namespace bgfx { namespace gl profiler.end(); } + + if (m_srgbWriteControlSupport) + { + // switch state back to default for cases when the on-screen draw is done externally + GL_CHECK(glDisable(GL_FRAMEBUFFER_SRGB) ); + } } BGFX_GL_PROFILER_END(); From 35b0fdd60b8f592d9db84819845a4ee0e6ff3188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:00:05 -0800 Subject: [PATCH 26/86] Updated cgltf. --- 3rdparty/cgltf/cgltf.h | 37 ++++++++++++++++++------------------ 3rdparty/cgltf/cgltf_write.h | 1 + 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/3rdparty/cgltf/cgltf.h b/3rdparty/cgltf/cgltf.h index 0e9c67eaa..f38fd665d 100644 --- a/3rdparty/cgltf/cgltf.h +++ b/3rdparty/cgltf/cgltf.h @@ -65,7 +65,8 @@ * * `cgltf_num_components` is a tiny utility that tells you the dimensionality of * a certain accessor type. This can be used before `cgltf_accessor_unpack_floats` to help allocate - * the necessary amount of memory. + * the necessary amount of memory. `cgltf_component_size` and `cgltf_calc_size` exist for + * similar purposes. * * `cgltf_accessor_read_float` reads a certain element from a non-sparse accessor and converts it to * floating point, assuming that `cgltf_load_buffers` has already been called. The passed-in element @@ -837,6 +838,8 @@ cgltf_bool cgltf_accessor_read_uint(const cgltf_accessor* accessor, cgltf_size i cgltf_size cgltf_accessor_read_index(const cgltf_accessor* accessor, cgltf_size index); cgltf_size cgltf_num_components(cgltf_type type); +cgltf_size cgltf_component_size(cgltf_component_type component_type); +cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type); cgltf_size cgltf_accessor_unpack_floats(const cgltf_accessor* accessor, cgltf_float* out, cgltf_size float_count); @@ -904,15 +907,15 @@ enum jsmnerr { }; typedef struct { jsmntype_t type; - int start; - int end; + ptrdiff_t start; + ptrdiff_t end; int size; #ifdef JSMN_PARENT_LINKS int parent; #endif } jsmntok_t; typedef struct { - unsigned int pos; /* offset in the JSON string */ + size_t pos; /* offset in the JSON string */ unsigned int toknext; /* next token to allocate */ int toksuper; /* superior token node, e.g parent object or array */ } jsmn_parser; @@ -1488,8 +1491,6 @@ cgltf_result cgltf_load_buffers(const cgltf_options* options, cgltf_data* data, return cgltf_result_success; } -static cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type); - static cgltf_size cgltf_calc_index_bound(cgltf_buffer_view* buffer_view, cgltf_size offset, cgltf_component_type component_type, cgltf_size count) { char* data = (char*)buffer_view->buffer->data + offset + buffer_view->offset; @@ -2253,8 +2254,6 @@ static cgltf_float cgltf_component_read_float(const void* in, cgltf_component_ty return (cgltf_float)cgltf_component_read_integer(in, component_type); } -static cgltf_size cgltf_component_size(cgltf_component_type component_type); - static cgltf_bool cgltf_element_read_float(const uint8_t* element, cgltf_type type, cgltf_component_type component_type, cgltf_bool normalized, cgltf_float* out, cgltf_size element_size) { cgltf_size num_components = cgltf_num_components(type); @@ -2505,7 +2504,7 @@ static int cgltf_json_strcmp(jsmntok_t const* tok, const uint8_t* json_chunk, co { CGLTF_CHECK_TOKTYPE(*tok, JSMN_STRING); size_t const str_len = strlen(str); - size_t const name_length = tok->end - tok->start; + size_t const name_length = (size_t)(tok->end - tok->start); return (str_len == name_length) ? strncmp((const char*)json_chunk + tok->start, str, str_len) : 128; } @@ -2513,7 +2512,7 @@ static int cgltf_json_to_int(jsmntok_t const* tok, const uint8_t* json_chunk) { CGLTF_CHECK_TOKTYPE(*tok, JSMN_PRIMITIVE); char tmp[128]; - int size = (cgltf_size)(tok->end - tok->start) < sizeof(tmp) ? tok->end - tok->start : (int)(sizeof(tmp) - 1); + int size = (size_t)(tok->end - tok->start) < sizeof(tmp) ? (int)(tok->end - tok->start) : (int)(sizeof(tmp) - 1); strncpy(tmp, (const char*)json_chunk + tok->start, size); tmp[size] = 0; return CGLTF_ATOI(tmp); @@ -2523,7 +2522,7 @@ static cgltf_size cgltf_json_to_size(jsmntok_t const* tok, const uint8_t* json_c { CGLTF_CHECK_TOKTYPE_RETTYPE(*tok, JSMN_PRIMITIVE, cgltf_size); char tmp[128]; - int size = (cgltf_size)(tok->end - tok->start) < sizeof(tmp) ? tok->end - tok->start : (int)(sizeof(tmp) - 1); + int size = (size_t)(tok->end - tok->start) < sizeof(tmp) ? (int)(tok->end - tok->start) : (int)(sizeof(tmp) - 1); strncpy(tmp, (const char*)json_chunk + tok->start, size); tmp[size] = 0; return (cgltf_size)CGLTF_ATOLL(tmp); @@ -2533,7 +2532,7 @@ static cgltf_float cgltf_json_to_float(jsmntok_t const* tok, const uint8_t* json { CGLTF_CHECK_TOKTYPE(*tok, JSMN_PRIMITIVE); char tmp[128]; - int size = (cgltf_size)(tok->end - tok->start) < sizeof(tmp) ? tok->end - tok->start : (int)(sizeof(tmp) - 1); + int size = (size_t)(tok->end - tok->start) < sizeof(tmp) ? (int)(tok->end - tok->start) : (int)(sizeof(tmp) - 1); strncpy(tmp, (const char*)json_chunk + tok->start, size); tmp[size] = 0; return (cgltf_float)CGLTF_ATOF(tmp); @@ -2541,7 +2540,7 @@ static cgltf_float cgltf_json_to_float(jsmntok_t const* tok, const uint8_t* json static cgltf_bool cgltf_json_to_bool(jsmntok_t const* tok, const uint8_t* json_chunk) { - int size = tok->end - tok->start; + int size = (int)(tok->end - tok->start); return size == 4 && memcmp(json_chunk + tok->start, "true", 4) == 0; } @@ -2607,7 +2606,7 @@ static int cgltf_parse_json_string(cgltf_options* options, jsmntok_t const* toke { return CGLTF_ERROR_JSON; } - int size = tokens[i].end - tokens[i].start; + int size = (int)(tokens[i].end - tokens[i].start); char* result = (char*)options->memory.alloc_func(options->memory.user_data, size + 1); if (!result) { @@ -5965,7 +5964,7 @@ cgltf_size cgltf_num_components(cgltf_type type) { } } -static cgltf_size cgltf_component_size(cgltf_component_type component_type) { +cgltf_size cgltf_component_size(cgltf_component_type component_type) { switch (component_type) { case cgltf_component_type_r_8: @@ -5983,7 +5982,7 @@ static cgltf_size cgltf_component_size(cgltf_component_type component_type) { } } -static cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type) +cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type) { cgltf_size component_size = cgltf_component_size(component_type); if (type == cgltf_type_mat2 && component_size == 1) @@ -6501,7 +6500,7 @@ static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, * Fills token type and boundaries. */ static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type, - int start, int end) { + ptrdiff_t start, ptrdiff_t end) { token->type = type; token->start = start; token->end = end; @@ -6514,7 +6513,7 @@ static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type, static int jsmn_parse_primitive(jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, size_t num_tokens) { jsmntok_t *token; - int start; + ptrdiff_t start; start = parser->pos; @@ -6564,7 +6563,7 @@ static int jsmn_parse_string(jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, size_t num_tokens) { jsmntok_t *token; - int start = parser->pos; + ptrdiff_t start = parser->pos; parser->pos++; diff --git a/3rdparty/cgltf/cgltf_write.h b/3rdparty/cgltf/cgltf_write.h index 033b0d1cc..1b3c7721c 100644 --- a/3rdparty/cgltf/cgltf_write.h +++ b/3rdparty/cgltf/cgltf_write.h @@ -1123,6 +1123,7 @@ static void cgltf_write_light(cgltf_write_context* context, const cgltf_light* l cgltf_write_floatprop(context, "outerConeAngle", light->spot_outer_cone_angle, 3.14159265358979323846f/4.0f); cgltf_write_line(context, "}"); } + cgltf_write_extras( context, &light->extras ); cgltf_write_line(context, "}"); } From 94ce7aa6a919768fd0390bdd2afcf750c1aaeca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:00:14 -0800 Subject: [PATCH 27/86] Updated meshoptimizer. --- 3rdparty/meshoptimizer/LICENSE.md | 2 +- 3rdparty/meshoptimizer/src/meshoptimizer.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/3rdparty/meshoptimizer/LICENSE.md b/3rdparty/meshoptimizer/LICENSE.md index b673c248b..962ed41ff 100644 --- a/3rdparty/meshoptimizer/LICENSE.md +++ b/3rdparty/meshoptimizer/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2022 Arseny Kapoulkine +Copyright (c) 2016-2023 Arseny Kapoulkine Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/3rdparty/meshoptimizer/src/meshoptimizer.h b/3rdparty/meshoptimizer/src/meshoptimizer.h index d95725dd7..f3dcac277 100644 --- a/3rdparty/meshoptimizer/src/meshoptimizer.h +++ b/3rdparty/meshoptimizer/src/meshoptimizer.h @@ -1,7 +1,7 @@ /** * meshoptimizer - version 0.18 * - * Copyright (C) 2016-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) + * Copyright (C) 2016-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Report bugs and download new versions at https://github.com/zeux/meshoptimizer * * This library is distributed under the MIT License. See notice at the end of this file. @@ -501,7 +501,8 @@ struct meshopt_Bounds * dot(center - camera_position, cone_axis) >= cone_cutoff * length(center - camera_position) + radius * * The formula that uses the apex is slightly more accurate but needs the apex; if you are already using bounding sphere - * to do frustum/occlusion culling, the formula that doesn't use the apex may be preferable. + * to do frustum/occlusion culling, the formula that doesn't use the apex may be preferable (for derivation see + * Real-Time Rendering 4th Edition, section 19.3). * * vertex_positions should have float3 position in the first 12 bytes of each vertex * index_count/3 should be less than or equal to 512 (the function assumes clusters of limited size) @@ -1044,7 +1045,7 @@ inline void meshopt_spatialSortTriangles(T* destination, const T* indices, size_ #endif /** - * Copyright (c) 2016-2022 Arseny Kapoulkine + * Copyright (c) 2016-2023 Arseny Kapoulkine * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation From a7ef647e98247a79785096f60ea25629bdc0df8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:00:28 -0800 Subject: [PATCH 28/86] Updated ImGui. --- 3rdparty/dear-imgui/imgui.cpp | 66 ++++++++++---- 3rdparty/dear-imgui/imgui.h | 10 +-- 3rdparty/dear-imgui/imgui_demo.cpp | 100 +++++++++++---------- 3rdparty/dear-imgui/imgui_draw.cpp | 24 +++-- 3rdparty/dear-imgui/imgui_internal.h | 87 +++++++++--------- 3rdparty/dear-imgui/imgui_tables.cpp | 90 ++++++++++--------- 3rdparty/dear-imgui/imgui_widgets.cpp | 123 +++++++++++++++++--------- 7 files changed, 288 insertions(+), 212 deletions(-) diff --git a/3rdparty/dear-imgui/imgui.cpp b/3rdparty/dear-imgui/imgui.cpp index 94414cfd2..24fb8fd3a 100644 --- a/3rdparty/dear-imgui/imgui.cpp +++ b/3rdparty/dear-imgui/imgui.cpp @@ -11,7 +11,7 @@ // - FAQ http://dearimgui.org/faq // - Homepage & latest https://github.com/ocornut/imgui // - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/5243 (please post your screenshots/video there!) +// - Gallery https://github.com/ocornut/imgui/issues/5886 (please post your screenshots/video there!) // - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there) // - Glossary https://github.com/ocornut/imgui/wiki/Glossary // - Issues & support https://github.com/ocornut/imgui/issues @@ -1469,7 +1469,7 @@ void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down) g.InputEventsQueue.push_back(e); } -// Queue a mouse wheel event (most mouse/API will only have a Y component) +// Queue a mouse wheel event (some mouse/API may only have a Y component) void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y) { ImGuiContext& g = *GImGui; @@ -1807,18 +1807,36 @@ void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, ImGuiContext& g = *GImGui; va_list args; va_start(args, fmt); - int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); - *out_buf = g.TempBuffer.Data; - if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; } + if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0) + { + const char* buf = va_arg(args, const char*); // Skip formatting when using "%s" + *out_buf = buf; + if (out_buf_end) { *out_buf_end = buf + strlen(buf); } + } + else + { + int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); + *out_buf = g.TempBuffer.Data; + if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; } + } va_end(args); } void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args) { ImGuiContext& g = *GImGui; - int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); - *out_buf = g.TempBuffer.Data; - if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; } + if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0) + { + const char* buf = va_arg(args, const char*); // Skip formatting when using "%s" + *out_buf = buf; + if (out_buf_end) { *out_buf_end = buf + strlen(buf); } + } + else + { + int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); + *out_buf = g.TempBuffer.Data; + if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; } + } } // CRC32 needs a 1KB lookup table (not cache friendly) @@ -1905,7 +1923,7 @@ ImFileHandle ImFileOpen(const char* filename, const char* mode) // Previously we used ImTextCountCharsFromUtf8/ImTextStrFromUtf8 here but we now need to support ImWchar16 and ImWchar32! const int filename_wsize = ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0); const int mode_wsize = ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0); - ImVector buf; + ImVector buf; buf.resize(filename_wsize + mode_wsize); ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, (wchar_t*)&buf[0], filename_wsize); ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, (wchar_t*)&buf[filename_wsize], mode_wsize); @@ -5812,12 +5830,15 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar { for (int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++) { + const ImU32 col = resize_grip_col[resize_grip_n]; + if ((col & IM_COL32_A_MASK) == 0) + continue; const ImGuiResizeGripDef& grip = resize_grip_def[resize_grip_n]; const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPosN); window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(window_border_size, resize_grip_draw_size) : ImVec2(resize_grip_draw_size, window_border_size))); window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(resize_grip_draw_size, window_border_size) : ImVec2(window_border_size, resize_grip_draw_size))); window->DrawList->PathArcToFast(ImVec2(corner.x + grip.InnerDir.x * (window_rounding + window_border_size), corner.y + grip.InnerDir.y * (window_rounding + window_border_size)), window_rounding, grip.AngleMin12, grip.AngleMax12); - window->DrawList->PathFillConvex(resize_grip_col[resize_grip_n]); + window->DrawList->PathFillConvex(col); } } @@ -8469,7 +8490,8 @@ void ImGui::UpdateMouseWheel() // Mouse wheel scrolling // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead - // (we avoid doing it on OSX as it the OS input layer handles this already) + // - We avoid doing it on OSX as it the OS input layer handles this already. + // - However this means when running on OSX over Emcripten, Shift+WheelY will incur two swappings (1 in OS, 1 here), cancelling the feature. const bool swap_axis = g.IO.KeyShift && !g.IO.ConfigMacOSXBehaviors; if (swap_axis) { @@ -8851,6 +8873,13 @@ static void ImGui::ErrorCheckNewFrameSanityChecks() // #define IM_ASSERT(EXPR) do { if (SomeCode(EXPR)) SomeMoreCode(); } while (0) // Correct! if (true) IM_ASSERT(1); else IM_ASSERT(0); + // Emscripten backends are often imprecise in their submission of DeltaTime. (#6114, #3644) + // Ideally the Emscripten app/backend should aim to fix or smooth this value and avoid feeding zero, but we tolerate it. +#ifdef __EMSCRIPTEN__ + if (g.IO.DeltaTime <= 0.0f && g.FrameCount > 0) + g.IO.DeltaTime = 0.00001f; +#endif + // Check user data // (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument) IM_ASSERT(g.Initialized); @@ -13142,10 +13171,13 @@ void ImGui::ShowFontAtlas(ImFontAtlas* atlas) DebugNodeFont(font); PopID(); } - if (TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight)) + if (TreeNode("Font Atlas", "Font Atlas (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight)) { - ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); - ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); + ImGuiContext& g = *GImGui; + ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig; + Checkbox("Tint with Text Color", &cfg->ShowAtlasTintedWithTextColor); // Using text color ensure visibility of core atlas data, but will alter custom colored icons + ImVec4 tint_col = cfg->ShowAtlasTintedWithTextColor ? GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); + ImVec4 border_col = GetStyleColorVec4(ImGuiCol_Border); Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), tint_col, border_col); TreePop(); } @@ -13937,7 +13969,7 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label) { ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; p += ImFormatString(p, buf_end - p, "%s'%s'", - tab_n > 0 ? ", " : "", (tab->NameOffset != -1) ? tab_bar->GetTabName(tab) : "???"); + tab_n > 0 ? ", " : "", (tab->NameOffset != -1) ? TabBarGetTabName(tab_bar, tab) : "???"); } p += ImFormatString(p, buf_end - p, (tab_bar->Tabs.Size > 3) ? " ... }" : " } "); if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); } @@ -13954,12 +13986,12 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label) { for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) { - const ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; + ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; PushID(tab); if (SmallButton("<")) { TabBarQueueReorder(tab_bar, tab, -1); } SameLine(0, 2); if (SmallButton(">")) { TabBarQueueReorder(tab_bar, tab, +1); } SameLine(); Text("%02d%c Tab 0x%08X '%s' Offset: %.2f, Width: %.2f/%.2f", - tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, (tab->NameOffset != -1) ? tab_bar->GetTabName(tab) : "???", tab->Offset, tab->Width, tab->ContentWidth); + tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, (tab->NameOffset != -1) ? TabBarGetTabName(tab_bar, tab) : "???", tab->Offset, tab->Width, tab->ContentWidth); PopID(); } TreePop(); diff --git a/3rdparty/dear-imgui/imgui.h b/3rdparty/dear-imgui/imgui.h index fea413403..39879eea5 100644 --- a/3rdparty/dear-imgui/imgui.h +++ b/3rdparty/dear-imgui/imgui.h @@ -11,7 +11,7 @@ // - FAQ http://dearimgui.org/faq // - Homepage & latest https://github.com/ocornut/imgui // - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/5243 (please post your screenshots/video there!) +// - Gallery https://github.com/ocornut/imgui/issues/5886 (please post your screenshots/video there!) // - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there) // - Glossary https://github.com/ocornut/imgui/wiki/Glossary // - Issues & support https://github.com/ocornut/imgui/issues @@ -23,7 +23,7 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') #define IMGUI_VERSION "1.89.3 WIP" -#define IMGUI_VERSION_NUM 18921 +#define IMGUI_VERSION_NUM 18926 #define IMGUI_HAS_TABLE /* @@ -1968,7 +1968,7 @@ struct ImGuiIO IMGUI_API void AddKeyAnalogEvent(ImGuiKey key, bool down, float v); // Queue a new key down/up event for analog values (e.g. ImGuiKey_Gamepad_ values). Dead-zones should be handled by the backend. IMGUI_API void AddMousePosEvent(float x, float y); // Queue a mouse position update. Use -FLT_MAX,-FLT_MAX to signify no mouse (e.g. app not focused and not hovered) IMGUI_API void AddMouseButtonEvent(int button, bool down); // Queue a mouse button change - IMGUI_API void AddMouseWheelEvent(float wh_x, float wh_y); // Queue a mouse wheel update + IMGUI_API void AddMouseWheelEvent(float wheel_x, float wheel_y); // Queue a mouse wheel update. wheel_y<0: scroll down, wheel_y>0: scroll up, wheel_x<0: scroll right, wheel_x>0: scroll left. IMGUI_API void AddFocusEvent(bool focused); // Queue a gain/loss of focus for the application (generally based on OS/platform focus of your window) IMGUI_API void AddInputCharacter(unsigned int c); // Queue a new character input IMGUI_API void AddInputCharacterUTF16(ImWchar16 c); // Queue a new character input from a UTF-16 character, it can be a surrogate @@ -2018,8 +2018,8 @@ struct ImGuiIO // (reading from those variables is fair game, as they are extremely unlikely to be moving anywhere) ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.) bool MouseDown[5]; // Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Other buttons allow us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API. - float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. - float MouseWheelH; // Mouse wheel Horizontal. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends. + float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down. Hold SHIFT to turn vertical scroll into horizontal scroll. + float MouseWheelH; // Mouse wheel Horizontal. >0 scrolls Left, <0 scrolls Right. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends. bool KeyCtrl; // Keyboard modifier down: Control bool KeyShift; // Keyboard modifier down: Shift bool KeyAlt; // Keyboard modifier down: Alt diff --git a/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/dear-imgui/imgui_demo.cpp index 4827e694f..1c6de1ce0 100644 --- a/3rdparty/dear-imgui/imgui_demo.cpp +++ b/3rdparty/dear-imgui/imgui_demo.cpp @@ -457,6 +457,7 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges); ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback."); ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly); + ImGui::Checkbox("io.ConfigMacOSXBehaviors", &io.ConfigMacOSXBehaviors); ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor); ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something)."); ImGui::Text("Also see Style->Rendering for rendering options."); @@ -610,20 +611,41 @@ static void ShowDemoWindowWidgets() ImGui::SameLine(); ImGui::Text("%d", counter); - ImGui::Separator(); - ImGui::LabelText("label", "Value"); - { - // Using the _simplified_ one-liner Combo() api here - // See "Combo" section for examples of how to use the more flexible BeginCombo()/EndCombo() api. - IMGUI_DEMO_MARKER("Widgets/Basic/Combo"); - const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" }; - static int item_current = 0; - ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items)); - ImGui::SameLine(); HelpMarker( - "Using the simplified one-liner Combo API here.\nRefer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API."); + // Tooltips + IMGUI_DEMO_MARKER("Widgets/Basic/Tooltips"); + //ImGui::AlignTextToFramePadding(); + ImGui::Text("Tooltips:"); + + ImGui::SameLine(); + ImGui::SmallButton("Button"); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("I am a tooltip"); + + ImGui::SameLine(); + ImGui::SmallButton("Fancy"); + if (ImGui::IsItemHovered()) + { + ImGui::BeginTooltip(); + ImGui::Text("I am a fancy tooltip"); + static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; + ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr)); + ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime())); + ImGui::EndTooltip(); + } + + ImGui::SameLine(); + ImGui::SmallButton("Delayed"); + if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) // With a delay + ImGui::SetTooltip("I am a tooltip with a delay."); + + ImGui::SameLine(); + HelpMarker( + "Tooltip are created by using the IsItemHovered() function over any kind of item."); } + ImGui::LabelText("label", "Value"); + { // To wire InputText() with std::string or any other custom string type, // see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file. @@ -722,6 +744,17 @@ static void ShowDemoWindowWidgets() ImGui::ColorEdit4("color 2", col2); } + { + // Using the _simplified_ one-liner Combo() api here + // See "Combo" section for examples of how to use the more flexible BeginCombo()/EndCombo() api. + IMGUI_DEMO_MARKER("Widgets/Basic/Combo"); + const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" }; + static int item_current = 0; + ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items)); + ImGui::SameLine(); HelpMarker( + "Using the simplified one-liner Combo API here.\nRefer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API."); + } + { // Using the _simplified_ one-liner ListBox() api here // See "List boxes" section for examples of how to use the more flexible BeginListBox()/EndListBox() api. @@ -733,40 +766,6 @@ static void ShowDemoWindowWidgets() "Using the simplified one-liner ListBox API here.\nRefer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API."); } - { - // Tooltips - IMGUI_DEMO_MARKER("Widgets/Basic/Tooltips"); - ImGui::AlignTextToFramePadding(); - ImGui::Text("Tooltips:"); - - ImGui::SameLine(); - ImGui::Button("Button"); - if (ImGui::IsItemHovered()) - ImGui::SetTooltip("I am a tooltip"); - - ImGui::SameLine(); - ImGui::Button("Fancy"); - if (ImGui::IsItemHovered()) - { - ImGui::BeginTooltip(); - ImGui::Text("I am a fancy tooltip"); - static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; - ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr)); - ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime())); - ImGui::EndTooltip(); - } - - ImGui::SameLine(); - ImGui::Button("Delayed"); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) // Delay best used on items that highlight on hover, so this not a great example! - ImGui::SetTooltip("I am a tooltip with a delay."); - - ImGui::SameLine(); - HelpMarker( - "Tooltip are created by using the IsItemHovered() function over any kind of item."); - - } - ImGui::TreePop(); } @@ -1026,12 +1025,14 @@ static void ShowDemoWindowWidgets() float my_tex_w = (float)io.Fonts->TexWidth; float my_tex_h = (float)io.Fonts->TexHeight; { + static bool use_text_color_for_tint = false; + ImGui::Checkbox("Use Text Color for Tint", &use_text_color_for_tint); ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h); ImVec2 pos = ImGui::GetCursorScreenPos(); ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right - ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint - ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); // 50% opaque white + ImVec4 tint_col = use_text_color_for_tint ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint + ImVec4 border_col = ImGui::GetStyleColorVec4(ImGuiCol_Border); ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col); if (ImGui::IsItemHovered()) { @@ -5993,6 +5994,9 @@ void ImGui::ShowAboutWindow(bool* p_open) #endif #ifdef __clang_version__ ImGui::Text("define: __clang_version__=%s", __clang_version__); +#endif +#ifdef __EMSCRIPTEN__ + ImGui::Text("define: __EMSCRIPTEN__"); #endif ImGui::Separator(); ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL"); @@ -6165,7 +6169,6 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f"); ImGui::Text("Alignment"); ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); @@ -6180,6 +6183,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::Text("Safe Area Padding"); ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); + ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f"); ImGui::EndTabItem(); } diff --git a/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/dear-imgui/imgui_draw.cpp index 25493df3a..09db1c6bd 100644 --- a/3rdparty/dear-imgui/imgui_draw.cpp +++ b/3rdparty/dear-imgui/imgui_draw.cpp @@ -706,7 +706,7 @@ void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, c // We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds. void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, ImDrawFlags flags, float thickness) { - if (points_count < 2) + if (points_count < 2 || (col & IM_COL32_A_MASK) == 0) return; const bool closed = (flags & ImDrawFlags_Closed) != 0; @@ -964,7 +964,7 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 // - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing. void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col) { - if (points_count < 3) + if (points_count < 3 || (col & IM_COL32_A_MASK) == 0) return; const ImVec2 uv = _Data->TexUvWhitePixel; @@ -3573,18 +3573,17 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im while (y + line_height < clip_rect.y && s < text_end) { const char* line_end = (const char*)memchr(s, '\n', text_end - s); - const char* line_next = line_end ? line_end + 1 : text_end; if (word_wrap_enabled) { // FIXME-OPT: This is not optimal as do first do a search for \n before calling CalcWordWrapPositionA(). // If the specs for CalcWordWrapPositionA() were reworked to optionally return on \n we could combine both. // However it is still better than nothing performing the fast-forward! - s = CalcWordWrapPositionA(scale, s, line_next, wrap_width); + s = CalcWordWrapPositionA(scale, s, line_end ? line_end : text_end, wrap_width); s = CalcWordWrapNextLineStartA(s, text_end); } else { - s = line_next; + s = line_end ? line_end + 1 : text_end; } y += line_height; } @@ -3611,10 +3610,9 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im const int idx_count_max = (int)(text_end - s) * 6; const int idx_expected_size = draw_list->IdxBuffer.Size + idx_count_max; draw_list->PrimReserve(idx_count_max, vtx_count_max); - - ImDrawVert* vtx_write = draw_list->_VtxWritePtr; - ImDrawIdx* idx_write = draw_list->_IdxWritePtr; - unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx; + ImDrawVert* vtx_write = draw_list->_VtxWritePtr; + ImDrawIdx* idx_write = draw_list->_IdxWritePtr; + unsigned int vtx_index = draw_list->_VtxCurrentIdx; const ImU32 col_untinted = col | ~IM_COL32_A_MASK; const char* word_wrap_eol = NULL; @@ -3713,14 +3711,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im // We are NOT calling PrimRectUV() here because non-inlined causes too much overhead in a debug builds. Inlined here: { - idx_write[0] = (ImDrawIdx)(vtx_current_idx); idx_write[1] = (ImDrawIdx)(vtx_current_idx+1); idx_write[2] = (ImDrawIdx)(vtx_current_idx+2); - idx_write[3] = (ImDrawIdx)(vtx_current_idx); idx_write[4] = (ImDrawIdx)(vtx_current_idx+2); idx_write[5] = (ImDrawIdx)(vtx_current_idx+3); vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = glyph_col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1; vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = glyph_col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1; vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = glyph_col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2; vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = glyph_col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2; + idx_write[0] = (ImDrawIdx)(vtx_index); idx_write[1] = (ImDrawIdx)(vtx_index + 1); idx_write[2] = (ImDrawIdx)(vtx_index + 2); + idx_write[3] = (ImDrawIdx)(vtx_index); idx_write[4] = (ImDrawIdx)(vtx_index + 2); idx_write[5] = (ImDrawIdx)(vtx_index + 3); vtx_write += 4; - vtx_current_idx += 4; + vtx_index += 4; idx_write += 6; } } @@ -3734,7 +3732,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im draw_list->CmdBuffer[draw_list->CmdBuffer.Size - 1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size); draw_list->_VtxWritePtr = vtx_write; draw_list->_IdxWritePtr = idx_write; - draw_list->_VtxCurrentIdx = vtx_current_idx; + draw_list->_VtxCurrentIdx = vtx_index; } //----------------------------------------------------------------------------- diff --git a/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/dear-imgui/imgui_internal.h index 987a215b5..571b15986 100644 --- a/3rdparty/dear-imgui/imgui_internal.h +++ b/3rdparty/dear-imgui/imgui_internal.h @@ -1,10 +1,12 @@ // dear imgui, v1.89.3 WIP // (internal structures/api) -// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! -// Set: -// #define IMGUI_DEFINE_MATH_OPERATORS -// To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators) +// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility. +// To implement maths operators for ImVec2 (disabled by default to not conflict with using IM_VEC2_CLASS_EXTRA with your own math types+operators), use: +/* +#define IMGUI_DEFINE_MATH_OPERATORS +#include "imgui_internal.h" +*/ /* @@ -548,9 +550,12 @@ struct IMGUI_API ImRect bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; } ImVec4 ToVec4() const { return ImVec4(Min.x, Min.y, Max.x, Max.y); } }; -IM_MSVC_RUNTIME_CHECKS_RESTORE // Helper: ImBitArray +#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0) // Macro version of ImBitArrayTestBit(): ensure args have side-effect or are costly! +#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31)))) // Macro version of ImBitArrayClearBit(): ensure args have side-effect or are costly! +inline size_t ImBitArrayGetStorageSizeInBytes(int bitcount) { return (size_t)((bitcount + 31) >> 5) << 2; } +inline void ImBitArrayClearAllBits(ImU32* arr, int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); } inline bool ImBitArrayTestBit(const ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); return (arr[n >> 5] & mask) != 0; } inline void ImBitArrayClearBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; } inline void ImBitArraySetBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; } @@ -567,6 +572,8 @@ inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Works on ran } } +typedef ImU32* ImBitArrayPtr; // Name for use in structs + // Helper: ImBitArray class (wrapper over ImBitArray functions) // Store 1-bit per value. template @@ -576,11 +583,11 @@ struct ImBitArray ImBitArray() { ClearAllBits(); } void ClearAllBits() { memset(Storage, 0, sizeof(Storage)); } void SetAllBits() { memset(Storage, 255, sizeof(Storage)); } - bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return ImBitArrayTestBit(Storage, n); } + bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); } void SetBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); } void ClearBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); } void SetBitRange(int n, int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); } // Works on range [n..n2) - bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return ImBitArrayTestBit(Storage, n); } + bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); } }; // Helper: ImBitVector @@ -590,10 +597,11 @@ struct IMGUI_API ImBitVector ImVector Storage; void Create(int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (size_t)Storage.Size * sizeof(Storage.Data[0])); } void Clear() { Storage.clear(); } - bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return ImBitArrayTestBit(Storage.Data, n); } + bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return IM_BITARRAY_TESTBIT(Storage.Data, n); } void SetBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); } void ClearBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); } }; +IM_MSVC_RUNTIME_CHECKS_RESTORE // Helper: ImSpan<> // Pointing to a span of data we don't own. @@ -1663,23 +1671,16 @@ enum ImGuiDebugLogFlags_ struct ImGuiMetricsConfig { - bool ShowDebugLog; - bool ShowStackTool; - bool ShowWindowsRects; - bool ShowWindowsBeginOrder; - bool ShowTablesRects; - bool ShowDrawCmdMesh; - bool ShowDrawCmdBoundingBoxes; - int ShowWindowsRectsType; - int ShowTablesRectsType; - - ImGuiMetricsConfig() - { - ShowDebugLog = ShowStackTool = ShowWindowsRects = ShowWindowsBeginOrder = ShowTablesRects = false; - ShowDrawCmdMesh = true; - ShowDrawCmdBoundingBoxes = true; - ShowWindowsRectsType = ShowTablesRectsType = -1; - } + bool ShowDebugLog = false; + bool ShowStackTool = false; + bool ShowWindowsRects = false; + bool ShowWindowsBeginOrder = false; + bool ShowTablesRects = false; + bool ShowDrawCmdMesh = true; + bool ShowDrawCmdBoundingBoxes = true; + bool ShowAtlasTintedWithTextColor = false; + int ShowWindowsRectsType = -1; + int ShowTablesRectsType = -1; }; struct ImGuiStackLevelInfo @@ -2384,7 +2385,7 @@ struct ImGuiTabItem float RequestedWidth; // Width optionally requested by caller, -1.0f is unused ImS32 NameOffset; // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames ImS16 BeginOrder; // BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable - ImS16 IndexDuringLayout; // Index only used during TabBarLayout() + ImS16 IndexDuringLayout; // Index only used during TabBarLayout(). Tabs gets reordered so 'Tabs[n].IndexDuringLayout == n' but may mismatch during additions. bool WantClose; // Marked as closed by SetTabItemClosed() ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; } @@ -2426,12 +2427,6 @@ struct IMGUI_API ImGuiTabBar ImGuiTextBuffer TabsNames; // For non-docking tab bar we re-append names in a contiguous buffer. ImGuiTabBar(); - int GetTabOrder(const ImGuiTabItem* tab) const { return Tabs.index_from_ptr(tab); } - const char* GetTabName(const ImGuiTabItem* tab) const - { - IM_ASSERT(tab->NameOffset != -1 && tab->NameOffset < TabsNames.Buf.Size); - return TabsNames.Buf.Data + tab->NameOffset; - } }; //----------------------------------------------------------------------------- @@ -2439,12 +2434,11 @@ struct IMGUI_API ImGuiTabBar //----------------------------------------------------------------------------- #define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color. -#define IMGUI_TABLE_MAX_COLUMNS 64 // sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64. -#define IMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2) // See TableSetupDrawChannels() +#define IMGUI_TABLE_MAX_COLUMNS 512 // May be further lifted // Our current column maximum is 64 but we may raise that in the future. -typedef ImS8 ImGuiTableColumnIdx; -typedef ImU8 ImGuiTableDrawChannelIdx; +typedef ImS16 ImGuiTableColumnIdx; +typedef ImU16 ImGuiTableDrawChannelIdx; // [Internal] sizeof() ~ 104 // We use the terminology "Enabled" to refer to a column that is not Hidden by user/api. @@ -2535,10 +2529,9 @@ struct IMGUI_API ImGuiTable ImSpan Columns; // Point within RawData[] ImSpan DisplayOrderToIndex; // Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1) ImSpan RowCellData; // Point within RawData[]. Store cells background requests for current row. - ImU64 EnabledMaskByDisplayOrder; // Column DisplayOrder -> IsEnabled map - ImU64 EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data - ImU64 VisibleMaskByIndex; // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect) - ImU64 RequestOutputMaskByIndex; // Column Index -> IsVisible || AutoFit (== expect user to submit items) + ImBitArrayPtr EnabledMaskByDisplayOrder; // Column DisplayOrder -> IsEnabled map + ImBitArrayPtr EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data + ImBitArrayPtr VisibleMaskByIndex; // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect) ImGuiTableFlags SettingsLoadedFlags; // Which data were loaded from the .ini file (e.g. when order is not altered we won't save order) int SettingsOffset; // Offset in g.SettingsTables int LastFrameActive; @@ -3034,12 +3027,18 @@ namespace ImGui IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id); // Tab Bars + inline ImGuiTabBar* GetCurrentTabBar() { ImGuiContext& g = *GImGui; return g.CurrentTabBar; } IMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags); IMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id); + IMGUI_API ImGuiTabItem* TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order); + IMGUI_API ImGuiTabItem* TabBarGetCurrentTab(ImGuiTabBar* tab_bar); + inline int TabBarGetTabOrder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) { return tab_bar->Tabs.index_from_ptr(tab); } + IMGUI_API const char* TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab); IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id); IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab); - IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int offset); - IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, ImVec2 mouse_pos); + IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab); + IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset); + IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos); IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar); IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window); IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker); @@ -3074,7 +3073,7 @@ namespace ImGui IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0); IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0); IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0); - IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col); + IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0); IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags); IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value); IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value); @@ -3130,7 +3129,7 @@ namespace ImGui IMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags); // Plot - IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size); + IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, const ImVec2& size_arg); // Shade functions (write over already created vertices) IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1); diff --git a/3rdparty/dear-imgui/imgui_tables.cpp b/3rdparty/dear-imgui/imgui_tables.cpp index b6e367039..89fe8a732 100644 --- a/3rdparty/dear-imgui/imgui_tables.cpp +++ b/3rdparty/dear-imgui/imgui_tables.cpp @@ -315,7 +315,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG return false; // Sanity checks - IM_ASSERT(columns_count > 0 && columns_count <= IMGUI_TABLE_MAX_COLUMNS && "Only 1..64 columns allowed!"); + IM_ASSERT(columns_count > 0 && columns_count < IMGUI_TABLE_MAX_COLUMNS); if (flags & ImGuiTableFlags_ScrollX) IM_ASSERT(inner_width >= 0.0f); @@ -581,16 +581,22 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG void ImGui::TableBeginInitMemory(ImGuiTable* table, int columns_count) { // Allocate single buffer for our arrays - ImSpanAllocator<3> span_allocator; + const int columns_bit_array_size = (int)ImBitArrayGetStorageSizeInBytes(columns_count); + ImSpanAllocator<6> span_allocator; span_allocator.Reserve(0, columns_count * sizeof(ImGuiTableColumn)); span_allocator.Reserve(1, columns_count * sizeof(ImGuiTableColumnIdx)); span_allocator.Reserve(2, columns_count * sizeof(ImGuiTableCellData), 4); + for (int n = 3; n < 6; n++) + span_allocator.Reserve(n, columns_bit_array_size); table->RawData = IM_ALLOC(span_allocator.GetArenaSizeInBytes()); memset(table->RawData, 0, span_allocator.GetArenaSizeInBytes()); span_allocator.SetArenaBasePtr(table->RawData); span_allocator.GetSpan(0, &table->Columns); span_allocator.GetSpan(1, &table->DisplayOrderToIndex); span_allocator.GetSpan(2, &table->RowCellData); + table->EnabledMaskByDisplayOrder = (ImU32*)span_allocator.GetSpanPtrBegin(3); + table->EnabledMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(4); + table->VisibleMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(5); } // Apply queued resizing/reordering/hiding requests @@ -729,8 +735,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) const ImGuiTableFlags table_sizing_policy = (table->Flags & ImGuiTableFlags_SizingMask_); table->IsDefaultDisplayOrder = true; table->ColumnsEnabledCount = 0; - table->EnabledMaskByIndex = 0x00; - table->EnabledMaskByDisplayOrder = 0x00; + ImBitArrayClearAllBits(table->EnabledMaskByIndex, table->ColumnsCount); + ImBitArrayClearAllBits(table->EnabledMaskByDisplayOrder, table->ColumnsCount); table->LeftMostEnabledColumn = -1; table->MinColumnWidth = ImMax(1.0f, g.Style.FramePadding.x * 1.0f); // g.Style.ColumnsMinSpacing; // FIXME-TABLE @@ -795,8 +801,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) else table->LeftMostEnabledColumn = (ImGuiTableColumnIdx)column_n; column->IndexWithinEnabledSet = table->ColumnsEnabledCount++; - table->EnabledMaskByIndex |= (ImU64)1 << column_n; - table->EnabledMaskByDisplayOrder |= (ImU64)1 << column->DisplayOrder; + ImBitArraySetBit(table->EnabledMaskByIndex, column_n); + ImBitArraySetBit(table->EnabledMaskByDisplayOrder, column->DisplayOrder); prev_visible_column_idx = column_n; IM_ASSERT(column->IndexWithinEnabledSet <= column->DisplayOrder); @@ -844,7 +850,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) table->LeftMostStretchedColumn = table->RightMostStretchedColumn = -1; for (int column_n = 0; column_n < table->ColumnsCount; column_n++) { - if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n))) + if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n)) continue; ImGuiTableColumn* column = &table->Columns[column_n]; @@ -860,7 +866,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // Latch initial size for fixed columns and update it constantly for auto-resizing column (unless clipped!) if (column->AutoFitQueue != 0x00) column->WidthRequest = width_auto; - else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n))) + else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && column->IsRequestOutput) column->WidthRequest = width_auto; // FIXME-TABLE: Increase minimum size during init frame to avoid biasing auto-fitting widgets @@ -908,7 +914,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) table->ColumnsGivenWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount; for (int column_n = 0; column_n < table->ColumnsCount; column_n++) { - if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n))) + if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n)) continue; ImGuiTableColumn* column = &table->Columns[column_n]; @@ -935,7 +941,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) if (width_remaining_for_stretched_columns >= 1.0f && !(table->Flags & ImGuiTableFlags_PreciseWidths)) for (int order_n = table->ColumnsCount - 1; stretch_sum_weights > 0.0f && width_remaining_for_stretched_columns >= 1.0f && order_n >= 0; order_n--) { - if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n))) + if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n)) continue; ImGuiTableColumn* column = &table->Columns[table->DisplayOrderToIndex[order_n]]; if (!(column->Flags & ImGuiTableColumnFlags_WidthStretch)) @@ -966,8 +972,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) float offset_x = ((table->FreezeColumnsCount > 0) ? table->OuterRect.Min.x : work_rect.Min.x) + table->OuterPaddingX - table->CellSpacingX1; ImRect host_clip_rect = table->InnerClipRect; //host_clip_rect.Max.x += table->CellPaddingX + table->CellSpacingX2; - table->VisibleMaskByIndex = 0x00; - table->RequestOutputMaskByIndex = 0x00; + ImBitArrayClearAllBits(table->VisibleMaskByIndex, table->ColumnsCount); for (int order_n = 0; order_n < table->ColumnsCount; order_n++) { const int column_n = table->DisplayOrderToIndex[order_n]; @@ -984,7 +989,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // Clear status flags column->Flags &= ~ImGuiTableColumnFlags_StatusMask_; - if ((table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)) == 0) + if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n)) { // Hidden column: clear a few fields and we are done with it for the remainder of the function. // We set a zero-width clip rect but set Min.y/Max.y properly to not interfere with the clipper. @@ -1037,12 +1042,10 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) column->IsVisibleY = true; // (column->ClipRect.Max.y > column->ClipRect.Min.y); const bool is_visible = column->IsVisibleX; //&& column->IsVisibleY; if (is_visible) - table->VisibleMaskByIndex |= ((ImU64)1 << column_n); + ImBitArraySetBit(table->VisibleMaskByIndex, column_n); // Mark column as requesting output from user. Note that fixed + non-resizable sets are auto-fitting at all times and therefore always request output. column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0; - if (column->IsRequestOutput) - table->RequestOutputMaskByIndex |= ((ImU64)1 << column_n); // Mark column as SkipItems (ignoring all items/layout) column->IsSkipItems = !column->IsEnabled || table->HostSkipItems; @@ -1169,7 +1172,7 @@ void ImGui::TableUpdateBorders(ImGuiTable* table) for (int order_n = 0; order_n < table->ColumnsCount; order_n++) { - if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n))) + if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n)) continue; const int column_n = table->DisplayOrderToIndex[order_n]; @@ -1305,7 +1308,7 @@ void ImGui::EndTable() float auto_fit_width_for_stretched = 0.0f; float auto_fit_width_for_stretched_min = 0.0f; for (int column_n = 0; column_n < table->ColumnsCount; column_n++) - if (table->EnabledMaskByIndex & ((ImU64)1 << column_n)) + if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n)) { ImGuiTableColumn* column = &table->Columns[column_n]; float column_width_request = ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize)) ? column->WidthRequest : TableGetColumnWidthAuto(table, column); @@ -1651,7 +1654,7 @@ void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n return; if (column_n == -1) column_n = table->CurrentColumn; - if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0) + if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n)) return; if (table->RowCellDataCurrent < 0 || table->RowCellData[table->RowCellDataCurrent].Column != column_n) table->RowCellDataCurrent++; @@ -1926,7 +1929,7 @@ bool ImGui::TableSetColumnIndex(int column_n) // Return whether the column is visible. User may choose to skip submitting items based on this return value, // however they shouldn't skip submitting for columns that may have the tallest contribution to row height. - return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0; + return table->Columns[column_n].IsRequestOutput; } // [Public] Append into the next column, wrap and create a new row when already on last column @@ -1951,8 +1954,7 @@ bool ImGui::TableNextColumn() // Return whether the column is visible. User may choose to skip submitting items based on this return value, // however they shouldn't skip submitting for columns that may have the tallest contribution to row height. - int column_n = table->CurrentColumn; - return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0; + return table->Columns[table->CurrentColumn].IsRequestOutput; } @@ -2292,7 +2294,7 @@ void ImGui::TableSetupDrawChannels(ImGuiTable* table) const int freeze_row_multiplier = (table->FreezeRowsCount > 0) ? 2 : 1; const int channels_for_row = (table->Flags & ImGuiTableFlags_NoClip) ? 1 : table->ColumnsEnabledCount; const int channels_for_bg = 1 + 1 * freeze_row_multiplier; - const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || table->VisibleMaskByIndex != table->EnabledMaskByIndex) ? +1 : 0; + const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || (memcmp(table->VisibleMaskByIndex, table->EnabledMaskByIndex, ImBitArrayGetStorageSizeInBytes(table->ColumnsCount)) != 0)) ? +1 : 0; const int channels_total = channels_for_bg + (channels_for_row * freeze_row_multiplier) + channels_for_dummy; table->DrawSplitter->Split(table->InnerWindow->DrawList, channels_total); table->DummyDrawChannel = (ImGuiTableDrawChannelIdx)((channels_for_dummy > 0) ? channels_total - 1 : -1); @@ -2366,19 +2368,26 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) // Track which groups we are going to attempt to merge, and which channels goes into each group. struct MergeGroup { - ImRect ClipRect; - int ChannelsCount; - ImBitArray ChannelsMask; - - MergeGroup() { ChannelsCount = 0; } + ImRect ClipRect; + int ChannelsCount; + ImBitArrayPtr ChannelsMask; }; int merge_group_mask = 0x00; - MergeGroup merge_groups[4]; + MergeGroup merge_groups[4] = {}; + + // Use a reusable temp buffer for the merge masks as they are dynamically sized. + const int max_draw_channels = (4 + table->ColumnsCount * 2); + const int size_for_masks_bitarrays_one = (int)ImBitArrayGetStorageSizeInBytes(max_draw_channels); + g.TempBuffer.reserve(size_for_masks_bitarrays_one * 5); + memset(g.TempBuffer.Data, 0, size_for_masks_bitarrays_one * 5); + for (int n = 0; n < IM_ARRAYSIZE(merge_groups); n++) + merge_groups[n].ChannelsMask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * n)); + ImBitArrayPtr remaining_mask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * 4)); // 1. Scan channels and take note of those which can be merged for (int column_n = 0; column_n < table->ColumnsCount; column_n++) { - if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0) + if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n)) continue; ImGuiTableColumn* column = &table->Columns[column_n]; @@ -2410,11 +2419,11 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) } const int merge_group_n = (has_freeze_h && column_n < table->FreezeColumnsCount ? 0 : 1) + (has_freeze_v && merge_group_sub_n == 0 ? 0 : 2); - IM_ASSERT(channel_no < IMGUI_TABLE_MAX_DRAW_CHANNELS); + IM_ASSERT(channel_no < max_draw_channels); MergeGroup* merge_group = &merge_groups[merge_group_n]; if (merge_group->ChannelsCount == 0) merge_group->ClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX); - merge_group->ChannelsMask.SetBit(channel_no); + ImBitArraySetBit(merge_group->ChannelsMask, channel_no); merge_group->ChannelsCount++; merge_group->ClipRect.Add(src_channel->_CmdBuffer[0].ClipRect); merge_group_mask |= (1 << merge_group_n); @@ -2450,9 +2459,8 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) const int LEADING_DRAW_CHANNELS = 2; g.DrawChannelsTempMergeBuffer.resize(splitter->_Count - LEADING_DRAW_CHANNELS); // Use shared temporary storage so the allocation gets amortized ImDrawChannel* dst_tmp = g.DrawChannelsTempMergeBuffer.Data; - ImBitArray remaining_mask; // We need 132-bit of storage - remaining_mask.SetBitRange(LEADING_DRAW_CHANNELS, splitter->_Count); - remaining_mask.ClearBit(table->Bg2DrawChannelUnfrozen); + ImBitArraySetBitRange(remaining_mask, LEADING_DRAW_CHANNELS, splitter->_Count); + ImBitArrayClearBit(remaining_mask, table->Bg2DrawChannelUnfrozen); IM_ASSERT(has_freeze_v == false || table->Bg2DrawChannelUnfrozen != TABLE_DRAW_CHANNEL_BG2_FROZEN); int remaining_count = splitter->_Count - (has_freeze_v ? LEADING_DRAW_CHANNELS + 1 : LEADING_DRAW_CHANNELS); //ImRect host_rect = (table->InnerWindow == table->OuterWindow) ? table->InnerClipRect : table->HostClipRect; @@ -2485,14 +2493,14 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) GetOverlayDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200)); #endif remaining_count -= merge_group->ChannelsCount; - for (int n = 0; n < IM_ARRAYSIZE(remaining_mask.Storage); n++) - remaining_mask.Storage[n] &= ~merge_group->ChannelsMask.Storage[n]; + for (int n = 0; n < (size_for_masks_bitarrays_one >> 2); n++) + remaining_mask[n] &= ~merge_group->ChannelsMask[n]; for (int n = 0; n < splitter->_Count && merge_channels_count != 0; n++) { // Copy + overwrite new clip rect - if (!merge_group->ChannelsMask.TestBit(n)) + if (!IM_BITARRAY_TESTBIT(merge_group->ChannelsMask, n)) continue; - merge_group->ChannelsMask.ClearBit(n); + IM_BITARRAY_CLEARBIT(merge_group->ChannelsMask, n); merge_channels_count--; ImDrawChannel* channel = &splitter->_Channels[n]; @@ -2510,7 +2518,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) // Append unmergeable channels that we didn't reorder at the end of the list for (int n = 0; n < splitter->_Count && remaining_count != 0; n++) { - if (!remaining_mask.TestBit(n)) + if (!IM_BITARRAY_TESTBIT(remaining_mask, n)) continue; ImDrawChannel* channel = &splitter->_Channels[n]; memcpy(dst_tmp++, channel, sizeof(ImDrawChannel)); @@ -2542,7 +2550,7 @@ void ImGui::TableDrawBorders(ImGuiTable* table) { for (int order_n = 0; order_n < table->ColumnsCount; order_n++) { - if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n))) + if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n)) continue; const int column_n = table->DisplayOrderToIndex[order_n]; diff --git a/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/dear-imgui/imgui_widgets.cpp index 2cfac8f61..75c45e48d 100644 --- a/3rdparty/dear-imgui/imgui_widgets.cpp +++ b/3rdparty/dear-imgui/imgui_widgets.cpp @@ -274,7 +274,6 @@ void ImGui::TextV(const char* fmt, va_list args) if (window->SkipItems) return; - // FIXME-OPT: Handle the %s shortcut? const char* text, *text_end; ImFormatStringToTempBufferV(&text, &text_end, fmt, args); TextEx(text, text_end, ImGuiTextFlags_NoWidthForLargeClippedText); @@ -291,10 +290,7 @@ void ImGui::TextColored(const ImVec4& col, const char* fmt, ...) void ImGui::TextColoredV(const ImVec4& col, const char* fmt, va_list args) { PushStyleColor(ImGuiCol_Text, col); - if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0) - TextEx(va_arg(args, const char*), NULL, ImGuiTextFlags_NoWidthForLargeClippedText); // Skip formatting - else - TextV(fmt, args); + TextV(fmt, args); PopStyleColor(); } @@ -310,10 +306,7 @@ void ImGui::TextDisabledV(const char* fmt, va_list args) { ImGuiContext& g = *GImGui; PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]); - if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0) - TextEx(va_arg(args, const char*), NULL, ImGuiTextFlags_NoWidthForLargeClippedText); // Skip formatting - else - TextV(fmt, args); + TextV(fmt, args); PopStyleColor(); } @@ -328,13 +321,10 @@ void ImGui::TextWrapped(const char* fmt, ...) void ImGui::TextWrappedV(const char* fmt, va_list args) { ImGuiContext& g = *GImGui; - bool need_backup = (g.CurrentWindow->DC.TextWrapPos < 0.0f); // Keep existing wrap position if one is already set + const bool need_backup = (g.CurrentWindow->DC.TextWrapPos < 0.0f); // Keep existing wrap position if one is already set if (need_backup) PushTextWrapPos(0.0f); - if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0) - TextEx(va_arg(args, const char*), NULL, ImGuiTextFlags_NoWidthForLargeClippedText); // Skip formatting - else - TextV(fmt, args); + TextV(fmt, args); if (need_backup) PopTextWrapPos(); } @@ -1042,7 +1032,7 @@ void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& // ImageButton() is flawed as 'id' is always derived from 'texture_id' (see #2464 #1390) // We provide this internal helper to write your own variant while we figure out how to redesign the public ImageButton() API. -bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col) +bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); @@ -1056,7 +1046,7 @@ bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size return false; bool hovered, held; - bool pressed = ButtonBehavior(bb, id, &hovered, &held); + bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); // Render const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); @@ -1705,7 +1695,12 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags if (flags & ImGuiComboFlags_HeightRegular) popup_max_height_in_items = 8; else if (flags & ImGuiComboFlags_HeightSmall) popup_max_height_in_items = 4; else if (flags & ImGuiComboFlags_HeightLarge) popup_max_height_in_items = 20; - SetNextWindowSizeConstraints(ImVec2(w, 0.0f), ImVec2(FLT_MAX, CalcMaxPopupHeightFromItemCount(popup_max_height_in_items))); + ImVec2 constraint_min(0.0f, 0.0f), constraint_max(FLT_MAX, FLT_MAX); + if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) == 0 || g.NextWindowData.SizeVal.x <= 0.0f) // Don't apply constraints if user specified a size + constraint_min.x = w; + if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) == 0 || g.NextWindowData.SizeVal.y <= 0.0f) + constraint_max.y = CalcMaxPopupHeightFromItemCount(popup_max_height_in_items); + SetNextWindowSizeConstraints(constraint_min, constraint_max); } // This is essentially a specialized version of BeginPopupEx() @@ -4111,6 +4106,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ state->Stb.insert_mode = 1; // stb field name is indeed incorrect (see #2863) } + const bool is_osx = io.ConfigMacOSXBehaviors; if (g.ActiveId != id && init_make_active) { IM_ASSERT(state && state->ID == id); @@ -4133,6 +4129,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ SetKeyOwner(ImGuiKey_PageUp, id); SetKeyOwner(ImGuiKey_PageDown, id); } + if (is_osx) + SetKeyOwner(ImGuiMod_Alt, id); if (flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_AllowTabInput)) // Disable keyboard tabbing out as we will use the \t character. SetKeyOwner(ImGuiKey_Tab, id); } @@ -4202,7 +4200,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + state->ScrollX; const float mouse_y = (is_multiline ? (io.MousePos.y - draw_window->DC.CursorPos.y) : (g.FontSize * 0.5f)); - const bool is_osx = io.ConfigMacOSXBehaviors; if (select_all) { state->SelectAll(); @@ -4303,7 +4300,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ state->Stb.row_count_per_page = row_count_per_page; const int k_mask = (io.KeyShift ? STB_TEXTEDIT_K_SHIFT : 0); - const bool is_osx = io.ConfigMacOSXBehaviors; const bool is_wordmove_key_down = is_osx ? io.KeyAlt : io.KeyCtrl; // OS X style: Text editing cursor movement using Alt instead of Ctrl const bool is_startend_key_down = is_osx && io.KeySuper && !io.KeyCtrl && !io.KeyAlt; // OS X style: Line/Text Start and End using Cmd+Arrows instead of Home/End @@ -4332,7 +4328,16 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ else if (IsKeyPressed(ImGuiKey_PageDown) && is_multiline) { state->OnKeyPressed(STB_TEXTEDIT_K_PGDOWN | k_mask); scroll_y += row_count_per_page * g.FontSize; } else if (IsKeyPressed(ImGuiKey_Home)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); } else if (IsKeyPressed(ImGuiKey_End)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); } - else if (IsKeyPressed(ImGuiKey_Delete) && !is_readonly && !is_cut) { state->OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); } + else if (IsKeyPressed(ImGuiKey_Delete) && !is_readonly && !is_cut) + { + if (!state->HasSelection()) + { + // OSX doesn't seem to have Super+Delete to delete until end-of-line, so we don't emulate that (as opposed to Super+Backspace) + if (is_wordmove_key_down) + state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT); + } + state->OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); + } else if (IsKeyPressed(ImGuiKey_Backspace) && !is_readonly) { if (!state->HasSelection()) @@ -6561,7 +6566,7 @@ bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(v // - others https://github.com/ocornut/imgui/wiki/Useful-Extensions //------------------------------------------------------------------------- -int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size) +int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, const ImVec2& size_arg) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); @@ -6572,10 +6577,7 @@ int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_get const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); - if (frame_size.x == 0.0f) - frame_size.x = CalcItemWidth(); - if (frame_size.y == 0.0f) - frame_size.y = label_size.y + (style.FramePadding.y * 2); + const ImVec2 frame_size = CalcItemSize(size_arg, CalcItemWidth(), label_size.y + style.FramePadding.y * 2.0f); const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size); const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding); @@ -7040,7 +7042,7 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y)); float w = label_size.x; ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset); - pressed = Selectable("", menu_is_open, selectable_flags, ImVec2(w, 0.0f)); + pressed = Selectable("", menu_is_open, selectable_flags, ImVec2(w, label_size.y)); RenderText(text_pos, label); PopStyleVar(); window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). @@ -7056,7 +7058,7 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) float min_w = window->DC.MenuColumns.DeclColumns(icon_w, label_size.x, 0.0f, checkmark_w); // Feedback to next frame float extra_w = ImMax(0.0f, GetContentRegionAvail().x - min_w); ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset); - pressed = Selectable("", menu_is_open, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f)); + pressed = Selectable("", menu_is_open, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, label_size.y)); RenderText(text_pos, label); if (icon_w > 0.0f) RenderText(pos + ImVec2(offsets->OffsetIcon, 0.0f), icon); @@ -7248,7 +7250,7 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut float checkmark_w = IM_FLOOR(g.FontSize * 1.20f); float min_w = window->DC.MenuColumns.DeclColumns(icon_w, label_size.x, shortcut_w, checkmark_w); // Feedback for next frame float stretch_w = ImMax(0.0f, GetContentRegionAvail().x - min_w); - pressed = Selectable("", false, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f)); + pressed = Selectable("", false, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, label_size.y)); if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible) { RenderText(pos + ImVec2(offsets->OffsetLabel, 0.0f), label); @@ -7300,11 +7302,17 @@ bool ImGui::MenuItem(const char* label, const char* shortcut, bool* p_selected, // - TabBarCalcTabID() [Internal] // - TabBarCalcMaxTabWidth() [Internal] // - TabBarFindTabById() [Internal] +// - TabBarFindTabByOrder() [Internal] +// - TabBarGetCurrentTab() [Internal] +// - TabBarGetTabName() [Internal] // - TabBarRemoveTab() [Internal] // - TabBarCloseTab() [Internal] // - TabBarScrollClamp() [Internal] // - TabBarScrollToTab() [Internal] -// - TabBarQueueChangeTabOrder() [Internal] +// - TabBarQueueFocus() [Internal] +// - TabBarQueueReorder() [Internal] +// - TabBarProcessReorderFromMousePos() [Internal] +// - TabBarProcessReorder() [Internal] // - TabBarScrollingButtons() [Internal] // - TabBarTabListPopupButton() [Internal] //------------------------------------------------------------------------- @@ -7429,6 +7437,7 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG tab_bar->ItemSpacingY = g.Style.ItemSpacing.y; tab_bar->FramePadding = g.Style.FramePadding; tab_bar->TabsActiveCount = 0; + tab_bar->LastTabItemIdx = -1; tab_bar->BeginCount = 1; // Set cursor pos in a way which only be used in the off-chance the user erroneously submits item before BeginTabItem(): items will overlap @@ -7477,6 +7486,7 @@ void ImGui::EndTabBar() if (tab_bar->BeginCount > 1) window->DC.CursorPos = tab_bar->BackupCursorPos; + tab_bar->LastTabItemIdx = -1; if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0) PopID(); @@ -7586,7 +7596,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) // Refresh tab width immediately, otherwise changes of style e.g. style.FramePadding.x would noticeably lag in the tab bar. // Additionally, when using TabBarAddTab() to manipulate tab bar order we occasionally insert new tabs that don't have a width yet, // and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window. - const char* tab_name = tab_bar->GetTabName(tab); + const char* tab_name = TabBarGetTabName(tab_bar, tab); const bool has_close_button_or_unsaved_marker = (tab->Flags & ImGuiTabItemFlags_NoCloseButton) == 0 || (tab->Flags & ImGuiTabItemFlags_UnsavedDocument); tab->ContentWidth = (tab->RequestedWidth >= 0.0f) ? tab->RequestedWidth : TabItemCalcSize(tab_name, has_close_button_or_unsaved_marker).x; @@ -7747,7 +7757,28 @@ ImGuiTabItem* ImGui::TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id) return NULL; } -// The *TabId fields be already set by the docking system _before_ the actual TabItem was created, so we clear them regardless. +// Order = visible order, not submission order! (which is tab->BeginOrder) +ImGuiTabItem* ImGui::TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order) +{ + if (order < 0 || order >= tab_bar->Tabs.Size) + return NULL; + return &tab_bar->Tabs[order]; +} + +ImGuiTabItem* ImGui::TabBarGetCurrentTab(ImGuiTabBar* tab_bar) +{ + if (tab_bar->LastTabItemIdx <= 0 || tab_bar->LastTabItemIdx >= tab_bar->Tabs.Size) + return NULL; + return &tab_bar->Tabs[tab_bar->LastTabItemIdx]; +} + +const char* ImGui::TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) +{ + IM_ASSERT(tab->NameOffset != -1 && tab->NameOffset < tab_bar->TabsNames.Buf.Size); + return tab_bar->TabsNames.Buf.Data + tab->NameOffset; +} + +// The *TabId fields are already set by the docking system _before_ the actual TabItem was created, so we clear them regardless. void ImGui::TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id) { if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id)) @@ -7778,7 +7809,7 @@ void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) { // Actually select before expecting closure attempt (on an UnsavedDocument tab user is expect to e.g. show a popup) if (tab_bar->VisibleTabId != tab->ID) - tab_bar->NextSelectedTabId = tab->ID; + TabBarQueueFocus(tab_bar, tab); } } @@ -7799,7 +7830,7 @@ static void ImGui::TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGui ImGuiContext& g = *GImGui; float margin = g.FontSize * 1.0f; // When to scroll to make Tab N+1 visible always make a bit of N visible to suggest more scrolling area (since we don't have a scrollbar) - int order = tab_bar->GetTabOrder(tab); + int order = TabBarGetTabOrder(tab_bar, tab); // Scrolling happens only in the central section (leading/trailing sections are not scrolling) // FIXME: This is all confusing. @@ -7823,7 +7854,12 @@ static void ImGui::TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGui } } -void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int offset) +void ImGui::TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) +{ + tab_bar->NextSelectedTabId = tab->ID; +} + +void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset) { IM_ASSERT(offset != 0); IM_ASSERT(tab_bar->ReorderRequestTabId == 0); @@ -7831,7 +7867,7 @@ void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, in tab_bar->ReorderRequestOffset = (ImS16)offset; } -void ImGui::TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, const ImGuiTabItem* src_tab, ImVec2 mouse_pos) +void ImGui::TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* src_tab, ImVec2 mouse_pos) { ImGuiContext& g = *GImGui; IM_ASSERT(tab_bar->ReorderRequestTabId == 0); @@ -7874,7 +7910,7 @@ bool ImGui::TabBarProcessReorder(ImGuiTabBar* tab_bar) return false; //IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_Reorderable); // <- this may happen when using debug tools - int tab2_order = tab_bar->GetTabOrder(tab1) + tab_bar->ReorderRequestOffset; + int tab2_order = TabBarGetTabOrder(tab_bar, tab1) + tab_bar->ReorderRequestOffset; if (tab2_order < 0 || tab2_order >= tab_bar->Tabs.Size) return false; @@ -7934,7 +7970,7 @@ static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar) if (select_dir != 0) if (ImGuiTabItem* tab_item = TabBarFindTabByID(tab_bar, tab_bar->SelectedTabId)) { - int selected_order = tab_bar->GetTabOrder(tab_item); + int selected_order = TabBarGetTabOrder(tab_bar, tab_item); int target_order = selected_order + select_dir; // Skip tab item buttons until another tab item is found or end is reached @@ -7986,7 +8022,7 @@ static ImGuiTabItem* ImGui::TabBarTabListPopupButton(ImGuiTabBar* tab_bar) if (tab->Flags & ImGuiTabItemFlags_Button) continue; - const char* tab_name = tab_bar->GetTabName(tab); + const char* tab_name = TabBarGetTabName(tab_bar, tab); if (Selectable(tab_name, tab_bar->SelectedTabId == tab->ID)) tab_to_select = tab; } @@ -8150,9 +8186,9 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, { if (tab_appearing && (tab_bar->Flags & ImGuiTabBarFlags_AutoSelectNewTabs) && tab_bar->NextSelectedTabId == 0) if (!tab_bar_appearing || tab_bar->SelectedTabId == 0) - tab_bar->NextSelectedTabId = id; // New tabs gets activated + TabBarQueueFocus(tab_bar, tab); // New tabs gets activated if ((flags & ImGuiTabItemFlags_SetSelected) && (tab_bar->SelectedTabId != id)) // _SetSelected can only be passed on explicit tab bar - tab_bar->NextSelectedTabId = id; + TabBarQueueFocus(tab_bar, tab); } // Lock visibility @@ -8216,7 +8252,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags); if (pressed && !is_tab_button) - tab_bar->NextSelectedTabId = id; + TabBarQueueFocus(tab_bar, tab); // Allow the close button to overlap unless we are dragging (in which case we don't want any overlapping tabs to be hovered) if (g.ActiveId != id) @@ -8257,9 +8293,8 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, // Select with right mouse button. This is so the common idiom for context menu automatically highlight the current widget. const bool hovered_unblocked = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup); - if (hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1))) - if (!is_tab_button) - tab_bar->NextSelectedTabId = id; + if (hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1)) && !is_tab_button) + TabBarQueueFocus(tab_bar, tab); if (tab_bar->Flags & ImGuiTabBarFlags_NoCloseWithMiddleMouseButton) flags |= ImGuiTabItemFlags_NoCloseWithMiddleMouseButton; From 028a1cc605093d6cbd860c5652a4dd2a335953ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:00:35 -0800 Subject: [PATCH 29/86] Updated glslang. --- 3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 52 ++-- 3rdparty/glslang/build_info.h | 4 +- 3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp | 276 +++++++++++++++++- 3rdparty/glslang/glslang/HLSL/hlslGrammar.h | 2 +- .../glslang/glslang/HLSL/hlslScanContext.cpp | 160 ++++++++++ 3rdparty/glslang/glslang/HLSL/hlslTokens.h | 80 +++++ .../glslang/MachineIndependent/Constant.cpp | 6 +- .../MachineIndependent/ParseHelper.cpp | 10 +- .../glslang/MachineIndependent/ParseHelper.h | 4 + 9 files changed, 555 insertions(+), 39 deletions(-) diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index 378f79248..713db67df 100644 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -175,7 +175,7 @@ protected: spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&); void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, - const glslang::TQualifier&, spv::Id); + const glslang::TQualifier&, spv::Id, const std::vector& spvMembers); spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim); spv::Id accessChainLoad(const glslang::TType& type); void accessChainStore(const glslang::TType& type, spv::Id rvalue); @@ -375,27 +375,25 @@ spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type) } // Translate glslang type to SPIR-V block decorations. -spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useStorageBuffer) +spv::Decoration TranslateBlockDecoration(const glslang::TStorageQualifier storage, bool useStorageBuffer) { - if (type.getBasicType() == glslang::EbtBlock) { - switch (type.getQualifier().storage) { - case glslang::EvqUniform: return spv::DecorationBlock; - case glslang::EvqBuffer: return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock; - case glslang::EvqVaryingIn: return spv::DecorationBlock; - case glslang::EvqVaryingOut: return spv::DecorationBlock; - case glslang::EvqShared: return spv::DecorationBlock; + switch (storage) { + case glslang::EvqUniform: return spv::DecorationBlock; + case glslang::EvqBuffer: return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock; + case glslang::EvqVaryingIn: return spv::DecorationBlock; + case glslang::EvqVaryingOut: return spv::DecorationBlock; + case glslang::EvqShared: return spv::DecorationBlock; #ifndef GLSLANG_WEB - case glslang::EvqPayload: return spv::DecorationBlock; - case glslang::EvqPayloadIn: return spv::DecorationBlock; - case glslang::EvqHitAttr: return spv::DecorationBlock; - case glslang::EvqCallableData: return spv::DecorationBlock; - case glslang::EvqCallableDataIn: return spv::DecorationBlock; - case glslang::EvqHitObjectAttrNV: return spv::DecorationBlock; + case glslang::EvqPayload: return spv::DecorationBlock; + case glslang::EvqPayloadIn: return spv::DecorationBlock; + case glslang::EvqHitAttr: return spv::DecorationBlock; + case glslang::EvqCallableData: return spv::DecorationBlock; + case glslang::EvqCallableDataIn: return spv::DecorationBlock; + case glslang::EvqHitObjectAttrNV: return spv::DecorationBlock; #endif - default: - assert(0); - break; - } + default: + assert(0); + break; } return spv::DecorationMax; @@ -4672,7 +4670,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType; // Decorate it - decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType); + decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType, spvMembers); for (int i = 0; i < (int)deferredForwardPointers.size(); ++i) { auto it = deferredForwardPointers[i]; @@ -4686,7 +4684,8 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, const glslang::TTypeList* glslangMembers, glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier, - spv::Id spvType) + spv::Id spvType, + const std::vector& spvMembers) { // Name and decorate the non-hidden members int offset = -1; @@ -4839,7 +4838,16 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, // Decorate the structure builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); - builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); + const auto basicType = type.getBasicType(); + const auto typeStorageQualifier = type.getQualifier().storage; + if (basicType == glslang::EbtBlock) { + builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer())); + } else if (basicType == glslang::EbtStruct && glslangIntermediate->getSpv().vulkan > 0) { + const auto hasRuntimeArray = !spvMembers.empty() && builder.getOpCode(spvMembers.back()) == spv::OpTypeRuntimeArray; + if (hasRuntimeArray) { + builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer())); + } + } if (qualifier.hasHitObjectShaderRecordNV()) builder.addDecoration(spvType, spv::DecorationHitObjectShaderRecordBufferNV); diff --git a/3rdparty/glslang/build_info.h b/3rdparty/glslang/build_info.h index 3ab3fbaed..9327e840e 100644 --- a/3rdparty/glslang/build_info.h +++ b/3rdparty/glslang/build_info.h @@ -34,8 +34,8 @@ #ifndef GLSLANG_BUILD_INFO #define GLSLANG_BUILD_INFO -#define GLSLANG_VERSION_MAJOR 11 -#define GLSLANG_VERSION_MINOR 13 +#define GLSLANG_VERSION_MAJOR 12 +#define GLSLANG_VERSION_MINOR 0 #define GLSLANG_VERSION_PATCH 0 #define GLSLANG_VERSION_FLAVOR "" diff --git a/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp b/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp index 19a792b98..8e6f44e3a 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp +++ b/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp @@ -823,8 +823,10 @@ bool HlslGrammar::acceptLayoutQualifierList(TQualifier& qualifier) // | UINT // | BOOL // -bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType) +bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType, + TPrecisionQualifier& precision) { + precision = EpqNone; switch (peek()) { case EHTokFloat: basicType = EbtFloat; @@ -842,6 +844,23 @@ bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType) case EHTokBool: basicType = EbtBool; break; + case EHTokHalf: + basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat; + break; + case EHTokMin16float: + case EHTokMin10float: + basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat; + precision = EpqMedium; + break; + case EHTokMin16int: + case EHTokMin12int: + basicType = parseContext.hlslEnable16BitTypes() ? EbtInt16 : EbtInt; + precision = EpqMedium; + break; + case EHTokMin16uint: + basicType = parseContext.hlslEnable16BitTypes() ? EbtUint16 : EbtUint; + precision = EpqMedium; + break; default: return false; } @@ -867,7 +886,8 @@ bool HlslGrammar::acceptVectorTemplateType(TType& type) } TBasicType basicType; - if (! acceptTemplateVecMatBasicType(basicType)) { + TPrecisionQualifier precision; + if (! acceptTemplateVecMatBasicType(basicType, precision)) { expected("scalar type"); return false; } @@ -890,7 +910,7 @@ bool HlslGrammar::acceptVectorTemplateType(TType& type) const int vecSizeI = vecSize->getAsConstantUnion()->getConstArray()[0].getIConst(); - new(&type) TType(basicType, EvqTemporary, vecSizeI); + new(&type) TType(basicType, EvqTemporary, precision, vecSizeI); if (vecSizeI == 1) type.makeVector(); @@ -919,7 +939,8 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type) } TBasicType basicType; - if (! acceptTemplateVecMatBasicType(basicType)) { + TPrecisionQualifier precision; + if (! acceptTemplateVecMatBasicType(basicType, precision)) { expected("scalar type"); return false; } @@ -956,7 +977,7 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type) if (! acceptLiteral(cols)) return false; - new(&type) TType(basicType, EvqTemporary, 0, + new(&type) TType(basicType, EvqTemporary, precision, 0, rows->getAsConstantUnion()->getConstArray()[0].getIConst(), cols->getAsConstantUnion()->getConstArray()[0].getIConst()); @@ -2064,6 +2085,251 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 4); break; + case EHTokMin16float1x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin16float1x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin16float1x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin16float1x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin16float2x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin16float2x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin16float2x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin16float2x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin16float3x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin16float3x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin16float3x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin16float3x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin16float4x1: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin16float4x2: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin16float4x3: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin16float4x4: + new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin10float1x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin10float1x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin10float1x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin10float1x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin10float2x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin10float2x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin10float2x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin10float2x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin10float3x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin10float3x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin10float3x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin10float3x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin10float4x1: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin10float4x2: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin10float4x3: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin10float4x4: + new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin16int1x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin16int1x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin16int1x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin16int1x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin16int2x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin16int2x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin16int2x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin16int2x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin16int3x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin16int3x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin16int3x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin16int3x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin16int4x1: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin16int4x2: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin16int4x3: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin16int4x4: + new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin12int1x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin12int1x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin12int1x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin12int1x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin12int2x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin12int2x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin12int2x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin12int2x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin12int3x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin12int3x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin12int3x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin12int3x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin12int4x1: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin12int4x2: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin12int4x3: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin12int4x4: + new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + + case EHTokMin16uint1x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 1); + break; + case EHTokMin16uint1x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 2); + break; + case EHTokMin16uint1x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 3); + break; + case EHTokMin16uint1x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 4); + break; + case EHTokMin16uint2x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 1); + break; + case EHTokMin16uint2x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 2); + break; + case EHTokMin16uint2x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 3); + break; + case EHTokMin16uint2x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 4); + break; + case EHTokMin16uint3x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 1); + break; + case EHTokMin16uint3x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 2); + break; + case EHTokMin16uint3x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 3); + break; + case EHTokMin16uint3x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 4); + break; + case EHTokMin16uint4x1: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 1); + break; + case EHTokMin16uint4x2: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 2); + break; + case EHTokMin16uint4x3: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 3); + break; + case EHTokMin16uint4x4: + new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 4); + break; + default: return false; } diff --git a/3rdparty/glslang/glslang/HLSL/hlslGrammar.h b/3rdparty/glslang/glslang/HLSL/hlslGrammar.h index 27706b2b9..6c120081a 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslGrammar.h +++ b/3rdparty/glslang/glslang/HLSL/hlslGrammar.h @@ -76,7 +76,7 @@ namespace glslang { bool acceptLayoutQualifierList(TQualifier&); bool acceptType(TType&); bool acceptType(TType&, TIntermNode*& nodeList); - bool acceptTemplateVecMatBasicType(TBasicType&); + bool acceptTemplateVecMatBasicType(TBasicType&, TPrecisionQualifier&); bool acceptVectorTemplateType(TType&); bool acceptMatrixTemplateType(TType&); bool acceptTessellationDeclType(TBuiltInVariable&); diff --git a/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp b/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp index fc62672f4..823b17aa3 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp +++ b/3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp @@ -312,6 +312,86 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["double4x2"] = EHTokDouble4x2; (*KeywordMap)["double4x3"] = EHTokDouble4x3; (*KeywordMap)["double4x4"] = EHTokDouble4x4; + (*KeywordMap)["min16float1x1"] = EHTokMin16float1x1; + (*KeywordMap)["min16float1x2"] = EHTokMin16float1x2; + (*KeywordMap)["min16float1x3"] = EHTokMin16float1x3; + (*KeywordMap)["min16float1x4"] = EHTokMin16float1x4; + (*KeywordMap)["min16float2x1"] = EHTokMin16float2x1; + (*KeywordMap)["min16float2x2"] = EHTokMin16float2x2; + (*KeywordMap)["min16float2x3"] = EHTokMin16float2x3; + (*KeywordMap)["min16float2x4"] = EHTokMin16float2x4; + (*KeywordMap)["min16float3x1"] = EHTokMin16float3x1; + (*KeywordMap)["min16float3x2"] = EHTokMin16float3x2; + (*KeywordMap)["min16float3x3"] = EHTokMin16float3x3; + (*KeywordMap)["min16float3x4"] = EHTokMin16float3x4; + (*KeywordMap)["min16float4x1"] = EHTokMin16float4x1; + (*KeywordMap)["min16float4x2"] = EHTokMin16float4x2; + (*KeywordMap)["min16float4x3"] = EHTokMin16float4x3; + (*KeywordMap)["min16float4x4"] = EHTokMin16float4x4; + (*KeywordMap)["min10float1x1"] = EHTokMin10float1x1; + (*KeywordMap)["min10float1x2"] = EHTokMin10float1x2; + (*KeywordMap)["min10float1x3"] = EHTokMin10float1x3; + (*KeywordMap)["min10float1x4"] = EHTokMin10float1x4; + (*KeywordMap)["min10float2x1"] = EHTokMin10float2x1; + (*KeywordMap)["min10float2x2"] = EHTokMin10float2x2; + (*KeywordMap)["min10float2x3"] = EHTokMin10float2x3; + (*KeywordMap)["min10float2x4"] = EHTokMin10float2x4; + (*KeywordMap)["min10float3x1"] = EHTokMin10float3x1; + (*KeywordMap)["min10float3x2"] = EHTokMin10float3x2; + (*KeywordMap)["min10float3x3"] = EHTokMin10float3x3; + (*KeywordMap)["min10float3x4"] = EHTokMin10float3x4; + (*KeywordMap)["min10float4x1"] = EHTokMin10float4x1; + (*KeywordMap)["min10float4x2"] = EHTokMin10float4x2; + (*KeywordMap)["min10float4x3"] = EHTokMin10float4x3; + (*KeywordMap)["min10float4x4"] = EHTokMin10float4x4; + (*KeywordMap)["min16int1x1"] = EHTokMin16int1x1; + (*KeywordMap)["min16int1x2"] = EHTokMin16int1x2; + (*KeywordMap)["min16int1x3"] = EHTokMin16int1x3; + (*KeywordMap)["min16int1x4"] = EHTokMin16int1x4; + (*KeywordMap)["min16int2x1"] = EHTokMin16int2x1; + (*KeywordMap)["min16int2x2"] = EHTokMin16int2x2; + (*KeywordMap)["min16int2x3"] = EHTokMin16int2x3; + (*KeywordMap)["min16int2x4"] = EHTokMin16int2x4; + (*KeywordMap)["min16int3x1"] = EHTokMin16int3x1; + (*KeywordMap)["min16int3x2"] = EHTokMin16int3x2; + (*KeywordMap)["min16int3x3"] = EHTokMin16int3x3; + (*KeywordMap)["min16int3x4"] = EHTokMin16int3x4; + (*KeywordMap)["min16int4x1"] = EHTokMin16int4x1; + (*KeywordMap)["min16int4x2"] = EHTokMin16int4x2; + (*KeywordMap)["min16int4x3"] = EHTokMin16int4x3; + (*KeywordMap)["min16int4x4"] = EHTokMin16int4x4; + (*KeywordMap)["min12int1x1"] = EHTokMin12int1x1; + (*KeywordMap)["min12int1x2"] = EHTokMin12int1x2; + (*KeywordMap)["min12int1x3"] = EHTokMin12int1x3; + (*KeywordMap)["min12int1x4"] = EHTokMin12int1x4; + (*KeywordMap)["min12int2x1"] = EHTokMin12int2x1; + (*KeywordMap)["min12int2x2"] = EHTokMin12int2x2; + (*KeywordMap)["min12int2x3"] = EHTokMin12int2x3; + (*KeywordMap)["min12int2x4"] = EHTokMin12int2x4; + (*KeywordMap)["min12int3x1"] = EHTokMin12int3x1; + (*KeywordMap)["min12int3x2"] = EHTokMin12int3x2; + (*KeywordMap)["min12int3x3"] = EHTokMin12int3x3; + (*KeywordMap)["min12int3x4"] = EHTokMin12int3x4; + (*KeywordMap)["min12int4x1"] = EHTokMin12int4x1; + (*KeywordMap)["min12int4x2"] = EHTokMin12int4x2; + (*KeywordMap)["min12int4x3"] = EHTokMin12int4x3; + (*KeywordMap)["min12int4x4"] = EHTokMin12int4x4; + (*KeywordMap)["min16uint1x1"] = EHTokMin16uint1x1; + (*KeywordMap)["min16uint1x2"] = EHTokMin16uint1x2; + (*KeywordMap)["min16uint1x3"] = EHTokMin16uint1x3; + (*KeywordMap)["min16uint1x4"] = EHTokMin16uint1x4; + (*KeywordMap)["min16uint2x1"] = EHTokMin16uint2x1; + (*KeywordMap)["min16uint2x2"] = EHTokMin16uint2x2; + (*KeywordMap)["min16uint2x3"] = EHTokMin16uint2x3; + (*KeywordMap)["min16uint2x4"] = EHTokMin16uint2x4; + (*KeywordMap)["min16uint3x1"] = EHTokMin16uint3x1; + (*KeywordMap)["min16uint3x2"] = EHTokMin16uint3x2; + (*KeywordMap)["min16uint3x3"] = EHTokMin16uint3x3; + (*KeywordMap)["min16uint3x4"] = EHTokMin16uint3x4; + (*KeywordMap)["min16uint4x1"] = EHTokMin16uint4x1; + (*KeywordMap)["min16uint4x2"] = EHTokMin16uint4x2; + (*KeywordMap)["min16uint4x3"] = EHTokMin16uint4x3; + (*KeywordMap)["min16uint4x4"] = EHTokMin16uint4x4; (*KeywordMap)["sampler"] = EHTokSampler; (*KeywordMap)["sampler1D"] = EHTokSampler1d; @@ -806,6 +886,86 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier() case EHTokDouble4x2: case EHTokDouble4x3: case EHTokDouble4x4: + case EHTokMin16float1x1: + case EHTokMin16float1x2: + case EHTokMin16float1x3: + case EHTokMin16float1x4: + case EHTokMin16float2x1: + case EHTokMin16float2x2: + case EHTokMin16float2x3: + case EHTokMin16float2x4: + case EHTokMin16float3x1: + case EHTokMin16float3x2: + case EHTokMin16float3x3: + case EHTokMin16float3x4: + case EHTokMin16float4x1: + case EHTokMin16float4x2: + case EHTokMin16float4x3: + case EHTokMin16float4x4: + case EHTokMin10float1x1: + case EHTokMin10float1x2: + case EHTokMin10float1x3: + case EHTokMin10float1x4: + case EHTokMin10float2x1: + case EHTokMin10float2x2: + case EHTokMin10float2x3: + case EHTokMin10float2x4: + case EHTokMin10float3x1: + case EHTokMin10float3x2: + case EHTokMin10float3x3: + case EHTokMin10float3x4: + case EHTokMin10float4x1: + case EHTokMin10float4x2: + case EHTokMin10float4x3: + case EHTokMin10float4x4: + case EHTokMin16int1x1: + case EHTokMin16int1x2: + case EHTokMin16int1x3: + case EHTokMin16int1x4: + case EHTokMin16int2x1: + case EHTokMin16int2x2: + case EHTokMin16int2x3: + case EHTokMin16int2x4: + case EHTokMin16int3x1: + case EHTokMin16int3x2: + case EHTokMin16int3x3: + case EHTokMin16int3x4: + case EHTokMin16int4x1: + case EHTokMin16int4x2: + case EHTokMin16int4x3: + case EHTokMin16int4x4: + case EHTokMin12int1x1: + case EHTokMin12int1x2: + case EHTokMin12int1x3: + case EHTokMin12int1x4: + case EHTokMin12int2x1: + case EHTokMin12int2x2: + case EHTokMin12int2x3: + case EHTokMin12int2x4: + case EHTokMin12int3x1: + case EHTokMin12int3x2: + case EHTokMin12int3x3: + case EHTokMin12int3x4: + case EHTokMin12int4x1: + case EHTokMin12int4x2: + case EHTokMin12int4x3: + case EHTokMin12int4x4: + case EHTokMin16uint1x1: + case EHTokMin16uint1x2: + case EHTokMin16uint1x3: + case EHTokMin16uint1x4: + case EHTokMin16uint2x1: + case EHTokMin16uint2x2: + case EHTokMin16uint2x3: + case EHTokMin16uint2x4: + case EHTokMin16uint3x1: + case EHTokMin16uint3x2: + case EHTokMin16uint3x3: + case EHTokMin16uint3x4: + case EHTokMin16uint4x1: + case EHTokMin16uint4x2: + case EHTokMin16uint4x3: + case EHTokMin16uint4x4: return keyword; // texturing types diff --git a/3rdparty/glslang/glslang/HLSL/hlslTokens.h b/3rdparty/glslang/glslang/HLSL/hlslTokens.h index 4426bccec..a7c129907 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslTokens.h +++ b/3rdparty/glslang/glslang/HLSL/hlslTokens.h @@ -249,6 +249,86 @@ enum EHlslTokenClass { EHTokDouble4x2, EHTokDouble4x3, EHTokDouble4x4, + EHTokMin16float1x1, + EHTokMin16float1x2, + EHTokMin16float1x3, + EHTokMin16float1x4, + EHTokMin16float2x1, + EHTokMin16float2x2, + EHTokMin16float2x3, + EHTokMin16float2x4, + EHTokMin16float3x1, + EHTokMin16float3x2, + EHTokMin16float3x3, + EHTokMin16float3x4, + EHTokMin16float4x1, + EHTokMin16float4x2, + EHTokMin16float4x3, + EHTokMin16float4x4, + EHTokMin10float1x1, + EHTokMin10float1x2, + EHTokMin10float1x3, + EHTokMin10float1x4, + EHTokMin10float2x1, + EHTokMin10float2x2, + EHTokMin10float2x3, + EHTokMin10float2x4, + EHTokMin10float3x1, + EHTokMin10float3x2, + EHTokMin10float3x3, + EHTokMin10float3x4, + EHTokMin10float4x1, + EHTokMin10float4x2, + EHTokMin10float4x3, + EHTokMin10float4x4, + EHTokMin16int1x1, + EHTokMin16int1x2, + EHTokMin16int1x3, + EHTokMin16int1x4, + EHTokMin16int2x1, + EHTokMin16int2x2, + EHTokMin16int2x3, + EHTokMin16int2x4, + EHTokMin16int3x1, + EHTokMin16int3x2, + EHTokMin16int3x3, + EHTokMin16int3x4, + EHTokMin16int4x1, + EHTokMin16int4x2, + EHTokMin16int4x3, + EHTokMin16int4x4, + EHTokMin12int1x1, + EHTokMin12int1x2, + EHTokMin12int1x3, + EHTokMin12int1x4, + EHTokMin12int2x1, + EHTokMin12int2x2, + EHTokMin12int2x3, + EHTokMin12int2x4, + EHTokMin12int3x1, + EHTokMin12int3x2, + EHTokMin12int3x3, + EHTokMin12int3x4, + EHTokMin12int4x1, + EHTokMin12int4x2, + EHTokMin12int4x3, + EHTokMin12int4x4, + EHTokMin16uint1x1, + EHTokMin16uint1x2, + EHTokMin16uint1x3, + EHTokMin16uint1x4, + EHTokMin16uint2x1, + EHTokMin16uint2x2, + EHTokMin16uint2x3, + EHTokMin16uint2x4, + EHTokMin16uint3x1, + EHTokMin16uint3x2, + EHTokMin16uint3x3, + EHTokMin16uint3x4, + EHTokMin16uint4x1, + EHTokMin16uint4x2, + EHTokMin16uint4x3, + EHTokMin16uint4x4, // texturing types EHTokSampler, diff --git a/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp index 40f53bbcc..f6916cbef 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp @@ -212,9 +212,9 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right case EbtInt64: if (rightUnionArray[i] == 0ll) - newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll); - else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)-0x8000000000000000ll) - newConstArray[i].setI64Const((long long)-0x8000000000000000ll); + newConstArray[i].setI64Const(LLONG_MAX); + else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) + newConstArray[i].setI64Const(LLONG_MIN); else newConstArray[i].setI64Const(leftUnionArray[i].getI64Const() / rightUnionArray[i].getI64Const()); break; diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 515137b70..4b22c6cd4 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -80,10 +80,6 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b globalBufferDefaults.layoutMatrix = ElmColumnMajor; globalBufferDefaults.layoutPacking = spvVersion.spv != 0 ? ElpStd430 : ElpShared; - // use storage buffer on SPIR-V 1.3 and up - if (spvVersion.spv >= EShTargetSpv_1_3) - intermediate.setUseStorageBuffer(); - globalInputDefaults.clear(); globalOutputDefaults.clear(); @@ -3983,8 +3979,10 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali return; } - if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) - profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output"); + if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) { + profileRequires(loc, EEsProfile, 300, nullptr, "non-float shader input/output"); + profileRequires(loc, ~EEsProfile, 130, nullptr, "non-float shader input/output"); + } if (!qualifier.flat && !qualifier.isExplicitInterpolation() && !qualifier.isPervertexNV() && !qualifier.isPervertexEXT()) { if (isTypeInt(publicType.basicType) || diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h index 8edcfdf8f..509b3004e 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h @@ -95,6 +95,10 @@ public: globalUniformSet(TQualifier::layoutSetEnd), atomicCounterBlockSet(TQualifier::layoutSetEnd) { + // use storage buffer on SPIR-V 1.3 and up + if (spvVersion.spv >= EShTargetSpv_1_3) + intermediate.setUseStorageBuffer(); + if (entryPoint != nullptr) sourceEntryPointName = *entryPoint; } From faf90023daa6649b8c73c110d911b2fcb0f51bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:00:58 -0800 Subject: [PATCH 30/86] Updated spirv-headers. --- .../spirv/unified1/NonSemanticDebugBreak.h | 50 ++++++++++++ ...xtinst.nonsemantic.debugbreak.grammar.json | 9 +++ .../spirv/unified1/spirv.core.grammar.json | 80 ++++++++++++++++++- .../include/spirv/unified1/spirv.h | 10 +++ .../include/spirv/unified1/spirv.hpp11 | 10 +++ .../include/spirv/unified1/spirv.json | 12 ++- 6 files changed, 168 insertions(+), 3 deletions(-) create mode 100644 3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h create mode 100644 3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.debugbreak.grammar.json diff --git a/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h b/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h new file mode 100644 index 000000000..6ec2b5bb3 --- /dev/null +++ b/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticDebugBreak.h @@ -0,0 +1,50 @@ +// Copyright (c) 2020 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +// + +#ifndef SPIRV_UNIFIED1_NonSemanticDebugBreak_H_ +#define SPIRV_UNIFIED1_NonSemanticDebugBreak_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticDebugBreakRevision = 1, + NonSemanticDebugBreakRevision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticDebugBreakInstructions { + NonSemanticDebugBreakDebugBreak = 1, + NonSemanticDebugBreakInstructionsMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticDebugBreak_H_ diff --git a/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.debugbreak.grammar.json b/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.debugbreak.grammar.json new file mode 100644 index 000000000..ae2888338 --- /dev/null +++ b/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.debugbreak.grammar.json @@ -0,0 +1,9 @@ +{ + "revision" : 1, + "instructions" : [ + { + "opname" : "DebugBreak", + "opcode" : 1 + } + ] +} diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json index b23d8a86c..3e4f81ea6 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json @@ -4751,7 +4751,6 @@ { "kind" : "IdScope", "name" : "'Scope'" } ], "capabilities" : [ "ShaderClockKHR" ], - "extensions" : [ "SPV_KHR_shader_clock" ], "version" : "None" }, { @@ -12517,6 +12516,78 @@ "value" : 6140, "capabilities" : [ "VectorComputeINTEL" ], "version" : "None" + }, + { + "enumerant" : "ConduitKernelArgumentINTEL", + "value" : 6175, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "version" : "None" + }, + { + "enumerant" : "RegisterMapKernelArgumentINTEL", + "value" : 6176, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "version" : "None" + }, + { + "enumerant" : "MMHostInterfaceAddressWidthINTEL", + "value" : 6177, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'AddressWidth'" } + ], + "version" : "None" + }, + { + "enumerant" : "MMHostInterfaceDataWidthINTEL", + "value" : 6178, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'DataWidth'" } + ], + "version" : "None" + }, + { + "enumerant" : "MMHostInterfaceLatencyINTEL", + "value" : 6179, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Latency'" } + ], + "version" : "None" + }, + { + "enumerant" : "MMHostInterfaceReadWriteModeINTEL", + "value" : 6180, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "parameters" : [ + { "kind" : "AccessQualifier", "name" : "'ReadWriteMode'" } + ], + "version" : "None" + }, + { + "enumerant" : "MMHostInterfaceMaxBurstINTEL", + "value" : 6181, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'MaxBurstCount'" } + ], + "version" : "None" + }, + { + "enumerant" : "MMHostInterfaceWaitRequestINTEL", + "value" : 6182, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Waitrequest'" } + ], + "version" : "None" + }, + { + "enumerant" : "StableKernelArgumentINTEL", + "value" : 6183, + "capabilities" : [ "FPGAArgumentInterfacesINTEL" ], + "version" : "None" } ] }, @@ -14056,7 +14127,6 @@ { "enumerant" : "ShaderClockKHR", "value" : 5055, - "capabilities" : [ "Shader" ], "extensions" : [ "SPV_KHR_shader_clock" ], "version" : "None" }, @@ -14823,6 +14893,12 @@ "extensions" : [ "SPV_INTEL_split_barrier" ], "version" : "None" }, + { + "enumerant" : "FPGAArgumentInterfacesINTEL", + "value" : 6174, + "extensions" : [ "SPV_INTEL_fpga_argument_interfaces" ], + "version" : "None" + }, { "enumerant" : "GroupUniformArithmeticKHR", "value" : 6400, diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h index 366b55608..f6b77aed7 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h @@ -580,6 +580,15 @@ typedef enum SpvDecoration_ { SpvDecorationSingleElementVectorINTEL = 6085, SpvDecorationVectorComputeCallableFunctionINTEL = 6087, SpvDecorationMediaBlockIOINTEL = 6140, + SpvDecorationConduitKernelArgumentINTEL = 6175, + SpvDecorationRegisterMapKernelArgumentINTEL = 6176, + SpvDecorationMMHostInterfaceAddressWidthINTEL = 6177, + SpvDecorationMMHostInterfaceDataWidthINTEL = 6178, + SpvDecorationMMHostInterfaceLatencyINTEL = 6179, + SpvDecorationMMHostInterfaceReadWriteModeINTEL = 6180, + SpvDecorationMMHostInterfaceMaxBurstINTEL = 6181, + SpvDecorationMMHostInterfaceWaitRequestINTEL = 6182, + SpvDecorationStableKernelArgumentINTEL = 6183, SpvDecorationMax = 0x7fffffff, } SpvDecoration; @@ -1137,6 +1146,7 @@ typedef enum SpvCapability_ { SpvCapabilityAtomicFloat16AddEXT = 6095, SpvCapabilityDebugInfoModuleINTEL = 6114, SpvCapabilitySplitBarrierINTEL = 6141, + SpvCapabilityFPGAArgumentInterfacesINTEL = 6174, SpvCapabilityGroupUniformArithmeticKHR = 6400, SpvCapabilityMax = 0x7fffffff, } SpvCapability; diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 index 341d333da..b7d041a37 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 @@ -576,6 +576,15 @@ enum class Decoration : unsigned { SingleElementVectorINTEL = 6085, VectorComputeCallableFunctionINTEL = 6087, MediaBlockIOINTEL = 6140, + ConduitKernelArgumentINTEL = 6175, + RegisterMapKernelArgumentINTEL = 6176, + MMHostInterfaceAddressWidthINTEL = 6177, + MMHostInterfaceDataWidthINTEL = 6178, + MMHostInterfaceLatencyINTEL = 6179, + MMHostInterfaceReadWriteModeINTEL = 6180, + MMHostInterfaceMaxBurstINTEL = 6181, + MMHostInterfaceWaitRequestINTEL = 6182, + StableKernelArgumentINTEL = 6183, Max = 0x7fffffff, }; @@ -1133,6 +1142,7 @@ enum class Capability : unsigned { AtomicFloat16AddEXT = 6095, DebugInfoModuleINTEL = 6114, SplitBarrierINTEL = 6141, + FPGAArgumentInterfacesINTEL = 6174, GroupUniformArithmeticKHR = 6400, Max = 0x7fffffff, }; diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json index 4cd00db24..06e3a909b 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json @@ -601,7 +601,16 @@ "FunctionFloatingPointModeINTEL": 6080, "SingleElementVectorINTEL": 6085, "VectorComputeCallableFunctionINTEL": 6087, - "MediaBlockIOINTEL": 6140 + "MediaBlockIOINTEL": 6140, + "ConduitKernelArgumentINTEL": 6175, + "RegisterMapKernelArgumentINTEL": 6176, + "MMHostInterfaceAddressWidthINTEL": 6177, + "MMHostInterfaceDataWidthINTEL": 6178, + "MMHostInterfaceLatencyINTEL": 6179, + "MMHostInterfaceReadWriteModeINTEL": 6180, + "MMHostInterfaceMaxBurstINTEL": 6181, + "MMHostInterfaceWaitRequestINTEL": 6182, + "StableKernelArgumentINTEL": 6183 } }, { @@ -1113,6 +1122,7 @@ "AtomicFloat16AddEXT": 6095, "DebugInfoModuleINTEL": 6114, "SplitBarrierINTEL": 6141, + "FPGAArgumentInterfacesINTEL": 6174, "GroupUniformArithmeticKHR": 6400 } }, From 3d390308dc7b78fedb3ecd0b8fd2b5187bd0734c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:01:13 -0800 Subject: [PATCH 31/86] Updated spirv-tools. --- .../include/generated/build-version.inc | 2 +- .../include/generated/core.insts-unified1.inc | 3 +- .../include/generated/enum_string_mapping.inc | 8 +- .../include/generated/extension_enum.inc | 1 + .../generated/operand.kinds-unified1.inc | 16 +- .../include/spirv-tools/libspirv.h | 59 +++ .../source/opt/inst_bindless_check_pass.cpp | 37 +- .../source/opt/inst_buff_addr_check_pass.cpp | 38 +- .../source/opt/inst_debug_printf_pass.cpp | 9 +- .../source/opt/instrument_pass.cpp | 357 +++++++++--------- .../spirv-tools/source/opt/instrument_pass.h | 33 +- 3rdparty/spirv-tools/source/opt/optimizer.cpp | 92 +++++ .../source/val/validate_bitwise.cpp | 5 +- 13 files changed, 424 insertions(+), 236 deletions(-) diff --git a/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/spirv-tools/include/generated/build-version.inc index d0561b53c..f5411dcee 100644 --- a/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2022.5-dev", "SPIRV-Tools v2022.5-dev 466c6a4e95f6c2ebd61040d6fe2f6418e45b7e20" +"v2023.2-dev", "SPIRV-Tools v2023.2-dev v2022.4-89-g4ee97c03" diff --git a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc index 1a45cbba5..d2ca74927 100644 --- a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc @@ -95,7 +95,6 @@ static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_query[] = {spvt static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_tracing[] = {spvtools::Extension::kSPV_KHR_ray_tracing}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_tracingSPV_KHR_ray_query[] = {spvtools::Extension::kSPV_KHR_ray_tracing, spvtools::Extension::kSPV_KHR_ray_query}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_ballot[] = {spvtools::Extension::kSPV_KHR_shader_ballot}; -static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_clock[] = {spvtools::Extension::kSPV_KHR_shader_clock}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_subgroup_vote[] = {spvtools::Extension::kSPV_KHR_subgroup_vote}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_terminate_invocation[] = {spvtools::Extension::kSPV_KHR_terminate_invocation}; static const spvtools::Extension pygen_variable_exts_SPV_NV_cooperative_matrix[] = {spvtools::Extension::kSPV_NV_cooperative_matrix}; @@ -494,7 +493,7 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = { {"GroupSMaxNonUniformAMD", spv::Op::OpGroupSMaxNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, {"FragmentMaskFetchAMD", spv::Op::OpFragmentMaskFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, {"FragmentFetchAMD", spv::Op::OpFragmentFetchAMD, 1, pygen_variable_caps_FragmentMaskAMD, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, 0xffffffffu, 0xffffffffu}, - {"ReadClockKHR", spv::Op::OpReadClockKHR, 1, pygen_variable_caps_ShaderClockKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_clock, 0xffffffffu, 0xffffffffu}, + {"ReadClockKHR", spv::Op::OpReadClockKHR, 1, pygen_variable_caps_ShaderClockKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"HitObjectRecordHitMotionNV", spv::Op::OpHitObjectRecordHitMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 14, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"HitObjectRecordHitWithIndexMotionNV", spv::Op::OpHitObjectRecordHitWithIndexMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 13, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"HitObjectRecordMissMotionNV", spv::Op::OpHitObjectRecordMissMotionNV, 2, pygen_variable_caps_ShaderInvocationReorderNVRayTracingMotionBlurNV, 7, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, diff --git a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc index 967dbb6a3..18344e8d7 100644 --- a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc +++ b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc @@ -74,6 +74,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_float_controls2"; case Extension::kSPV_INTEL_fp_fast_math_mode: return "SPV_INTEL_fp_fast_math_mode"; + case Extension::kSPV_INTEL_fpga_argument_interfaces: + return "SPV_INTEL_fpga_argument_interfaces"; case Extension::kSPV_INTEL_fpga_buffer_location: return "SPV_INTEL_fpga_buffer_location"; case Extension::kSPV_INTEL_fpga_cluster_attributes: @@ -229,8 +231,8 @@ const char* ExtensionToString(Extension extension) { bool GetExtensionFromString(const char* str, Extension* extension) { - static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_VALIDATOR_ignore_type_decl_unique" }; - static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; + static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_argument_interfaces", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_VALIDATOR_ignore_type_decl_unique" }; + static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_argument_interfaces, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; const auto b = std::begin(known_ext_strs); const auto e = std::end(known_ext_strs); const auto found = std::equal_range( @@ -656,6 +658,8 @@ const char* CapabilityToString(spv::Capability capability) { return "DebugInfoModuleINTEL"; case spv::Capability::SplitBarrierINTEL: return "SplitBarrierINTEL"; + case spv::Capability::FPGAArgumentInterfacesINTEL: + return "FPGAArgumentInterfacesINTEL"; case spv::Capability::GroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; case spv::Capability::Max: diff --git a/3rdparty/spirv-tools/include/generated/extension_enum.inc b/3rdparty/spirv-tools/include/generated/extension_enum.inc index cc785937c..68c36bb41 100644 --- a/3rdparty/spirv-tools/include/generated/extension_enum.inc +++ b/3rdparty/spirv-tools/include/generated/extension_enum.inc @@ -35,6 +35,7 @@ kSPV_INTEL_debug_module, kSPV_INTEL_device_side_avc_motion_estimation, kSPV_INTEL_float_controls2, kSPV_INTEL_fp_fast_math_mode, +kSPV_INTEL_fpga_argument_interfaces, kSPV_INTEL_fpga_buffer_location, kSPV_INTEL_fpga_cluster_attributes, kSPV_INTEL_fpga_dsp_control, diff --git a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc index b6d9c6b7a..003a5a588 100644 --- a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc @@ -15,6 +15,7 @@ static const spv::Capability pygen_variable_caps_DeviceGroup[] = {spv::Capabilit static const spv::Capability pygen_variable_caps_DrawParameters[] = {spv::Capability::DrawParameters}; static const spv::Capability pygen_variable_caps_DrawParametersMeshShadingNVMeshShadingEXT[] = {spv::Capability::DrawParameters, spv::Capability::MeshShadingNV, spv::Capability::MeshShadingEXT}; static const spv::Capability pygen_variable_caps_FPFastMathModeINTEL[] = {spv::Capability::FPFastMathModeINTEL}; +static const spv::Capability pygen_variable_caps_FPGAArgumentInterfacesINTEL[] = {spv::Capability::FPGAArgumentInterfacesINTEL}; static const spv::Capability pygen_variable_caps_FPGABufferLocationINTEL[] = {spv::Capability::FPGABufferLocationINTEL}; static const spv::Capability pygen_variable_caps_FPGAClusterAttributesINTEL[] = {spv::Capability::FPGAClusterAttributesINTEL}; static const spv::Capability pygen_variable_caps_FPGADSPControlINTEL[] = {spv::Capability::FPGADSPControlINTEL}; @@ -164,6 +165,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_debug_module[] = static const spvtools::Extension pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation[] = {spvtools::Extension::kSPV_INTEL_device_side_avc_motion_estimation}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_float_controls2[] = {spvtools::Extension::kSPV_INTEL_float_controls2}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fp_fast_math_mode[] = {spvtools::Extension::kSPV_INTEL_fp_fast_math_mode}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_argument_interfaces[] = {spvtools::Extension::kSPV_INTEL_fpga_argument_interfaces}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_buffer_location[] = {spvtools::Extension::kSPV_INTEL_fpga_buffer_location}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_cluster_attributes[] = {spvtools::Extension::kSPV_INTEL_fpga_cluster_attributes}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_dsp_control[] = {spvtools::Extension::kSPV_INTEL_fpga_dsp_control}; @@ -831,7 +833,16 @@ static const spv_operand_desc_t pygen_variable_DecorationEntries[] = { {"FunctionFloatingPointModeINTEL", 6080, 1, pygen_variable_caps_FunctionFloatControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_FPOPERATION_MODE}, 0xffffffffu, 0xffffffffu}, {"SingleElementVectorINTEL", 6085, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"VectorComputeCallableFunctionINTEL", 6087, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, - {"MediaBlockIOINTEL", 6140, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} + {"MediaBlockIOINTEL", 6140, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"ConduitKernelArgumentINTEL", 6175, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"RegisterMapKernelArgumentINTEL", 6176, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceAddressWidthINTEL", 6177, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceDataWidthINTEL", 6178, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceLatencyINTEL", 6179, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceReadWriteModeINTEL", 6180, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_ACCESS_QUALIFIER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceMaxBurstINTEL", 6181, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"MMHostInterfaceWaitRequestINTEL", 6182, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"StableKernelArgumentINTEL", 6183, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = { @@ -1104,7 +1115,7 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"StencilExportEXT", 5013, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu}, {"ImageReadWriteLodAMD", 5015, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_image_load_store_lod, {}, 0xffffffffu, 0xffffffffu}, {"Int64ImageEXT", 5016, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_image_int64, {}, 0xffffffffu, 0xffffffffu}, - {"ShaderClockKHR", 5055, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_shader_clock, {}, 0xffffffffu, 0xffffffffu}, + {"ShaderClockKHR", 5055, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_clock, {}, 0xffffffffu, 0xffffffffu}, {"SampleMaskOverrideCoverageNV", 5249, 1, pygen_variable_caps_SampleRateShading, 1, pygen_variable_exts_SPV_NV_sample_mask_override_coverage, {}, 0xffffffffu, 0xffffffffu}, {"GeometryShaderPassthroughNV", 5251, 1, pygen_variable_caps_Geometry, 1, pygen_variable_exts_SPV_NV_geometry_shader_passthrough, {}, 0xffffffffu, 0xffffffffu}, {"ShaderViewportIndexLayerEXT", 5254, 1, pygen_variable_caps_MultiViewport, 2, pygen_variable_exts_SPV_EXT_shader_viewport_index_layerSPV_NV_viewport_array2, {}, 0xffffffffu, 0xffffffffu}, @@ -1226,6 +1237,7 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"AtomicFloat16AddEXT", 6095, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float16_add, {}, 0xffffffffu, 0xffffffffu}, {"DebugInfoModuleINTEL", 6114, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_debug_module, {}, 0xffffffffu, 0xffffffffu}, {"SplitBarrierINTEL", 6141, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_split_barrier, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAArgumentInterfacesINTEL", 6174, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_argument_interfaces, {}, 0xffffffffu, 0xffffffffu}, {"GroupUniformArithmeticKHR", 6400, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_uniform_group_instructions, {}, 0xffffffffu, 0xffffffffu} }; diff --git a/3rdparty/spirv-tools/include/spirv-tools/libspirv.h b/3rdparty/spirv-tools/include/spirv-tools/libspirv.h index 1643b5a9b..10102cc39 100644 --- a/3rdparty/spirv-tools/include/spirv-tools/libspirv.h +++ b/3rdparty/spirv-tools/include/spirv-tools/libspirv.h @@ -442,6 +442,8 @@ typedef struct spv_reducer_options_t spv_reducer_options_t; typedef struct spv_fuzzer_options_t spv_fuzzer_options_t; +typedef struct spv_optimizer_t spv_optimizer_t; + // Type Definitions typedef spv_const_binary_t* spv_const_binary; @@ -901,6 +903,63 @@ SPIRV_TOOLS_EXPORT spv_result_t spvBinaryParse( const size_t num_words, spv_parsed_header_fn_t parse_header, spv_parsed_instruction_fn_t parse_instruction, spv_diagnostic* diagnostic); +// The optimizer interface. + +// A pointer to a function that accepts a log message from an optimizer. +typedef void (*spv_message_consumer)( + spv_message_level_t, const char*, const spv_position_t*, const char*); + +// Creates and returns an optimizer object. This object must be passed to +// optimizer APIs below and is valid until passed to spvOptimizerDestroy. +SPIRV_TOOLS_EXPORT spv_optimizer_t* spvOptimizerCreate(spv_target_env env); + +// Destroys the given optimizer object. +SPIRV_TOOLS_EXPORT void spvOptimizerDestroy(spv_optimizer_t* optimizer); + +// Sets an spv_message_consumer on an optimizer object. +SPIRV_TOOLS_EXPORT void spvOptimizerSetMessageConsumer( + spv_optimizer_t* optimizer, spv_message_consumer consumer); + +// Registers passes that attempt to legalize the generated code. +SPIRV_TOOLS_EXPORT void spvOptimizerRegisterLegalizationPasses( + spv_optimizer_t* optimizer); + +// Registers passes that attempt to improve performance of generated code. +SPIRV_TOOLS_EXPORT void spvOptimizerRegisterPerformancePasses( + spv_optimizer_t* optimizer); + +// Registers passes that attempt to improve the size of generated code. +SPIRV_TOOLS_EXPORT void spvOptimizerRegisterSizePasses( + spv_optimizer_t* optimizer); + +// Registers a pass specified by a flag in an optimizer object. +SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassFromFlag( + spv_optimizer_t* optimizer, const char* flag); + +// Registers passes specified by length number of flags in an optimizer object. +SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassesFromFlags( + spv_optimizer_t* optimizer, const char** flags, const size_t flag_count); + +// Optimizes the SPIR-V code of size |word_count| pointed to by |binary| and +// returns an optimized spv_binary in |optimized_binary|. +// +// Returns SPV_SUCCESS on successful optimization, whether or not the module is +// modified. Returns an SPV_ERROR_* if the module fails to validate or if +// errors occur when processing using any of the registered passes. In that +// case, no further passes are executed and the |optimized_binary| contents may +// be invalid. +// +// By default, the binary is validated before any transforms are performed, +// and optionally after each transform. Validation uses SPIR-V spec rules +// for the SPIR-V version named in the binary's header (at word offset 1). +// Additionally, if the target environment is a client API (such as +// Vulkan 1.1), then validate for that client API version, to the extent +// that it is verifiable from data in the binary itself, or from the +// validator options set on the optimizer options. +SPIRV_TOOLS_EXPORT spv_result_t spvOptimizerRun( + spv_optimizer_t* optimizer, const uint32_t* binary, const size_t word_count, + spv_binary* optimized_binary, const spv_optimizer_options options); + #ifdef __cplusplus } #endif diff --git a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp index ca36dd606..cd712f068 100644 --- a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp @@ -497,8 +497,8 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, if (sum_id == 0) sum_id = curr_offset_id; else { - Instruction* sum_inst = builder->AddBinaryOp(GetUintId(), spv::Op::OpIAdd, - sum_id, curr_offset_id); + Instruction* sum_inst = + builder->AddIAdd(GetUintId(), sum_id, curr_offset_id); sum_id = sum_inst->result_id(); } ++ac_in_idx; @@ -507,8 +507,7 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref, uint32_t bsize = ByteSize(curr_ty_id, matrix_stride, col_major, in_matrix); uint32_t last = bsize - 1; uint32_t last_id = builder->GetUintConstantId(last); - Instruction* sum_inst = - builder->AddBinaryOp(GetUintId(), spv::Op::OpIAdd, sum_id, last_id); + Instruction* sum_inst = builder->AddIAdd(GetUintId(), sum_id, last_id); return sum_inst->result_id(); } @@ -536,6 +535,8 @@ void InstBindlessCheckPass::GenCheckCode( new BasicBlock(std::move(valid_label))); builder.SetInsertPoint(&*new_blk_ptr); uint32_t new_ref_id = CloneOriginalReference(ref, &builder); + uint32_t null_id = 0; + uint32_t ref_type_id = ref->ref_inst->type_id(); (void)builder.AddBranch(merge_blk_id); new_blocks->push_back(std::move(new_blk_ptr)); // Gen invalid block @@ -563,10 +564,23 @@ void InstBindlessCheckPass::GenCheckCode( GenDebugStreamWrite(uid2offset_[ref->ref_inst->unique_id()], stage_idx, {error_id, u_index_id, u_length_id}, &builder); } + // Generate a ConstantNull, converting to uint64 if the type cannot be a null. + if (new_ref_id != 0) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::Type* ref_type = type_mgr->GetType(ref_type_id); + if (ref_type->AsPointer() != nullptr) { + context()->AddCapability(spv::Capability::Int64); + uint32_t null_u64_id = GetNullId(GetUint64Id()); + Instruction* null_ptr_inst = builder.AddUnaryOp( + ref_type_id, spv::Op::OpConvertUToPtr, null_u64_id); + null_id = null_ptr_inst->result_id(); + } else { + null_id = GetNullId(ref_type_id); + } + } // Remember last invalid block id uint32_t last_invalid_blk_id = new_blk_ptr->GetLabelInst()->result_id(); // Gen zero for invalid reference - uint32_t ref_type_id = ref->ref_inst->type_id(); (void)builder.AddBranch(merge_blk_id); new_blocks->push_back(std::move(new_blk_ptr)); // Gen merge block @@ -577,8 +591,7 @@ void InstBindlessCheckPass::GenCheckCode( // reference. if (new_ref_id != 0) { Instruction* phi_inst = builder.AddPhi( - ref_type_id, {new_ref_id, valid_blk_id, GetNullId(ref_type_id), - last_invalid_blk_id}); + ref_type_id, {new_ref_id, valid_blk_id, null_id, last_invalid_blk_id}); context()->ReplaceAllUsesWith(ref->ref_inst->result_id(), phi_inst->result_id()); } @@ -734,15 +747,7 @@ void InstBindlessCheckPass::GenTexBuffCheckCode( if (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageArrayed) != 0) return; if (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageMS) != 0) return; // Enable ImageQuery Capability if not yet enabled - if (!get_feature_mgr()->HasCapability(spv::Capability::ImageQuery)) { - std::unique_ptr cap_image_query_inst( - new Instruction(context(), spv::Op::OpCapability, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_CAPABILITY, - {uint32_t(spv::Capability::ImageQuery)}}})); - get_def_use_mgr()->AnalyzeInstDefUse(&*cap_image_query_inst); - context()->AddCapability(std::move(cap_image_query_inst)); - } + context()->AddCapability(spv::Capability::ImageQuery); // Move original block's preceding instructions into first new block std::unique_ptr new_blk_ptr; MovePreludeCode(ref_inst_itr, ref_block_itr, &new_blk_ptr); diff --git a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp index be361e69b..c18f91d7f 100644 --- a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp @@ -257,9 +257,7 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { uint32_t hdr_blk_id = TakeNextId(); // Branch to search loop header std::unique_ptr hdr_blk_label(NewLabel(hdr_blk_id)); - (void)builder.AddInstruction(MakeUnique( - context(), spv::Op::OpBranch, 0, 0, - std::initializer_list{{SPV_OPERAND_TYPE_ID, {hdr_blk_id}}})); + (void)builder.AddBranch(hdr_blk_id); input_func->AddBasicBlock(std::move(first_blk_ptr)); // Linear search loop header block // TODO(greg-lunarg): Implement binary search @@ -293,17 +291,10 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { uint32_t bound_test_blk_id = TakeNextId(); std::unique_ptr bound_test_blk_label( NewLabel(bound_test_blk_id)); - (void)builder.AddInstruction(MakeUnique( - context(), spv::Op::OpLoopMerge, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {bound_test_blk_id}}, - {SPV_OPERAND_TYPE_ID, {cont_blk_id}}, - {SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::LoopControlMask::MaskNone)}}})); + (void)builder.AddLoopMerge(bound_test_blk_id, cont_blk_id, + uint32_t(spv::LoopControlMask::MaskNone)); // Branch to continue/work block - (void)builder.AddInstruction(MakeUnique( - context(), spv::Op::OpBranch, 0, 0, - std::initializer_list{{SPV_OPERAND_TYPE_ID, {cont_blk_id}}})); + (void)builder.AddBranch(cont_blk_id); input_func->AddBasicBlock(std::move(hdr_blk_ptr)); // Continue/Work Block. Read next buffer pointer and break if greater // than ref_ptr arg. @@ -386,10 +377,8 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() { GetBoolId(), spv::Op::OpULessThanEqual, ref_end_inst->result_id(), len_load_inst->result_id()); // Return test result - (void)builder.AddInstruction(MakeUnique( - context(), spv::Op::OpReturnValue, 0, 0, - std::initializer_list{ - {SPV_OPERAND_TYPE_ID, {len_test_inst->result_id()}}})); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + len_test_inst->result_id()); // Close block input_func->AddBasicBlock(std::move(bound_test_blk_ptr)); // Close function and add function to module @@ -408,14 +397,7 @@ uint32_t InstBuffAddrCheckPass::GenSearchAndTest(Instruction* ref_inst, InstructionBuilder* builder, uint32_t* ref_uptr_id) { // Enable Int64 if necessary - if (!get_feature_mgr()->HasCapability(spv::Capability::Int64)) { - std::unique_ptr cap_int64_inst(new Instruction( - context(), spv::Op::OpCapability, 0, 0, - std::initializer_list{{SPV_OPERAND_TYPE_CAPABILITY, - {uint32_t(spv::Capability::Int64)}}})); - get_def_use_mgr()->AnalyzeInstDefUse(&*cap_int64_inst); - context()->AddCapability(std::move(cap_int64_inst)); - } + context()->AddCapability(spv::Capability::Int64); // Convert reference pointer to uint64 uint32_t ref_ptr_id = ref_inst->GetSingleWordInOperand(0); Instruction* ref_uptr_inst = @@ -429,10 +411,8 @@ uint32_t InstBuffAddrCheckPass::GenSearchAndTest(Instruction* ref_inst, uint32_t ref_len = GetTypeLength(ref_ptr_ty_inst->GetSingleWordInOperand(1)); uint32_t ref_len_id = builder->GetUintConstantId(ref_len); // Gen call to search and test function - const std::vector args = {GetSearchAndTestFuncId(), *ref_uptr_id, - ref_len_id}; - Instruction* call_inst = - builder->AddNaryOp(GetBoolId(), spv::Op::OpFunctionCall, args); + Instruction* call_inst = builder->AddFunctionCall( + GetBoolId(), GetSearchAndTestFuncId(), {*ref_uptr_id, ref_len_id}); uint32_t retval = call_inst->result_id(); return retval; } diff --git a/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp index 151b94c73..4f9727781 100644 --- a/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp @@ -34,8 +34,8 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, const analysis::Type* c_ty = v_ty->element_type(); uint32_t c_ty_id = type_mgr->GetId(c_ty); for (uint32_t c = 0; c < v_ty->element_count(); ++c) { - Instruction* c_inst = builder->AddIdLiteralOp( - c_ty_id, spv::Op::OpCompositeExtract, val_inst->result_id(), c); + Instruction* c_inst = + builder->AddCompositeExtract(c_ty_id, val_inst->result_id(), {c}); GenOutputValues(c_inst, val_ids, builder); } return; @@ -44,9 +44,8 @@ void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst, // Select between uint32 zero or one uint32_t zero_id = builder->GetUintConstantId(0); uint32_t one_id = builder->GetUintConstantId(1); - Instruction* sel_inst = - builder->AddTernaryOp(GetUintId(), spv::Op::OpSelect, - val_inst->result_id(), one_id, zero_id); + Instruction* sel_inst = builder->AddSelect( + GetUintId(), val_inst->result_id(), one_id, zero_id); val_ids->push_back(sel_inst->result_id()); return; } diff --git a/3rdparty/spirv-tools/source/opt/instrument_pass.cpp b/3rdparty/spirv-tools/source/opt/instrument_pass.cpp index 441d943f7..c6e405051 100644 --- a/3rdparty/spirv-tools/source/opt/instrument_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/instrument_pass.cpp @@ -54,7 +54,6 @@ void InstrumentPass::MovePreludeCode( void InstrumentPass::MovePostludeCode( UptrVectorIterator ref_block_itr, BasicBlock* new_blk_ptr) { - // new_blk_ptr->reset(new BasicBlock(NewLabel(ref_block_itr->id()))); // Move contents of original ref block. for (auto cii = ref_block_itr->begin(); cii != ref_block_itr->end(); cii = ref_block_itr->begin()) { @@ -77,21 +76,62 @@ void InstrumentPass::MovePostludeCode( } std::unique_ptr InstrumentPass::NewLabel(uint32_t label_id) { - std::unique_ptr newLabel( - new Instruction(context(), spv::Op::OpLabel, 0, label_id, {})); - get_def_use_mgr()->AnalyzeInstDefUse(&*newLabel); - return newLabel; + auto new_label = + MakeUnique(context(), spv::Op::OpLabel, 0, label_id, + std::initializer_list{}); + get_def_use_mgr()->AnalyzeInstDefUse(&*new_label); + return new_label; +} + +std::unique_ptr InstrumentPass::StartFunction( + uint32_t func_id, const analysis::Type* return_type, + const std::vector& param_types) { + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + analysis::Function* func_type = GetFunction(return_type, param_types); + + const std::vector operands{ + {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, + {uint32_t(spv::FunctionControlMask::MaskNone)}}, + {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_mgr->GetId(func_type)}}, + }; + auto func_inst = + MakeUnique(context(), spv::Op::OpFunction, + type_mgr->GetId(return_type), func_id, operands); + get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); + return MakeUnique(std::move(func_inst)); +} + +std::unique_ptr InstrumentPass::EndFunction() { + auto end = MakeUnique(context(), spv::Op::OpFunctionEnd, 0, 0, + std::initializer_list{}); + get_def_use_mgr()->AnalyzeInstDefUse(end.get()); + return end; +} + +std::vector InstrumentPass::AddParameters( + Function& func, const std::vector& param_types) { + std::vector param_ids; + param_ids.reserve(param_types.size()); + for (const analysis::Type* param : param_types) { + uint32_t pid = TakeNextId(); + param_ids.push_back(pid); + auto param_inst = + MakeUnique(context(), spv::Op::OpFunctionParameter, + context()->get_type_mgr()->GetId(param), pid, + std::initializer_list{}); + get_def_use_mgr()->AnalyzeInstDefUse(param_inst.get()); + func.AddParameter(std::move(param_inst)); + } + return param_ids; } std::unique_ptr InstrumentPass::NewName( uint32_t id, const std::string& name_str) { - std::unique_ptr new_name(new Instruction( + return MakeUnique( context(), spv::Op::OpName, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {id}}, - {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}})); - - return new_name; + {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}}); } std::unique_ptr InstrumentPass::NewGlobalName( @@ -118,14 +158,12 @@ std::unique_ptr InstrumentPass::NewGlobalName( std::unique_ptr InstrumentPass::NewMemberName( uint32_t id, uint32_t member_index, const std::string& name_str) { - std::unique_ptr new_name(new Instruction( + return MakeUnique( context(), spv::Op::OpMemberName, 0, 0, std::initializer_list{ {SPV_OPERAND_TYPE_ID, {id}}, {SPV_OPERAND_TYPE_LITERAL_INTEGER, {member_index}}, - {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}})); - - return new_name; + {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}}); } uint32_t InstrumentPass::Gen32BitCvtCode(uint32_t val_id, @@ -167,17 +205,15 @@ void InstrumentPass::GenDebugOutputFieldCode(uint32_t base_offset_id, // Cast value to 32-bit unsigned if necessary uint32_t val_id = GenUintCastCode(field_value_id, builder); // Store value - Instruction* data_idx_inst = - builder->AddBinaryOp(GetUintId(), spv::Op::OpIAdd, base_offset_id, - builder->GetUintConstantId(field_offset)); + Instruction* data_idx_inst = builder->AddIAdd( + GetUintId(), base_offset_id, builder->GetUintConstantId(field_offset)); uint32_t buf_id = GetOutputBufferId(); uint32_t buf_uint_ptr_id = GetOutputBufferPtrId(); - Instruction* achain_inst = - builder->AddTernaryOp(buf_uint_ptr_id, spv::Op::OpAccessChain, buf_id, - builder->GetUintConstantId(kDebugOutputDataOffset), - data_idx_inst->result_id()); - (void)builder->AddBinaryOp(0, spv::Op::OpStore, achain_inst->result_id(), - val_id); + Instruction* achain_inst = builder->AddAccessChain( + buf_uint_ptr_id, buf_id, + {builder->GetUintConstantId(kDebugOutputDataOffset), + data_idx_inst->result_id()}); + (void)builder->AddStore(achain_inst->result_id(), val_id); } void InstrumentPass::GenCommonStreamWriteCode(uint32_t record_sz, @@ -202,8 +238,8 @@ void InstrumentPass::GenCommonStreamWriteCode(uint32_t record_sz, void InstrumentPass::GenFragCoordEltDebugOutputCode( uint32_t base_offset_id, uint32_t uint_frag_coord_id, uint32_t element, InstructionBuilder* builder) { - Instruction* element_val_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, uint_frag_coord_id, element); + Instruction* element_val_inst = + builder->AddCompositeExtract(GetUintId(), uint_frag_coord_id, {element}); GenDebugOutputFieldCode(base_offset_id, kInstFragOutFragCoordX + element, element_val_inst->result_id(), builder); } @@ -212,8 +248,7 @@ uint32_t InstrumentPass::GenVarLoad(uint32_t var_id, InstructionBuilder* builder) { Instruction* var_inst = get_def_use_mgr()->GetDef(var_id); uint32_t type_id = GetPointeeTypeId(var_inst); - Instruction* load_inst = - builder->AddUnaryOp(type_id, spv::Op::OpLoad, var_id); + Instruction* load_inst = builder->AddLoad(type_id, var_id); return load_inst->result_id(); } @@ -249,12 +284,12 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx, uint32_t load_id = GenVarLoad(context()->GetBuiltinInputVarId(uint32_t( spv::BuiltIn::GlobalInvocationId)), builder); - Instruction* x_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, load_id, 0); - Instruction* y_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, load_id, 1); - Instruction* z_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, load_id, 2); + Instruction* x_inst = + builder->AddCompositeExtract(GetUintId(), load_id, {0}); + Instruction* y_inst = + builder->AddCompositeExtract(GetUintId(), load_id, {1}); + Instruction* z_inst = + builder->AddCompositeExtract(GetUintId(), load_id, {2}); GenDebugOutputFieldCode(base_offset_id, kInstCompOutGlobalInvocationIdX, x_inst->result_id(), builder); GenDebugOutputFieldCode(base_offset_id, kInstCompOutGlobalInvocationIdY, @@ -291,10 +326,10 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx, Instruction* uvec3_cast_inst = builder->AddUnaryOp(GetVec3UintId(), spv::Op::OpBitcast, load_id); uint32_t uvec3_cast_id = uvec3_cast_inst->result_id(); - Instruction* u_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, uvec3_cast_id, 0); - Instruction* v_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, uvec3_cast_id, 1); + Instruction* u_inst = + builder->AddCompositeExtract(GetUintId(), uvec3_cast_id, {0}); + Instruction* v_inst = + builder->AddCompositeExtract(GetUintId(), uvec3_cast_id, {1}); GenDebugOutputFieldCode(base_offset_id, kInstTessEvalOutTessCoordU, u_inst->result_id(), builder); GenDebugOutputFieldCode(base_offset_id, kInstTessEvalOutTessCoordV, @@ -302,8 +337,8 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx, } break; case spv::ExecutionModel::Fragment: { // Load FragCoord and convert to Uint - Instruction* frag_coord_inst = builder->AddUnaryOp( - GetVec4FloatId(), spv::Op::OpLoad, + Instruction* frag_coord_inst = builder->AddLoad( + GetVec4FloatId(), context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::FragCoord))); Instruction* uint_frag_coord_inst = builder->AddUnaryOp( GetVec4UintId(), spv::Op::OpBitcast, frag_coord_inst->result_id()); @@ -321,12 +356,12 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx, uint32_t launch_id = GenVarLoad( context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::LaunchIdNV)), builder); - Instruction* x_launch_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, launch_id, 0); - Instruction* y_launch_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, launch_id, 1); - Instruction* z_launch_inst = builder->AddIdLiteralOp( - GetUintId(), spv::Op::OpCompositeExtract, launch_id, 2); + Instruction* x_launch_inst = + builder->AddCompositeExtract(GetUintId(), launch_id, {0}); + Instruction* y_launch_inst = + builder->AddCompositeExtract(GetUintId(), launch_id, {1}); + Instruction* z_launch_inst = + builder->AddCompositeExtract(GetUintId(), launch_id, {2}); GenDebugOutputFieldCode(base_offset_id, kInstRayTracingOutLaunchIdX, x_launch_inst->result_id(), builder); GenDebugOutputFieldCode(base_offset_id, kInstRayTracingOutLaunchIdY, @@ -344,11 +379,10 @@ void InstrumentPass::GenDebugStreamWrite( // Call debug output function. Pass func_idx, instruction_idx and // validation ids as args. uint32_t val_id_cnt = static_cast(validation_ids.size()); - uint32_t output_func_id = GetStreamWriteFunctionId(stage_idx, val_id_cnt); - std::vector args = {output_func_id, - builder->GetUintConstantId(instruction_idx)}; + std::vector args = {builder->GetUintConstantId(instruction_idx)}; (void)args.insert(args.end(), validation_ids.begin(), validation_ids.end()); - (void)builder->AddNaryOp(GetVoidId(), spv::Op::OpFunctionCall, args); + (void)builder->AddFunctionCall( + GetVoidId(), GetStreamWriteFunctionId(stage_idx, val_id_cnt), args); } bool InstrumentPass::AllConstant(const std::vector& ids) { @@ -360,33 +394,38 @@ bool InstrumentPass::AllConstant(const std::vector& ids) { } uint32_t InstrumentPass::GenDebugDirectRead( - const std::vector& offset_ids, InstructionBuilder* ref_builder) { + const std::vector& offset_ids, InstructionBuilder* builder) { // Call debug input function. Pass func_idx and offset ids as args. - uint32_t off_id_cnt = static_cast(offset_ids.size()); - uint32_t input_func_id = GetDirectReadFunctionId(off_id_cnt); - std::vector args = {input_func_id}; - (void)args.insert(args.end(), offset_ids.begin(), offset_ids.end()); + const uint32_t off_id_cnt = static_cast(offset_ids.size()); + const uint32_t input_func_id = GetDirectReadFunctionId(off_id_cnt); + return GenReadFunctionCall(input_func_id, offset_ids, builder); +} + +uint32_t InstrumentPass::GenReadFunctionCall( + uint32_t func_id, const std::vector& func_call_args, + InstructionBuilder* ref_builder) { // If optimizing direct reads and the call has already been generated, // use its result if (opt_direct_reads_) { - uint32_t res_id = call2id_[args]; + uint32_t res_id = call2id_[func_call_args]; if (res_id != 0) return res_id; } - // If the offsets are all constants, the call can be moved to the first block - // of the function where its result can be reused. One example where this is - // profitable is for uniform buffer references, of which there are often many. + // If the function arguments are all constants, the call can be moved to the + // first block of the function where its result can be reused. One example + // where this is profitable is for uniform buffer references, of which there + // are often many. InstructionBuilder builder(ref_builder->GetContext(), &*ref_builder->GetInsertPoint(), ref_builder->GetPreservedAnalysis()); - bool insert_in_first_block = opt_direct_reads_ && AllConstant(offset_ids); + bool insert_in_first_block = opt_direct_reads_ && AllConstant(func_call_args); if (insert_in_first_block) { Instruction* insert_before = &*curr_func_->begin()->tail(); builder.SetInsertPoint(insert_before); } uint32_t res_id = - builder.AddNaryOp(GetUintId(), spv::Op::OpFunctionCall, args) + builder.AddFunctionCall(GetUintId(), func_id, func_call_args) ->result_id(); - if (insert_in_first_block) call2id_[args] = res_id; + if (insert_in_first_block) call2id_[func_call_args] = res_id; return res_id; } @@ -502,32 +541,61 @@ uint32_t InstrumentPass::GetInputBufferBinding() { return 0; } -analysis::Type* InstrumentPass::GetUintXRuntimeArrayType( - uint32_t width, analysis::Type** rarr_ty) { +analysis::Integer* InstrumentPass::GetInteger(uint32_t width, bool is_signed) { + analysis::Integer i(width, is_signed); + analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&i); + assert(type && type->AsInteger()); + return type->AsInteger(); +} + +analysis::Struct* InstrumentPass::GetStruct( + const std::vector& fields) { + analysis::Struct s(fields); + analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&s); + assert(type && type->AsStruct()); + return type->AsStruct(); +} + +analysis::RuntimeArray* InstrumentPass::GetRuntimeArray( + const analysis::Type* element) { + analysis::RuntimeArray r(element); + analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&r); + assert(type && type->AsRuntimeArray()); + return type->AsRuntimeArray(); +} + +analysis::Function* InstrumentPass::GetFunction( + const analysis::Type* return_val, + const std::vector& args) { + analysis::Function func(return_val, args); + analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&func); + assert(type && type->AsFunction()); + return type->AsFunction(); +} + +analysis::RuntimeArray* InstrumentPass::GetUintXRuntimeArrayType( + uint32_t width, analysis::RuntimeArray** rarr_ty) { if (*rarr_ty == nullptr) { - analysis::DecorationManager* deco_mgr = get_decoration_mgr(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Integer uint_ty(width, false); - analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty); - analysis::RuntimeArray uint_rarr_ty_tmp(reg_uint_ty); - *rarr_ty = type_mgr->GetRegisteredType(&uint_rarr_ty_tmp); - uint32_t uint_arr_ty_id = type_mgr->GetTypeInstruction(*rarr_ty); + *rarr_ty = GetRuntimeArray(GetInteger(width, false)); + uint32_t uint_arr_ty_id = + context()->get_type_mgr()->GetTypeInstruction(*rarr_ty); // By the Vulkan spec, a pre-existing RuntimeArray of uint must be part of // a block, and will therefore be decorated with an ArrayStride. Therefore // the undecorated type returned here will not be pre-existing and can // safely be decorated. Since this type is now decorated, it is out of // sync with the TypeManager and therefore the TypeManager must be // invalidated after this pass. - assert(context()->get_def_use_mgr()->NumUses(uint_arr_ty_id) == 0 && + assert(get_def_use_mgr()->NumUses(uint_arr_ty_id) == 0 && "used RuntimeArray type returned"); - deco_mgr->AddDecorationVal( + get_decoration_mgr()->AddDecorationVal( uint_arr_ty_id, uint32_t(spv::Decoration::ArrayStride), width / 8u); } return *rarr_ty; } -analysis::Type* InstrumentPass::GetUintRuntimeArrayType(uint32_t width) { - analysis::Type** rarr_ty = +analysis::RuntimeArray* InstrumentPass::GetUintRuntimeArrayType( + uint32_t width) { + analysis::RuntimeArray** rarr_ty = (width == 64) ? &uint64_rarr_ty_ : &uint32_rarr_ty_; return GetUintXRuntimeArrayType(width, rarr_ty); } @@ -546,11 +614,10 @@ uint32_t InstrumentPass::GetOutputBufferId() { // If not created yet, create one analysis::DecorationManager* deco_mgr = get_decoration_mgr(); analysis::TypeManager* type_mgr = context()->get_type_mgr(); - analysis::Type* reg_uint_rarr_ty = GetUintRuntimeArrayType(32); - analysis::Integer uint_ty(32, false); - analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty); - analysis::Struct buf_ty({reg_uint_ty, reg_uint_ty, reg_uint_rarr_ty}); - analysis::Type* reg_buf_ty = type_mgr->GetRegisteredType(&buf_ty); + analysis::RuntimeArray* reg_uint_rarr_ty = GetUintRuntimeArrayType(32); + analysis::Integer* reg_uint_ty = GetInteger(32, false); + analysis::Type* reg_buf_ty = + GetStruct({reg_uint_ty, reg_uint_ty, reg_uint_rarr_ty}); uint32_t obufTyId = type_mgr->GetTypeInstruction(reg_buf_ty); // By the Vulkan spec, a pre-existing struct containing a RuntimeArray // must be a block, and will therefore be decorated with Block. Therefore @@ -604,8 +671,7 @@ uint32_t InstrumentPass::GetInputBufferId() { analysis::TypeManager* type_mgr = context()->get_type_mgr(); uint32_t width = (validation_id_ == kInstValidationIdBuffAddr) ? 64u : 32u; analysis::Type* reg_uint_rarr_ty = GetUintRuntimeArrayType(width); - analysis::Struct buf_ty({reg_uint_rarr_ty}); - analysis::Type* reg_buf_ty = type_mgr->GetRegisteredType(&buf_ty); + analysis::Struct* reg_buf_ty = GetStruct({reg_uint_rarr_ty}); uint32_t ibufTyId = type_mgr->GetTypeInstruction(reg_buf_ty); // By the Vulkan spec, a pre-existing struct containing a RuntimeArray // must be a block, and will therefore be decorated with Block. Therefore @@ -747,37 +813,17 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, // Create function param2output_func_id_[param_cnt] = TakeNextId(); analysis::TypeManager* type_mgr = context()->get_type_mgr(); - std::vector param_types; - for (uint32_t c = 0; c < param_cnt; ++c) - param_types.push_back(type_mgr->GetType(GetUintId())); - analysis::Function func_ty(type_mgr->GetType(GetVoidId()), param_types); - analysis::Type* reg_func_ty = type_mgr->GetRegisteredType(&func_ty); - std::unique_ptr func_inst( - new Instruction(get_module()->context(), spv::Op::OpFunction, - GetVoidId(), param2output_func_id_[param_cnt], - {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::FunctionControlMask::MaskNone)}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, - {type_mgr->GetTypeInstruction(reg_func_ty)}}})); - get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); - std::unique_ptr output_func = - MakeUnique(std::move(func_inst)); - // Add parameters - std::vector param_vec; - for (uint32_t c = 0; c < param_cnt; ++c) { - uint32_t pid = TakeNextId(); - param_vec.push_back(pid); - std::unique_ptr param_inst( - new Instruction(get_module()->context(), spv::Op::OpFunctionParameter, - GetUintId(), pid, {})); - get_def_use_mgr()->AnalyzeInstDefUse(&*param_inst); - output_func->AddParameter(std::move(param_inst)); - } + + const std::vector param_types(param_cnt, + GetInteger(32, false)); + std::unique_ptr output_func = StartFunction( + param2output_func_id_[param_cnt], type_mgr->GetVoidType(), param_types); + + std::vector param_ids = AddParameters(*output_func, param_types); + // Create first block - uint32_t test_blk_id = TakeNextId(); - std::unique_ptr test_label(NewLabel(test_blk_id)); - std::unique_ptr new_blk_ptr = - MakeUnique(std::move(test_label)); + auto new_blk_ptr = MakeUnique(NewLabel(TakeNextId())); + InstructionBuilder builder( context(), &*new_blk_ptr, IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); @@ -786,9 +832,9 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, uint32_t obuf_record_sz = val_spec_offset + val_spec_param_cnt; uint32_t buf_id = GetOutputBufferId(); uint32_t buf_uint_ptr_id = GetOutputBufferPtrId(); - Instruction* obuf_curr_sz_ac_inst = - builder.AddBinaryOp(buf_uint_ptr_id, spv::Op::OpAccessChain, buf_id, - builder.GetUintConstantId(kDebugOutputSizeOffset)); + Instruction* obuf_curr_sz_ac_inst = builder.AddAccessChain( + buf_uint_ptr_id, buf_id, + {builder.GetUintConstantId(kDebugOutputSizeOffset)}); // Fetch the current debug buffer written size atomically, adding the // size of the record to be written. uint32_t obuf_record_sz_id = builder.GetUintConstantId(obuf_record_sz); @@ -802,8 +848,8 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, uint32_t obuf_curr_sz_id = obuf_curr_sz_inst->result_id(); // Compute new written size Instruction* obuf_new_sz_inst = - builder.AddBinaryOp(GetUintId(), spv::Op::OpIAdd, obuf_curr_sz_id, - builder.GetUintConstantId(obuf_record_sz)); + builder.AddIAdd(GetUintId(), obuf_curr_sz_id, + builder.GetUintConstantId(obuf_record_sz)); // Fetch the data bound Instruction* obuf_bnd_inst = builder.AddIdLiteralOp(GetUintId(), spv::Op::OpArrayLength, @@ -825,13 +871,13 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, new_blk_ptr = MakeUnique(std::move(write_label)); builder.SetInsertPoint(&*new_blk_ptr); // Generate common and stage-specific debug record members - GenCommonStreamWriteCode(obuf_record_sz, param_vec[kInstCommonParamInstIdx], + GenCommonStreamWriteCode(obuf_record_sz, param_ids[kInstCommonParamInstIdx], stage_idx, obuf_curr_sz_id, &builder); GenStageStreamWriteCode(stage_idx, obuf_curr_sz_id, &builder); // Gen writes of validation specific data for (uint32_t i = 0; i < val_spec_param_cnt; ++i) { GenDebugOutputFieldCode(obuf_curr_sz_id, val_spec_offset + i, - param_vec[kInstCommonParamCnt + i], &builder); + param_ids[kInstCommonParamCnt + i], &builder); } // Close write block and gen merge block (void)builder.AddBranch(merge_blk_id); @@ -840,11 +886,9 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx, builder.SetInsertPoint(&*new_blk_ptr); // Close merge block and function and add function to module (void)builder.AddNullaryOp(0, spv::Op::OpReturn); + output_func->AddBasicBlock(std::move(new_blk_ptr)); - std::unique_ptr func_end_inst(new Instruction( - get_module()->context(), spv::Op::OpFunctionEnd, 0, 0, {})); - get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst); - output_func->SetFunctionEnd(std::move(func_end_inst)); + output_func->SetFunctionEnd(EndFunction()); context()->AddFunction(std::move(output_func)); std::string name("stream_write_"); @@ -861,77 +905,48 @@ uint32_t InstrumentPass::GetDirectReadFunctionId(uint32_t param_cnt) { if (func_id != 0) return func_id; // Create input function for param_cnt. func_id = TakeNextId(); - analysis::TypeManager* type_mgr = context()->get_type_mgr(); - std::vector param_types; - for (uint32_t c = 0; c < param_cnt; ++c) - param_types.push_back(type_mgr->GetType(GetUintId())); - uint32_t ibuf_type_id = GetInputBufferTypeId(); - analysis::Function func_ty(type_mgr->GetType(ibuf_type_id), param_types); - analysis::Type* reg_func_ty = type_mgr->GetRegisteredType(&func_ty); - std::unique_ptr func_inst(new Instruction( - get_module()->context(), spv::Op::OpFunction, ibuf_type_id, func_id, - {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, - {uint32_t(spv::FunctionControlMask::MaskNone)}}, - {spv_operand_type_t::SPV_OPERAND_TYPE_ID, - {type_mgr->GetTypeInstruction(reg_func_ty)}}})); - get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst); + analysis::Integer* uint_type = GetInteger(32, false); + std::vector param_types(param_cnt, uint_type); + std::unique_ptr input_func = - MakeUnique(std::move(func_inst)); - // Add parameters - std::vector param_vec; - for (uint32_t c = 0; c < param_cnt; ++c) { - uint32_t pid = TakeNextId(); - param_vec.push_back(pid); - std::unique_ptr param_inst( - new Instruction(get_module()->context(), spv::Op::OpFunctionParameter, - GetUintId(), pid, {})); - get_def_use_mgr()->AnalyzeInstDefUse(&*param_inst); - input_func->AddParameter(std::move(param_inst)); - } + StartFunction(func_id, uint_type, param_types); + std::vector param_ids = AddParameters(*input_func, param_types); + // Create block - uint32_t blk_id = TakeNextId(); - std::unique_ptr blk_label(NewLabel(blk_id)); - std::unique_ptr new_blk_ptr = - MakeUnique(std::move(blk_label)); + auto new_blk_ptr = MakeUnique(NewLabel(TakeNextId())); InstructionBuilder builder( context(), &*new_blk_ptr, IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); // For each offset parameter, generate new offset with parameter, adding last // loaded value if it exists, and load value from input buffer at new offset. // Return last loaded value. + uint32_t ibuf_type_id = GetInputBufferTypeId(); uint32_t buf_id = GetInputBufferId(); uint32_t buf_ptr_id = GetInputBufferPtrId(); uint32_t last_value_id = 0; for (uint32_t p = 0; p < param_cnt; ++p) { uint32_t offset_id; if (p == 0) { - offset_id = param_vec[0]; + offset_id = param_ids[0]; } else { if (ibuf_type_id != GetUintId()) { - Instruction* ucvt_inst = - builder.AddUnaryOp(GetUintId(), spv::Op::OpUConvert, last_value_id); - last_value_id = ucvt_inst->result_id(); + last_value_id = + builder.AddUnaryOp(GetUintId(), spv::Op::OpUConvert, last_value_id) + ->result_id(); } - Instruction* offset_inst = builder.AddBinaryOp( - GetUintId(), spv::Op::OpIAdd, last_value_id, param_vec[p]); - offset_id = offset_inst->result_id(); + offset_id = builder.AddIAdd(GetUintId(), last_value_id, param_ids[p]) + ->result_id(); } - Instruction* ac_inst = builder.AddTernaryOp( - buf_ptr_id, spv::Op::OpAccessChain, buf_id, - builder.GetUintConstantId(kDebugInputDataOffset), offset_id); - Instruction* load_inst = - builder.AddUnaryOp(ibuf_type_id, spv::Op::OpLoad, ac_inst->result_id()); - last_value_id = load_inst->result_id(); + Instruction* ac_inst = builder.AddAccessChain( + buf_ptr_id, buf_id, + {builder.GetUintConstantId(kDebugInputDataOffset), offset_id}); + last_value_id = + builder.AddLoad(ibuf_type_id, ac_inst->result_id())->result_id(); } - (void)builder.AddInstruction(MakeUnique( - context(), spv::Op::OpReturnValue, 0, 0, - std::initializer_list{{SPV_OPERAND_TYPE_ID, {last_value_id}}})); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, last_value_id); // Close block and function and add function to module input_func->AddBasicBlock(std::move(new_blk_ptr)); - std::unique_ptr func_end_inst(new Instruction( - get_module()->context(), spv::Op::OpFunctionEnd, 0, 0, {})); - get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst); - input_func->SetFunctionEnd(std::move(func_end_inst)); + input_func->SetFunctionEnd(EndFunction()); context()->AddFunction(std::move(input_func)); std::string name("direct_read_"); diff --git a/3rdparty/spirv-tools/source/opt/instrument_pass.h b/3rdparty/spirv-tools/source/opt/instrument_pass.h index e98ba88e4..13119297c 100644 --- a/3rdparty/spirv-tools/source/opt/instrument_pass.h +++ b/3rdparty/spirv-tools/source/opt/instrument_pass.h @@ -214,6 +214,10 @@ class InstrumentPass : public Pass { uint32_t GenDebugDirectRead(const std::vector& offset_ids, InstructionBuilder* builder); + uint32_t GenReadFunctionCall(uint32_t func_id, + const std::vector& args, + InstructionBuilder* builder); + // Generate code to convert integer |value_id| to 32bit, if needed. Return // an id to the 32bit equivalent. uint32_t Gen32BitCvtCode(uint32_t value_id, InstructionBuilder* builder); @@ -222,6 +226,15 @@ class InstrumentPass : public Pass { // Return an id to the Uint equivalent. uint32_t GenUintCastCode(uint32_t value_id, InstructionBuilder* builder); + std::unique_ptr StartFunction( + uint32_t func_id, const analysis::Type* return_type, + const std::vector& param_types); + + std::vector AddParameters( + Function& func, const std::vector& param_types); + + std::unique_ptr EndFunction(); + // Return new label. std::unique_ptr NewLabel(uint32_t label_id); @@ -253,12 +266,20 @@ class InstrumentPass : public Pass { // Return id for void type uint32_t GetVoidId(); - // Return pointer to type for runtime array of uint - analysis::Type* GetUintXRuntimeArrayType(uint32_t width, - analysis::Type** rarr_ty); + // Get registered type structures + analysis::Integer* GetInteger(uint32_t width, bool is_signed); + analysis::Struct* GetStruct(const std::vector& fields); + analysis::RuntimeArray* GetRuntimeArray(const analysis::Type* element); + analysis::Function* GetFunction( + const analysis::Type* return_val, + const std::vector& args); // Return pointer to type for runtime array of uint - analysis::Type* GetUintRuntimeArrayType(uint32_t width); + analysis::RuntimeArray* GetUintXRuntimeArrayType( + uint32_t width, analysis::RuntimeArray** rarr_ty); + + // Return pointer to type for runtime array of uint + analysis::RuntimeArray* GetUintRuntimeArrayType(uint32_t width); // Return id for buffer uint type uint32_t GetOutputBufferPtrId(); @@ -448,10 +469,10 @@ class InstrumentPass : public Pass { bool storage_buffer_ext_defined_; // runtime array of uint type - analysis::Type* uint64_rarr_ty_; + analysis::RuntimeArray* uint64_rarr_ty_; // runtime array of uint type - analysis::Type* uint32_rarr_ty_; + analysis::RuntimeArray* uint32_rarr_ty_; // Pre-instrumentation same-block insts std::unordered_map same_block_pre_; diff --git a/3rdparty/spirv-tools/source/opt/optimizer.cpp b/3rdparty/spirv-tools/source/opt/optimizer.cpp index be0daebda..cbc4b82f7 100644 --- a/3rdparty/spirv-tools/source/opt/optimizer.cpp +++ b/3rdparty/spirv-tools/source/opt/optimizer.cpp @@ -1065,3 +1065,95 @@ Optimizer::PassToken CreateFixFuncCallArgumentsPass() { MakeUnique()); } } // namespace spvtools + +extern "C" { + +SPIRV_TOOLS_EXPORT spv_optimizer_t* spvOptimizerCreate(spv_target_env env) { + return reinterpret_cast(new spvtools::Optimizer(env)); +} + +SPIRV_TOOLS_EXPORT void spvOptimizerDestroy(spv_optimizer_t* optimizer) { + delete reinterpret_cast(optimizer); +} + +SPIRV_TOOLS_EXPORT void spvOptimizerSetMessageConsumer( + spv_optimizer_t* optimizer, spv_message_consumer consumer) { + reinterpret_cast(optimizer)-> + SetMessageConsumer( + [consumer](spv_message_level_t level, const char* source, + const spv_position_t& position, const char* message) { + return consumer(level, source, &position, message); + }); +} + +SPIRV_TOOLS_EXPORT void spvOptimizerRegisterLegalizationPasses( + spv_optimizer_t* optimizer) { + reinterpret_cast(optimizer)-> + RegisterLegalizationPasses(); +} + +SPIRV_TOOLS_EXPORT void spvOptimizerRegisterPerformancePasses( + spv_optimizer_t* optimizer) { + reinterpret_cast(optimizer)-> + RegisterPerformancePasses(); +} + +SPIRV_TOOLS_EXPORT void spvOptimizerRegisterSizePasses( + spv_optimizer_t* optimizer) { + reinterpret_cast(optimizer)->RegisterSizePasses(); +} + +SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassFromFlag( + spv_optimizer_t* optimizer, const char* flag) +{ + return reinterpret_cast(optimizer)-> + RegisterPassFromFlag(flag); +} + +SPIRV_TOOLS_EXPORT bool spvOptimizerRegisterPassesFromFlags( + spv_optimizer_t* optimizer, const char** flags, const size_t flag_count) { + std::vector opt_flags; + for (uint32_t i = 0; i < flag_count; i++) { + opt_flags.emplace_back(flags[i]); + } + + return reinterpret_cast(optimizer)-> + RegisterPassesFromFlags(opt_flags); +} + +SPIRV_TOOLS_EXPORT +spv_result_t spvOptimizerRun(spv_optimizer_t* optimizer, + const uint32_t* binary, + const size_t word_count, + spv_binary* optimized_binary, + const spv_optimizer_options options) { + std::vector optimized; + + if (!reinterpret_cast(optimizer)-> + Run(binary, word_count, &optimized, options)) { + return SPV_ERROR_INTERNAL; + } + + auto result_binary = new spv_binary_t(); + if (!result_binary) { + *optimized_binary = nullptr; + return SPV_ERROR_OUT_OF_MEMORY; + } + + result_binary->code = new uint32_t[optimized.size()]; + if (!result_binary->code) { + delete result_binary; + *optimized_binary = nullptr; + return SPV_ERROR_OUT_OF_MEMORY; + } + result_binary->wordCount = optimized.size(); + + memcpy(result_binary->code, optimized.data(), + optimized.size() * sizeof(uint32_t)); + + *optimized_binary = result_binary; + + return SPV_SUCCESS; +} + +} // extern "C" diff --git a/3rdparty/spirv-tools/source/val/validate_bitwise.cpp b/3rdparty/spirv-tools/source/val/validate_bitwise.cpp index 87c955630..6ab1faebc 100644 --- a/3rdparty/spirv-tools/source/val/validate_bitwise.cpp +++ b/3rdparty/spirv-tools/source/val/validate_bitwise.cpp @@ -206,13 +206,14 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) { << spvOpcodeString(opcode); const uint32_t base_type = _.GetOperandTypeId(inst, 2); - const uint32_t base_dimension = _.GetDimension(base_type); - const uint32_t result_dimension = _.GetDimension(result_type); if (spv_result_t error = ValidateBaseType(_, inst, base_type)) { return error; } + const uint32_t base_dimension = _.GetDimension(base_type); + const uint32_t result_dimension = _.GetDimension(result_type); + if (base_dimension != result_dimension) return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Base dimension to be equal to Result Type " From 709d33f2c5cce90bf9e60f8476243d25e965f55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:01:23 -0800 Subject: [PATCH 32/86] Updated spirv-cross. --- 3rdparty/spirv-cross/spirv_glsl.cpp | 701 ++++++++++++++++++++++++---- 3rdparty/spirv-cross/spirv_glsl.hpp | 25 +- 3rdparty/spirv-cross/spirv_hlsl.cpp | 33 +- 3rdparty/spirv-cross/spirv_hlsl.hpp | 2 +- 3rdparty/spirv-cross/spirv_msl.cpp | 22 +- 3rdparty/spirv-cross/spirv_msl.hpp | 2 +- 6 files changed, 668 insertions(+), 117 deletions(-) diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 4b22d47ea..319cfac6f 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -636,6 +636,17 @@ void CompilerGLSL::find_static_extensions() barycentric_is_nv = true; } +void CompilerGLSL::require_polyfill(Polyfill polyfill, bool relaxed) +{ + uint32_t &polyfills = (relaxed && options.es) ? required_polyfills_relaxed : required_polyfills; + + if ((polyfills & polyfill) == 0) + { + polyfills |= polyfill; + force_recompile(); + } +} + void CompilerGLSL::ray_tracing_khr_fixup_locations() { uint32_t location = 0; @@ -701,6 +712,11 @@ string CompilerGLSL::compile() emit_resources(); emit_extension_workarounds(get_execution_model()); + if (required_polyfills != 0) + emit_polyfills(required_polyfills, false); + if (options.es && required_polyfills_relaxed != 0) + emit_polyfills(required_polyfills_relaxed, true); + emit_function(get(ir.default_entry_point), Bitset()); pass_count++; @@ -1249,14 +1265,33 @@ string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags) if (flags.get(DecorationFlat)) res += "flat "; if (flags.get(DecorationNoPerspective)) + { + if (options.es) + { + if (options.version < 300) + SPIRV_CROSS_THROW("noperspective requires ESSL 300."); + require_extension_internal("GL_NV_shader_noperspective_interpolation"); + } + else if (is_legacy_desktop()) + require_extension_internal("GL_EXT_gpu_shader4"); res += "noperspective "; + } if (flags.get(DecorationCentroid)) res += "centroid "; if (flags.get(DecorationPatch)) res += "patch "; if (flags.get(DecorationSample)) + { + if (options.es) + { + if (options.version < 300) + SPIRV_CROSS_THROW("sample requires ESSL 300."); + else if (options.version < 320) + require_extension_internal("GL_OES_shader_multisample_interpolation"); + } res += "sample "; - if (flags.get(DecorationInvariant)) + } + if (flags.get(DecorationInvariant) && (options.es || options.version >= 120)) res += "invariant "; if (flags.get(DecorationPerPrimitiveEXT)) res += "perprimitiveEXT "; @@ -1529,7 +1564,7 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bits // In std140, struct alignment is rounded up to 16. if (packing_is_vec4_padded(packing)) - alignment = max(alignment, 16u); + alignment = max(alignment, 16u); return alignment; } @@ -1757,7 +1792,7 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin uint32_t begin_word = offset / 16; uint32_t end_word = (offset + packed_size - 1) / 16; if (begin_word != end_word) - packed_alignment = max(packed_alignment, 16u); + packed_alignment = max(packed_alignment, 16u); } uint32_t actual_offset = type_struct_member_offset(type, i); @@ -2713,30 +2748,26 @@ void CompilerGLSL::emit_interface_block(const SPIRVariable &var) { add_resource_name(var.self); - // Tessellation control and evaluation shaders must have either gl_MaxPatchVertices or unsized arrays for input arrays. + // Legacy GLSL did not support int attributes, we automatically + // declare them as float and cast them on load/store + SPIRType newtype = type; + if (is_legacy() && var.storage == StorageClassInput && type.basetype == SPIRType::Int) + newtype.basetype = SPIRType::Float; + + // Tessellation control and evaluation shaders must have either + // gl_MaxPatchVertices or unsized arrays for input arrays. // Opt for unsized as it's the more "correct" variant to use. - bool control_point_input_array = type.storage == StorageClassInput && !type.array.empty() && - !has_decoration(var.self, DecorationPatch) && - (get_entry_point().model == ExecutionModelTessellationControl || - get_entry_point().model == ExecutionModelTessellationEvaluation); - - uint32_t old_array_size = 0; - bool old_array_size_literal = true; - - if (control_point_input_array) + if (type.storage == StorageClassInput && !type.array.empty() && + !has_decoration(var.self, DecorationPatch) && + (get_entry_point().model == ExecutionModelTessellationControl || + get_entry_point().model == ExecutionModelTessellationEvaluation)) { - swap(type.array.back(), old_array_size); - swap(type.array_size_literal.back(), old_array_size_literal); + newtype.array.back() = 0; + newtype.array_size_literal.back() = true; } statement(layout_for_variable(var), to_qualifiers_glsl(var.self), - variable_decl(type, to_name(var.self), var.self), ";"); - - if (control_point_input_array) - { - swap(type.array.back(), old_array_size); - swap(type.array_size_literal.back(), old_array_size_literal); - } + variable_decl(newtype, to_name(var.self), var.self), ";"); } } } @@ -3511,7 +3542,7 @@ void CompilerGLSL::emit_resources() statement(""); } - if (position_invariant) + if (position_invariant && (options.es || options.version >= 120)) { statement("invariant gl_Position;"); statement(""); @@ -4386,34 +4417,135 @@ void CompilerGLSL::emit_extension_workarounds(spv::ExecutionModel model) } statement(""); } +} - if (requires_transpose_2x2) +void CompilerGLSL::emit_polyfills(uint32_t polyfills, bool relaxed) +{ + const char *qual = ""; + const char *suffix = (options.es && relaxed) ? "MP" : ""; + if (options.es) + qual = relaxed ? "mediump " : "highp "; + + if (polyfills & PolyfillTranspose2x2) { - statement("mat2 spvTranspose(mat2 m)"); + statement(qual, "mat2 spvTranspose", suffix, "(", qual, "mat2 m)"); begin_scope(); statement("return mat2(m[0][0], m[1][0], m[0][1], m[1][1]);"); end_scope(); statement(""); } - if (requires_transpose_3x3) + if (polyfills & PolyfillTranspose3x3) { - statement("mat3 spvTranspose(mat3 m)"); + statement(qual, "mat3 spvTranspose", suffix, "(", qual, "mat3 m)"); begin_scope(); statement("return mat3(m[0][0], m[1][0], m[2][0], m[0][1], m[1][1], m[2][1], m[0][2], m[1][2], m[2][2]);"); end_scope(); statement(""); } - if (requires_transpose_4x4) + if (polyfills & PolyfillTranspose4x4) { - statement("mat4 spvTranspose(mat4 m)"); + statement(qual, "mat4 spvTranspose", suffix, "(", qual, "mat4 m)"); begin_scope(); statement("return mat4(m[0][0], m[1][0], m[2][0], m[3][0], m[0][1], m[1][1], m[2][1], m[3][1], m[0][2], " "m[1][2], m[2][2], m[3][2], m[0][3], m[1][3], m[2][3], m[3][3]);"); end_scope(); statement(""); } + + if (polyfills & PolyfillDeterminant2x2) + { + statement(qual, "float spvDeterminant", suffix, "(", qual, "mat2 m)"); + begin_scope(); + statement("return m[0][0] * m[1][1] - m[0][1] * m[1][0];"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillDeterminant3x3) + { + statement(qual, "float spvDeterminant", suffix, "(", qual, "mat3 m)"); + begin_scope(); + statement("return dot(m[0], vec3(m[1][1] * m[2][2] - m[1][2] * m[2][1], " + "m[1][2] * m[2][0] - m[1][0] * m[2][2], " + "m[1][0] * m[2][1] - m[1][1] * m[2][0]));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillDeterminant4x4) + { + statement(qual, "float spvDeterminant", suffix, "(", qual, "mat4 m)"); + begin_scope(); + statement("return dot(m[0], vec4(" + "m[2][1] * m[3][2] * m[1][3] - m[3][1] * m[2][2] * m[1][3] + m[3][1] * m[1][2] * m[2][3] - m[1][1] * m[3][2] * m[2][3] - m[2][1] * m[1][2] * m[3][3] + m[1][1] * m[2][2] * m[3][3], " + "m[3][0] * m[2][2] * m[1][3] - m[2][0] * m[3][2] * m[1][3] - m[3][0] * m[1][2] * m[2][3] + m[1][0] * m[3][2] * m[2][3] + m[2][0] * m[1][2] * m[3][3] - m[1][0] * m[2][2] * m[3][3], " + "m[2][0] * m[3][1] * m[1][3] - m[3][0] * m[2][1] * m[1][3] + m[3][0] * m[1][1] * m[2][3] - m[1][0] * m[3][1] * m[2][3] - m[2][0] * m[1][1] * m[3][3] + m[1][0] * m[2][1] * m[3][3], " + "m[3][0] * m[2][1] * m[1][2] - m[2][0] * m[3][1] * m[1][2] - m[3][0] * m[1][1] * m[2][2] + m[1][0] * m[3][1] * m[2][2] + m[2][0] * m[1][1] * m[3][2] - m[1][0] * m[2][1] * m[3][2]));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillMatrixInverse2x2) + { + statement(qual, "mat2 spvInverse", suffix, "(", qual, "mat2 m)"); + begin_scope(); + statement("return mat2(m[1][1], -m[0][1], -m[1][0], m[0][0]) " + "* (1.0 / (m[0][0] * m[1][1] - m[1][0] * m[0][1]));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillMatrixInverse3x3) + { + statement(qual, "mat3 spvInverse", suffix, "(", qual, "mat3 m)"); + begin_scope(); + statement(qual, "vec3 t = vec3(m[1][1] * m[2][2] - m[1][2] * m[2][1], m[1][2] * m[2][0] - m[1][0] * m[2][2], m[1][0] * m[2][1] - m[1][1] * m[2][0]);"); + statement("return mat3(t[0], " + "m[0][2] * m[2][1] - m[0][1] * m[2][2], " + "m[0][1] * m[1][2] - m[0][2] * m[1][1], " + "t[1], " + "m[0][0] * m[2][2] - m[0][2] * m[2][0], " + "m[0][2] * m[1][0] - m[0][0] * m[1][2], " + "t[2], " + "m[0][1] * m[2][0] - m[0][0] * m[2][1], " + "m[0][0] * m[1][1] - m[0][1] * m[1][0]) " + "* (1.0 / dot(m[0], t));"); + end_scope(); + statement(""); + } + + if (polyfills & PolyfillMatrixInverse4x4) + { + statement(qual, "mat4 spvInverse", suffix, "(", qual, "mat4 m)"); + begin_scope(); + statement(qual, "vec4 t = vec4(" + "m[2][1] * m[3][2] * m[1][3] - m[3][1] * m[2][2] * m[1][3] + m[3][1] * m[1][2] * m[2][3] - m[1][1] * m[3][2] * m[2][3] - m[2][1] * m[1][2] * m[3][3] + m[1][1] * m[2][2] * m[3][3], " + "m[3][0] * m[2][2] * m[1][3] - m[2][0] * m[3][2] * m[1][3] - m[3][0] * m[1][2] * m[2][3] + m[1][0] * m[3][2] * m[2][3] + m[2][0] * m[1][2] * m[3][3] - m[1][0] * m[2][2] * m[3][3], " + "m[2][0] * m[3][1] * m[1][3] - m[3][0] * m[2][1] * m[1][3] + m[3][0] * m[1][1] * m[2][3] - m[1][0] * m[3][1] * m[2][3] - m[2][0] * m[1][1] * m[3][3] + m[1][0] * m[2][1] * m[3][3], " + "m[3][0] * m[2][1] * m[1][2] - m[2][0] * m[3][1] * m[1][2] - m[3][0] * m[1][1] * m[2][2] + m[1][0] * m[3][1] * m[2][2] + m[2][0] * m[1][1] * m[3][2] - m[1][0] * m[2][1] * m[3][2]);"); + statement("return mat4(" + "t[0], " + "m[3][1] * m[2][2] * m[0][3] - m[2][1] * m[3][2] * m[0][3] - m[3][1] * m[0][2] * m[2][3] + m[0][1] * m[3][2] * m[2][3] + m[2][1] * m[0][2] * m[3][3] - m[0][1] * m[2][2] * m[3][3], " + "m[1][1] * m[3][2] * m[0][3] - m[3][1] * m[1][2] * m[0][3] + m[3][1] * m[0][2] * m[1][3] - m[0][1] * m[3][2] * m[1][3] - m[1][1] * m[0][2] * m[3][3] + m[0][1] * m[1][2] * m[3][3], " + "m[2][1] * m[1][2] * m[0][3] - m[1][1] * m[2][2] * m[0][3] - m[2][1] * m[0][2] * m[1][3] + m[0][1] * m[2][2] * m[1][3] + m[1][1] * m[0][2] * m[2][3] - m[0][1] * m[1][2] * m[2][3], " + "t[1], " + "m[2][0] * m[3][2] * m[0][3] - m[3][0] * m[2][2] * m[0][3] + m[3][0] * m[0][2] * m[2][3] - m[0][0] * m[3][2] * m[2][3] - m[2][0] * m[0][2] * m[3][3] + m[0][0] * m[2][2] * m[3][3], " + "m[3][0] * m[1][2] * m[0][3] - m[1][0] * m[3][2] * m[0][3] - m[3][0] * m[0][2] * m[1][3] + m[0][0] * m[3][2] * m[1][3] + m[1][0] * m[0][2] * m[3][3] - m[0][0] * m[1][2] * m[3][3], " + "m[1][0] * m[2][2] * m[0][3] - m[2][0] * m[1][2] * m[0][3] + m[2][0] * m[0][2] * m[1][3] - m[0][0] * m[2][2] * m[1][3] - m[1][0] * m[0][2] * m[2][3] + m[0][0] * m[1][2] * m[2][3], " + "t[2], " + "m[3][0] * m[2][1] * m[0][3] - m[2][0] * m[3][1] * m[0][3] - m[3][0] * m[0][1] * m[2][3] + m[0][0] * m[3][1] * m[2][3] + m[2][0] * m[0][1] * m[3][3] - m[0][0] * m[2][1] * m[3][3], " + "m[1][0] * m[3][1] * m[0][3] - m[3][0] * m[1][1] * m[0][3] + m[3][0] * m[0][1] * m[1][3] - m[0][0] * m[3][1] * m[1][3] - m[1][0] * m[0][1] * m[3][3] + m[0][0] * m[1][1] * m[3][3], " + "m[2][0] * m[1][1] * m[0][3] - m[1][0] * m[2][1] * m[0][3] - m[2][0] * m[0][1] * m[1][3] + m[0][0] * m[2][1] * m[1][3] + m[1][0] * m[0][1] * m[2][3] - m[0][0] * m[1][1] * m[2][3], " + "t[3], " + "m[2][0] * m[3][1] * m[0][2] - m[3][0] * m[2][1] * m[0][2] + m[3][0] * m[0][1] * m[2][2] - m[0][0] * m[3][1] * m[2][2] - m[2][0] * m[0][1] * m[3][2] + m[0][0] * m[2][1] * m[3][2], " + "m[3][0] * m[1][1] * m[0][2] - m[1][0] * m[3][1] * m[0][2] - m[3][0] * m[0][1] * m[1][2] + m[0][0] * m[3][1] * m[1][2] + m[1][0] * m[0][1] * m[3][2] - m[0][0] * m[1][1] * m[3][2], " + "m[1][0] * m[2][1] * m[0][2] - m[2][0] * m[1][1] * m[0][2] + m[2][0] * m[0][1] * m[1][2] - m[0][0] * m[2][1] * m[1][2] - m[1][0] * m[0][1] * m[2][2] + m[0][0] * m[1][1] * m[2][2]) " + "* (1.0 / dot(m[0], t));"); + end_scope(); + statement(""); + } } // Returns a string representation of the ID, usable as a function arg. @@ -4849,8 +4981,9 @@ string CompilerGLSL::to_expression(uint32_t id, bool register_expression_read) // when consuming an access chain expression. uint32_t physical_type_id = get_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID); bool is_packed = has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked); + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); return convert_row_major_matrix(e.expression, get(e.expression_type), physical_type_id, - is_packed); + is_packed, relaxed); } else if (flattened_structs.count(id)) { @@ -6691,6 +6824,9 @@ string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtyp require_extension_internal("GL_EXT_shadow_samplers"); else SPIRV_CROSS_THROW(join(op, " not allowed on depth samplers in legacy ES")); + + if (imgtype.image.dim == spv::DimCube) + return "shadowCubeNV"; } if (op == "textureSize") @@ -7845,8 +7981,22 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, break; case GLSLstd450Trunc: - emit_unary_func_op(result_type, id, args[0], "trunc"); + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "trunc"); + else + { + // Implement by value-casting to int and back. + bool forward = should_forward(args[0]); + auto op0 = to_unpacked_expression(args[0]); + auto &op0_type = expression_type(args[0]); + auto via_type = op0_type; + via_type.basetype = SPIRType::Int; + auto expr = join(type_to_glsl(op0_type), "(", type_to_glsl(via_type), "(", op0, "))"); + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + } break; + case GLSLstd450SAbs: emit_unary_func_op_cast(result_type, id, args[0], "abs", int_type, int_type); break; @@ -7888,18 +8038,47 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, else emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "fma"); break; + case GLSLstd450Modf: register_call_out_argument(args[1]); - forced_temporaries.insert(id); - emit_binary_func_op(result_type, id, args[0], args[1], "modf"); + if (!is_legacy()) + { + forced_temporaries.insert(id); + emit_binary_func_op(result_type, id, args[0], args[1], "modf"); + } + else + { + //NB. legacy GLSL doesn't have trunc() either, so we do a value cast + auto &op1_type = expression_type(args[1]); + auto via_type = op1_type; + via_type.basetype = SPIRType::Int; + statement(to_expression(args[1]), " = ", + type_to_glsl(op1_type), "(", type_to_glsl(via_type), + "(", to_expression(args[0]), "));"); + emit_binary_op(result_type, id, args[0], args[1], "-"); + } break; case GLSLstd450ModfStruct: { auto &type = get(result_type); emit_uninitialized_temporary_expression(result_type, id); - statement(to_expression(id), ".", to_member_name(type, 0), " = ", "modf(", to_expression(args[0]), ", ", - to_expression(id), ".", to_member_name(type, 1), ");"); + if (!is_legacy()) + { + statement(to_expression(id), ".", to_member_name(type, 0), " = ", "modf(", to_expression(args[0]), ", ", + to_expression(id), ".", to_member_name(type, 1), ");"); + } + else + { + //NB. legacy GLSL doesn't have trunc() either, so we do a value cast + auto &op0_type = expression_type(args[0]); + auto via_type = op0_type; + via_type.basetype = SPIRType::Int; + statement(to_expression(id), ".", to_member_name(type, 1), " = ", type_to_glsl(op0_type), + "(", type_to_glsl(via_type), "(", to_expression(args[0]), "));"); + statement(to_expression(id), ".", to_member_name(type, 0), " = ", to_enclosed_expression(args[0]), " - ", + to_expression(id), ".", to_member_name(type, 1), ";"); + } break; } @@ -7960,22 +8139,77 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, emit_unary_func_op(result_type, id, args[0], "atan"); break; case GLSLstd450Sinh: - emit_unary_func_op(result_type, id, args[0], "sinh"); + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "sinh"); + else + { + bool forward = should_forward(args[0]); + auto expr = join("(exp(", to_expression(args[0]), ") - exp(-", to_enclosed_expression(args[0]), ")) * 0.5"); + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + } break; case GLSLstd450Cosh: - emit_unary_func_op(result_type, id, args[0], "cosh"); + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "cosh"); + else + { + bool forward = should_forward(args[0]); + auto expr = join("(exp(", to_expression(args[0]), ") + exp(-", to_enclosed_expression(args[0]), ")) * 0.5"); + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, args[0]); + } break; case GLSLstd450Tanh: - emit_unary_func_op(result_type, id, args[0], "tanh"); + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "tanh"); + else + { + // Create temporaries to store the result of exp(arg) and exp(-arg). + uint32_t &ids = extra_sub_expressions[id]; + if (!ids) + { + ids = ir.increase_bound_by(2); + + // Inherit precision qualifier (legacy has no NoContraction). + if (has_decoration(id, DecorationRelaxedPrecision)) + { + set_decoration(ids, DecorationRelaxedPrecision); + set_decoration(ids + 1, DecorationRelaxedPrecision); + } + } + uint32_t epos_id = ids; + uint32_t eneg_id = ids + 1; + + emit_op(result_type, epos_id, join("exp(", to_expression(args[0]), ")"), false); + emit_op(result_type, eneg_id, join("exp(-", to_enclosed_expression(args[0]), ")"), false); + inherit_expression_dependencies(epos_id, args[0]); + inherit_expression_dependencies(eneg_id, args[0]); + + auto expr = join("(", to_enclosed_expression(epos_id), " - ", to_enclosed_expression(eneg_id), ") / " + "(", to_enclosed_expression(epos_id), " + ", to_enclosed_expression(eneg_id), ")"); + emit_op(result_type, id, expr, true); + inherit_expression_dependencies(id, epos_id); + inherit_expression_dependencies(id, eneg_id); + } break; case GLSLstd450Asinh: - emit_unary_func_op(result_type, id, args[0], "asinh"); + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "asinh"); + else + emit_emulated_ahyper_op(result_type, id, args[0], GLSLstd450Asinh); break; case GLSLstd450Acosh: - emit_unary_func_op(result_type, id, args[0], "acosh"); + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "acosh"); + else + emit_emulated_ahyper_op(result_type, id, args[0], GLSLstd450Acosh); break; case GLSLstd450Atanh: - emit_unary_func_op(result_type, id, args[0], "atanh"); + if (!is_legacy()) + emit_unary_func_op(result_type, id, args[0], "atanh"); + else + emit_emulated_ahyper_op(result_type, id, args[0], GLSLstd450Atanh); break; case GLSLstd450Atan2: emit_binary_func_op(result_type, id, args[0], args[1], "atan"); @@ -8006,11 +8240,74 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, // Matrix math case GLSLstd450Determinant: - emit_unary_func_op(result_type, id, args[0], "determinant"); + { + // No need to transpose - it doesn't affect the determinant + auto *e = maybe_get(args[0]); + bool old_transpose = e && e->need_transpose; + if (old_transpose) + e->need_transpose = false; + + if (options.version < 150) // also matches ES 100 + { + auto &type = expression_type(args[0]); + assert(type.vecsize >= 2 && type.vecsize <= 4); + assert(type.vecsize == type.columns); + + // ARB_gpu_shader_fp64 needs GLSL 150, other types are not valid + if (type.basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Unsupported type for matrix determinant"); + + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + require_polyfill(static_cast(PolyfillDeterminant2x2 << (type.vecsize - 2)), + relaxed); + emit_unary_func_op(result_type, id, args[0], + (options.es && relaxed) ? "spvDeterminantMP" : "spvDeterminant"); + } + else + emit_unary_func_op(result_type, id, args[0], "determinant"); + + if (old_transpose) + e->need_transpose = true; break; + } + case GLSLstd450MatrixInverse: - emit_unary_func_op(result_type, id, args[0], "inverse"); + { + // The inverse of the transpose is the same as the transpose of + // the inverse, so we can just flip need_transpose of the result. + auto *a = maybe_get(args[0]); + bool old_transpose = a && a->need_transpose; + if (old_transpose) + a->need_transpose = false; + + const char *func = "inverse"; + if (options.version < 140) // also matches ES 100 + { + auto &type = get(result_type); + assert(type.vecsize >= 2 && type.vecsize <= 4); + assert(type.vecsize == type.columns); + + // ARB_gpu_shader_fp64 needs GLSL 150, other types are invalid + if (type.basetype != SPIRType::Float) + SPIRV_CROSS_THROW("Unsupported type for matrix inverse"); + + bool relaxed = has_decoration(id, DecorationRelaxedPrecision); + require_polyfill(static_cast(PolyfillMatrixInverse2x2 << (type.vecsize - 2)), + relaxed); + func = (options.es && relaxed) ? "spvInverseMP" : "spvInverse"; + } + + bool forward = should_forward(args[0]); + auto &e = emit_op(result_type, id, join(func, "(", to_unpacked_expression(args[0]), ")"), forward); + inherit_expression_dependencies(id, args[0]); + + if (old_transpose) + { + e.need_transpose = true; + a->need_transpose = true; + } break; + } // Lerping case GLSLstd450FMix: @@ -8203,13 +8500,60 @@ void CompilerGLSL::emit_nminmax_op(uint32_t result_type, uint32_t id, uint32_t o ir.meta[tmp_id] = ir.meta[id]; ir.meta[mixed_first_id] = ir.meta[id]; - emit_unary_func_op(btype_id, left_nan_id, op0, "isnan"); - emit_unary_func_op(btype_id, right_nan_id, op1, "isnan"); + if (!is_legacy()) + { + emit_unary_func_op(btype_id, left_nan_id, op0, "isnan"); + emit_unary_func_op(btype_id, right_nan_id, op1, "isnan"); + } + else if (expression_type(op0).vecsize > 1) + { + // If the number doesn't equal itself, it must be NaN + emit_binary_func_op(btype_id, left_nan_id, op0, op0, "notEqual"); + emit_binary_func_op(btype_id, right_nan_id, op1, op1, "notEqual"); + } + else + { + emit_binary_op(btype_id, left_nan_id, op0, op0, "!="); + emit_binary_op(btype_id, right_nan_id, op1, op1, "!="); + } emit_binary_func_op(result_type, tmp_id, op0, op1, op == GLSLstd450NMin ? "min" : "max"); emit_mix_op(result_type, mixed_first_id, tmp_id, op1, left_nan_id); emit_mix_op(result_type, id, mixed_first_id, op0, right_nan_id); } +void CompilerGLSL::emit_emulated_ahyper_op(uint32_t result_type, uint32_t id, uint32_t op0, GLSLstd450 op) +{ + const char *one = backend.float_literal_suffix ? "1.0f" : "1.0"; + std::string expr; + bool forward = should_forward(op0); + + switch (op) + { + case GLSLstd450Asinh: + expr = join("log(", to_enclosed_expression(op0), " + sqrt(", + to_enclosed_expression(op0), " * ", to_enclosed_expression(op0), " + ", one, "))"); + emit_op(result_type, id, expr, forward); + break; + + case GLSLstd450Acosh: + expr = join("log(", to_enclosed_expression(op0), " + sqrt(", + to_enclosed_expression(op0), " * ", to_enclosed_expression(op0), " - ", one, "))"); + break; + + case GLSLstd450Atanh: + expr = join("log((", one, " + ", to_enclosed_expression(op0), ") / " + "(", one, " - ", to_enclosed_expression(op0), ")) * 0.5", + backend.float_literal_suffix ? "f" : ""); + break; + + default: + SPIRV_CROSS_THROW("Invalid op."); + } + + emit_op(result_type, id, expr, forward); + inherit_expression_dependencies(id, op0); +} + void CompilerGLSL::emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t) { @@ -8793,9 +9137,17 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) case BuiltInPointSize: return "gl_PointSize"; case BuiltInClipDistance: + { + if (options.es) + require_extension_internal("GL_EXT_clip_cull_distance"); return "gl_ClipDistance"; + } case BuiltInCullDistance: + { + if (options.es) + require_extension_internal("GL_EXT_clip_cull_distance"); return "gl_CullDistance"; + } case BuiltInVertexId: if (options.vulkan_semantics) SPIRV_CROSS_THROW("Cannot implement gl_VertexID in Vulkan GLSL. This shader was created " @@ -8940,17 +9292,21 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) return "gl_DrawIDARB"; case BuiltInSampleId: - if (options.es && options.version < 320) + if (is_legacy()) + SPIRV_CROSS_THROW("Sample variables not supported in legacy GLSL."); + else if (options.es && options.version < 320) require_extension_internal("GL_OES_sample_variables"); - if (!options.es && options.version < 400) - SPIRV_CROSS_THROW("gl_SampleID not supported before GLSL 400."); + else if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_sample_shading"); return "gl_SampleID"; case BuiltInSampleMask: - if (options.es && options.version < 320) + if (is_legacy()) + SPIRV_CROSS_THROW("Sample variables not supported in legacy GLSL."); + else if (options.es && options.version < 320) require_extension_internal("GL_OES_sample_variables"); - if (!options.es && options.version < 400) - SPIRV_CROSS_THROW("gl_SampleMask/gl_SampleMaskIn not supported before GLSL 400."); + else if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_sample_shading"); if (storage == StorageClassInput) return "gl_SampleMaskIn"; @@ -8958,10 +9314,12 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) return "gl_SampleMask"; case BuiltInSamplePosition: - if (options.es && options.version < 320) + if (is_legacy()) + SPIRV_CROSS_THROW("Sample variables not supported in legacy GLSL."); + else if (options.es && options.version < 320) require_extension_internal("GL_OES_sample_variables"); - if (!options.es && options.version < 400) - SPIRV_CROSS_THROW("gl_SamplePosition not supported before GLSL 400."); + else if (!options.es && options.version < 400) + require_extension_internal("GL_ARB_sample_shading"); return "gl_SamplePosition"; case BuiltInViewIndex: @@ -9777,10 +10135,13 @@ std::string CompilerGLSL::flattened_access_chain_struct(uint32_t base, const uin // The access chain terminates at the struct, so we need to find matrix strides and row-major information // ahead of time. bool need_transpose = false; + bool relaxed = false; uint32_t matrix_stride = 0; if (member_type.columns > 1) { - need_transpose = combined_decoration_for_member(target_type, i).get(DecorationRowMajor); + auto decorations = combined_decoration_for_member(target_type, i); + need_transpose = decorations.get(DecorationRowMajor); + relaxed = decorations.get(DecorationRelaxedPrecision); matrix_stride = type_struct_member_matrix_stride(target_type, i); } @@ -9789,7 +10150,7 @@ std::string CompilerGLSL::flattened_access_chain_struct(uint32_t base, const uin // Cannot forward transpositions, so resolve them here. if (need_transpose) - expr += convert_row_major_matrix(tmp, member_type, 0, false); + expr += convert_row_major_matrix(tmp, member_type, 0, false, relaxed); else expr += tmp; } @@ -11809,11 +12170,57 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // ALU case OpIsNan: - GLSL_UFOP(isnan); + if (!is_legacy()) + GLSL_UFOP(isnan); + else + { + // Check if the number doesn't equal itself + auto &type = get(ops[0]); + if (type.vecsize > 1) + emit_binary_func_op(ops[0], ops[1], ops[2], ops[2], "notEqual"); + else + emit_binary_op(ops[0], ops[1], ops[2], ops[2], "!="); + } break; case OpIsInf: - GLSL_UFOP(isinf); + if (!is_legacy()) + GLSL_UFOP(isinf); + else + { + // inf * 2 == inf by IEEE 754 rules, note this also applies to 0.0 + // This is more reliable than checking if product with zero is NaN + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t operand = ops[2]; + + auto &type = get(result_type); + std::string expr; + if (type.vecsize > 1) + { + expr = type_to_glsl_constructor(type); + expr += '('; + for (uint32_t i = 0; i < type.vecsize; i++) + { + auto comp = to_extract_component_expression(operand, i); + expr += join(comp, " != 0.0 && 2.0 * ", comp, " == ", comp); + + if (i + 1 < type.vecsize) + expr += ", "; + } + expr += ')'; + } + else + { + // Register an extra read to force writing out a temporary + auto oper = to_enclosed_expression(operand); + track_expression_read(operand); + expr += join(oper, " != 0.0 && 2.0 * ", oper, " == ", oper); + } + emit_op(result_type, result_id, expr, should_forward(operand)); + + inherit_expression_dependencies(result_id, operand); + } break; case OpSNegate: @@ -11912,14 +12319,59 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) break; } - case OpFMul: case OpMatrixTimesScalar: + { + auto *a = maybe_get(ops[2]); + + // If the matrix need transpose, just mark the result as needing so. + if (a && a->need_transpose) + { + a->need_transpose = false; + auto expr = join(enclose_expression(to_unpacked_row_major_matrix_expression(ops[2])), " * ", + to_enclosed_unpacked_expression(ops[3])); + bool forward = should_forward(ops[2]) && should_forward(ops[3]); + auto &e = emit_op(ops[0], ops[1], expr, forward); + e.need_transpose = true; + a->need_transpose = true; + inherit_expression_dependencies(ops[1], ops[2]); + inherit_expression_dependencies(ops[1], ops[3]); + } + else + GLSL_BOP(*); + break; + } + + case OpFMul: case OpVectorTimesScalar: GLSL_BOP(*); break; case OpOuterProduct: - GLSL_BFOP(outerProduct); + if (options.version < 120) // Matches GLSL 1.10 / ESSL 1.00 + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2]; + uint32_t b = ops[3]; + + auto &type = get(result_type); + string expr = type_to_glsl_constructor(type); + expr += "("; + for (uint32_t col = 0; col < type.columns; col++) + { + expr += to_enclosed_expression(a); + expr += " * "; + expr += to_extract_component_expression(b, col); + if (col + 1 < type.columns) + expr += ", "; + } + expr += ")"; + emit_op(result_type, id, expr, should_forward(a) && should_forward(b)); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + } + else + GLSL_BFOP(outerProduct); break; case OpDot: @@ -12087,10 +12539,6 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpFRem: { - if (is_legacy()) - SPIRV_CROSS_THROW("OpFRem requires trunc() and is only supported on non-legacy targets. A workaround is " - "needed for legacy."); - uint32_t result_type = ops[0]; uint32_t result_id = ops[1]; uint32_t op0 = ops[2]; @@ -12098,8 +12546,22 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // Needs special handling. bool forward = should_forward(op0) && should_forward(op1); - auto expr = join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", "trunc(", - to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), ")"); + std::string expr; + if (!is_legacy()) + { + expr = join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", "trunc(", + to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), ")"); + } + else + { + // Legacy GLSL has no trunc, emulate by casting to int and back + auto &op0_type = expression_type(op0); + auto via_type = op0_type; + via_type.basetype = SPIRType::Int; + expr = join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", + type_to_glsl(op0_type), "(", type_to_glsl(via_type), "(", + to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), "))"); + } emit_op(result_type, result_id, expr, forward); inherit_expression_dependencies(result_id, op0); @@ -12753,7 +13215,12 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) op = "textureQueryLOD"; } else if (options.es) - SPIRV_CROSS_THROW("textureQueryLod not supported in ES profile."); + { + if (options.version < 300) + SPIRV_CROSS_THROW("textureQueryLod not supported in legacy ES"); + require_extension_internal("GL_EXT_texture_query_lod"); + op = "textureQueryLOD"; + } else op = "textureQueryLod"; @@ -12799,6 +13266,11 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t result_type = ops[0]; uint32_t id = ops[1]; + if (options.es) + SPIRV_CROSS_THROW("textureSamples and imageSamples not supported in ES profile."); + else if (options.version < 450) + require_extension_internal("GL_ARB_texture_query_samples"); + string expr; if (type.image.sampled == 2) expr = join("imageSamples(", to_non_uniform_aware_expression(ops[2]), ")"); @@ -13841,6 +14313,42 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) statement("SetMeshOutputsEXT(", to_unpacked_expression(ops[0]), ", ", to_unpacked_expression(ops[1]), ");"); break; + case OpReadClockKHR: + { + auto &type = get(ops[0]); + auto scope = static_cast(evaluate_constant_u32(ops[2])); + const char *op = nullptr; + // Forwarding clock statements leads to a scenario where an SSA value can take on different + // values every time it's evaluated. Block any forwarding attempt. + // We also might want to invalidate all expressions to function as a sort of optimization + // barrier, but might be overkill for now. + if (scope == ScopeDevice) + { + require_extension_internal("GL_EXT_shader_realtime_clock"); + if (type.basetype == SPIRType::BaseType::UInt64) + op = "clockRealtimeEXT()"; + else if (type.basetype == SPIRType::BaseType::UInt && type.vecsize == 2) + op = "clockRealtime2x32EXT()"; + else + SPIRV_CROSS_THROW("Unsupported result type for OpReadClockKHR opcode."); + } + else if (scope == ScopeSubgroup) + { + require_extension_internal("GL_ARB_shader_clock"); + if (type.basetype == SPIRType::BaseType::UInt64) + op = "clockARB()"; + else if (type.basetype == SPIRType::BaseType::UInt && type.vecsize == 2) + op = "clock2x32ARB()"; + else + SPIRV_CROSS_THROW("Unsupported result type for OpReadClockKHR opcode."); + } + else + SPIRV_CROSS_THROW("Unsupported scope for OpReadClockKHR opcode."); + + emit_op(ops[0], ops[1], op, false); + break; + } + default: statement("// unimplemented op ", instruction.op); break; @@ -13973,7 +14481,7 @@ bool CompilerGLSL::member_is_packed_physical_type(const SPIRType &type, uint32_t // Base implementation uses the standard library transpose() function. // Subclasses may override to use a different function. string CompilerGLSL::convert_row_major_matrix(string exp_str, const SPIRType &exp_type, uint32_t /* physical_type_id */, - bool /*is_packed*/) + bool /*is_packed*/, bool relaxed) { strip_enclosed_expression(exp_str); if (!is_matrix(exp_type)) @@ -14003,32 +14511,14 @@ string CompilerGLSL::convert_row_major_matrix(string exp_str, const SPIRType &ex // GLSL 110, ES 100 do not have transpose(), so emulate it. Note that // these GLSL versions do not support non-square matrices. if (exp_type.vecsize == 2 && exp_type.columns == 2) - { - if (!requires_transpose_2x2) - { - requires_transpose_2x2 = true; - force_recompile(); - } - } + require_polyfill(PolyfillTranspose2x2, relaxed); else if (exp_type.vecsize == 3 && exp_type.columns == 3) - { - if (!requires_transpose_3x3) - { - requires_transpose_3x3 = true; - force_recompile(); - } - } + require_polyfill(PolyfillTranspose3x3, relaxed); else if (exp_type.vecsize == 4 && exp_type.columns == 4) - { - if (!requires_transpose_4x4) - { - requires_transpose_4x4 = true; - force_recompile(); - } - } + require_polyfill(PolyfillTranspose4x4, relaxed); else SPIRV_CROSS_THROW("Non-square matrices are not supported in legacy GLSL, cannot transpose."); - return join("spvTranspose(", exp_str, ")"); + return join("spvTranspose", (options.es && relaxed) ? "MP" : "", "(", exp_str, ")"); } else return join("transpose(", exp_str, ")"); @@ -14531,6 +15021,17 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id) is_depth_image(type, id)) { res += "Shadow"; + + if (type.image.dim == DimCube && is_legacy()) + { + if (!options.es) + require_extension_internal("GL_EXT_gpu_shader4"); + else + { + require_extension_internal("GL_NV_shadow_samplers_cube"); + res += "NV"; + } + } } return res; @@ -14610,7 +15111,20 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) } if (type.basetype == SPIRType::UInt && is_legacy()) - SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy targets."); + { + if (options.es) + SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy ESSL."); + else + require_extension_internal("GL_EXT_gpu_shader4"); + } + + if (type.basetype == SPIRType::AtomicCounter) + { + if (options.es && options.version < 310) + SPIRV_CROSS_THROW("At least ESSL 3.10 required for atomic counters."); + else if (!options.es && options.version < 420) + require_extension_internal("GL_ARB_shader_atomic_counters"); + } if (type.vecsize == 1 && type.columns == 1) // Scalar builtin { @@ -16654,7 +17168,12 @@ void CompilerGLSL::cast_from_variable_load(uint32_t source_id, std::string &expr // Only interested in standalone builtin variables. if (!has_decoration(source_id, DecorationBuiltIn)) + { + // Except for int attributes in legacy GLSL, which are cast from float. + if (is_legacy() && expr_type.basetype == SPIRType::Int && var && var->storage == StorageClassInput) + expr = join(type_to_glsl(expr_type), "(", expr, ")"); return; + } auto builtin = static_cast(get_decoration(source_id, DecorationBuiltIn)); auto expected_type = expr_type.basetype; diff --git a/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/spirv-cross/spirv_glsl.hpp index 4dcde5540..d48ca8fd0 100644 --- a/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/3rdparty/spirv-cross/spirv_glsl.hpp @@ -552,7 +552,8 @@ protected: bool member_is_remapped_physical_type(const SPIRType &type, uint32_t index) const; bool member_is_packed_physical_type(const SPIRType &type, uint32_t index) const; virtual std::string convert_row_major_matrix(std::string exp_str, const SPIRType &exp_type, - uint32_t physical_type_id, bool is_packed); + uint32_t physical_type_id, bool is_packed, + bool relaxed = false); std::unordered_set local_variable_names; std::unordered_set resource_names; @@ -626,6 +627,7 @@ protected: void emit_struct(SPIRType &type); void emit_resources(); void emit_extension_workarounds(spv::ExecutionModel model); + void emit_polyfills(uint32_t polyfills, bool relaxed); void emit_buffer_block_native(const SPIRVariable &var); void emit_buffer_reference_block(uint32_t type_id, bool forward_declaration); void emit_buffer_block_legacy(const SPIRVariable &var); @@ -663,6 +665,7 @@ protected: bool should_suppress_usage_tracking(uint32_t id) const; void emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, uint32_t right, uint32_t lerp); void emit_nminmax_op(uint32_t result_type, uint32_t id, uint32_t op0, uint32_t op1, GLSLstd450 op); + void emit_emulated_ahyper_op(uint32_t result_type, uint32_t result_id, uint32_t op0, GLSLstd450 op); bool to_trivial_mix_op(const SPIRType &type, std::string &op, uint32_t left, uint32_t right, uint32_t lerp); void emit_quaternary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, uint32_t op3, const char *op); @@ -883,9 +886,23 @@ protected: return !options.es && options.version < 130; } - bool requires_transpose_2x2 = false; - bool requires_transpose_3x3 = false; - bool requires_transpose_4x4 = false; + enum Polyfill : uint32_t + { + PolyfillTranspose2x2 = 1 << 0, + PolyfillTranspose3x3 = 1 << 1, + PolyfillTranspose4x4 = 1 << 2, + PolyfillDeterminant2x2 = 1 << 3, + PolyfillDeterminant3x3 = 1 << 4, + PolyfillDeterminant4x4 = 1 << 5, + PolyfillMatrixInverse2x2 = 1 << 6, + PolyfillMatrixInverse3x3 = 1 << 7, + PolyfillMatrixInverse4x4 = 1 << 8, + }; + + uint32_t required_polyfills = 0; + uint32_t required_polyfills_relaxed = 0; + void require_polyfill(Polyfill polyfill, bool relaxed); + bool ray_tracing_is_khr = false; bool barycentric_is_nv = false; void ray_tracing_khr_fixup_locations(); diff --git a/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/spirv-cross/spirv_hlsl.cpp index b3ba58041..5c885bd86 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -682,10 +682,14 @@ void CompilerHLSL::emit_builtin_outputs_in_struct() // If point_size_compat is enabled, just ignore PointSize. // PointSize does not exist in HLSL, but some code bases might want to be able to use these shaders, // even if it means working around the missing feature. - if (hlsl_options.point_size_compat) - break; - else + if (legacy) + { + type = "float"; + semantic = "PSIZE"; + } + else if (!hlsl_options.point_size_compat) SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); + break; case BuiltInLayer: case BuiltInPrimitiveId: @@ -1016,6 +1020,7 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord string binding; bool use_location_number = true; + bool need_matrix_unroll = false; bool legacy = hlsl_options.shader_model <= 30; if (execution.model == ExecutionModelFragment && var.storage == StorageClassOutput) { @@ -1031,6 +1036,12 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord if (legacy) // COLOR must be a four-component vector on legacy shader model targets (HLSL ERR_COLOR_4COMP) type.vecsize = 4; } + else if (var.storage == StorageClassInput && execution.model == ExecutionModelVertex) + { + need_matrix_unroll = true; + if (legacy) // Inputs must be floating-point in legacy targets. + type.basetype = SPIRType::Float; + } const auto get_vacant_location = [&]() -> uint32_t { for (uint32_t i = 0; i < 64; i++) @@ -1039,8 +1050,6 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord SPIRV_CROSS_THROW("All locations from 0 to 63 are exhausted."); }; - bool need_matrix_unroll = var.storage == StorageClassInput && execution.model == ExecutionModelVertex; - auto name = to_name(var.self); if (use_location_number) { @@ -1221,7 +1230,7 @@ void CompilerHLSL::emit_builtin_variables() break; case BuiltInPointSize: - if (hlsl_options.point_size_compat) + if (hlsl_options.point_size_compat || hlsl_options.shader_model <= 30) { // Just emit the global variable, it will be ignored. type = "float"; @@ -3218,8 +3227,8 @@ void CompilerHLSL::emit_hlsl_entry_point() // Copy builtins from globals to return struct. active_output_builtins.for_each_bit([&](uint32_t i) { - // PointSize doesn't exist in HLSL. - if (i == BuiltInPointSize) + // PointSize doesn't exist in HLSL SM 4+. + if (i == BuiltInPointSize && !legacy) return; switch (static_cast(i)) @@ -4115,10 +4124,16 @@ void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, emit_unary_func_op(result_type, id, args[0], "round"); break; + case GLSLstd450Trunc: + emit_unary_func_op(result_type, id, args[0], "trunc"); + break; + case GLSLstd450Acosh: case GLSLstd450Asinh: case GLSLstd450Atanh: - SPIRV_CROSS_THROW("Inverse hyperbolics are not supported on HLSL."); + // These are not supported in HLSL, always emulate them. + emit_emulated_ahyper_op(result_type, id, args[0], op); + break; case GLSLstd450FMix: case GLSLstd450IMix: diff --git a/3rdparty/spirv-cross/spirv_hlsl.hpp b/3rdparty/spirv-cross/spirv_hlsl.hpp index 57d1c2cdc..2e16ebd30 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.hpp +++ b/3rdparty/spirv-cross/spirv_hlsl.hpp @@ -110,7 +110,7 @@ public: { uint32_t shader_model = 30; // TODO: map ps_4_0_level_9_0,... somehow - // Allows the PointSize builtin, and ignores it, as PointSize is not supported in HLSL. + // Allows the PointSize builtin in SM 4.0+, and ignores it, as PointSize is not supported in SM 4+. bool point_size_compat = false; // Allows the PointCoord builtin, returns float2(0.5, 0.5), as PointCoord is not supported in HLSL. diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index 0e67fa1ac..ac862c351 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -2364,7 +2364,7 @@ bool CompilerMSL::add_component_variable_to_interface_block(spv::StorageClass st if (pad_fragment_output) { uint32_t locn = get_decoration(var.self, DecorationLocation); - num_components = std::max(num_components, get_target_components_for_fragment_location(locn)); + num_components = max(num_components, get_target_components_for_fragment_location(locn)); } // We have already declared an IO block member as m_location_N. @@ -3846,7 +3846,7 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch) for (uint32_t location_offset = 0; location_offset < array_size; location_offset++) { auto &location_meta = meta.location_meta[location + location_offset]; - location_meta.num_components = std::max(location_meta.num_components, component + type.vecsize); + location_meta.num_components = max(location_meta.num_components, component + type.vecsize); // For variables sharing location, decorations and base type must match. location_meta.base_type_id = type.self; @@ -4515,7 +4515,7 @@ void CompilerMSL::mark_scalar_layout_structs(const SPIRType &type) for (uint32_t dim = 0; dim < dimensions; dim++) { uint32_t array_size = to_array_size_literal(mbr_type, dim); - array_stride /= max(array_size, 1u); + array_stride /= max(array_size, 1u); } // Set expected struct size based on ArrayStride. @@ -4722,7 +4722,7 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in // Hack off array-of-arrays until we find the array stride per element we must have to make it work. uint32_t dimensions = uint32_t(mbr_type.array.size() - 1); for (uint32_t dim = 0; dim < dimensions; dim++) - array_stride /= max(to_array_size_literal(mbr_type, dim), 1u); + array_stride /= max(to_array_size_literal(mbr_type, dim), 1u); // Pointers are 8 bytes uint32_t mbr_width_in_bytes = is_buff_ptr ? 8 : (mbr_type.width / 8); @@ -7206,7 +7206,7 @@ static string inject_top_level_storage_qualifier(const string &expr, const strin else if (last_pointer == string::npos) last_significant = last_reference; else - last_significant = std::max(last_reference, last_pointer); + last_significant = max(last_reference, last_pointer); if (last_significant == string::npos) return join(qualifier, " ", expr); @@ -11487,11 +11487,11 @@ bool CompilerMSL::member_is_non_native_row_major_matrix(const SPIRType &type, ui } string CompilerMSL::convert_row_major_matrix(string exp_str, const SPIRType &exp_type, uint32_t physical_type_id, - bool is_packed) + bool is_packed, bool relaxed) { if (!is_matrix(exp_type)) { - return CompilerGLSL::convert_row_major_matrix(std::move(exp_str), exp_type, physical_type_id, is_packed); + return CompilerGLSL::convert_row_major_matrix(std::move(exp_str), exp_type, physical_type_id, is_packed, relaxed); } else { @@ -15920,7 +15920,7 @@ uint32_t CompilerMSL::get_declared_type_array_stride_msl(const SPIRType &type, b for (uint32_t dim = 0; dim < dimensions; dim++) { uint32_t array_size = to_array_size_literal(type, dim); - value_size *= max(array_size, 1u); + value_size *= max(array_size, 1u); } return value_size; @@ -16031,7 +16031,7 @@ uint32_t CompilerMSL::get_declared_type_size_msl(const SPIRType &type, bool is_p if (!type.array.empty()) { uint32_t array_size = to_array_size_literal(type); - return get_declared_type_array_stride_msl(type, is_packed, row_major) * max(array_size, 1u); + return get_declared_type_array_stride_msl(type, is_packed, row_major) * max(array_size, 1u); } if (type.basetype == SPIRType::Struct) @@ -16705,7 +16705,7 @@ void CompilerMSL::cast_from_variable_load(uint32_t source_id, std::string &expr, bool is_packed = has_extended_decoration(source_id, SPIRVCrossDecorationPhysicalTypePacked); auto *source_expr = maybe_get(source_id); auto *var = maybe_get_backing_variable(source_id); - const SPIRType *var_type, *phys_type; + const SPIRType *var_type = nullptr, *phys_type = nullptr; if (uint32_t phys_id = get_extended_decoration(source_id, SPIRVCrossDecorationPhysicalTypeID)) phys_type = &get(phys_id); else @@ -16831,7 +16831,7 @@ void CompilerMSL::cast_to_variable_store(uint32_t target_id, std::string &expr, bool is_packed = has_extended_decoration(target_id, SPIRVCrossDecorationPhysicalTypePacked); auto *target_expr = maybe_get(target_id); auto *var = maybe_get_backing_variable(target_id); - const SPIRType *var_type, *phys_type; + const SPIRType *var_type = nullptr, *phys_type = nullptr; if (uint32_t phys_id = get_extended_decoration(target_id, SPIRVCrossDecorationPhysicalTypeID)) phys_type = &get(phys_id); else diff --git a/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/spirv-cross/spirv_msl.hpp index 737575d49..9493219e0 100644 --- a/3rdparty/spirv-cross/spirv_msl.hpp +++ b/3rdparty/spirv-cross/spirv_msl.hpp @@ -864,7 +864,7 @@ protected: bool is_non_native_row_major_matrix(uint32_t id) override; bool member_is_non_native_row_major_matrix(const SPIRType &type, uint32_t index) override; std::string convert_row_major_matrix(std::string exp_str, const SPIRType &exp_type, uint32_t physical_type_id, - bool is_packed) override; + bool is_packed, bool relaxed) override; bool is_tesc_shader() const; bool is_tese_shader() const; From dcf926f624b9642769f8486e789ec26c74e34f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Feb 2023 19:01:37 -0800 Subject: [PATCH 33/86] Updated vulkan headers. --- .../vk_video/vulkan_video_codec_h264std.h | 310 ++++++++++++ .../vulkan_video_codec_h264std_decode.h | 75 +++ .../vulkan_video_codec_h264std_encode.h | 132 ++++++ .../vk_video/vulkan_video_codec_h265std.h | 443 ++++++++++++++++++ .../vulkan_video_codec_h265std_decode.h | 65 +++ .../vulkan_video_codec_h265std_encode.h | 146 ++++++ .../vk_video/vulkan_video_codecs_common.h | 31 ++ 3rdparty/khronos/vulkan-local/vulkan_core.h | 168 ++++++- 8 files changed, 1369 insertions(+), 1 deletion(-) create mode 100644 3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h create mode 100644 3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h create mode 100644 3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h create mode 100644 3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h create mode 100644 3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h create mode 100644 3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h create mode 100644 3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h diff --git a/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h new file mode 100644 index 000000000..d3ebec6a1 --- /dev/null +++ b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std.h @@ -0,0 +1,310 @@ +#ifndef VULKAN_VIDEO_CODEC_H264STD_H_ +#define VULKAN_VIDEO_CODEC_H264STD_H_ 1 + +/* +** Copyright 2015-2022 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define vulkan_video_codec_h264std 1 +#include +#define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32 +#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6 +#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16 +#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS 6 +#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64 +#define STD_VIDEO_H264_MAX_NUM_LIST_REF 32 +#define STD_VIDEO_H264_MAX_CHROMA_PLANES 2 + +typedef enum StdVideoH264ChromaFormatIdc { + STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_420 = 1, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_422 = 2, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_444 = 3, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264ChromaFormatIdc; + +typedef enum StdVideoH264ProfileIdc { + STD_VIDEO_H264_PROFILE_IDC_BASELINE = 66, + STD_VIDEO_H264_PROFILE_IDC_MAIN = 77, + STD_VIDEO_H264_PROFILE_IDC_HIGH = 100, + STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE = 244, + STD_VIDEO_H264_PROFILE_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264ProfileIdc; + +typedef enum StdVideoH264LevelIdc { + STD_VIDEO_H264_LEVEL_IDC_1_0 = 0, + STD_VIDEO_H264_LEVEL_IDC_1_1 = 1, + STD_VIDEO_H264_LEVEL_IDC_1_2 = 2, + STD_VIDEO_H264_LEVEL_IDC_1_3 = 3, + STD_VIDEO_H264_LEVEL_IDC_2_0 = 4, + STD_VIDEO_H264_LEVEL_IDC_2_1 = 5, + STD_VIDEO_H264_LEVEL_IDC_2_2 = 6, + STD_VIDEO_H264_LEVEL_IDC_3_0 = 7, + STD_VIDEO_H264_LEVEL_IDC_3_1 = 8, + STD_VIDEO_H264_LEVEL_IDC_3_2 = 9, + STD_VIDEO_H264_LEVEL_IDC_4_0 = 10, + STD_VIDEO_H264_LEVEL_IDC_4_1 = 11, + STD_VIDEO_H264_LEVEL_IDC_4_2 = 12, + STD_VIDEO_H264_LEVEL_IDC_5_0 = 13, + STD_VIDEO_H264_LEVEL_IDC_5_1 = 14, + STD_VIDEO_H264_LEVEL_IDC_5_2 = 15, + STD_VIDEO_H264_LEVEL_IDC_6_0 = 16, + STD_VIDEO_H264_LEVEL_IDC_6_1 = 17, + STD_VIDEO_H264_LEVEL_IDC_6_2 = 18, + STD_VIDEO_H264_LEVEL_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_LEVEL_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264LevelIdc; + +typedef enum StdVideoH264PocType { + STD_VIDEO_H264_POC_TYPE_0 = 0, + STD_VIDEO_H264_POC_TYPE_1 = 1, + STD_VIDEO_H264_POC_TYPE_2 = 2, + STD_VIDEO_H264_POC_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_POC_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264PocType; + +typedef enum StdVideoH264AspectRatioIdc { + STD_VIDEO_H264_ASPECT_RATIO_IDC_UNSPECIFIED = 0, + STD_VIDEO_H264_ASPECT_RATIO_IDC_SQUARE = 1, + STD_VIDEO_H264_ASPECT_RATIO_IDC_12_11 = 2, + STD_VIDEO_H264_ASPECT_RATIO_IDC_10_11 = 3, + STD_VIDEO_H264_ASPECT_RATIO_IDC_16_11 = 4, + STD_VIDEO_H264_ASPECT_RATIO_IDC_40_33 = 5, + STD_VIDEO_H264_ASPECT_RATIO_IDC_24_11 = 6, + STD_VIDEO_H264_ASPECT_RATIO_IDC_20_11 = 7, + STD_VIDEO_H264_ASPECT_RATIO_IDC_32_11 = 8, + STD_VIDEO_H264_ASPECT_RATIO_IDC_80_33 = 9, + STD_VIDEO_H264_ASPECT_RATIO_IDC_18_11 = 10, + STD_VIDEO_H264_ASPECT_RATIO_IDC_15_11 = 11, + STD_VIDEO_H264_ASPECT_RATIO_IDC_64_33 = 12, + STD_VIDEO_H264_ASPECT_RATIO_IDC_160_99 = 13, + STD_VIDEO_H264_ASPECT_RATIO_IDC_4_3 = 14, + STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2 = 15, + STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1 = 16, + STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR = 255, + STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_ASPECT_RATIO_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264AspectRatioIdc; + +typedef enum StdVideoH264WeightedBipredIdc { + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT = 0, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT = 1, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT = 2, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264WeightedBipredIdc; + +typedef enum StdVideoH264ModificationOfPicNumsIdc { + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_SUBTRACT = 0, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD = 1, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM = 2, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END = 3, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264ModificationOfPicNumsIdc; + +typedef enum StdVideoH264MemMgmtControlOp { + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_END = 0, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_SHORT_TERM = 1, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_LONG_TERM = 2, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_LONG_TERM = 3, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX = 4, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL = 5, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM = 6, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264MemMgmtControlOp; + +typedef enum StdVideoH264CabacInitIdc { + STD_VIDEO_H264_CABAC_INIT_IDC_0 = 0, + STD_VIDEO_H264_CABAC_INIT_IDC_1 = 1, + STD_VIDEO_H264_CABAC_INIT_IDC_2 = 2, + STD_VIDEO_H264_CABAC_INIT_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_CABAC_INIT_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264CabacInitIdc; + +typedef enum StdVideoH264DisableDeblockingFilterIdc { + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED = 0, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED = 1, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL = 2, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264DisableDeblockingFilterIdc; + +typedef enum StdVideoH264SliceType { + STD_VIDEO_H264_SLICE_TYPE_P = 0, + STD_VIDEO_H264_SLICE_TYPE_B = 1, + STD_VIDEO_H264_SLICE_TYPE_I = 2, + STD_VIDEO_H264_SLICE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264SliceType; + +typedef enum StdVideoH264PictureType { + STD_VIDEO_H264_PICTURE_TYPE_P = 0, + STD_VIDEO_H264_PICTURE_TYPE_B = 1, + STD_VIDEO_H264_PICTURE_TYPE_I = 2, + STD_VIDEO_H264_PICTURE_TYPE_IDR = 5, + STD_VIDEO_H264_PICTURE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264PictureType; + +typedef enum StdVideoH264NonVclNaluType { + STD_VIDEO_H264_NON_VCL_NALU_TYPE_SPS = 0, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_PPS = 1, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_AUD = 2, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_PREFIX = 3, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE = 4, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM = 5, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED = 6, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264NonVclNaluType; +typedef struct StdVideoH264SpsVuiFlags { + uint32_t aspect_ratio_info_present_flag : 1; + uint32_t overscan_info_present_flag : 1; + uint32_t overscan_appropriate_flag : 1; + uint32_t video_signal_type_present_flag : 1; + uint32_t video_full_range_flag : 1; + uint32_t color_description_present_flag : 1; + uint32_t chroma_loc_info_present_flag : 1; + uint32_t timing_info_present_flag : 1; + uint32_t fixed_frame_rate_flag : 1; + uint32_t bitstream_restriction_flag : 1; + uint32_t nal_hrd_parameters_present_flag : 1; + uint32_t vcl_hrd_parameters_present_flag : 1; +} StdVideoH264SpsVuiFlags; + +typedef struct StdVideoH264HrdParameters { + uint8_t cpb_cnt_minus1; + uint8_t bit_rate_scale; + uint8_t cpb_size_scale; + uint8_t reserved1; + uint32_t bit_rate_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; + uint32_t cpb_size_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; + uint8_t cbr_flag[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; + uint32_t initial_cpb_removal_delay_length_minus1; + uint32_t cpb_removal_delay_length_minus1; + uint32_t dpb_output_delay_length_minus1; + uint32_t time_offset_length; +} StdVideoH264HrdParameters; + +typedef struct StdVideoH264SequenceParameterSetVui { + StdVideoH264SpsVuiFlags flags; + StdVideoH264AspectRatioIdc aspect_ratio_idc; + uint16_t sar_width; + uint16_t sar_height; + uint8_t video_format; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; + uint32_t num_units_in_tick; + uint32_t time_scale; + uint8_t max_num_reorder_frames; + uint8_t max_dec_frame_buffering; + uint8_t chroma_sample_loc_type_top_field; + uint8_t chroma_sample_loc_type_bottom_field; + uint32_t reserved1; + const StdVideoH264HrdParameters* pHrdParameters; +} StdVideoH264SequenceParameterSetVui; + +typedef struct StdVideoH264SpsFlags { + uint32_t constraint_set0_flag : 1; + uint32_t constraint_set1_flag : 1; + uint32_t constraint_set2_flag : 1; + uint32_t constraint_set3_flag : 1; + uint32_t constraint_set4_flag : 1; + uint32_t constraint_set5_flag : 1; + uint32_t direct_8x8_inference_flag : 1; + uint32_t mb_adaptive_frame_field_flag : 1; + uint32_t frame_mbs_only_flag : 1; + uint32_t delta_pic_order_always_zero_flag : 1; + uint32_t separate_colour_plane_flag : 1; + uint32_t gaps_in_frame_num_value_allowed_flag : 1; + uint32_t qpprime_y_zero_transform_bypass_flag : 1; + uint32_t frame_cropping_flag : 1; + uint32_t seq_scaling_matrix_present_flag : 1; + uint32_t vui_parameters_present_flag : 1; +} StdVideoH264SpsFlags; + +typedef struct StdVideoH264ScalingLists { + uint16_t scaling_list_present_mask; + uint16_t use_default_scaling_matrix_mask; + uint8_t ScalingList4x4[STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS]; + uint8_t ScalingList8x8[STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS]; +} StdVideoH264ScalingLists; + +typedef struct StdVideoH264SequenceParameterSet { + StdVideoH264SpsFlags flags; + StdVideoH264ProfileIdc profile_idc; + StdVideoH264LevelIdc level_idc; + StdVideoH264ChromaFormatIdc chroma_format_idc; + uint8_t seq_parameter_set_id; + uint8_t bit_depth_luma_minus8; + uint8_t bit_depth_chroma_minus8; + uint8_t log2_max_frame_num_minus4; + StdVideoH264PocType pic_order_cnt_type; + int32_t offset_for_non_ref_pic; + int32_t offset_for_top_to_bottom_field; + uint8_t log2_max_pic_order_cnt_lsb_minus4; + uint8_t num_ref_frames_in_pic_order_cnt_cycle; + uint8_t max_num_ref_frames; + uint8_t reserved1; + uint32_t pic_width_in_mbs_minus1; + uint32_t pic_height_in_map_units_minus1; + uint32_t frame_crop_left_offset; + uint32_t frame_crop_right_offset; + uint32_t frame_crop_top_offset; + uint32_t frame_crop_bottom_offset; + uint32_t reserved2; + const int32_t* pOffsetForRefFrame; + const StdVideoH264ScalingLists* pScalingLists; + const StdVideoH264SequenceParameterSetVui* pSequenceParameterSetVui; +} StdVideoH264SequenceParameterSet; + +typedef struct StdVideoH264PpsFlags { + uint32_t transform_8x8_mode_flag : 1; + uint32_t redundant_pic_cnt_present_flag : 1; + uint32_t constrained_intra_pred_flag : 1; + uint32_t deblocking_filter_control_present_flag : 1; + uint32_t weighted_pred_flag : 1; + uint32_t bottom_field_pic_order_in_frame_present_flag : 1; + uint32_t entropy_coding_mode_flag : 1; + uint32_t pic_scaling_matrix_present_flag : 1; +} StdVideoH264PpsFlags; + +typedef struct StdVideoH264PictureParameterSet { + StdVideoH264PpsFlags flags; + uint8_t seq_parameter_set_id; + uint8_t pic_parameter_set_id; + uint8_t num_ref_idx_l0_default_active_minus1; + uint8_t num_ref_idx_l1_default_active_minus1; + StdVideoH264WeightedBipredIdc weighted_bipred_idc; + int8_t pic_init_qp_minus26; + int8_t pic_init_qs_minus26; + int8_t chroma_qp_index_offset; + int8_t second_chroma_qp_index_offset; + const StdVideoH264ScalingLists* pScalingLists; +} StdVideoH264PictureParameterSet; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h new file mode 100644 index 000000000..b1e79429d --- /dev/null +++ b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_decode.h @@ -0,0 +1,75 @@ +#ifndef VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ +#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1 + +/* +** Copyright 2015-2022 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define vulkan_video_codec_h264std_decode 1 + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2 +#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 +#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_decode" + +typedef enum StdVideoDecodeH264FieldOrderCount { + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP = 0, + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM = 1, + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID = 0x7FFFFFFF, + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_MAX_ENUM = 0x7FFFFFFF +} StdVideoDecodeH264FieldOrderCount; +typedef struct StdVideoDecodeH264PictureInfoFlags { + uint32_t field_pic_flag : 1; + uint32_t is_intra : 1; + uint32_t IdrPicFlag : 1; + uint32_t bottom_field_flag : 1; + uint32_t is_reference : 1; + uint32_t complementary_field_pair : 1; +} StdVideoDecodeH264PictureInfoFlags; + +typedef struct StdVideoDecodeH264PictureInfo { + StdVideoDecodeH264PictureInfoFlags flags; + uint8_t seq_parameter_set_id; + uint8_t pic_parameter_set_id; + uint8_t reserved1; + uint8_t reserved2; + uint16_t frame_num; + uint16_t idr_pic_id; + int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]; +} StdVideoDecodeH264PictureInfo; + +typedef struct StdVideoDecodeH264ReferenceInfoFlags { + uint32_t top_field_flag : 1; + uint32_t bottom_field_flag : 1; + uint32_t used_for_long_term_reference : 1; + uint32_t is_non_existing : 1; +} StdVideoDecodeH264ReferenceInfoFlags; + +typedef struct StdVideoDecodeH264ReferenceInfo { + StdVideoDecodeH264ReferenceInfoFlags flags; + uint16_t FrameNum; + uint16_t reserved; + int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]; +} StdVideoDecodeH264ReferenceInfo; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h new file mode 100644 index 000000000..7bd96aa7b --- /dev/null +++ b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h264std_encode.h @@ -0,0 +1,132 @@ +#ifndef VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ +#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1 + +/* +** Copyright 2015-2022 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define vulkan_video_codec_h264std_encode 1 +// Vulkan 0.9 provisional Vulkan video H.264 encode std specification version number +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_8 VK_MAKE_VIDEO_STD_VERSION(0, 9, 8) + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_8 +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_encode" +typedef struct StdVideoEncodeH264WeightTableFlags { + uint32_t luma_weight_l0_flag; + uint32_t chroma_weight_l0_flag; + uint32_t luma_weight_l1_flag; + uint32_t chroma_weight_l1_flag; +} StdVideoEncodeH264WeightTableFlags; + +typedef struct StdVideoEncodeH264WeightTable { + StdVideoEncodeH264WeightTableFlags flags; + uint8_t luma_log2_weight_denom; + uint8_t chroma_log2_weight_denom; + int8_t luma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t luma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t chroma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; + int8_t chroma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; + int8_t luma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t luma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t chroma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; + int8_t chroma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; +} StdVideoEncodeH264WeightTable; + +typedef struct StdVideoEncodeH264SliceHeaderFlags { + uint32_t direct_spatial_mv_pred_flag : 1; + uint32_t num_ref_idx_active_override_flag : 1; + uint32_t no_output_of_prior_pics_flag : 1; + uint32_t adaptive_ref_pic_marking_mode_flag : 1; + uint32_t no_prior_references_available_flag : 1; +} StdVideoEncodeH264SliceHeaderFlags; + +typedef struct StdVideoEncodeH264PictureInfoFlags { + uint32_t idr_flag : 1; + uint32_t is_reference_flag : 1; + uint32_t used_for_long_term_reference : 1; +} StdVideoEncodeH264PictureInfoFlags; + +typedef struct StdVideoEncodeH264ReferenceInfoFlags { + uint32_t used_for_long_term_reference : 1; +} StdVideoEncodeH264ReferenceInfoFlags; + +typedef struct StdVideoEncodeH264RefMgmtFlags { + uint32_t ref_pic_list_modification_l0_flag : 1; + uint32_t ref_pic_list_modification_l1_flag : 1; +} StdVideoEncodeH264RefMgmtFlags; + +typedef struct StdVideoEncodeH264RefListModEntry { + StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc; + uint16_t abs_diff_pic_num_minus1; + uint16_t long_term_pic_num; +} StdVideoEncodeH264RefListModEntry; + +typedef struct StdVideoEncodeH264RefPicMarkingEntry { + StdVideoH264MemMgmtControlOp operation; + uint16_t difference_of_pic_nums_minus1; + uint16_t long_term_pic_num; + uint16_t long_term_frame_idx; + uint16_t max_long_term_frame_idx_plus1; +} StdVideoEncodeH264RefPicMarkingEntry; + +typedef struct StdVideoEncodeH264RefMemMgmtCtrlOperations { + StdVideoEncodeH264RefMgmtFlags flags; + uint8_t refList0ModOpCount; + const StdVideoEncodeH264RefListModEntry* pRefList0ModOperations; + uint8_t refList1ModOpCount; + const StdVideoEncodeH264RefListModEntry* pRefList1ModOperations; + uint8_t refPicMarkingOpCount; + const StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations; +} StdVideoEncodeH264RefMemMgmtCtrlOperations; + +typedef struct StdVideoEncodeH264PictureInfo { + StdVideoEncodeH264PictureInfoFlags flags; + uint8_t seq_parameter_set_id; + uint8_t pic_parameter_set_id; + StdVideoH264PictureType pictureType; + uint32_t frame_num; + int32_t PicOrderCnt; +} StdVideoEncodeH264PictureInfo; + +typedef struct StdVideoEncodeH264ReferenceInfo { + StdVideoEncodeH264ReferenceInfoFlags flags; + uint32_t FrameNum; + int32_t PicOrderCnt; + uint16_t long_term_pic_num; + uint16_t long_term_frame_idx; +} StdVideoEncodeH264ReferenceInfo; + +typedef struct StdVideoEncodeH264SliceHeader { + StdVideoEncodeH264SliceHeaderFlags flags; + uint32_t first_mb_in_slice; + StdVideoH264SliceType slice_type; + uint16_t idr_pic_id; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + StdVideoH264CabacInitIdc cabac_init_idc; + StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; + int8_t slice_alpha_c0_offset_div2; + int8_t slice_beta_offset_div2; + const StdVideoEncodeH264WeightTable* pWeightTable; +} StdVideoEncodeH264SliceHeader; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h new file mode 100644 index 000000000..862f8817f --- /dev/null +++ b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std.h @@ -0,0 +1,443 @@ +#ifndef VULKAN_VIDEO_CODEC_H265STD_H_ +#define VULKAN_VIDEO_CODEC_H265STD_H_ 1 + +/* +** Copyright 2015-2022 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define vulkan_video_codec_h265std 1 +#define STD_VIDEO_H265_SUBLAYERS_LIST_SIZE 7 +#define STD_VIDEO_H265_CPB_CNT_LIST_SIZE 32 +#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS 6 +#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS 16 +#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS 6 +#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS 64 +#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS 6 +#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS 64 +#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS 2 +#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS 64 +#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3 +#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128 +#define STD_VIDEO_H265_MAX_DPB_SIZE 16 +#define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32 +#define STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE 6 +#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE 19 +#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE 21 +#define STD_VIDEO_H265_MAX_NUM_LIST_REF 15 +#define STD_VIDEO_H265_MAX_CHROMA_PLANES 2 +#define STD_VIDEO_H265_MAX_SHORT_TERM_REF_PIC_SETS 64 +#define STD_VIDEO_H265_MAX_LONG_TERM_PICS 16 +#define STD_VIDEO_H265_MAX_DELTA_POC 48 + +typedef enum StdVideoH265ChromaFormatIdc { + STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_420 = 1, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_422 = 2, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_444 = 3, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265ChromaFormatIdc; + +typedef enum StdVideoH265ProfileIdc { + STD_VIDEO_H265_PROFILE_IDC_MAIN = 1, + STD_VIDEO_H265_PROFILE_IDC_MAIN_10 = 2, + STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE = 3, + STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS = 4, + STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS = 9, + STD_VIDEO_H265_PROFILE_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265ProfileIdc; + +typedef enum StdVideoH265LevelIdc { + STD_VIDEO_H265_LEVEL_IDC_1_0 = 0, + STD_VIDEO_H265_LEVEL_IDC_2_0 = 1, + STD_VIDEO_H265_LEVEL_IDC_2_1 = 2, + STD_VIDEO_H265_LEVEL_IDC_3_0 = 3, + STD_VIDEO_H265_LEVEL_IDC_3_1 = 4, + STD_VIDEO_H265_LEVEL_IDC_4_0 = 5, + STD_VIDEO_H265_LEVEL_IDC_4_1 = 6, + STD_VIDEO_H265_LEVEL_IDC_5_0 = 7, + STD_VIDEO_H265_LEVEL_IDC_5_1 = 8, + STD_VIDEO_H265_LEVEL_IDC_5_2 = 9, + STD_VIDEO_H265_LEVEL_IDC_6_0 = 10, + STD_VIDEO_H265_LEVEL_IDC_6_1 = 11, + STD_VIDEO_H265_LEVEL_IDC_6_2 = 12, + STD_VIDEO_H265_LEVEL_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_LEVEL_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265LevelIdc; + +typedef enum StdVideoH265SliceType { + STD_VIDEO_H265_SLICE_TYPE_B = 0, + STD_VIDEO_H265_SLICE_TYPE_P = 1, + STD_VIDEO_H265_SLICE_TYPE_I = 2, + STD_VIDEO_H265_SLICE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265SliceType; + +typedef enum StdVideoH265PictureType { + STD_VIDEO_H265_PICTURE_TYPE_P = 0, + STD_VIDEO_H265_PICTURE_TYPE_B = 1, + STD_VIDEO_H265_PICTURE_TYPE_I = 2, + STD_VIDEO_H265_PICTURE_TYPE_IDR = 3, + STD_VIDEO_H265_PICTURE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265PictureType; + +typedef enum StdVideoH265AspectRatioIdc { + STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED = 0, + STD_VIDEO_H265_ASPECT_RATIO_IDC_SQUARE = 1, + STD_VIDEO_H265_ASPECT_RATIO_IDC_12_11 = 2, + STD_VIDEO_H265_ASPECT_RATIO_IDC_10_11 = 3, + STD_VIDEO_H265_ASPECT_RATIO_IDC_16_11 = 4, + STD_VIDEO_H265_ASPECT_RATIO_IDC_40_33 = 5, + STD_VIDEO_H265_ASPECT_RATIO_IDC_24_11 = 6, + STD_VIDEO_H265_ASPECT_RATIO_IDC_20_11 = 7, + STD_VIDEO_H265_ASPECT_RATIO_IDC_32_11 = 8, + STD_VIDEO_H265_ASPECT_RATIO_IDC_80_33 = 9, + STD_VIDEO_H265_ASPECT_RATIO_IDC_18_11 = 10, + STD_VIDEO_H265_ASPECT_RATIO_IDC_15_11 = 11, + STD_VIDEO_H265_ASPECT_RATIO_IDC_64_33 = 12, + STD_VIDEO_H265_ASPECT_RATIO_IDC_160_99 = 13, + STD_VIDEO_H265_ASPECT_RATIO_IDC_4_3 = 14, + STD_VIDEO_H265_ASPECT_RATIO_IDC_3_2 = 15, + STD_VIDEO_H265_ASPECT_RATIO_IDC_2_1 = 16, + STD_VIDEO_H265_ASPECT_RATIO_IDC_EXTENDED_SAR = 255, + STD_VIDEO_H265_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_ASPECT_RATIO_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265AspectRatioIdc; +typedef struct StdVideoH265DecPicBufMgr { + uint32_t max_latency_increase_plus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint8_t max_dec_pic_buffering_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint8_t max_num_reorder_pics[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; +} StdVideoH265DecPicBufMgr; + +typedef struct StdVideoH265SubLayerHrdParameters { + uint32_t bit_rate_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t cpb_size_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t cpb_size_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t bit_rate_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t cbr_flag; +} StdVideoH265SubLayerHrdParameters; + +typedef struct StdVideoH265HrdFlags { + uint32_t nal_hrd_parameters_present_flag : 1; + uint32_t vcl_hrd_parameters_present_flag : 1; + uint32_t sub_pic_hrd_params_present_flag : 1; + uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1; + uint32_t fixed_pic_rate_general_flag : 8; + uint32_t fixed_pic_rate_within_cvs_flag : 8; + uint32_t low_delay_hrd_flag : 8; +} StdVideoH265HrdFlags; + +typedef struct StdVideoH265HrdParameters { + StdVideoH265HrdFlags flags; + uint8_t tick_divisor_minus2; + uint8_t du_cpb_removal_delay_increment_length_minus1; + uint8_t dpb_output_delay_du_length_minus1; + uint8_t bit_rate_scale; + uint8_t cpb_size_scale; + uint8_t cpb_size_du_scale; + uint8_t initial_cpb_removal_delay_length_minus1; + uint8_t au_cpb_removal_delay_length_minus1; + uint8_t dpb_output_delay_length_minus1; + uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint16_t reserved[3]; + const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersNal; + const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersVcl; +} StdVideoH265HrdParameters; + +typedef struct StdVideoH265VpsFlags { + uint32_t vps_temporal_id_nesting_flag : 1; + uint32_t vps_sub_layer_ordering_info_present_flag : 1; + uint32_t vps_timing_info_present_flag : 1; + uint32_t vps_poc_proportional_to_timing_flag : 1; +} StdVideoH265VpsFlags; + +typedef struct StdVideoH265ProfileTierLevelFlags { + uint32_t general_tier_flag : 1; + uint32_t general_progressive_source_flag : 1; + uint32_t general_interlaced_source_flag : 1; + uint32_t general_non_packed_constraint_flag : 1; + uint32_t general_frame_only_constraint_flag : 1; +} StdVideoH265ProfileTierLevelFlags; + +typedef struct StdVideoH265ProfileTierLevel { + StdVideoH265ProfileTierLevelFlags flags; + StdVideoH265ProfileIdc general_profile_idc; + StdVideoH265LevelIdc general_level_idc; +} StdVideoH265ProfileTierLevel; + +typedef struct StdVideoH265VideoParameterSet { + StdVideoH265VpsFlags flags; + uint8_t vps_video_parameter_set_id; + uint8_t vps_max_sub_layers_minus1; + uint8_t reserved1; + uint8_t reserved2; + uint32_t vps_num_units_in_tick; + uint32_t vps_time_scale; + uint32_t vps_num_ticks_poc_diff_one_minus1; + uint32_t reserved3; + const StdVideoH265DecPicBufMgr* pDecPicBufMgr; + const StdVideoH265HrdParameters* pHrdParameters; + const StdVideoH265ProfileTierLevel* pProfileTierLevel; +} StdVideoH265VideoParameterSet; + +typedef struct StdVideoH265ScalingLists { + uint8_t ScalingList4x4[STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS]; + uint8_t ScalingList8x8[STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS]; + uint8_t ScalingList16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS]; + uint8_t ScalingList32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS]; + uint8_t ScalingListDCCoef16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS]; + uint8_t ScalingListDCCoef32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS]; +} StdVideoH265ScalingLists; + +typedef struct StdVideoH265SpsVuiFlags { + uint32_t aspect_ratio_info_present_flag : 1; + uint32_t overscan_info_present_flag : 1; + uint32_t overscan_appropriate_flag : 1; + uint32_t video_signal_type_present_flag : 1; + uint32_t video_full_range_flag : 1; + uint32_t colour_description_present_flag : 1; + uint32_t chroma_loc_info_present_flag : 1; + uint32_t neutral_chroma_indication_flag : 1; + uint32_t field_seq_flag : 1; + uint32_t frame_field_info_present_flag : 1; + uint32_t default_display_window_flag : 1; + uint32_t vui_timing_info_present_flag : 1; + uint32_t vui_poc_proportional_to_timing_flag : 1; + uint32_t vui_hrd_parameters_present_flag : 1; + uint32_t bitstream_restriction_flag : 1; + uint32_t tiles_fixed_structure_flag : 1; + uint32_t motion_vectors_over_pic_boundaries_flag : 1; + uint32_t restricted_ref_pic_lists_flag : 1; +} StdVideoH265SpsVuiFlags; + +typedef struct StdVideoH265SequenceParameterSetVui { + StdVideoH265SpsVuiFlags flags; + StdVideoH265AspectRatioIdc aspect_ratio_idc; + uint16_t sar_width; + uint16_t sar_height; + uint8_t video_format; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coeffs; + uint8_t chroma_sample_loc_type_top_field; + uint8_t chroma_sample_loc_type_bottom_field; + uint8_t reserved1; + uint8_t reserved2; + uint16_t def_disp_win_left_offset; + uint16_t def_disp_win_right_offset; + uint16_t def_disp_win_top_offset; + uint16_t def_disp_win_bottom_offset; + uint32_t vui_num_units_in_tick; + uint32_t vui_time_scale; + uint32_t vui_num_ticks_poc_diff_one_minus1; + uint16_t min_spatial_segmentation_idc; + uint16_t reserved3; + uint8_t max_bytes_per_pic_denom; + uint8_t max_bits_per_min_cu_denom; + uint8_t log2_max_mv_length_horizontal; + uint8_t log2_max_mv_length_vertical; + const StdVideoH265HrdParameters* pHrdParameters; +} StdVideoH265SequenceParameterSetVui; + +typedef struct StdVideoH265PredictorPaletteEntries { + uint16_t PredictorPaletteEntries[STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE][STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE]; +} StdVideoH265PredictorPaletteEntries; + +typedef struct StdVideoH265SpsFlags { + uint32_t sps_temporal_id_nesting_flag : 1; + uint32_t separate_colour_plane_flag : 1; + uint32_t conformance_window_flag : 1; + uint32_t sps_sub_layer_ordering_info_present_flag : 1; + uint32_t scaling_list_enabled_flag : 1; + uint32_t sps_scaling_list_data_present_flag : 1; + uint32_t amp_enabled_flag : 1; + uint32_t sample_adaptive_offset_enabled_flag : 1; + uint32_t pcm_enabled_flag : 1; + uint32_t pcm_loop_filter_disabled_flag : 1; + uint32_t long_term_ref_pics_present_flag : 1; + uint32_t sps_temporal_mvp_enabled_flag : 1; + uint32_t strong_intra_smoothing_enabled_flag : 1; + uint32_t vui_parameters_present_flag : 1; + uint32_t sps_extension_present_flag : 1; + uint32_t sps_range_extension_flag : 1; + uint32_t transform_skip_rotation_enabled_flag : 1; + uint32_t transform_skip_context_enabled_flag : 1; + uint32_t implicit_rdpcm_enabled_flag : 1; + uint32_t explicit_rdpcm_enabled_flag : 1; + uint32_t extended_precision_processing_flag : 1; + uint32_t intra_smoothing_disabled_flag : 1; + uint32_t high_precision_offsets_enabled_flag : 1; + uint32_t persistent_rice_adaptation_enabled_flag : 1; + uint32_t cabac_bypass_alignment_enabled_flag : 1; + uint32_t sps_scc_extension_flag : 1; + uint32_t sps_curr_pic_ref_enabled_flag : 1; + uint32_t palette_mode_enabled_flag : 1; + uint32_t sps_palette_predictor_initializers_present_flag : 1; + uint32_t intra_boundary_filtering_disabled_flag : 1; +} StdVideoH265SpsFlags; + +typedef struct StdVideoH265ShortTermRefPicSetFlags { + uint32_t inter_ref_pic_set_prediction_flag : 1; + uint32_t delta_rps_sign : 1; +} StdVideoH265ShortTermRefPicSetFlags; + +typedef struct StdVideoH265ShortTermRefPicSet { + StdVideoH265ShortTermRefPicSetFlags flags; + uint32_t delta_idx_minus1; + uint16_t use_delta_flag; + uint16_t abs_delta_rps_minus1; + uint16_t used_by_curr_pic_flag; + uint16_t used_by_curr_pic_s0_flag; + uint16_t used_by_curr_pic_s1_flag; + uint16_t reserved1; + uint8_t reserved2; + uint8_t reserved3; + uint8_t num_negative_pics; + uint8_t num_positive_pics; + uint16_t delta_poc_s0_minus1[STD_VIDEO_H265_MAX_DPB_SIZE]; + uint16_t delta_poc_s1_minus1[STD_VIDEO_H265_MAX_DPB_SIZE]; +} StdVideoH265ShortTermRefPicSet; + +typedef struct StdVideoH265LongTermRefPicsSps { + uint32_t used_by_curr_pic_lt_sps_flag; + uint32_t lt_ref_pic_poc_lsb_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; +} StdVideoH265LongTermRefPicsSps; + +typedef struct StdVideoH265SequenceParameterSet { + StdVideoH265SpsFlags flags; + StdVideoH265ChromaFormatIdc chroma_format_idc; + uint32_t pic_width_in_luma_samples; + uint32_t pic_height_in_luma_samples; + uint8_t sps_video_parameter_set_id; + uint8_t sps_max_sub_layers_minus1; + uint8_t sps_seq_parameter_set_id; + uint8_t bit_depth_luma_minus8; + uint8_t bit_depth_chroma_minus8; + uint8_t log2_max_pic_order_cnt_lsb_minus4; + uint8_t log2_min_luma_coding_block_size_minus3; + uint8_t log2_diff_max_min_luma_coding_block_size; + uint8_t log2_min_luma_transform_block_size_minus2; + uint8_t log2_diff_max_min_luma_transform_block_size; + uint8_t max_transform_hierarchy_depth_inter; + uint8_t max_transform_hierarchy_depth_intra; + uint8_t num_short_term_ref_pic_sets; + uint8_t num_long_term_ref_pics_sps; + uint8_t pcm_sample_bit_depth_luma_minus1; + uint8_t pcm_sample_bit_depth_chroma_minus1; + uint8_t log2_min_pcm_luma_coding_block_size_minus3; + uint8_t log2_diff_max_min_pcm_luma_coding_block_size; + uint8_t reserved1; + uint8_t reserved2; + uint8_t palette_max_size; + uint8_t delta_palette_max_predictor_size; + uint8_t motion_vector_resolution_control_idc; + uint8_t sps_num_palette_predictor_initializers_minus1; + uint32_t conf_win_left_offset; + uint32_t conf_win_right_offset; + uint32_t conf_win_top_offset; + uint32_t conf_win_bottom_offset; + const StdVideoH265ProfileTierLevel* pProfileTierLevel; + const StdVideoH265DecPicBufMgr* pDecPicBufMgr; + const StdVideoH265ScalingLists* pScalingLists; + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; + const StdVideoH265LongTermRefPicsSps* pLongTermRefPicsSps; + const StdVideoH265SequenceParameterSetVui* pSequenceParameterSetVui; + const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; +} StdVideoH265SequenceParameterSet; + +typedef struct StdVideoH265PpsFlags { + uint32_t dependent_slice_segments_enabled_flag : 1; + uint32_t output_flag_present_flag : 1; + uint32_t sign_data_hiding_enabled_flag : 1; + uint32_t cabac_init_present_flag : 1; + uint32_t constrained_intra_pred_flag : 1; + uint32_t transform_skip_enabled_flag : 1; + uint32_t cu_qp_delta_enabled_flag : 1; + uint32_t pps_slice_chroma_qp_offsets_present_flag : 1; + uint32_t weighted_pred_flag : 1; + uint32_t weighted_bipred_flag : 1; + uint32_t transquant_bypass_enabled_flag : 1; + uint32_t tiles_enabled_flag : 1; + uint32_t entropy_coding_sync_enabled_flag : 1; + uint32_t uniform_spacing_flag : 1; + uint32_t loop_filter_across_tiles_enabled_flag : 1; + uint32_t pps_loop_filter_across_slices_enabled_flag : 1; + uint32_t deblocking_filter_control_present_flag : 1; + uint32_t deblocking_filter_override_enabled_flag : 1; + uint32_t pps_deblocking_filter_disabled_flag : 1; + uint32_t pps_scaling_list_data_present_flag : 1; + uint32_t lists_modification_present_flag : 1; + uint32_t slice_segment_header_extension_present_flag : 1; + uint32_t pps_extension_present_flag : 1; + uint32_t cross_component_prediction_enabled_flag : 1; + uint32_t chroma_qp_offset_list_enabled_flag : 1; + uint32_t pps_curr_pic_ref_enabled_flag : 1; + uint32_t residual_adaptive_colour_transform_enabled_flag : 1; + uint32_t pps_slice_act_qp_offsets_present_flag : 1; + uint32_t pps_palette_predictor_initializers_present_flag : 1; + uint32_t monochrome_palette_flag : 1; + uint32_t pps_range_extension_flag : 1; +} StdVideoH265PpsFlags; + +typedef struct StdVideoH265PictureParameterSet { + StdVideoH265PpsFlags flags; + uint8_t pps_pic_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t sps_video_parameter_set_id; + uint8_t num_extra_slice_header_bits; + uint8_t num_ref_idx_l0_default_active_minus1; + uint8_t num_ref_idx_l1_default_active_minus1; + int8_t init_qp_minus26; + uint8_t diff_cu_qp_delta_depth; + int8_t pps_cb_qp_offset; + int8_t pps_cr_qp_offset; + int8_t pps_beta_offset_div2; + int8_t pps_tc_offset_div2; + uint8_t log2_parallel_merge_level_minus2; + uint8_t log2_max_transform_skip_block_size_minus2; + uint8_t diff_cu_chroma_qp_offset_depth; + uint8_t chroma_qp_offset_list_len_minus1; + int8_t cb_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; + int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; + uint8_t log2_sao_offset_scale_luma; + uint8_t log2_sao_offset_scale_chroma; + int8_t pps_act_y_qp_offset_plus5; + int8_t pps_act_cb_qp_offset_plus5; + int8_t pps_act_cr_qp_offset_plus3; + uint8_t pps_num_palette_predictor_initializers; + uint8_t luma_bit_depth_entry_minus8; + uint8_t chroma_bit_depth_entry_minus8; + uint8_t num_tile_columns_minus1; + uint8_t num_tile_rows_minus1; + uint8_t reserved1; + uint8_t reserved2; + uint16_t column_width_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE]; + uint16_t row_height_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE]; + uint32_t reserved3; + const StdVideoH265ScalingLists* pScalingLists; + const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; +} StdVideoH265PictureParameterSet; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h new file mode 100644 index 000000000..d8660d12e --- /dev/null +++ b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_decode.h @@ -0,0 +1,65 @@ +#ifndef VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ +#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1 + +/* +** Copyright 2015-2022 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define vulkan_video_codec_h265std_decode 1 + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8 +#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 +#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_decode" +typedef struct StdVideoDecodeH265PictureInfoFlags { + uint32_t IrapPicFlag : 1; + uint32_t IdrPicFlag : 1; + uint32_t IsReference : 1; + uint32_t short_term_ref_pic_set_sps_flag : 1; +} StdVideoDecodeH265PictureInfoFlags; + +typedef struct StdVideoDecodeH265PictureInfo { + StdVideoDecodeH265PictureInfoFlags flags; + uint8_t sps_video_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t pps_pic_parameter_set_id; + uint8_t NumDeltaPocsOfRefRpsIdx; + int32_t PicOrderCntVal; + uint16_t NumBitsForSTRefPicSetInSlice; + uint16_t reserved; + uint8_t RefPicSetStCurrBefore[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; + uint8_t RefPicSetStCurrAfter[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; + uint8_t RefPicSetLtCurr[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; +} StdVideoDecodeH265PictureInfo; + +typedef struct StdVideoDecodeH265ReferenceInfoFlags { + uint32_t used_for_long_term_reference : 1; + uint32_t unused_for_reference : 1; +} StdVideoDecodeH265ReferenceInfoFlags; + +typedef struct StdVideoDecodeH265ReferenceInfo { + StdVideoDecodeH265ReferenceInfoFlags flags; + int32_t PicOrderCntVal; +} StdVideoDecodeH265ReferenceInfo; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h new file mode 100644 index 000000000..5a419b14b --- /dev/null +++ b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codec_h265std_encode.h @@ -0,0 +1,146 @@ +#ifndef VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ +#define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1 + +/* +** Copyright 2015-2022 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define vulkan_video_codec_h265std_encode 1 +// Vulkan 0.9 provisional Vulkan video H.265 encode std specification version number +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_9 VK_MAKE_VIDEO_STD_VERSION(0, 9, 9) + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_9 +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_encode" +typedef struct StdVideoEncodeH265WeightTableFlags { + uint16_t luma_weight_l0_flag; + uint16_t chroma_weight_l0_flag; + uint16_t luma_weight_l1_flag; + uint16_t chroma_weight_l1_flag; +} StdVideoEncodeH265WeightTableFlags; + +typedef struct StdVideoEncodeH265WeightTable { + StdVideoEncodeH265WeightTableFlags flags; + uint8_t luma_log2_weight_denom; + int8_t delta_chroma_log2_weight_denom; + int8_t delta_luma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t luma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t delta_chroma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; + int8_t delta_chroma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; + int8_t delta_luma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t luma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t delta_chroma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; + int8_t delta_chroma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; +} StdVideoEncodeH265WeightTable; + +typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags { + uint32_t first_slice_segment_in_pic_flag : 1; + uint32_t no_output_of_prior_pics_flag : 1; + uint32_t dependent_slice_segment_flag : 1; + uint32_t pic_output_flag : 1; + uint32_t short_term_ref_pic_set_sps_flag : 1; + uint32_t slice_temporal_mvp_enable_flag : 1; + uint32_t slice_sao_luma_flag : 1; + uint32_t slice_sao_chroma_flag : 1; + uint32_t num_ref_idx_active_override_flag : 1; + uint32_t mvd_l1_zero_flag : 1; + uint32_t cabac_init_flag : 1; + uint32_t cu_chroma_qp_offset_enabled_flag : 1; + uint32_t deblocking_filter_override_flag : 1; + uint32_t slice_deblocking_filter_disabled_flag : 1; + uint32_t collocated_from_l0_flag : 1; + uint32_t slice_loop_filter_across_slices_enabled_flag : 1; +} StdVideoEncodeH265SliceSegmentHeaderFlags; + +typedef struct StdVideoEncodeH265SliceSegmentLongTermRefPics { + uint8_t num_long_term_sps; + uint8_t num_long_term_pics; + uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; + uint8_t poc_lsb_lt[STD_VIDEO_H265_MAX_LONG_TERM_PICS]; + uint16_t used_by_curr_pic_lt_flag; + uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC]; + uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC]; +} StdVideoEncodeH265SliceSegmentLongTermRefPics; + +typedef struct StdVideoEncodeH265SliceSegmentHeader { + StdVideoEncodeH265SliceSegmentHeaderFlags flags; + StdVideoH265SliceType slice_type; + uint32_t slice_segment_address; + uint8_t short_term_ref_pic_set_idx; + uint8_t collocated_ref_idx; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + uint8_t MaxNumMergeCand; + int8_t slice_cb_qp_offset; + int8_t slice_cr_qp_offset; + int8_t slice_beta_offset_div2; + int8_t slice_tc_offset_div2; + int8_t slice_act_y_qp_offset; + int8_t slice_act_cb_qp_offset; + int8_t slice_act_cr_qp_offset; + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; + const StdVideoEncodeH265SliceSegmentLongTermRefPics* pLongTermRefPics; + const StdVideoEncodeH265WeightTable* pWeightTable; +} StdVideoEncodeH265SliceSegmentHeader; + +typedef struct StdVideoEncodeH265ReferenceModificationFlags { + uint32_t ref_pic_list_modification_flag_l0 : 1; + uint32_t ref_pic_list_modification_flag_l1 : 1; +} StdVideoEncodeH265ReferenceModificationFlags; + +typedef struct StdVideoEncodeH265ReferenceModifications { + StdVideoEncodeH265ReferenceModificationFlags flags; + uint8_t referenceList0ModificationsCount; + const uint8_t* pReferenceList0Modifications; + uint8_t referenceList1ModificationsCount; + const uint8_t* pReferenceList1Modifications; +} StdVideoEncodeH265ReferenceModifications; + +typedef struct StdVideoEncodeH265PictureInfoFlags { + uint32_t is_reference_flag : 1; + uint32_t IrapPicFlag : 1; + uint32_t long_term_flag : 1; + uint32_t discardable_flag : 1; + uint32_t cross_layer_bla_flag : 1; +} StdVideoEncodeH265PictureInfoFlags; + +typedef struct StdVideoEncodeH265PictureInfo { + StdVideoEncodeH265PictureInfoFlags flags; + StdVideoH265PictureType PictureType; + uint8_t sps_video_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t pps_pic_parameter_set_id; + int32_t PicOrderCntVal; + uint8_t TemporalId; +} StdVideoEncodeH265PictureInfo; + +typedef struct StdVideoEncodeH265ReferenceInfoFlags { + uint32_t used_for_long_term_reference : 1; + uint32_t unused_for_reference : 1; +} StdVideoEncodeH265ReferenceInfoFlags; + +typedef struct StdVideoEncodeH265ReferenceInfo { + StdVideoEncodeH265ReferenceInfoFlags flags; + int32_t PicOrderCntVal; + uint8_t TemporalId; +} StdVideoEncodeH265ReferenceInfo; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h new file mode 100644 index 000000000..1e498265e --- /dev/null +++ b/3rdparty/khronos/vulkan-local/vk_video/vulkan_video_codecs_common.h @@ -0,0 +1,31 @@ +#ifndef VULKAN_VIDEO_CODECS_COMMON_H_ +#define VULKAN_VIDEO_CODECS_COMMON_H_ 1 + +/* +** Copyright 2015-2022 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define vulkan_video_codecs_common 1 +#define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/khronos/vulkan-local/vulkan_core.h b/3rdparty/khronos/vulkan-local/vulkan_core.h index b2da59953..e8fe54828 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_core.h +++ b/3rdparty/khronos/vulkan-local/vulkan_core.h @@ -72,7 +72,7 @@ extern "C" { #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 238 +#define VK_HEADER_VERSION 240 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) @@ -946,6 +946,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT = 1000396007, VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT = 1000396008, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT = 1000396009, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI = 1000404000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI = 1000404001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = 1000411001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = 1000412000, @@ -999,6 +1001,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT = 1000351002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, @@ -2352,6 +2355,7 @@ typedef enum VkQueryPipelineStatisticFlagBits { VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, VK_QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT = 0x00000800, VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT = 0x00001000, + VK_QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI = 0x00002000, VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkQueryPipelineStatisticFlagBits; typedef VkFlags VkQueryPipelineStatisticFlags; @@ -2512,6 +2516,7 @@ typedef enum VkShaderStageFlagBits { VK_SHADER_STAGE_TASK_BIT_EXT = 0x00000040, VK_SHADER_STAGE_MESH_BIT_EXT = 0x00000080, VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI = 0x00004000, + VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI = 0x00080000, VK_SHADER_STAGE_RAYGEN_BIT_NV = VK_SHADER_STAGE_RAYGEN_BIT_KHR, VK_SHADER_STAGE_ANY_HIT_BIT_NV = VK_SHADER_STAGE_ANY_HIT_BIT_KHR, VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV = VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR, @@ -5641,6 +5646,7 @@ typedef enum VkDriverId { VK_DRIVER_ID_MESA_VENUS = 22, VK_DRIVER_ID_MESA_DOZEN = 23, VK_DRIVER_ID_MESA_NVK = 24, + VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, VK_DRIVER_ID_AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY, VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE, VK_DRIVER_ID_MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV, @@ -6475,6 +6481,7 @@ static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HU static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0x10000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR = 0x10000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT = 0x40000000ULL; +static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI = 0x20000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV = 0x20000000ULL; typedef VkFlags64 VkAccessFlags2; @@ -8175,6 +8182,66 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDecodeVideoKHR( #endif +#define VK_KHR_video_decode_h264 1 +#include "vk_video/vulkan_video_codec_h264std.h" +#include "vk_video/vulkan_video_codec_h264std_decode.h" +#define VK_KHR_VIDEO_DECODE_H264_SPEC_VERSION 8 +#define VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME "VK_KHR_video_decode_h264" + +typedef enum VkVideoDecodeH264PictureLayoutFlagBitsKHR { + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR = 0, + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR = 0x00000001, + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR = 0x00000002, + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoDecodeH264PictureLayoutFlagBitsKHR; +typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsKHR; +typedef struct VkVideoDecodeH264ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH264ProfileIdc stdProfileIdc; + VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout; +} VkVideoDecodeH264ProfileInfoKHR; + +typedef struct VkVideoDecodeH264CapabilitiesKHR { + VkStructureType sType; + void* pNext; + StdVideoH264LevelIdc maxLevelIdc; + VkOffset2D fieldOffsetGranularity; +} VkVideoDecodeH264CapabilitiesKHR; + +typedef struct VkVideoDecodeH264SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdSPSCount; + const StdVideoH264SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH264PictureParameterSet* pStdPPSs; +} VkVideoDecodeH264SessionParametersAddInfoKHR; + +typedef struct VkVideoDecodeH264SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoDecodeH264SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoDecodeH264SessionParametersCreateInfoKHR; + +typedef struct VkVideoDecodeH264PictureInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH264PictureInfo* pStdPictureInfo; + uint32_t sliceCount; + const uint32_t* pSliceOffsets; +} VkVideoDecodeH264PictureInfoKHR; + +typedef struct VkVideoDecodeH264DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH264ReferenceInfo* pStdReferenceInfo; +} VkVideoDecodeH264DpbSlotInfoKHR; + + + #define VK_KHR_dynamic_rendering 1 #define VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION 1 #define VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME "VK_KHR_dynamic_rendering" @@ -9288,6 +9355,59 @@ typedef struct VkPhysicalDeviceShaderClockFeaturesKHR { +#define VK_KHR_video_decode_h265 1 +#include "vk_video/vulkan_video_codec_h265std.h" +#include "vk_video/vulkan_video_codec_h265std_decode.h" +#define VK_KHR_VIDEO_DECODE_H265_SPEC_VERSION 7 +#define VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME "VK_KHR_video_decode_h265" +typedef struct VkVideoDecodeH265ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH265ProfileIdc stdProfileIdc; +} VkVideoDecodeH265ProfileInfoKHR; + +typedef struct VkVideoDecodeH265CapabilitiesKHR { + VkStructureType sType; + void* pNext; + StdVideoH265LevelIdc maxLevelIdc; +} VkVideoDecodeH265CapabilitiesKHR; + +typedef struct VkVideoDecodeH265SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdVPSCount; + const StdVideoH265VideoParameterSet* pStdVPSs; + uint32_t stdSPSCount; + const StdVideoH265SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH265PictureParameterSet* pStdPPSs; +} VkVideoDecodeH265SessionParametersAddInfoKHR; + +typedef struct VkVideoDecodeH265SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdVPSCount; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoDecodeH265SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoDecodeH265SessionParametersCreateInfoKHR; + +typedef struct VkVideoDecodeH265PictureInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoDecodeH265PictureInfo* pStdPictureInfo; + uint32_t sliceSegmentCount; + const uint32_t* pSliceSegmentOffsets; +} VkVideoDecodeH265PictureInfoKHR; + +typedef struct VkVideoDecodeH265DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH265ReferenceInfo* pStdReferenceInfo; +} VkVideoDecodeH265DpbSlotInfoKHR; + + + #define VK_KHR_global_priority 1 #define VK_MAX_GLOBAL_PRIORITY_SIZE_KHR 16U #define VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION 1 @@ -15303,6 +15423,41 @@ VKAPI_ATTR void VKAPI_CALL vkGetMicromapBuildSizesEXT( #define VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_EXT_load_store_op_none" +#define VK_HUAWEI_cluster_culling_shader 1 +#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 1 +#define VK_HUAWEI_CLUSTER_CULLING_SHADER_EXTENSION_NAME "VK_HUAWEI_cluster_culling_shader" +typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI { + VkStructureType sType; + void* pNext; + VkBool32 clustercullingShader; + VkBool32 multiviewClusterCullingShader; +} VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI; + +typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI { + VkStructureType sType; + void* pNext; + uint32_t maxWorkGroupCount[3]; + uint32_t maxWorkGroupSize[3]; + uint32_t maxOutputClusterCount; +} VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI; + +typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterHUAWEI)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterIndirectHUAWEI)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDrawClusterHUAWEI( + VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawClusterIndirectHUAWEI( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset); +#endif + + #define VK_EXT_border_color_swizzle 1 #define VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION 1 #define VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME "VK_EXT_border_color_swizzle" @@ -16248,6 +16403,17 @@ typedef struct VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM { +#define VK_EXT_pipeline_library_group_handles 1 +#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_SPEC_VERSION 1 +#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_EXTENSION_NAME "VK_EXT_pipeline_library_group_handles" +typedef struct VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 pipelineLibraryGroupHandles; +} VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT; + + + #define VK_KHR_acceleration_structure 1 #define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 #define VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME "VK_KHR_acceleration_structure" From 4f878bf473e91e373046fe38871325cd8c992b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 13 Feb 2023 19:59:31 -0800 Subject: [PATCH 34/86] Updated version number. --- bindings/bf/bgfx.bf | 2 +- bindings/cs/bgfx.cs | 2 +- bindings/cs/bgfx_dllname.cs | 2 +- bindings/zig/bgfx.zig | 2 +- src/version.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bindings/bf/bgfx.bf b/bindings/bf/bgfx.bf index 71d5e2556..609f2fe77 100644 --- a/bindings/bf/bgfx.bf +++ b/bindings/bf/bgfx.bf @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs index 24a2a17e1..ba5ab70d1 100644 --- a/bindings/cs/bgfx.cs +++ b/bindings/cs/bgfx.cs @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bindings/cs/bgfx_dllname.cs b/bindings/cs/bgfx_dllname.cs index 54bb7ceca..32418ce4a 100644 --- a/bindings/cs/bgfx_dllname.cs +++ b/bindings/cs/bgfx_dllname.cs @@ -1,5 +1,5 @@ /* - * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * Copyright 2011-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ diff --git a/bindings/zig/bgfx.zig b/bindings/zig/bgfx.zig index 612647d77..465fa5027 100644 --- a/bindings/zig/bgfx.zig +++ b/bindings/zig/bgfx.zig @@ -1,4 +1,4 @@ -// Copyright 2011-2022 Branimir Karadzic. All rights reserved. +// Copyright 2011-2023 Branimir Karadzic. All rights reserved. // License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE diff --git a/src/version.h b/src/version.h index 3b3f87df8..4f2407d61 100644 --- a/src/version.h +++ b/src/version.h @@ -9,5 +9,5 @@ * */ -#define BGFX_REV_NUMBER 8381 -#define BGFX_REV_SHA1 "988565aa983beb0b329ded834cd09f6a198b41e0" +#define BGFX_REV_NUMBER 8427 +#define BGFX_REV_SHA1 "dcf926f624b9642769f8486e789ec26c74e34f4b" From 9d5b980f5c060e54cc30dec18500a5b54db00405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 15 Feb 2023 21:54:54 -0800 Subject: [PATCH 35/86] Cleanup. --- src/renderer_mtl.mm | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 2317c16d6..5fc2e3c5b 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -1273,38 +1273,40 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa renderPassDescriptor.colorAttachments[0].loadAction = MTLLoadActionLoad; renderPassDescriptor.colorAttachments[0].storeAction = - NULL != renderPassDescriptor.colorAttachments[0].resolveTexture - ? MTLStoreActionMultisampleResolve - : MTLStoreActionStore - ; + NULL != renderPassDescriptor.colorAttachments[0].resolveTexture + ? MTLStoreActionMultisampleResolve + : MTLStoreActionStore + ; RenderCommandEncoder rce = m_commandBuffer.renderCommandEncoderWithDescriptor(renderPassDescriptor); m_renderCommandEncoder = rce; m_renderCommandEncoderFrameBufferHandle = fbh; MTL_RELEASE(renderPassDescriptor); - MTLViewport viewport = { 0.0f, 0.0f, (float)width, (float)height, 0.0f, 1.0f}; + MTLViewport viewport = { 0.0f, 0.0f, (float)width, (float)height, 0.0f, 1.0f }; rce.setViewport(viewport); - MTLScissorRect rc = { 0,0,width,height }; + + MTLScissorRect rc = { 0, 0, width, height }; rce.setScissorRect(rc); + rce.setCullMode(MTLCullModeNone); uint64_t state = 0 - | BGFX_STATE_WRITE_RGB - | BGFX_STATE_WRITE_A - | BGFX_STATE_DEPTH_TEST_ALWAYS - ; + | BGFX_STATE_WRITE_RGB + | BGFX_STATE_WRITE_A + | BGFX_STATE_DEPTH_TEST_ALWAYS + ; setDepthStencilState(state); PipelineStateMtl* pso = getPipelineState( - state - , 0 - , fbh - , _blitter.m_vb->layoutHandle - , _blitter.m_program - , 0 - ); + state + , 0 + , fbh + , _blitter.m_vb->layoutHandle + , _blitter.m_program + , 0 + ); rce.setRenderPipelineState(pso->m_rps); const uint32_t vertexUniformBufferSize = pso->m_vshConstantBufferSize; @@ -1891,6 +1893,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa uint32_t hash = murmur.end(); DepthStencilState dss = m_depthStencilStateCache.find(hash); + if (NULL == dss) { DepthStencilDescriptor desc = m_depthStencilDescriptor; From caa637dbd5d6a532ff3a7ea66d6eb98043d26810 Mon Sep 17 00:00:00 2001 From: Francis Hart Date: Mon, 27 Feb 2023 17:10:53 +0200 Subject: [PATCH 36/86] Expose nvgCreateBgfxTexture() helper function (#3046) The nvgCreateBgfxTexture() helper function is already implemented in the nanovg wrapper library, so its useful to expose this function to the user. Also expose the NVG_IMAGE_NODELETE flag so this can be passed to the nvgCreateBgfxTexture() function, to indicate that the caller retains ownership of the bgfx texture. --- examples/common/nanovg/nanovg_bgfx.cpp | 5 ----- examples/common/nanovg/nanovg_bgfx.h | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/common/nanovg/nanovg_bgfx.cpp b/examples/common/nanovg/nanovg_bgfx.cpp index 8eeb8570a..c7626f949 100644 --- a/examples/common/nanovg/nanovg_bgfx.cpp +++ b/examples/common/nanovg/nanovg_bgfx.cpp @@ -58,11 +58,6 @@ namespace NSVG_SHADER_IMG }; - // These are additional flags on top of NVGimageFlags. - enum NVGimageFlagsGL { - NVG_IMAGE_NODELETE = 1<<16, // Do not delete GL texture handle. - }; - struct GLNVGtexture { bgfx::TextureHandle id; diff --git a/examples/common/nanovg/nanovg_bgfx.h b/examples/common/nanovg/nanovg_bgfx.h index 78257930a..a0beb9261 100644 --- a/examples/common/nanovg/nanovg_bgfx.h +++ b/examples/common/nanovg/nanovg_bgfx.h @@ -20,6 +20,11 @@ struct NVGLUframebuffer bgfx::ViewId viewId; }; +// These are additional flags on top of NVGimageFlags. +enum NVGimageFlagsGL { + NVG_IMAGE_NODELETE = 1<<16, // Do not delete GL texture handle. +}; + /// NVGcontext* nvgCreate(int32_t _edgeaa, bgfx::ViewId _viewId, bx::AllocatorI* _allocator); @@ -76,4 +81,7 @@ void nvgluDeleteFramebuffer(NVGLUframebuffer* _framebuffer); /// void nvgluSetViewFramebuffer(bgfx::ViewId _viewId, NVGLUframebuffer* _framebuffer); +/// +int nvgCreateBgfxTexture(struct NVGcontext *_ctx, bgfx::TextureHandle _id, int _width, int _height, int _flags); + #endif // NANOVG_BGFX_H_HEADER_GUARD From 403c4da2e0723670d7c0261a10bd636d2346404d Mon Sep 17 00:00:00 2001 From: Francis Hart Date: Tue, 28 Feb 2023 04:33:29 +0200 Subject: [PATCH 37/86] Fix compiler warnings for nanovg wrapper (#3048) * Fix compiler warnings for nanovg wrapper Code for the nanovg wrapper was generating compiler warnings for implicit casts from int32_t to uint16_t. These casts are unavoidable due to how bgfx and nanovg APIs use different types for texture width/height. * Fix compiler warning from nanovg fontstash.h This fixes some warnings for signed/unsigned comparsion coming from the nanovg fontstash.h header. --- examples/common/nanovg/fontstash.h | 2 +- examples/common/nanovg/nanovg_bgfx.cpp | 38 +++++++++++++++++--------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/examples/common/nanovg/fontstash.h b/examples/common/nanovg/fontstash.h index 7285d7e04..39a48fb90 100644 --- a/examples/common/nanovg/fontstash.h +++ b/examples/common/nanovg/fontstash.h @@ -231,7 +231,7 @@ void fons__tt_renderGlyphBitmap(FONSttFontImpl *font, unsigned char *output, int { FT_GlyphSlot ftGlyph = font->font->glyph; int ftGlyphOffset = 0; - int x, y; + unsigned int x, y; FONS_NOTUSED(outWidth); FONS_NOTUSED(outHeight); FONS_NOTUSED(scaleX); diff --git a/examples/common/nanovg/nanovg_bgfx.cpp b/examples/common/nanovg/nanovg_bgfx.cpp index c7626f949..b87eea013 100644 --- a/examples/common/nanovg/nanovg_bgfx.cpp +++ b/examples/common/nanovg/nanovg_bgfx.cpp @@ -320,9 +320,12 @@ namespace mem = bgfx::copy(_rgba, tex->height * pitch); } + BX_ASSERT(tex->width >= 0 && tex->width <= bx::max(), "Invalid tex width %d (max: %u)", tex->width, bx::max()); + BX_ASSERT(tex->height >= 0 && tex->height <= bx::max(), "Invalid tex height %d (max: %u)", tex->height, bx::max()); + tex->id = bgfx::createTexture2D( - tex->width - , tex->height + uint16_t(tex->width) + , uint16_t(tex->height) , false , 1 , NVG_TEXTURE_RGBA == _type ? bgfx::TextureFormat::RGBA8 : bgfx::TextureFormat::R8 @@ -337,8 +340,8 @@ namespace , 0 , 0 , 0 - , tex->width - , tex->height + , uint16_t(tex->width) + , uint16_t(tex->height) , mem ); } @@ -371,14 +374,19 @@ namespace w * bytesPerPixel, // stride h); // num + BX_ASSERT(x >= 0 && x <= bx::max(), "Invalid tex x pos %d (max: %u)", x, bx::max()); + BX_ASSERT(y >= 0 && y <= bx::max(), "Invalid tex y pos %d (max: %u)", y, bx::max()); + BX_ASSERT(w >= 0 && w <= bx::max(), "Invalid tex width %d (max: %u)", w, bx::max()); + BX_ASSERT(h >= 0 && h <= bx::max(), "Invalid tex width %d (max: %u)", h, bx::max()); + bgfx::updateTexture2D( tex->id , 0 , 0 - , x - , y - , w - , h + , uint16_t(x) + , uint16_t(y) + , uint16_t(w) + , uint16_t(h) , mem , UINT16_MAX ); @@ -569,9 +577,9 @@ namespace uint16_t* data = (uint16_t*)tib.data; for (uint32_t ii = 0; ii < numTris; ++ii) { - data[ii*3+0] = _start; - data[ii*3+1] = _start + ii + 1; - data[ii*3+2] = _start + ii + 2; + data[ii*3+0] = uint16_t(_start); + data[ii*3+1] = uint16_t(_start + ii + 1); + data[ii*3+2] = uint16_t(_start + ii + 2); } bgfx::setIndexBuffer(&tib); @@ -1197,10 +1205,14 @@ NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* ctx, int32_t width, int32_t NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* _ctx, int32_t _width, int32_t _height, int32_t _imageFlags) { BX_UNUSED(_imageFlags); + BX_ASSERT(_width >= 0 && _width <= bx::max(), "Invalid tex width %d (max: %u)", _width, bx::max()); + BX_ASSERT(_height >= 0 && _height <= bx::max(), "Invalid tex height %d (max: %u)", _height, bx::max()); + const uint16_t w = uint16_t(_width); + const uint16_t h = uint16_t(_height); bgfx::TextureHandle textures[] = { - bgfx::createTexture2D(_width, _height, false, 1, bgfx::TextureFormat::RGBA8, BGFX_TEXTURE_RT), - bgfx::createTexture2D(_width, _height, false, 1, bgfx::TextureFormat::D24S8, BGFX_TEXTURE_RT | BGFX_TEXTURE_RT_WRITE_ONLY) + bgfx::createTexture2D(w, h, false, 1, bgfx::TextureFormat::RGBA8, BGFX_TEXTURE_RT), + bgfx::createTexture2D(w, h, false, 1, bgfx::TextureFormat::D24S8, BGFX_TEXTURE_RT | BGFX_TEXTURE_RT_WRITE_ONLY) }; bgfx::FrameBufferHandle fbh = bgfx::createFrameBuffer( BX_COUNTOF(textures) From e0b5e0d67ae819dabc0bfef6fdfb9d5fc5017e85 Mon Sep 17 00:00:00 2001 From: Gary Hsu Date: Mon, 27 Feb 2023 18:38:49 -0800 Subject: [PATCH 38/86] Add support for Windows App SDK (WinUI 3) (#3044) * Add support for Windows App SDK (WinUI 3) * Update namespace --- src/dxgi.cpp | 199 ++++++++++++++++++----------------------- src/dxgi.h | 2 +- src/renderer_d3d11.cpp | 8 +- 3 files changed, 91 insertions(+), 118 deletions(-) diff --git a/src/dxgi.cpp b/src/dxgi.cpp index 06ed02cf0..6871e1167 100644 --- a/src/dxgi.cpp +++ b/src/dxgi.cpp @@ -17,6 +17,33 @@ # endif // BX_PLATFORM_WINRT #endif // !BX_PLATFORM_WINDOWS +#if BX_PLATFORM_WINRT +// Copied from from Windows App SDK +// Put in a namespace to avoid conflict with +namespace WinUI3 +{ + // https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/win32/microsoft.ui.xaml.media.dxinterop/nn-microsoft-ui-xaml-media-dxinterop-iswapchainpanelnative + MIDL_INTERFACE("63aad0b8-7c24-40ff-85a8-640d944cc325") + ISwapChainPanelNative : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetSwapChain( + /* [annotation][in] */ + _In_ IDXGISwapChain *swapChain) = 0; + }; + + // https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/win32/microsoft.ui.xaml.media.dxinterop/nn-microsoft-ui-xaml-media-dxinterop-iswapchainbackgroundpanelnative + MIDL_INTERFACE("24d43d84-4246-4aa7-9774-8604cb73d90d") + ISwapChainBackgroundPanelNative : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetSwapChain( + /* [annotation][in] */ + _In_ IDXGISwapChain *swapChain) = 0; + }; +} +#endif // BX_PLATFORM_WINRT + namespace bgfx { BX_PRAGMA_DIAGNOSTIC_PUSH(); @@ -111,6 +138,54 @@ namespace bgfx IID_IDXGISwapChain3, }; +#if BX_PLATFORM_WINRT + template + static bool trySetSwapChain(IInspectable* nativeWindow, Dxgi::SwapChainI* swapChain, HRESULT* hr) + { + ISwapChainPanelNative* swapChainPanelNative; + + if (FAILED(nativeWindow->QueryInterface(__uuidof(T), (void**)&swapChainPanelNative)) + || NULL == swapChainPanelNative) + { + return false; + } + + *hr = swapChainPanelNative->SetSwapChain(swapChain); + if (SUCCEEDED(*hr)) + { + DX_RELEASE_I(swapChainPanelNative); + } + else + { + DX_RELEASE(swapChainPanelNative, 0); + } + + return true; + } + + static HRESULT setSwapChain(IInspectable* nativeWindow, Dxgi::SwapChainI* swapChain) + { + HRESULT hr = S_OK; + + if (trySetSwapChain(nativeWindow, swapChain, &hr) + || trySetSwapChain(nativeWindow, swapChain, &hr) + || trySetSwapChain(nativeWindow, swapChain, &hr) + || trySetSwapChain(nativeWindow, swapChain, &hr)) + { + if (FAILED(hr)) + { + BX_TRACE("Failed to SetSwapChain, hr %x."); + } + } + else + { + BX_TRACE("No available interface on native window to SetSwapChain."); + } + + return hr; + } +#endif // BX_PLATFORM_WINRT + DxgiSwapChain::DxgiSwapChain() { } @@ -183,7 +258,7 @@ namespace bgfx hr = CreateDXGIFactory(IID_IDXGIFactory, (void**)&m_factory); #endif // BX_PLATFORM_* - if (FAILED(hr) ) + if (FAILED(hr)) { BX_TRACE("Init error: Unable to create DXGI factory."); return false; @@ -475,65 +550,17 @@ namespace bgfx , NULL , reinterpret_cast(_swapChain) ); - if (FAILED(hr) ) + if (FAILED(hr)) { return hr; } # if BX_PLATFORM_WINRT - IInspectable *nativeWindow = reinterpret_cast(_scd.nwh); - ISwapChainPanelNative* swapChainPanelNative; - - hr = nativeWindow->QueryInterface( - __uuidof(ISwapChainPanelNative) - , (void**)&swapChainPanelNative - ); - - if (!FAILED(hr) ) + IInspectable* nativeWindow = reinterpret_cast(_scd.nwh); + hr = setSwapChain(nativeWindow, *_swapChain); + if (FAILED(hr)) { - // Swap Chain Panel - if (NULL != swapChainPanelNative) - { - hr = swapChainPanelNative->SetSwapChain(*_swapChain); - - if (FAILED(hr) ) - { - DX_RELEASE(swapChainPanelNative, 0); - BX_TRACE("Failed to SetSwapChain, hr %x."); - return hr; - } - - DX_RELEASE_I(swapChainPanelNative); - } - } - else - { - // Swap Chain Background Panel - ISwapChainBackgroundPanelNative* swapChainBackgroundPanelNative = NULL; - - hr = nativeWindow->QueryInterface( - __uuidof(ISwapChainBackgroundPanelNative) - , (void**)&swapChainBackgroundPanelNative - ); - - if (FAILED(hr) ) - { - return hr; - } - - if (NULL != swapChainBackgroundPanelNative) - { - hr = swapChainBackgroundPanelNative->SetSwapChain(*_swapChain); - - if (FAILED(hr) ) - { - DX_RELEASE(swapChainBackgroundPanelNative, 0); - BX_TRACE("Failed to SetSwapChain, hr %x."); - return hr; - } - - DX_RELEASE_I(swapChainBackgroundPanelNative); - } + return hr; } # endif // BX_PLATFORM_WINRT } @@ -546,7 +573,7 @@ namespace bgfx if (NULL != dxgiDevice1) { hr = dxgiDevice1->SetMaximumFrameLatency(_scd.maxFrameLatency); - if (FAILED(hr) ) + if (FAILED(hr)) { BX_TRACE("Failed to set maximum frame latency, hr 0x%08x", hr); hr = S_OK; @@ -555,7 +582,7 @@ namespace bgfx } } - if (FAILED(hr) ) + if (FAILED(hr)) { BX_TRACE("Failed to create swap chain."); return hr; @@ -602,64 +629,10 @@ namespace bgfx } #if BX_PLATFORM_WINRT - HRESULT Dxgi::removeSwapChain(const SwapChainDesc& _scd, SwapChainI** _swapChain) + HRESULT Dxgi::removeSwapChain(const SwapChainDesc& _scd) { - IInspectable *nativeWindow = reinterpret_cast(_scd.nwh); - ISwapChainPanelNative* swapChainPanelNative; - - HRESULT hr = nativeWindow->QueryInterface( - __uuidof(ISwapChainPanelNative) - , (void**)&swapChainPanelNative - ); - - if (SUCCEEDED(hr)) - { - // Swap Chain Panel - if (NULL != swapChainPanelNative) - { - // Remove swap chain - hr = swapChainPanelNative->SetSwapChain(NULL); - - if (FAILED(hr)) - { - DX_RELEASE(swapChainPanelNative, 0); - BX_TRACE("Failed to SetSwapChain, hr %x."); - return hr; - } - - DX_RELEASE_I(swapChainPanelNative); - } - } - else - { - // Swap Chain Background Panel - ISwapChainBackgroundPanelNative* swapChainBackgroundPanelNative = NULL; - - hr = nativeWindow->QueryInterface( - __uuidof(ISwapChainBackgroundPanelNative) - , (void**)&swapChainBackgroundPanelNative - ); - - if (FAILED(hr)) - { - return hr; - } - - if (NULL != swapChainBackgroundPanelNative) - { - // Remove swap chain - hr = swapChainBackgroundPanelNative->SetSwapChain(NULL); - - if (FAILED(hr)) - { - DX_RELEASE(swapChainBackgroundPanelNative, 0); - BX_TRACE("Failed to SetSwapChain, hr %x."); - return hr; - } - - DX_RELEASE_I(swapChainBackgroundPanelNative); - } - } + IInspectable* nativeWindow = reinterpret_cast(_scd.nwh); + return setSwapChain(nativeWindow, NULL); } #endif diff --git a/src/dxgi.h b/src/dxgi.h index 0a2623adb..e3a486d65 100644 --- a/src/dxgi.h +++ b/src/dxgi.h @@ -90,7 +90,7 @@ namespace bgfx #if BX_PLATFORM_WINRT /// - HRESULT removeSwapChain(const SwapChainDesc& _scd, SwapChainI** _swapChain); + HRESULT removeSwapChain(const SwapChainDesc& _scd); #endif /// diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index c4899f287..758db2f25 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1617,7 +1617,7 @@ namespace bgfx { namespace d3d11 DX_RELEASE(m_msaaRt, 0); #if BX_PLATFORM_WINRT // Remove swap chain from SwapChainPanel (nwh) if applicable - m_dxgi.removeSwapChain(m_scd, &m_swapChain); + m_dxgi.removeSwapChain(m_scd); #endif DX_RELEASE(m_swapChain, 0); DX_RELEASE(m_deviceCtx, 0); @@ -1708,7 +1708,7 @@ namespace bgfx { namespace d3d11 DX_RELEASE(m_msaaRt, 0); #if BX_PLATFORM_WINRT // Remove swap chain from SwapChainPanel (nwh) if applicable - m_dxgi.removeSwapChain(m_scd, &m_swapChain); + m_dxgi.removeSwapChain(m_scd); #endif DX_RELEASE(m_swapChain, 0); DX_RELEASE(m_deviceCtx, 0); @@ -2396,7 +2396,7 @@ namespace bgfx { namespace d3d11 && (m_scd.nwh != g_platformData.nwh || m_scd.ndt != g_platformData.ndt)) { // Remove swap chain from SwapChainPanel (nwh) if applicable - m_dxgi.removeSwapChain(m_scd, &m_swapChain); + m_dxgi.removeSwapChain(m_scd); // Update nwh after removing swap chain m_scd.nwh = g_platformData.nwh; m_scd.ndt = g_platformData.ndt; @@ -2511,7 +2511,7 @@ namespace bgfx { namespace d3d11 #if BX_PLATFORM_WINRT // Remove swap chain from SwapChainPanel (nwh) if applicable - m_dxgi.removeSwapChain(m_scd, &m_swapChain); + m_dxgi.removeSwapChain(m_scd); #endif DX_RELEASE(m_swapChain, 0); HRESULT hr = m_dxgi.createSwapChain(m_device From 23edb9c4d90744bf90a89ff9e7308b8ff6517fee Mon Sep 17 00:00:00 2001 From: Max <42641081+bmoxb@users.noreply.github.com> Date: Tue, 28 Feb 2023 23:42:55 +0000 Subject: [PATCH 39/86] Make the formatting of example projects consistent in README.md and fix broken image URLs (#3051) * Make the formatting of bgfx example projects consistent in README.md * Capital letter after hyphen * Fix broken image URLs * Make links visible * Remove broken web demo links --- README.md | 290 +++++++++++++++++++++++++++--------------------------- 1 file changed, 146 insertions(+), 144 deletions(-) diff --git a/README.md b/README.md index 99aed723b..4182d3f5d 100644 --- a/README.md +++ b/README.md @@ -87,77 +87,88 @@ Languages: Who is using it? [#madewithbgfx](https://twitter.com/search?q=%23madewithbgfx&src=typed_query&f=live) ----------------------------------------------------------------------------------------------------- -## Airmech +## AirMech -http://airmech.com/ AirMech is a free-to-play futuristic action real-time -strategy video game developed and published by Carbon Games. -![airmech](https://www.mobygames.com/images/shots/l/830630-airmech-playstation-4-screenshot-blue-bar-on-your-mech-indicates.jpg) +https://www.carbongames.com/airmech-strike - AirMech is a free-to-play +futuristic action real-time strategy video game developed and published by +Carbon Games. + +![AirMech screenshot](https://www.mobygames.com/images/shots/l/830630-airmech-playstation-4-screenshot-blue-bar-on-your-mech-indicates.jpg) ## cmftStudio -https://github.com/dariomanesku/cmftStudio cmftStudio - cubemap filtering tool. -![cmftStudio](https://github.com/dariomanesku/cmftStudio/raw/master/screenshots/cmftStudio_small.jpg) +https://github.com/dariomanesku/cmftStudio - cmftStudio - Cubemap filtering +tool. + +![cmftStudio screenshot](https://github.com/dariomanesku/cmftStudio/raw/master/screenshots/cmftStudio_small.jpg) ## Crown -https://github.com/dbartolini/crown Crown is a general purpose data-driven game -engine, written from scratch with a minimalistic and data-oriented design -philosophy in mind. +https://github.com/dbartolini/crown - Crown is a general purpose data-driven +game engine, written from scratch with a minimalistic and data-oriented design +philosophy in mind. + ![Crown screenshot](https://raw.githubusercontent.com/dbartolini/crown/master/docs/shots/level-editor.png) ## Offroad Legends 2 -http://www.dogbytegames.com/ Dogbyte Games is an indie mobile developer studio -focusing on racing games. -![ios](http://www.dogbytegames.com/bgfx/offroadlegends2_bgfx_ipad2.jpg) +http://www.dogbytegames.com/ - Dogbyte Games is an indie mobile developer studio +focusing on racing games. + +![Offroad Legends 2](http://www.dogbytegames.com/bgfx/offroadlegends2_bgfx_ipad2.jpg) ## Torque6 -https://github.com/andr3wmac/Torque6 Torque 6 is an MIT licensed 3D engine +https://github.com/andr3wmac/Torque6 - Torque 6 is an MIT licensed 3D engine loosely based on Torque2D. Being neither Torque2D or Torque3D it is the 6th derivative of the original Torque Engine. + Torque 6 Material Editor ## Kepler Orbits -https://github.com/podgorskiy/KeplerOrbits KeplerOrbits - Tool that calculates -positions of celestial bodies using their orbital elements. [Web Demo](http://podgorskiy.com/KeplerOrbits/KeplerOrbits.html) +https://github.com/podgorskiy/KeplerOrbits - KeplerOrbits - Tool that calculates +positions of celestial bodies using their orbital elements. ## CETech -https://github.com/cyberegoorg/cetech - CETech is Data-Driven game engine and -toolbox inspired by Bitsquid/Stingray engine. +https://github.com/cyberegoorg/cetech - CETech is a data-driven game engine and +toolbox inspired by Bitsquid/Stingray engine. + ![CETech screenshot](https://github.com/cyberegoorg/cetech/raw/master/docs/img/prototyp.png) ## ioquake3 https://github.com/jpcy/ioq3-renderer-bgfx - A renderer for ioquake3 written in -C++ and using bgfx to support multiple rendering APIs. +C++ and using bgfx to support multiple rendering APIs. + ![ioq3-renderer-bgfx screenshot](https://camo.githubusercontent.com/052aa40c05120e56306294d3a1bb5f99f97de8c8/687474703a2f2f692e696d6775722e636f6d2f64364f6856594b2e6a7067) ## DLS -http://makingartstudios.itch.io/dls - DLS the digital logic simulator game. +http://makingartstudios.itch.io/dls - DLS, the digital logic simulator game. + DLS - Creating a 4-bit Register -http://dls.makingartstudios.com/sandbox/ - DLS: The Sandbox -![dls-sandbox-screenshot](https://pbs.twimg.com/media/DBaFwOKWAAEq0mp.jpg:large) +http://dls.makingartstudios.com/sandbox/ - DLS: The Sandbox. + +![DLS: The Sandbox screenshot](https://pbs.twimg.com/media/DBaFwOKWAAEq0mp.jpg:large) ## MAME -https://github.com/mamedev/mame MAME - Multiple Arcade Machine Emulator -[Try MAME in Browser!](http://fos.textfiles.com/dfjustin/pacman/pacman/) -![mame-screenshot](https://raw.githubusercontent.com/mamedev/www.mamedev.org/d8d716dbb63919a11964b5d47b9b7f6cfa006b56/bgfx/Raiden.png) +https://github.com/mamedev/mame - MAME - Multiple Arcade Machine Emulator. + +![MAME screenshot](https://raw.githubusercontent.com/mamedev/www.mamedev.org/d8d716dbb63919a11964b5d47b9b7f6cfa006b56/bgfx/Raiden.png) ## Blackshift https://blackshift.itch.io/blackshift - Blackshift is a grid-based, space-themed -action puzzle game which isn't afraid of complexity — think Chip's Challenge on +action puzzle game which isn't afraid of complexity - think Chip's Challenge on crack. https://eheitzresearch.wordpress.com/415-2/ - Real-Time Polygonal-Light Shading with Linearly Transformed Cosines, Eric Heitz, Jonathan Dupuy, Stephen Hill and -David Neubelt, ACM SIGGRAPH 2016 +David Neubelt, ACM SIGGRAPH 2016. ## REGoth -https://github.com/degenerated1123/REGoth - Open source reimplementation of the -zEngine, used by the game "Gothic" and "Gothic II". - -Browser demo: http://gothic-dx11.de/gothic-js/REGoth.html +https://github.com/degenerated1123/REGoth - REGoth is an open-source +reimplementation of the zEngine, used by the game "Gothic" and "Gothic II". ## Ethereal Engine -https://github.com/volcoma/EtherealEngine EtherealEngine C++ Game Engine and -WYSIWYG Editor +https://github.com/volcoma/EtherealEngine - EtherealEngine is a C++ game engine +and WYSIWYG dditor. + ![EtherealEngine screenshot](https://user-images.githubusercontent.com/1499411/29488403-ff3c3df6-8512-11e7-869f-32a783530cc3.png) ## Go Rally @@ -217,16 +227,18 @@ width="640" height="480" border="0" /> ## vg-renderer -https://github.com/jdryg/vg-renderer#vg-renderer - A vector graphics renderer -for bgfx, based on ideas from both NanoVG and ImDrawList (Dear ImGUI) -![vg-renderer](https://raw.githubusercontent.com/jdryg/vg-renderer/master/img/vgrenderer_tiger.png) +https://github.com/jdryg/vg-renderer#vg-renderer - vg-renderer is a vector +graphics renderer for bgfx, based on ideas from both NanoVG and ImDrawList (Dear +ImGUI). + +![vg-renderer screenshot](https://raw.githubusercontent.com/jdryg/vg-renderer/master/img/vgrenderer_tiger.png) ## Zombie Safari http://www.dogbytegames.com/zombie_safari.html - Do what you please in this -Open-World Offroad Driving game: explore massive landscapes, complete challenges, -smash zombies, find secret locations, unlock and upgrade cars and weapons, it's -up to you! +open-world offroad driving game: explore massive landscapes, complete +challenges, smash zombies, find secret locations, unlock and upgrade cars and +weapons, it's up to you! http://www.smithandwinston.com/ - Smith and Winston is an exploration twin stick shooter for PC, PS4 & XBoxOne arriving in late 2018. Smith and Winston features a massively destructable voxel world, rapid twin stick combat, physics puzzles -and Metroid style discovery. +and Metroid-style discovery. ## WonderWorlds -http://wonderworlds.me/ - WonderWorlds is a place to play thousands -of user-created levels and stories, make your own using the extensive in-game -tools and share them with whomever you want. +http://wonderworlds.me/ - WonderWorlds is a place to play thousands of +user-created levels and stories, make your own using the extensive in-game tools +and share them with whomever you want. ## two-io / mud -https://hugoam.github.io/two-io/ - an all-purpose c++ app prototyping library, +https://hugoam.github.io/two-io/ - An all-purpose c++ app prototyping library, focused towards live graphical apps and games. -![mud](https://raw.githubusercontent.com/hugoam/mud-io/master/media/14_live_gfx.png) +![two-io / mud screenshot](https://raw.githubusercontent.com/hugoam/mud-io/master/media/14_live_gfx.png) ## Talking Tom Pool -https://outfit7.com/apps/talking-tom-pool/ - "Sling and match†puzzle game for +https://outfit7.com/apps/talking-tom-pool/ - A "sling and match" puzzle game for mobile devices. ## GPlayEngine -https://github.com/fredakilla/GPlayEngine#gplayengine - GPlayEngine is C++ -cross-platform game engine for creating 2D/3D games based on the GamePlay 3D +https://github.com/fredakilla/GPlayEngine#gplayengine - GPlayEngine is a C++ +cross-platform game engine for creating 2D/3D games based on the GamePlay 3D engine v3.0. -![](https://camo.githubusercontent.com/d89a364fb306f208ca14a58267c8303f60f0f0cf/68747470733a2f2f692e696d6775722e636f6d2f306569395932382e706e67) +![GPlayEngine screenshot](https://camo.githubusercontent.com/d89a364fb306f208ca14a58267c8303f60f0f0cf/68747470733a2f2f692e696d6775722e636f6d2f306569395932382e706e67) ## Off The Road -http://www.dogbytegames.com/off_the_road.html - Sandbox off-road driving +http://www.dogbytegames.com/off_the_road.html - A sandbox off-road driving simulator. ## Coal Burnout -https://beardsvibe.com/ - Multiplayer PVP rhythm game. +https://beardsvibe.com/ - A multiplayer PVP rhythm game. -![coal-burnout](https://beardsvibe.com/scr/0l.png) +![Coal Burnout screenshot](https://beardsvibe.com/scr/0l.png) ## My Talking Tom 2 @@ -321,21 +333,21 @@ width="640" height="480" border="0" /> https://www.neoaxis.com/ - Versatile 3D project development environment. -![neoaxis-engine](https://www.neoaxis.com/files/NeoAxisEngine04.jpg) +![NeoAxis Engine screenshot](https://www.neoaxis.com/files/NeoAxisEngine04.jpg) ## xatlas -https://github.com/jpcy/xatlas#xatlas - Mesh parameterization library +https://github.com/jpcy/xatlas#xatlas - Mesh parameterization library. -![xatlas](https://user-images.githubusercontent.com/3744372/43034066-53a62dee-8d18-11e8-9767-0b38ed3fa2d3.png) +![xatlas screenshot](https://user-images.githubusercontent.com/3744372/43034066-53a62dee-8d18-11e8-9767-0b38ed3fa2d3.png) ## Heroes of Hammerwatch -https://store.steampowered.com/app/677120/Heroes_of_Hammerwatch/ Heroes of Hammerwatch -is a rogue-lite action-adventure game set in the same universe as Hammerwatch. -Encounter endless hordes of enemies, traps, puzzles, secrets and lots of loot, -as you battle your way through procedurally generated levels to reach the top -of the Forsaken Spire. +https://store.steampowered.com/app/677120/Heroes_of_Hammerwatch/ - Heroes of +Hammerwatch is a rogue-lite action-adventure game set in the same universe as +Hammerwatch. Encounter endless hordes of enemies, traps, puzzles, secrets and +lots of loot, as you battle your way through procedurally generated levels to +reach the top of the Forsaken Spire. ## Babylon Native -Build cross-platform native applications with the power of the Babylon.js -JavaScript framework. - -[Babylon Native](https://github.com/BabylonJS/BabylonNative#babylon-native) +https://github.com/BabylonJS/BabylonNative#babylon-native - Build cross-platform +native applications with the power of the Babylon.js JavaScript framework. ## Nira -Instantly load and view assets on any device. All you need is a web browser. +https://nira.app/ - Instantly load and view assets on any device. All you need +is a web browser. -[Nira](https://nira.app/) -[SIGGRAPH 2019: Project Nira: Instant Interactive Real-Time Access to Multi-Gigabyte Sized 3D Assets on Any Device](https://s2019.siggraph.org/presentation/?sess=sess104&id=real_130#038;id=real_130) +SIGGRAPH 2019: Project Nira: Instant Interactive Real-Time Access to +Multi-Gigabyte Sized 3D Assets on Any Device: +https://s2019.siggraph.org/presentation/?sess=sess104&id=real_130#038;id=real_130 ## openblack -An open source reimplementation of the game Black & White (2001). +https://github.com/openblack/openblack#openblack - An open-source +reimplementation of the game Black & White (2001). -[openblack](https://github.com/openblack/openblack#openblack) - -![openblack](https://user-images.githubusercontent.com/32263167/184559293-56cfc6a7-a7da-4876-8fce-434ba8827eae.png) +![openblack screenshot](https://user-images.githubusercontent.com/32263167/184559293-56cfc6a7-a7da-4876-8fce-434ba8827eae.png) ## Cluster -Implementation of Clustered Shading and Physically Based Rendering with the bgfx rendering library. +https://github.com/pezcode/Cluster#cluster - Implementation of Clustered Shading +and Physically Based Rendering with the bgfx rendering library. -[Cluster](https://github.com/pezcode/Cluster#cluster) - -![cluster](https://raw.githubusercontent.com/pezcode/Cluster/master/images/sponza.jpg) +![Cluster screenshot](https://raw.githubusercontent.com/pezcode/Cluster/master/images/sponza.jpg) ## NIMBY Rails -NIMBY Rails is a management and design sandbox game for railways you build in the real world. +https://store.steampowered.com/app/1134710/NIMBY_Rails/ - NIMBY Rails is a +management and design sandbox game for railways you build in the real world. -[NIMBY Rails](https://store.steampowered.com/app/1134710/NIMBY_Rails/) - -![NIMBY Rails](https://user-images.githubusercontent.com/28320/78472283-03d5e200-7727-11ea-8bd4-db8754f52dc3.jpg) +![NIMBY Rails screenshot](https://user-images.githubusercontent.com/28320/78472283-03d5e200-7727-11ea-8bd4-db8754f52dc3.jpg) ## Minecraft https://www.minecraft.net/zh-hant/attribution/ -![home-hero-1200x600](https://user-images.githubusercontent.com/814772/79185288-57050000-7dcb-11ea-87b4-2126fcd1545b.jpg) +![Minecraft screenshot](https://user-images.githubusercontent.com/814772/79185288-57050000-7dcb-11ea-87b4-2126fcd1545b.jpg) ## FFNx -Next generation driver for Final Fantasy VII and Final Fantasy VIII -(with native Steam 2013 release support!) +https://github.com/julianxhokaxhiu/FFNx#ffnx - Next generation driver for Final +Fantasy VII and Final Fantasy VIII (with native Steam 2013 release support!) -[FFNx](https://github.com/julianxhokaxhiu/FFNx#ffnx) - -![FFVIII](https://raw.githubusercontent.com/julianxhokaxhiu/FFNx/master/.screens/ff8.png) +![FFVIII screenshot](https://raw.githubusercontent.com/julianxhokaxhiu/FFNx/master/.screens/ff8.png) ## Shadow Gangs -Shadow Gangs is an arcade style ninja action game. +https://www.microsoft.com/en-gb/p/shadow-gangs/9n6hkcr65qdq - Shadow Gangs is an +arcade style ninja action game. -https://www.microsoft.com/en-gb/p/shadow-gangs/9n6hkcr65qdq - -![Shadow Gangs](https://user-images.githubusercontent.com/814772/94508248-64ba1080-01c6-11eb-800f-47dc374ef054.jpeg) +![Shadow Gangs screenshot](https://user-images.githubusercontent.com/814772/94508248-64ba1080-01c6-11eb-800f-47dc374ef054.jpeg) ## Growtopia -Growtopia is a free-to-play sandbox MMO game with almost endless possibilities -for world creation, customization and having fun with your friends. Enjoy -thousands of items, challenges and events. +https://growtopiagame.com/ - Growtopia is a free-to-play sandbox MMO game with +almost endless possibilities for world creation, customization and having fun +with your friends. Enjoy thousands of items, challenges and events. -https://growtopiagame.com/ - -![growtopia](https://s3.eu-west-1.amazonaws.com/cdn.growtopiagame.com/website/resources/assets/images/grow_header.jpg) +![Growtopia screenshot](https://s3.eu-west-1.amazonaws.com/cdn.growtopiagame.com/website/resources/assets/images/grow_header.jpg) ## Galaxy Trucker -Digital implementation of tabletop spaceship building in real-time or turn-based mode, -then surviving space adventures, with AI opponents, multiplayer, achievements -and solo campaign. +https://galaxytrucker.com/ - Digital implementation of tabletop spaceship +building in real-time or turn-based mode, then surviving space adventures, with +AI opponents, multiplayer, achievements and solo campaign. -https://galaxytrucker.com/ - -![Galaxy Trucker](https://press.galaxytrucker.com/images/GTAT_junk.png) +![Galaxy Trucker screenshot](https://press.galaxytrucker.com/images/GTAT_junk.png) ## Through the Ages -The card tabletop deep strategy game in your devices. Lead your civilization from pyramids -to space flights. Challenges, achievements, skilled AIs and online multiplayer. +https://throughtheages.com/ - The card tabletop deep strategy game in your +devices. Lead your civilization from pyramids to space flights. Challenges, +achievements, skilled AIs and online multiplayer. -https://throughtheages.com/ - -![Through the Ages](https://press.throughtheages.com/images/tta01.png) +![Through the Ages screenshot](https://press.throughtheages.com/images/tta01.png) ## Codenames -One of the best party game. Two rival spymasters know the secret identities of 25 agents. -Their teammates know the agents only by their codenames. Simple to explain, -easy to understand, challenging gameplay. +https://codenamesgame.com/ - One of the best party games. Two rival spymasters +know the secret identities of 25 agents. Their teammates know the agents only by +their codenames. Simple to explain, easy to understand, challenging gameplay. -https://codenamesgame.com/ - -![Codenames](https://codenamesgame.com/img/game-features-img-1.jpg) +![Codenames screenshot](https://codenamesgame.com/img/game-features-img-1.jpg) ## PeakFinder -PeakFinder shows the names of all mountains and peaks with a 360° panorama display. -More than 850'000 peaks - from Mount Everest to the little hill around the corner. +https://www.peakfinder.org/ - PeakFinder shows the names of all mountains and +peaks with a 360° panorama display. More than 850'000 peaks - from Mount Everest +to the little hill around the corner. -https://www.peakfinder.org/ - -![PeakFinder](https://pfweb-c125.kxcdn.com/images/mobile/cards//en/cameramode.jpg) +![PeakFinder screenshot](https://pfweb-c125.kxcdn.com/videos/mobile/manual/v4/light/en/peakfinder-trecime.jpg) ## Ember Sword -Ember Sword is a free to play MMORPG running directly in your browser and is -being developed and published by Bright Star Studios. +https://embersword.com - Ember Sword is a free to play MMORPG running directly +in your browser and is being developed and published by Bright Star Studios. -https://embersword.com - -![Ember-Sword-ConceptArt5](https://user-images.githubusercontent.com/814772/120714133-a860ca80-c477-11eb-8680-f5a948dfd050.png) +![Ember Sword screenshot](https://user-images.githubusercontent.com/814772/120714133-a860ca80-c477-11eb-8680-f5a948dfd050.png) ## Off The Road Unleashed -Off The Road Unleashed is a sandbox driving game for the Nintendo Switch. -If you see a vehicle you bet you can hop into it! Pilot big rigs, helicopters, boats, airplanes or even trains. Sand dunes, frozen plains, mountains to climb and conquer. - -https://www.nintendo.com/games/detail/off-the-road-unleashed-switch/ +https://www.nintendo.com/games/detail/off-the-road-unleashed-switch/ - Off The +Road Unleashed is a sandbox driving game for the Nintendo Switch. If you see a +vehicle you bet you can hop into it! Pilot big rigs, helicopters, boats, +airplanes or even trains. Sand dunes, frozen plains, mountains to climb and +conquer. ## Guild Wars 2 -Guild Wars 2 is an online role-playing game with fast-paced action combat, a rich and detailed universe of stories, awe-inspiring landscapes to explore, two challenging player vs. player modes—and no subscription fees! +https://www.guildwars2.com/ - Guild Wars 2 is an online role-playing game with +fast-paced action combat, a rich and detailed universe of stories, awe-inspiring +landscapes to explore, two challenging player vs. player modes—and no +subscription fees! -https://www.guildwars2.com/ - -![Guild-Wars-2-wallpaper](https://d3b4yo2b5lbfy.cloudfront.net/wp-content/uploads/wallpapers/GuildWars2-01-800x600.jpg) +![Guild Wars 2 screenshot](https://d3b4yo2b5lbfy.cloudfront.net/wp-content/uploads/2017/07/1a684WvW_ArmorT3.jpg) ## Griftlands -Griftlands is a roguelike deck-building game with role-playing story elements in a science fiction setting, developed and published by Klei Entertainment. - -https://klei.com/games/griftlands +https://klei.com/games/griftlands - Griftlands is a roguelike deck-building game +with role-playing story elements in a science fiction setting, developed and +published by Klei Entertainment. ## HARFANG 3D -[HARFANG® 3D](https://www.harfang3d.com) is a **BGFX-powered** 3D visualization framework for C++, Python, Go, and Lua. -It comes with a 3D editor, HARFANG Studio. +https://www.harfang3d.com - HARFANG® 3D is a **BGFX-powered** 3D visualization +framework for C++, Python, Go, and Lua. It comes with a 3D editor, HARFANG +Studio. -![HARFANG-STUDIO](https://raw.githubusercontent.com/harfang3d/image-storage/main/portfolio/3.2.2/harfang-studio-cyber-city.png) +![HARFANG Studio screenshot](https://raw.githubusercontent.com/harfang3d/image-storage/main/portfolio/3.2.2/harfang-studio-cyber-city.png) ## Marine Melodies / Resistance -Demoscene musicdisk released at Evoke 2022 demoparty. +https://www.pouet.net/prod.php?which=91906 - Demoscene musicdisk released at +Evoke 2022 demoparty. + +https://github.com/astrofra/demo-marine-melodies Marine Melodies -https://www.pouet.net/prod.php?which=91906 - -https://github.com/astrofra/demo-marine-melodies - ## Activeworlds -[Activeworlds](https://www.activeworlds.com/) is an online VR platform with rich multimedia and presentation features. Create your own worlds or build in free community worlds, hold your own event / meeting or join inworld events! +https://www.activeworlds.com/ - Activeworlds is an online VR platform with rich +multimedia and presentation features. Create your own worlds or build in free +community worlds, hold your own event / meeting or join inworld events! -![Activeworlds-wallpaper](http://www.activeworlds.com/img/181107-213544_small_enkii.jpg) +![Activeworlds screenshot](http://www.activeworlds.com/img/181107-213544_small_enkii.jpg) ## Equilibrium Engine -[Equilibrium Engine](https://github.com/clibequilibrium/EquilibriumEngine) is a Data-oriented and multi-threaded C11 Game Engine with libraries & shaders hot-reloading. +https://github.com/clibequilibrium/EquilibriumEngine - Equilibrium Engine is a +data-oriented and multi-threaded C11 Game Engine with libraries & shaders +hot-reloading. -![Equilibrium Engine](https://raw.githubusercontent.com/clibequilibrium/EquilibriumEngine/master/docs/city.png) +![Equilibrium Engine screenshot](https://raw.githubusercontent.com/clibequilibrium/EquilibriumEngine/master/docs/city.png) [License (BSD 2-clause)](https://bkaradzic.github.io/bgfx/license.html) ----------------------------------------------------------------------- From 5ec297bc716deef216e6c6fbc82650951844d7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Mar 2023 21:21:10 -0800 Subject: [PATCH 40/86] Fixed issue #3045. --- src/renderer_mtl.mm | 85 ++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 5fc2e3c5b..bda0d4846 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -732,17 +732,17 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa } support |= true - && s_textureFormat[ii].m_rwTier != MTLReadWriteTextureTierNone - && s_textureFormat[ii].m_rwTier <= rwTier - ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ - | BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE - : BGFX_CAPS_FORMAT_TEXTURE_NONE - ; + && s_textureFormat[ii].m_rwTier != MTLReadWriteTextureTierNone + && s_textureFormat[ii].m_rwTier <= rwTier + ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ + | BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE + : BGFX_CAPS_FORMAT_TEXTURE_NONE + ; support |= s_textureFormat[ii].m_autoGetMipmap - ? BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN - : 0 - ; + ? BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN + : 0 + ; g_caps.formats[ii] = support; } @@ -1143,10 +1143,10 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa } #if BX_PLATFORM_OSX - m_blitCommandEncoder = getBlitCommandEncoder(); - m_blitCommandEncoder.synchronizeResource(m_screenshotTarget); - m_blitCommandEncoder.endEncoding(); - m_blitCommandEncoder = 0; + m_blitCommandEncoder = getBlitCommandEncoder(); + m_blitCommandEncoder.synchronizeResource(m_screenshotTarget); + m_blitCommandEncoder.endEncoding(); + m_blitCommandEncoder = NULL; #endif // BX_PLATFORM_OSX m_cmd.kick(false, true); @@ -1507,7 +1507,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (NULL != desc.texture) { desc.loadAction = MTLLoadActionLoad; - desc.storeAction = desc.resolveTexture == nil + desc.storeAction = desc.resolveTexture == NULL ? MTLStoreActionStore : MTLStoreActionMultisampleResolve ; @@ -1519,7 +1519,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (NULL != depthAttachment.texture) { depthAttachment.loadAction = MTLLoadActionLoad; - depthAttachment.storeAction = depthAttachment.resolveTexture == nil + depthAttachment.storeAction = depthAttachment.resolveTexture == NULL ? MTLStoreActionStore : MTLStoreActionMultisampleResolve ; @@ -1530,7 +1530,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (NULL != stencilAttachment.texture) { stencilAttachment.loadAction = MTLLoadActionLoad; - stencilAttachment.storeAction = stencilAttachment.resolveTexture == nil + stencilAttachment.storeAction = stencilAttachment.resolveTexture == NULL ? MTLStoreActionStore : MTLStoreActionMultisampleResolve ; @@ -3339,16 +3339,21 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa const int32_t sampleCount = s_msaa[(_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT]; #if BX_PLATFORM_OSX -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 +# if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 if (@available(macOS 10.13, *) ) { m_metalLayer.displaySyncEnabled = 0 != (_flags&BGFX_RESET_VSYNC); } + if (@available(macOS 10.13.2, *) ) { - m_metalLayer.maximumDrawableCount = bx::clamp(_maximumDrawableCount != 0 ? _maximumDrawableCount : BGFX_CONFIG_MAX_FRAME_LATENCY, 2, 3); + m_metalLayer.maximumDrawableCount = bx::clamp( + _maximumDrawableCount != 0 ? _maximumDrawableCount : BGFX_CONFIG_MAX_FRAME_LATENCY + , 2 + , 3 + ); } -#endif // __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 +# endif // __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 #endif // BX_PLATFORM_OSX m_metalLayer.drawableSize = CGSizeMake(_width, _height); @@ -3575,24 +3580,26 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa void FrameBufferMtl::resolve() { - BlitCommandEncoder bce = s_renderMtl->getBlitCommandEncoder(); for (uint32_t ii = 0; ii < m_num; ++ii) { if (0 != (m_colorAttachment[ii].resolve & BGFX_RESOLVE_AUTO_GEN_MIPS)) { const TextureMtl& texture = s_renderMtl->m_textures[m_colorHandle[ii].idx]; - const bool isRenderTarget = (texture.m_flags & BGFX_TEXTURE_RT_MASK); - const bool fmtSupport = 0 != (g_caps.formats[texture.m_textureFormat] & BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN); + const bool isRenderTarget = !!(texture.m_flags & BGFX_TEXTURE_RT_MASK); + const bool hasMips = 1 < texture.m_numMips; + const bool fmtSupport = 0 != (g_caps.formats[texture.m_textureFormat] & BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN); + if (isRenderTarget - && fmtSupport - && texture.m_numMips > 1) + && fmtSupport + && hasMips) { + BlitCommandEncoder bce = s_renderMtl->getBlitCommandEncoder(); bce.generateMipmapsForTexture(texture.m_ptr); } } } - s_renderMtl->endEncoding(); + s_renderMtl->endEncoding(); } void CommandQueueMtl::init(Device _device) @@ -4744,22 +4751,30 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa { if (bind.m_access == Access::ReadWrite && 0 == (g_caps.supported & BGFX_CAPS_IMAGE_RW)) { - BGFX_FATAL(false, Fatal::DebugCheck, - "Failed to set image with access: Access::ReadWrite, device is not support image read&write"); + BGFX_FATAL( + false + , Fatal::DebugCheck + , "Failed to set image with access: Access::ReadWrite, device is not support image read&write" + ); } - if ( - (bind.m_access == Access::Read && (0 == (g_caps.formats[bind.m_format] & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ))) - || (bind.m_access == Access::Write && (0 == (g_caps.formats[bind.m_format] & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE))) - || (bind.m_access == Access::ReadWrite && (0 == (g_caps.formats[bind.m_format] & (BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ|BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE)))) - ) + if ( (bind.m_access == Access::Read && (0 == (g_caps.formats[bind.m_format] & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ) ) ) + || (bind.m_access == Access::Write && (0 == (g_caps.formats[bind.m_format] & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE) ) ) + || (bind.m_access == Access::ReadWrite && (0 == (g_caps.formats[bind.m_format] & (BGFX_CAPS_FORMAT_TEXTURE_IMAGE_READ|BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE) ) ) ) + ) { - BGFX_FATAL(false, Fatal::DebugCheck, - "Failed to set image with access: %s, format:%s is not supoort", s_accessNames[bind.m_access], bimg::getName(bimg::TextureFormat::Enum(bind.m_format))); + BGFX_FATAL( + false + , Fatal::DebugCheck + , "Failed to set image with access: %s, format:%s is not supoort" + , s_accessNames[bind.m_access] + , bimg::getName(bimg::TextureFormat::Enum(bind.m_format) ) + ); } + TextureMtl& texture = m_textures[bind.m_idx]; texture.commit( - stage + stage , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToVertexShader) , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToFragmentShader) , bind.m_samplerFlags From f8019cb3d45c73f8d89136536a9ec2fe2e40a5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 2 Mar 2023 21:45:20 -0800 Subject: [PATCH 41/86] Cleanup. --- examples/common/entry/dialog_darwin.mm | 2 +- src/renderer_mtl.h | 22 +++++++++------- src/renderer_mtl.mm | 36 +++++++++++++++----------- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/examples/common/entry/dialog_darwin.mm b/examples/common/entry/dialog_darwin.mm index c80a7a91d..acf4278fc 100644 --- a/examples/common/entry/dialog_darwin.mm +++ b/examples/common/entry/dialog_darwin.mm @@ -104,7 +104,7 @@ bool openFileSelectionDialog( panel.message = [[NSString alloc] initWithBytes:_title.getPtr() length:_title.getLength() encoding:NSASCIIStringEncoding]; panel.directoryURL = [NSURL URLWithString:@(_inOutFilePath.getCPtr())]; - panel.allowedFileTypes = fileTypes; + panel.allowedContentTypes = fileTypes; if ([panel runModal] == NSModalResponseOK) { diff --git a/src/renderer_mtl.h b/src/renderer_mtl.h index 1ceba862c..b7f848080 100644 --- a/src/renderer_mtl.h +++ b/src/renderer_mtl.h @@ -62,7 +62,6 @@ namespace bgfx { namespace mtl #endif } - // c++ wrapper // objects with creation functions starting with 'new' has a refcount 1 after creation, object must be destroyed with release. // commandBuffer, commandEncoders are autoreleased objects. Needs AutoreleasePool! @@ -251,8 +250,11 @@ namespace bgfx { namespace mtl [m_obj dispatchThreadgroups:_threadgroupsPerGrid threadsPerThreadgroup:_threadsPerThreadgroup]; } - void dispatchThreadgroupsWithIndirectBuffer(id _indirectBuffer, - NSUInteger _indirectBufferOffset, MTLSize _threadsPerThreadgroup) + void dispatchThreadgroupsWithIndirectBuffer( + id _indirectBuffer + , NSUInteger _indirectBufferOffset + , MTLSize _threadsPerThreadgroup + ) { [m_obj dispatchThreadgroupsWithIndirectBuffer:_indirectBuffer indirectBufferOffset:_indirectBufferOffset threadsPerThreadgroup:_threadsPerThreadgroup]; } @@ -274,9 +276,9 @@ namespace bgfx { namespace mtl MTL_CLASS_END MTL_CLASS(Device) - bool supportsFeatureSet(MTLFeatureSet _featureSet) + bool supportsFamily(MTLGPUFamily _featureSet) { - return [m_obj supportsFeatureSet:_featureSet]; + return [m_obj supportsFamily:_featureSet]; } id newLibraryWithData(const void* _data) @@ -727,11 +729,11 @@ namespace bgfx { namespace mtl return [_str UTF8String]; } -#define MTL_RELEASE(_obj) \ - BX_MACRO_BLOCK_BEGIN \ - [_obj release]; \ - _obj = nil; \ - BX_MACRO_BLOCK_END +#define MTL_RELEASE(_obj) \ + BX_MACRO_BLOCK_BEGIN \ + [_obj release]; \ + _obj = NULL; \ + BX_MACRO_BLOCK_END // end of c++ wrapper diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index bda0d4846..e4933b6bf 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -634,21 +634,21 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa { if (iOSVersionEqualOrGreater("9.0.0") ) { - g_caps.limits.maxTextureSize = m_device.supportsFeatureSet( (MTLFeatureSet)4 /* iOS_GPUFamily3_v1 */) ? 16384 : 8192; + g_caps.limits.maxTextureSize = m_device.supportsFamily( (MTLGPUFamily)4 /* iOS_GPUFamily3_v1 */) ? 16384 : 8192; } else { g_caps.limits.maxTextureSize = 4096; } - g_caps.limits.maxFBAttachments = uint8_t(bx::uint32_min(m_device.supportsFeatureSet( (MTLFeatureSet)1 /* MTLFeatureSet_iOS_GPUFamily2_v1 */) ? 8 : 4, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) ); + g_caps.limits.maxFBAttachments = uint8_t(bx::uint32_min(m_device.supportsFamily( (MTLGPUFamily)1 /* MTLGPUFamily_iOS_GPUFamily2_v1 */) ? 8 : 4, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) ); - g_caps.supported |= m_device.supportsFeatureSet( (MTLFeatureSet)4 /* MTLFeatureSet_iOS_GPUFamily3_v1 */) + g_caps.supported |= m_device.supportsFamily( (MTLGPUFamily)4 /* MTLGPUFamily_iOS_GPUFamily3_v1 */) ? BGFX_CAPS_DRAW_INDIRECT : 0 ; - g_caps.supported |= m_device.supportsFeatureSet( (MTLFeatureSet)11 /* MTLFeatureSet_iOS_GPUFamily4_v1 */) + g_caps.supported |= m_device.supportsFamily( (MTLGPUFamily)11 /* MTLGPUFamily_iOS_GPUFamily4_v1 */) ? BGFX_CAPS_TEXTURE_CUBE_ARRAY : 0 ; @@ -659,7 +659,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa g_caps.limits.maxFBAttachments = 8; g_caps.supported |= BGFX_CAPS_TEXTURE_CUBE_ARRAY; - g_caps.supported |= m_device.supportsFeatureSet( (MTLFeatureSet)10001 /* MTLFeatureSet_macOS_GPUFamily1_v2 */) + g_caps.supported |= m_device.supportsFamily( (MTLGPUFamily)10001 /* MTLGPUFamily_macOS_GPUFamily1_v2 */) ? BGFX_CAPS_DRAW_INDIRECT : 0 ; @@ -1155,7 +1155,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa uint32_t width = m_screenshotTarget.width(); uint32_t height = m_screenshotTarget.height(); uint32_t length = width*height*4; - uint8_t* data = (uint8_t*)BX_ALLOC(g_allocator, length); + uint8_t* data = (uint8_t*)BX_ALLOC(g_allocator, length); MTLRegion region = { { 0, 0, 0 }, { width, height, 1 } }; @@ -1947,8 +1947,8 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa void processArguments( PipelineStateMtl* ps - , NSArray * _vertexArgs - , NSArray * _fragmentArgs + , NSArray* _vertexArgs + , NSArray* _fragmentArgs ) { ps->m_numPredefined = 0; @@ -2069,6 +2069,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa else if (arg.type == MTLArgumentTypeTexture) { const char* name = utf8String(arg.name); + if (arg.index >= BGFX_CONFIG_MAX_TEXTURE_SAMPLERS) { BX_WARN(false, "Binding index is too large %d max is %d. User defined uniform '%s' won't be set.", int(arg.index), BGFX_CONFIG_MAX_TEXTURE_SAMPLERS - 1, name); @@ -2173,7 +2174,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa ? s_renderMtl->m_mainFrameBuffer.m_swapChain : s_renderMtl->m_frameBuffers[_fbh.idx].m_swapChain ; - pd.sampleCount = NULL != swapChain->m_backBufferColorMsaa + pd.rasterSampleCount = NULL != swapChain->m_backBufferColorMsaa ? swapChain->m_backBufferColorMsaa.sampleCount() : 1 ; @@ -2189,7 +2190,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa for (uint32_t ii = 0; ii < frameBuffer.m_num; ++ii) { const TextureMtl& texture = m_textures[frameBuffer.m_colorHandle[ii].idx]; - pd.sampleCount = NULL != texture.m_ptrMsaa + pd.rasterSampleCount = NULL != texture.m_ptrMsaa ? texture.m_ptrMsaa.sampleCount() : 1 ; @@ -2200,7 +2201,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa { const TextureMtl& texture = m_textures[frameBuffer.m_depthHandle.idx]; pd.depthAttachmentPixelFormat = texture.m_ptr.m_obj.pixelFormat; - pd.sampleCount = NULL != texture.m_ptrMsaa + pd.rasterSampleCount = NULL != texture.m_ptrMsaa ? texture.m_ptrMsaa.sampleCount() : 1 ; @@ -2315,6 +2316,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa streamUsed = true; } } + if (streamUsed) { vertexDesc.layouts[stream+1].stride = layout.getStride(); vertexDesc.layouts[stream+1].stepFunction = MTLVertexStepFunctionPerVertex; @@ -2356,7 +2358,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (NULL != reflection) { - processArguments(pso, reflection.vertexArguments, reflection.fragmentArguments); + processArguments(pso, reflection.vertexBindings, reflection.fragmentBindings); } } @@ -2398,8 +2400,12 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa program.m_computePS = pso; ComputePipelineReflection reflection = NULL; - pso->m_cps = m_device.newComputePipelineStateWithFunction(program.m_vsh->m_function, MTLPipelineOptionBufferTypeInfo, &reflection); - processArguments(pso, reflection.arguments, NULL); + pso->m_cps = m_device.newComputePipelineStateWithFunction( + program.m_vsh->m_function + , MTLPipelineOptionBufferTypeInfo + , &reflection + ); + processArguments(pso, reflection.bindings, NULL); for (uint32_t ii = 0; ii < 3; ++ii) { @@ -2429,7 +2435,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa m_samplerDescriptor.maxAnisotropy = (0 != (_flags & (BGFX_SAMPLER_MIN_ANISOTROPIC|BGFX_SAMPLER_MAG_ANISOTROPIC) ) ) ? m_mainFrameBuffer.m_swapChain->m_maxAnisotropy : 1; if (m_macOS11Runtime - || [m_device supportsFeatureSet:(MTLFeatureSet)4 /*MTLFeatureSet_iOS_GPUFamily3_v1*/]) + || [m_device supportsFamily:(MTLGPUFamily)4 /*MTLGPUFamily_iOS_GPUFamily3_v1*/]) { const uint32_t cmpFunc = (_flags&BGFX_SAMPLER_COMPARE_MASK)>>BGFX_SAMPLER_COMPARE_SHIFT; m_samplerDescriptor.compareFunction = 0 == cmpFunc From 70ac58fd38eb2fb3d7e63f6cc350f980c7ce002a Mon Sep 17 00:00:00 2001 From: Jorge Rodriguez Date: Mon, 6 Mar 2023 10:30:06 -0800 Subject: [PATCH 42/86] =?UTF-8?q?Write=20messages=20to=20a=20stream=20spec?= =?UTF-8?q?ified=20by=20the=20caller=20of=20compilerShader=20=E2=80=A6=20(?= =?UTF-8?q?#3054)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Write messages to a stream specified by the caller of compilerShader rather than directly to stdOut, to allow tool writers to easily capture it. * PR updates * Missed a write * PR updates --- tools/shaderc/shaderc.cpp | 126 +++++++++++++++++--------------- tools/shaderc/shaderc.h | 10 +-- tools/shaderc/shaderc_glsl.cpp | 36 ++++----- tools/shaderc/shaderc_hlsl.cpp | 85 +++++++++++---------- tools/shaderc/shaderc_metal.cpp | 66 +++++++++-------- tools/shaderc/shaderc_pssl.cpp | 7 +- tools/shaderc/shaderc_spirv.cpp | 58 ++++++++------- 7 files changed, 205 insertions(+), 183 deletions(-) diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index 24823c0d4..39e95a03f 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -719,10 +719,11 @@ namespace bgfx struct Preprocessor { - Preprocessor(const char* _filePath, bool _essl) + Preprocessor(const char* _filePath, bool _essl, bx::WriterI* _messageWriter) : m_tagptr(m_tags) , m_scratchPos(0) , m_fgetsPos(0) + , m_messageWriter(_messageWriter) { m_tagptr->tag = FPPTAG_USERDATA; m_tagptr->data = this; @@ -883,9 +884,11 @@ namespace bgfx thisClass->m_preprocessed += char(_ch); } - static void fppError(void* /*_userData*/, char* _format, va_list _vargs) + static void fppError(void* _userData, char* _format, va_list _vargs) { - bx::vprintf(_format, _vargs); + bx::ErrorAssert err; + Preprocessor* thisClass = (Preprocessor*)_userData; + bx::write(thisClass->m_messageWriter, _format, _vargs, &err); } char* scratch(const char* _str) @@ -907,6 +910,7 @@ namespace bgfx char m_scratch[16<<10]; uint32_t m_scratchPos; uint32_t m_fgetsPos; + bx::WriterI* m_messageWriter; }; typedef std::vector InOut; @@ -1071,8 +1075,10 @@ namespace bgfx return word; } - bool compileShader(const char* _varying, const char* _comment, char* _shader, uint32_t _shaderLen, Options& _options, bx::WriterI* _writer) + bool compileShader(const char* _varying, const char* _comment, char* _shader, uint32_t _shaderLen, Options& _options, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { + bx::ErrorAssert messageErr; + uint32_t profile_id = 0; const char* profile_opt = _options.profile.c_str(); @@ -1098,14 +1104,14 @@ namespace bgfx if (profile_id == count) { - bx::printf("Unknown profile: %s\n", profile_opt); + bx::write(_messageWriter, &messageErr, "Unknown profile: %s\n", profile_opt); return false; } } const Profile *profile = &s_profiles[profile_id]; - Preprocessor preprocessor(_options.inputFilePath.c_str(), profile->lang == ShadingLang::ESSL); + Preprocessor preprocessor(_options.inputFilePath.c_str(), profile->lang == ShadingLang::ESSL, _messageWriter); for (size_t ii = 0; ii < _options.includeDirs.size(); ++ii) { @@ -1275,7 +1281,7 @@ namespace bgfx break; default: - bx::printf("Unknown type: %c?!", _options.shaderType); + bx::write(_messageWriter, &messageErr, "Unknown type: %c?!", _options.shaderType); return false; } @@ -1460,7 +1466,7 @@ namespace bgfx if (bx::findIdentifierMatch(it->c_str(), s_allowedVertexShaderInputs).isEmpty() ) { invalidShaderAttribute = true; - bx::printf( + bx::write(_messageWriter, &messageErr, "Invalid vertex shader input attribute '%s'.\n" "\n" "Valid input attributes:\n" @@ -1481,49 +1487,49 @@ namespace bgfx { if ('f' == _options.shaderType) { - bx::write(_writer, BGFX_CHUNK_MAGIC_FSH, &err); + bx::write(_shaderWriter, BGFX_CHUNK_MAGIC_FSH, &err); } else if ('v' == _options.shaderType) { - bx::write(_writer, BGFX_CHUNK_MAGIC_VSH, &err); + bx::write(_shaderWriter, BGFX_CHUNK_MAGIC_VSH, &err); } else { - bx::write(_writer, BGFX_CHUNK_MAGIC_CSH, &err); + bx::write(_shaderWriter, BGFX_CHUNK_MAGIC_CSH, &err); } - bx::write(_writer, inputHash, &err); - bx::write(_writer, outputHash, &err); + bx::write(_shaderWriter, inputHash, &err); + bx::write(_shaderWriter, outputHash, &err); } if (raw) { if (profile->lang == ShadingLang::GLSL) { - bx::write(_writer, uint16_t(0), &err); + bx::write(_shaderWriter, uint16_t(0), &err); uint32_t shaderSize = (uint32_t)bx::strLen(input); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, input, shaderSize, &err); - bx::write(_writer, uint8_t(0), &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, input, shaderSize, &err); + bx::write(_shaderWriter, uint8_t(0), &err); compiled = true; } else if (profile->lang == ShadingLang::Metal) { - compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), input, _writer); + compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), input, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::SpirV) { - compiled = compileSPIRVShader(_options, profile->id, input, _writer); + compiled = compileSPIRVShader(_options, profile->id, input, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::PSSL) { - compiled = compilePSSLShader(_options, 0, input, _writer); + compiled = compilePSSLShader(_options, 0, input, _shaderWriter, _messageWriter); } else { - compiled = compileHLSLShader(_options, profile->id, input, _writer); + compiled = compileHLSLShader(_options, profile->id, input, _shaderWriter, _messageWriter); } } else if ('c' == _options.shaderType) // Compute @@ -1531,7 +1537,7 @@ namespace bgfx bx::StringView entry = bx::strFind(input, "void main()"); if (entry.isEmpty() ) { - bx::printf("Shader entry point 'void main()' is not found.\n"); + bx::write(_messageWriter, &messageErr, "Shader entry point 'void main()' is not found.\n"); } else { @@ -1618,7 +1624,7 @@ namespace bgfx if (_options.preprocessOnly) { bx::write( - _writer + _shaderWriter , preprocessor.m_preprocessed.c_str() , (int32_t)preprocessor.m_preprocessed.size() , &err @@ -1630,9 +1636,9 @@ namespace bgfx { std::string code; - bx::write(_writer, BGFX_CHUNK_MAGIC_CSH, &err); - bx::write(_writer, uint32_t(0), &err); - bx::write(_writer, outputHash, &err); + bx::write(_shaderWriter, BGFX_CHUNK_MAGIC_CSH, &err); + bx::write(_shaderWriter, uint32_t(0), &err); + bx::write(_shaderWriter, outputHash, &err); if (profile->lang == ShadingLang::GLSL || profile->lang == ShadingLang::ESSL) @@ -1652,12 +1658,12 @@ namespace bgfx code += preprocessor.m_preprocessed; - bx::write(_writer, uint16_t(0), &err); + bx::write(_shaderWriter, uint16_t(0), &err); uint32_t shaderSize = (uint32_t)code.size(); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, code.c_str(), shaderSize, &err); - bx::write(_writer, uint8_t(0), &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, code.c_str(), shaderSize, &err); + bx::write(_shaderWriter, uint8_t(0), &err); compiled = true; } @@ -1668,19 +1674,19 @@ namespace bgfx if (profile->lang == ShadingLang::Metal) { - compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), code, _writer); + compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), code, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::SpirV) { - compiled = compileSPIRVShader(_options, profile->id, code, _writer); + compiled = compileSPIRVShader(_options, profile->id, code, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::PSSL) { - compiled = compilePSSLShader(_options, 0, code, _writer); + compiled = compilePSSLShader(_options, 0, code, _shaderWriter, _messageWriter); } else { - compiled = compileHLSLShader(_options, profile->id, code, _writer); + compiled = compileHLSLShader(_options, profile->id, code, _shaderWriter, _messageWriter); } } } @@ -1708,7 +1714,7 @@ namespace bgfx bx::StringView entry = bx::strFind(shader, "void main()"); if (entry.isEmpty() ) { - bx::printf("Shader entry point 'void main()' is not found.\n"); + bx::write(_messageWriter, &messageErr, "Shader entry point 'void main()' is not found.\n"); } else { @@ -1959,7 +1965,7 @@ namespace bgfx } else { - bx::printf("gl_PrimitiveID builtin is not supported by D3D9 HLSL.\n"); + bx::write(_messageWriter, &messageErr, "gl_PrimitiveID builtin is not supported by D3D9 HLSL.\n"); return false; } } @@ -2034,7 +2040,7 @@ namespace bgfx } else { - bx::printf("gl_ViewportIndex builtin is not supported by D3D9 HLSL.\n"); + bx::write(_messageWriter, &messageErr, "gl_ViewportIndex builtin is not supported by D3D9 HLSL.\n"); return false; } } @@ -2050,7 +2056,7 @@ namespace bgfx } else { - bx::printf("gl_Layer builtin is not supported by D3D9 HLSL.\n"); + bx::write(_messageWriter, &messageErr, "gl_Layer builtin is not supported by D3D9 HLSL.\n"); return false; } } @@ -2089,7 +2095,7 @@ namespace bgfx } else { - bx::printf("gl_VertexID builtin is not supported by D3D9 HLSL.\n"); + bx::write(_messageWriter, &messageErr, "gl_VertexID builtin is not supported by D3D9 HLSL.\n"); return false; } } @@ -2105,7 +2111,7 @@ namespace bgfx } else { - bx::printf("gl_InstanceID builtin is not supported by D3D9 HLSL.\n"); + bx::write(_messageWriter, &messageErr, "gl_InstanceID builtin is not supported by D3D9 HLSL.\n"); return false; } } @@ -2147,7 +2153,7 @@ namespace bgfx if (_options.preprocessOnly) { bx::write( - _writer + _shaderWriter , preprocessor.m_preprocessed.c_str() , (int32_t)preprocessor.m_preprocessed.size() , &err @@ -2161,21 +2167,21 @@ namespace bgfx if ('f' == _options.shaderType) { - bx::write(_writer, BGFX_CHUNK_MAGIC_FSH, &err); - bx::write(_writer, inputHash, &err); - bx::write(_writer, uint32_t(0), &err); + bx::write(_shaderWriter, BGFX_CHUNK_MAGIC_FSH, &err); + bx::write(_shaderWriter, inputHash, &err); + bx::write(_shaderWriter, uint32_t(0), &err); } else if ('v' == _options.shaderType) { - bx::write(_writer, BGFX_CHUNK_MAGIC_VSH, &err); - bx::write(_writer, uint32_t(0), &err); - bx::write(_writer, outputHash, &err); + bx::write(_shaderWriter, BGFX_CHUNK_MAGIC_VSH, &err); + bx::write(_shaderWriter, uint32_t(0), &err); + bx::write(_shaderWriter, outputHash, &err); } else { - bx::write(_writer, BGFX_CHUNK_MAGIC_CSH, &err); - bx::write(_writer, uint32_t(0), &err); - bx::write(_writer, outputHash, &err); + bx::write(_shaderWriter, BGFX_CHUNK_MAGIC_CSH, &err); + bx::write(_shaderWriter, uint32_t(0), &err); + bx::write(_shaderWriter, outputHash, &err); } if (profile->lang == ShadingLang::GLSL @@ -2538,12 +2544,12 @@ namespace bgfx { code += preprocessor.m_preprocessed; - bx::write(_writer, uint16_t(0), &err); + bx::write(_shaderWriter, uint16_t(0), &err); uint32_t shaderSize = (uint32_t)code.size(); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, code.c_str(), shaderSize, &err); - bx::write(_writer, uint8_t(0), &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, code.c_str(), shaderSize, &err); + bx::write(_shaderWriter, uint8_t(0), &err); compiled = true; } @@ -2557,7 +2563,7 @@ namespace bgfx glsl_profile |= 0x80000000; } - compiled = compileGLSLShader(_options, glsl_profile, code, _writer); + compiled = compileGLSLShader(_options, glsl_profile, code, _shaderWriter, _messageWriter); } } else @@ -2567,19 +2573,19 @@ namespace bgfx if (profile->lang == ShadingLang::Metal) { - compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), code, _writer); + compiled = compileMetalShader(_options, BX_MAKEFOURCC('M', 'T', 'L', 0), code, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::SpirV) { - compiled = compileSPIRVShader(_options, profile->id, code, _writer); + compiled = compileSPIRVShader(_options, profile->id, code, _shaderWriter, _messageWriter); } else if (profile->lang == ShadingLang::PSSL) { - compiled = compilePSSLShader(_options, 0, code, _writer); + compiled = compilePSSLShader(_options, 0, code, _shaderWriter, _messageWriter); } else { - compiled = compileHLSLShader(_options, profile->id, code, _writer); + compiled = compileHLSLShader(_options, profile->id, code, _shaderWriter, _messageWriter); } } } @@ -2837,7 +2843,7 @@ namespace bgfx } } - compiled = compileShader(varying, commandLineComment.c_str(), data, size, options, consoleOut ? bx::getStdOut() : writer); + compiled = compileShader(varying, commandLineComment.c_str(), data, size, options, consoleOut ? bx::getStdOut() : writer, bx::getStdOut()); if (!consoleOut) { diff --git a/tools/shaderc/shaderc.h b/tools/shaderc/shaderc.h index bf2657a72..43a1fc694 100644 --- a/tools/shaderc/shaderc.h +++ b/tools/shaderc/shaderc.h @@ -119,11 +119,11 @@ namespace bgfx int32_t writef(bx::WriterI* _writer, const char* _format, ...); void writeFile(const char* _filePath, const void* _data, int32_t _size); - bool compileGLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer); - bool compileHLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer); - bool compileMetalShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer); - bool compilePSSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer); - bool compileSPIRVShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer); + bool compileGLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bx::WriterI* _messages); + bool compileHLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bx::WriterI* _messages); + bool compileMetalShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bx::WriterI* _messages); + bool compilePSSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bx::WriterI* _messages); + bool compileSPIRVShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bx::WriterI* _messages); const char* getPsslPreamble(); diff --git a/tools/shaderc/shaderc_glsl.cpp b/tools/shaderc/shaderc_glsl.cpp index 33df30946..273e2a3dd 100644 --- a/tools/shaderc/shaderc_glsl.cpp +++ b/tools/shaderc/shaderc_glsl.cpp @@ -8,8 +8,10 @@ namespace bgfx { namespace glsl { - static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer) + static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { + bx::ErrorAssert messageErr; + char ch = _options.shaderType; const glslopt_shader_type type = ch == 'f' ? kGlslOptShaderFragment @@ -53,7 +55,7 @@ namespace bgfx { namespace glsl } printCode(_code.c_str(), line, start, end, column); - bx::printf("Error: %s\n", log); + bx::write(_messageWriter, &messageErr, "Error: %s\n", log); glslopt_shader_delete(shader); glslopt_cleanup(ctx); return false; @@ -348,22 +350,22 @@ namespace bgfx { namespace glsl bx::ErrorAssert err; uint16_t count = (uint16_t)uniforms.size(); - bx::write(_writer, count, &err); + bx::write(_shaderWriter, count, &err); for (UniformArray::const_iterator it = uniforms.begin(); it != uniforms.end(); ++it) { const Uniform& un = *it; uint8_t nameSize = (uint8_t)un.name.size(); - bx::write(_writer, nameSize, &err); - bx::write(_writer, un.name.c_str(), nameSize, &err); + bx::write(_shaderWriter, nameSize, &err); + bx::write(_shaderWriter, un.name.c_str(), nameSize, &err); uint8_t uniformType = uint8_t(un.type); - bx::write(_writer, uniformType, &err); - bx::write(_writer, un.num, &err); - bx::write(_writer, un.regIndex, &err); - bx::write(_writer, un.regCount, &err); - bx::write(_writer, un.texComponent, &err); - bx::write(_writer, un.texDimension, &err); - bx::write(_writer, un.texFormat, &err); + bx::write(_shaderWriter, uniformType, &err); + bx::write(_shaderWriter, un.num, &err); + bx::write(_shaderWriter, un.regIndex, &err); + bx::write(_shaderWriter, un.regCount, &err); + bx::write(_shaderWriter, un.texComponent, &err); + bx::write(_shaderWriter, un.texDimension, &err); + bx::write(_shaderWriter, un.texFormat, &err); BX_TRACE("%s, %s, %d, %d, %d" , un.name.c_str() @@ -375,10 +377,10 @@ namespace bgfx { namespace glsl } uint32_t shaderSize = (uint32_t)bx::strLen(optimizedShader); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, optimizedShader, shaderSize, &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, optimizedShader, shaderSize, &err); uint8_t nul = 0; - bx::write(_writer, nul, &err); + bx::write(_shaderWriter, nul, &err); if (_options.disasm ) { @@ -394,9 +396,9 @@ namespace bgfx { namespace glsl } // namespace glsl - bool compileGLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer) + bool compileGLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { - return glsl::compile(_options, _version, _code, _writer); + return glsl::compile(_options, _version, _code, _shaderWriter, _messageWriter); } } // namespace bgfx diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 37a6bc9c8..2397304cd 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -80,8 +80,10 @@ namespace bgfx { namespace hlsl static const D3DCompiler* s_compiler; static void* s_d3dcompilerdll; - const D3DCompiler* load() + const D3DCompiler* load(bx::WriterI* _messageWriter) { + bx::Error messageErr; + for (uint32_t ii = 0; ii < BX_COUNTOF(s_d3dcompiler); ++ii) { const D3DCompiler* compiler = &s_d3dcompiler[ii]; @@ -115,7 +117,7 @@ namespace bgfx { namespace hlsl return compiler; } - bx::printf("Error: Unable to open D3DCompiler_*.dll shader compiler.\n"); + bx::write(_messageWriter, &messageErr, "Error: Unable to open D3DCompiler_*.dll shader compiler.\n"); return NULL; } @@ -276,8 +278,10 @@ namespace bgfx { namespace hlsl return false; } - bool getReflectionDataD3D9(ID3DBlob* _code, UniformArray& _uniforms) + bool getReflectionDataD3D9(ID3DBlob* _code, UniformArray& _uniforms, bx::WriterI* _messageWriter) { + bx::ErrorAssert messageErr; + // see reference for magic values: https://msdn.microsoft.com/en-us/library/ff552891(VS.85).aspx const uint32_t D3DSIO_COMMENT = 0x0000FFFE; const uint32_t D3DSIO_END = 0x0000FFFF; @@ -311,7 +315,7 @@ namespace bgfx { namespace hlsl uint32_t tableSize = (commentSize - 1) * 4; if (tableSize < sizeof(CTHeader) || header->Size != sizeof(CTHeader) ) { - bx::printf("Error: Invalid constant table data\n"); + bx::write(_messageWriter, &messageErr, "Error: Invalid constant table data\n"); return false; } break; @@ -323,7 +327,7 @@ namespace bgfx { namespace hlsl if (!header) { - bx::printf("Error: Could not find constant table data\n"); + bx::write(_messageWriter, &messageErr, "Error: Could not find constant table data\n"); return false; } @@ -381,8 +385,10 @@ namespace bgfx { namespace hlsl return true; } - bool getReflectionDataD3D11(ID3DBlob* _code, bool _vshader, UniformArray& _uniforms, uint8_t& _numAttrs, uint16_t* _attrs, uint16_t& _size, UniformNameList& unusedUniforms) + bool getReflectionDataD3D11(ID3DBlob* _code, bool _vshader, UniformArray& _uniforms, uint8_t& _numAttrs, uint16_t* _attrs, uint16_t& _size, UniformNameList& unusedUniforms, bx::WriterI* _messageWriter) { + bx::Error messageErr; + ID3D11ShaderReflection* reflect = NULL; HRESULT hr = D3DReflect(_code->GetBufferPointer() , _code->GetBufferSize() @@ -391,7 +397,7 @@ namespace bgfx { namespace hlsl ); if (FAILED(hr) ) { - bx::printf("Error: D3DReflect failed 0x%08x\n", (uint32_t)hr); + bx::write(_messageWriter, &messageErr, "Error: D3DReflect failed 0x%08x\n", (uint32_t)hr); return false; } @@ -399,7 +405,7 @@ namespace bgfx { namespace hlsl hr = reflect->GetDesc(&desc); if (FAILED(hr) ) { - bx::printf("Error: ID3D11ShaderReflection::GetDesc failed 0x%08x\n", (uint32_t)hr); + bx::write(_messageWriter, &messageErr, "Error: ID3D11ShaderReflection::GetDesc failed 0x%08x\n", (uint32_t)hr); return false; } @@ -553,13 +559,15 @@ namespace bgfx { namespace hlsl return true; } - static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bool _firstPass) + static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter, bool _firstPass) { + bx::Error messageErr; + const char* profile = _options.profile.c_str(); if (profile[0] == '\0') { - bx::printf("Error: Shader profile must be specified.\n"); + bx::write(_messageWriter, &messageErr, "Error: Shader profile must be specified.\n"); return false; } @@ -567,7 +575,7 @@ namespace bgfx { namespace hlsl profileAndType[0] = (_options.shaderType == 'f') ? 'p' : _options.shaderType; bx::strCat(profileAndType, BX_COUNTOF(profileAndType), profile); - s_compiler = load(); + s_compiler = load(_messageWriter); bool result = false; bool debug = _options.debugInformation; @@ -660,7 +668,7 @@ namespace bgfx { namespace hlsl } printCode(_code.c_str(), line, start, end, column); - bx::printf("Error: D3DCompile failed 0x%08x %s\n", (uint32_t)hr, log); + bx::write(_messageWriter, &messageErr, "Error: D3DCompile failed 0x%08x %s\n", (uint32_t)hr, log); errorMsg->Release(); return false; } @@ -672,18 +680,18 @@ namespace bgfx { namespace hlsl if (_version < 400) { - if (!getReflectionDataD3D9(code, uniforms) ) + if (!getReflectionDataD3D9(code, uniforms, _messageWriter) ) { - bx::printf("Error: Unable to get D3D9 reflection data.\n"); + bx::write(_messageWriter, &messageErr, "Error: Unable to get D3D9 reflection data.\n"); goto error; } } else { UniformNameList unusedUniforms; - if (!getReflectionDataD3D11(code, profileAndType[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms) ) + if (!getReflectionDataD3D11(code, profileAndType[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms, _messageWriter) ) { - bx::printf("Error: Unable to get D3D11 reflection data.\n"); + bx::write(_messageWriter, &messageErr, "Error: Unable to get D3D11 reflection data.\n"); goto error; } @@ -732,29 +740,29 @@ namespace bgfx { namespace hlsl } // recompile with the unused uniforms converted to statics - return compile(_options, _version, output.c_str(), _writer, false); + return compile(_options, _version, output.c_str(), _shaderWriter, _messageWriter, false); } } { uint16_t count = (uint16_t)uniforms.size(); - bx::write(_writer, count, &err); + bx::write(_shaderWriter, count, &err); uint32_t fragmentBit = profileAndType[0] == 'p' ? kUniformFragmentBit : 0; for (UniformArray::const_iterator it = uniforms.begin(); it != uniforms.end(); ++it) { const Uniform& un = *it; uint8_t nameSize = (uint8_t)un.name.size(); - bx::write(_writer, nameSize, &err); - bx::write(_writer, un.name.c_str(), nameSize, &err); + bx::write(_shaderWriter, nameSize, &err); + bx::write(_shaderWriter, un.name.c_str(), nameSize, &err); uint8_t type = uint8_t(un.type | fragmentBit); - bx::write(_writer, type, &err); - bx::write(_writer, un.num, &err); - bx::write(_writer, un.regIndex, &err); - bx::write(_writer, un.regCount, &err); - bx::write(_writer, un.texComponent, &err); - bx::write(_writer, un.texDimension, &err); - bx::write(_writer, un.texFormat, &err); + bx::write(_shaderWriter, type, &err); + bx::write(_shaderWriter, un.num, &err); + bx::write(_shaderWriter, un.regIndex, &err); + bx::write(_shaderWriter, un.regCount, &err); + bx::write(_shaderWriter, un.texComponent, &err); + bx::write(_shaderWriter, un.texDimension, &err); + bx::write(_shaderWriter, un.texFormat, &err); BX_TRACE("%s, %s, %d, %d, %d" , un.name.c_str() @@ -784,18 +792,18 @@ namespace bgfx { namespace hlsl { uint32_t shaderSize = uint32_t(code->GetBufferSize() ); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, code->GetBufferPointer(), shaderSize, &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, code->GetBufferPointer(), shaderSize, &err); uint8_t nul = 0; - bx::write(_writer, nul, &err); + bx::write(_shaderWriter, nul, &err); } if (_version >= 400) { - bx::write(_writer, numAttrs, &err); - bx::write(_writer, attrs, numAttrs*sizeof(uint16_t), &err); + bx::write(_shaderWriter, numAttrs, &err); + bx::write(_shaderWriter, attrs, numAttrs*sizeof(uint16_t), &err); - bx::write(_writer, size, &err); + bx::write(_shaderWriter, size, &err); } if (_options.disasm ) @@ -832,9 +840,9 @@ namespace bgfx { namespace hlsl } // namespace hlsl - bool compileHLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer) + bool compileHLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { - return hlsl::compile(_options, _version, _code, _writer, true); + return hlsl::compile(_options, _version, _code, _shaderWriter, _messageWriter, true); } } // namespace bgfx @@ -843,10 +851,11 @@ namespace bgfx { namespace hlsl namespace bgfx { - bool compileHLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer) + bool compileHLSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { - BX_UNUSED(_options, _version, _code, _writer); - bx::printf("HLSL compiler is not supported on this platform.\n"); + BX_UNUSED(_options, _version, _code, _shaderWriter); + bx::Error messageErr; + bx::write(_messageWriter, &messageErr, "HLSL compiler is not supported on this platform.\n"); return false; } diff --git a/tools/shaderc/shaderc_metal.cpp b/tools/shaderc/shaderc_metal.cpp index 670314f35..744e3e366 100644 --- a/tools/shaderc/shaderc_metal.cpp +++ b/tools/shaderc/shaderc_metal.cpp @@ -225,14 +225,14 @@ namespace bgfx { namespace metal "BgfxSampler2DMS", }; - static uint16_t writeUniformArray(bx::WriterI* _writer, const UniformArray& uniforms, bool isFragmentShader) + static uint16_t writeUniformArray(bx::WriterI* _shaderWriter, const UniformArray& uniforms, bool isFragmentShader) { uint16_t size = 0; bx::ErrorAssert err; uint16_t count = uint16_t(uniforms.size()); - bx::write(_writer, count, &err); + bx::write(_shaderWriter, count, &err); uint32_t fragmentBit = isFragmentShader ? kUniformFragmentBit : 0; for (uint16_t ii = 0; ii < count; ++ii) @@ -242,15 +242,15 @@ namespace bgfx { namespace metal size += un.regCount*16; uint8_t nameSize = (uint8_t)un.name.size(); - bx::write(_writer, nameSize, &err); - bx::write(_writer, un.name.c_str(), nameSize, &err); - bx::write(_writer, uint8_t(un.type | fragmentBit), &err); - bx::write(_writer, un.num, &err); - bx::write(_writer, un.regIndex, &err); - bx::write(_writer, un.regCount, &err); - bx::write(_writer, un.texComponent, &err); - bx::write(_writer, un.texDimension, &err); - bx::write(_writer, un.texFormat, &err); + bx::write(_shaderWriter, nameSize, &err); + bx::write(_shaderWriter, un.name.c_str(), nameSize, &err); + bx::write(_shaderWriter, uint8_t(un.type | fragmentBit), &err); + bx::write(_shaderWriter, un.num, &err); + bx::write(_shaderWriter, un.regIndex, &err); + bx::write(_shaderWriter, un.regCount, &err); + bx::write(_shaderWriter, un.texComponent, &err); + bx::write(_shaderWriter, un.texDimension, &err); + bx::write(_shaderWriter, un.texFormat, &err); BX_TRACE("%s, %s, %d, %d, %d" , un.name.c_str() @@ -263,16 +263,18 @@ namespace bgfx { namespace metal return size; } - static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bool _firstPass) + static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter, bool _firstPass) { BX_UNUSED(_version); + bx::ErrorAssert messageErr; + glslang::InitializeProcess(); EShLanguage stage = getLang(_options.shaderType); if (EShLangCount == stage) { - bx::printf("Error: Unknown shader type '%c'.\n", _options.shaderType); + bx::write(_messageWriter, &messageErr, "Error: Unknown shader type '%c'.\n", _options.shaderType); return false; } @@ -338,7 +340,7 @@ namespace bgfx { namespace metal printCode(_code.c_str(), line, start, end, column); - bx::printf("%s\n", log); + bx::write(_messageWriter, &messageErr, "%s\n", log); } } else @@ -354,7 +356,7 @@ namespace bgfx { namespace metal const char* log = program->getInfoLog(); if (NULL != log) { - bx::printf("%s\n", log); + bx::write(_messageWriter, &messageErr, "%s\n", log); } } else @@ -434,7 +436,7 @@ namespace bgfx { namespace metal // recompile with the unused uniforms converted to statics delete program; delete shader; - return compile(_options, _version, output.c_str(), _writer, false); + return compile(_options, _version, output.c_str(), _shaderWriter, _messageWriter, false); } UniformArray uniforms; @@ -498,14 +500,14 @@ namespace bgfx { namespace metal spvtools::Optimizer opt(SPV_ENV_VULKAN_1_0); - auto print_msg_to_stderr = []( + auto print_msg_to_stderr = [_messageWriter, &messageErr]( spv_message_level_t , const char* , const spv_position_t& , const char* m ) { - bx::printf("Error: %s\n", m); + bx::write(_messageWriter, &messageErr, "Error: %s\n", m); }; opt.SetMessageConsumer(print_msg_to_stderr); @@ -554,7 +556,7 @@ namespace bgfx { namespace metal uniforms.push_back(un); } - uint16_t size = writeUniformArray( _writer, uniforms, _options.shaderType == 'f'); + uint16_t size = writeUniformArray(_shaderWriter, uniforms, _options.shaderType == 'f'); bx::Error err; @@ -642,42 +644,42 @@ namespace bgfx { namespace metal for (int i = 0; i < 3; ++i) { uint16_t dim = (uint16_t)msl.get_execution_mode_argument(spv::ExecutionMode::ExecutionModeLocalSize, i); - bx::write(_writer, dim, &err); + bx::write(_shaderWriter, dim, &err); } } uint32_t shaderSize = (uint32_t)source.size(); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, source.c_str(), shaderSize, &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, source.c_str(), shaderSize, &err); uint8_t nul = 0; - bx::write(_writer, nul, &err); + bx::write(_shaderWriter, nul, &err); } else { uint32_t shaderSize = (uint32_t)spirv.size() * sizeof(uint32_t); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, spirv.data(), shaderSize, &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, spirv.data(), shaderSize, &err); uint8_t nul = 0; - bx::write(_writer, nul, &err); + bx::write(_shaderWriter, nul, &err); } // const uint8_t numAttr = (uint8_t)program->getNumLiveAttributes(); - bx::write(_writer, numAttr, &err); + bx::write(_shaderWriter, numAttr, &err); for (uint8_t ii = 0; ii < numAttr; ++ii) { bgfx::Attrib::Enum attr = toAttribEnum(program->getAttributeName(ii) ); if (bgfx::Attrib::Count != attr) { - bx::write(_writer, bgfx::attribToId(attr), &err); + bx::write(_shaderWriter, bgfx::attribToId(attr), &err); } else { - bx::write(_writer, uint16_t(UINT16_MAX), &err); + bx::write(_shaderWriter, uint16_t(UINT16_MAX), &err); } } - bx::write(_writer, size, &err); + bx::write(_shaderWriter, size, &err); } } } @@ -692,9 +694,9 @@ namespace bgfx { namespace metal } // namespace metal - bool compileMetalShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer) + bool compileMetalShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { - return metal::compile(_options, _version, _code, _writer, true); + return metal::compile(_options, _version, _code, _shaderWriter, _messageWriter, true); } } // namespace bgfx diff --git a/tools/shaderc/shaderc_pssl.cpp b/tools/shaderc/shaderc_pssl.cpp index 4856edd59..9a6dc838d 100644 --- a/tools/shaderc/shaderc_pssl.cpp +++ b/tools/shaderc/shaderc_pssl.cpp @@ -7,10 +7,11 @@ namespace bgfx { - bool compilePSSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer) + bool compilePSSLShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { - BX_UNUSED(_options, _version, _code, _writer); - bx::printf("PSSL compiler is not supported.\n"); + BX_UNUSED(_options, _version, _code, _shaderWriter); + bx::ErrorAssert messageErr; + bx::write(_messageWriter, &messageErr, "PSSL compiler is not supported.\n"); return false; } diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp index 4b436ad16..f27ef832d 100644 --- a/tools/shaderc/shaderc_spirv.cpp +++ b/tools/shaderc/shaderc_spirv.cpp @@ -331,14 +331,14 @@ namespace bgfx { namespace spirv "BgfxSampler2DMS", }; - static uint16_t writeUniformArray(bx::WriterI* _writer, const UniformArray& uniforms, bool isFragmentShader) + static uint16_t writeUniformArray(bx::WriterI* _shaderWriter, const UniformArray& uniforms, bool isFragmentShader) { uint16_t size = 0; bx::ErrorAssert err; uint16_t count = uint16_t(uniforms.size()); - bx::write(_writer, count, &err); + bx::write(_shaderWriter, count, &err); uint32_t fragmentBit = isFragmentShader ? kUniformFragmentBit : 0; @@ -352,15 +352,15 @@ namespace bgfx { namespace spirv } uint8_t nameSize = (uint8_t)un.name.size(); - bx::write(_writer, nameSize, &err); - bx::write(_writer, un.name.c_str(), nameSize, &err); - bx::write(_writer, uint8_t(un.type | fragmentBit), &err); - bx::write(_writer, un.num, &err); - bx::write(_writer, un.regIndex, &err); - bx::write(_writer, un.regCount, &err); - bx::write(_writer, un.texComponent, &err); - bx::write(_writer, un.texDimension, &err); - bx::write(_writer, un.texFormat, &err); + bx::write(_shaderWriter, nameSize, &err); + bx::write(_shaderWriter, un.name.c_str(), nameSize, &err); + bx::write(_shaderWriter, uint8_t(un.type | fragmentBit), &err); + bx::write(_shaderWriter, un.num, &err); + bx::write(_shaderWriter, un.regIndex, &err); + bx::write(_shaderWriter, un.regCount, &err); + bx::write(_shaderWriter, un.texComponent, &err); + bx::write(_shaderWriter, un.texDimension, &err); + bx::write(_shaderWriter, un.texFormat, &err); BX_TRACE("%s, %s, %d, %d, %d" , un.name.c_str() @@ -438,16 +438,18 @@ namespace bgfx { namespace spirv /// The value is 100. constexpr int s_GLSL_VULKAN_CLIENT_VERSION = 100; - static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bool _firstPass) + static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter, bool _firstPass) { BX_UNUSED(_version); + bx::ErrorAssert messageErr; + glslang::InitializeProcess(); EShLanguage stage = getLang(_options.shaderType); if (EShLangCount == stage) { - bx::printf("Error: Unknown shader type '%c'.\n", _options.shaderType); + bx::write(_messageWriter, &messageErr, "Error: Unknown shader type '%c'.\n", _options.shaderType); return false; } @@ -519,7 +521,7 @@ namespace bgfx { namespace spirv printCode(_code.c_str(), line, start, end, column); - bx::printf("%s\n", log); + bx::write(_messageWriter, &messageErr, "%s\n", log); } } else @@ -535,7 +537,7 @@ namespace bgfx { namespace spirv const char* log = program->getInfoLog(); if (NULL != log) { - bx::printf("%s\n", log); + bx::write(_messageWriter, &messageErr, "%s\n", log); } } else @@ -640,7 +642,7 @@ namespace bgfx { namespace spirv // recompile with the unused uniforms converted to statics delete program; delete shader; - return compile(_options, _version, output.c_str(), _writer, false); + return compile(_options, _version, output.c_str(), _shaderWriter, _messageWriter, false); } UniformArray uniforms; @@ -708,14 +710,14 @@ namespace bgfx { namespace spirv spvtools::Optimizer opt(getSpirvTargetVersion(_version)); - auto print_msg_to_stderr = []( + auto print_msg_to_stderr = [_messageWriter, &messageErr]( spv_message_level_t , const char* , const spv_position_t& , const char* m ) { - bx::printf("Error: %s\n", m); + bx::write(_messageWriter, &messageErr, "Error: %s\n", m); }; opt.SetMessageConsumer(print_msg_to_stderr); @@ -842,31 +844,31 @@ namespace bgfx { namespace spirv uniforms.push_back(un); } - uint16_t size = writeUniformArray( _writer, uniforms, _options.shaderType == 'f'); + uint16_t size = writeUniformArray(_shaderWriter, uniforms, _options.shaderType == 'f'); uint32_t shaderSize = (uint32_t)spirv.size() * sizeof(uint32_t); - bx::write(_writer, shaderSize, &err); - bx::write(_writer, spirv.data(), shaderSize, &err); + bx::write(_shaderWriter, shaderSize, &err); + bx::write(_shaderWriter, spirv.data(), shaderSize, &err); uint8_t nul = 0; - bx::write(_writer, nul, &err); + bx::write(_shaderWriter, nul, &err); const uint8_t numAttr = (uint8_t)program->getNumLiveAttributes(); - bx::write(_writer, numAttr, &err); + bx::write(_shaderWriter, numAttr, &err); for (uint8_t ii = 0; ii < numAttr; ++ii) { bgfx::Attrib::Enum attr = toAttribEnum(program->getAttributeName(ii) ); if (bgfx::Attrib::Count != attr) { - bx::write(_writer, bgfx::attribToId(attr), &err); + bx::write(_shaderWriter, bgfx::attribToId(attr), &err); } else { - bx::write(_writer, uint16_t(UINT16_MAX), &err); + bx::write(_shaderWriter, uint16_t(UINT16_MAX), &err); } } - bx::write(_writer, size, &err); + bx::write(_shaderWriter, size, &err); } } } @@ -881,9 +883,9 @@ namespace bgfx { namespace spirv } // namespace spirv - bool compileSPIRVShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer) + bool compileSPIRVShader(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _shaderWriter, bx::WriterI* _messageWriter) { - return spirv::compile(_options, _version, _code, _writer, true); + return spirv::compile(_options, _version, _code, _shaderWriter, _messageWriter, true); } } // namespace bgfx From c3d55ba9f5ecf110bdb7cf72843480647324a873 Mon Sep 17 00:00:00 2001 From: Raziel Alphadios <64050682+RazielXYZ@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:51:34 +0200 Subject: [PATCH 43/86] Update supported platforms and compilers (#3057) * Update supported platforms and compilers * Update overview doc too --------- Co-authored-by: Raziel Alphadios --- README.md | 9 +++++---- docs/overview.rst | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4182d3f5d..20d1979ff 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Supported platforms: * iOS (iPhone, iPad, AppleTV) * Linux * MIPS Creator CI20 - * OSX (10.12+) + * OSX (11+) * PlayStation 4 * RaspberryPi * UWP (Universal Windows, Xbox One) @@ -62,9 +62,10 @@ Supported platforms: Supported compilers: - * Clang 3.3 and above - * GCC 5 and above - * VS2017 and above + * Clang 11 and above + * GCC 8 and above + * VS2019 and above + * Apple clang 12 and above Languages: diff --git a/docs/overview.rst b/docs/overview.rst index ab119e79d..f7f164f2c 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -39,7 +39,7 @@ Supported Platforms - iOS (iPhone, iPad, AppleTV) - Linux - MIPS Creator CI20 -- OSX (10.12+) +- OSX (11+) - PlayStation 4 - RaspberryPi - UWP (Universal Windows, Xbox One) @@ -49,9 +49,10 @@ Supported Platforms Supported Compilers ~~~~~~~~~~~~~~~~~~~ -- Clang 3.3 and above -- GCC 5 and above -- vs2017 and above +- Clang 11 and above +- GCC 8 and above +- VS2019 and above +- Apple clang 12 and above Supported Languages ~~~~~~~~~~~~~~~~~~~ From 0c5b986fafbe167fcddba52c03a4b85e9a8d1db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:03:45 -0700 Subject: [PATCH 44/86] Updated ImGui. --- 3rdparty/dear-imgui/imgui.cpp | 832 +++++++++++------- 3rdparty/dear-imgui/imgui.h | 103 ++- 3rdparty/dear-imgui/imgui_demo.cpp | 122 ++- 3rdparty/dear-imgui/imgui_draw.cpp | 14 +- 3rdparty/dear-imgui/imgui_internal.h | 160 ++-- 3rdparty/dear-imgui/imgui_tables.cpp | 63 +- 3rdparty/dear-imgui/imgui_widgets.cpp | 272 ++++-- 3rdparty/dear-imgui/widgets/memory_editor.inl | 4 +- 8 files changed, 986 insertions(+), 584 deletions(-) diff --git a/3rdparty/dear-imgui/imgui.cpp b/3rdparty/dear-imgui/imgui.cpp index 24fb8fd3a..40f96216f 100644 --- a/3rdparty/dear-imgui/imgui.cpp +++ b/3rdparty/dear-imgui/imgui.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.3 WIP +// dear imgui, v1.89.5 WIP // (main code and documentation) // Help: @@ -39,14 +39,13 @@ Index of this file: DOCUMENTATION - MISSION STATEMENT -- END-USER GUIDE +- CONTROLS GUIDE - PROGRAMMER GUIDE - READ FIRST - HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI - GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE - HOW A SIMPLE APPLICATION MAY LOOK LIKE - HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE - - USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS - API BREAKING CHANGES (read me when you update!) - FREQUENTLY ASKED QUESTIONS (FAQ) - Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer) @@ -114,27 +113,73 @@ CODE - Limited layout features, intricate layouts are typically crafted in code. - END-USER GUIDE + CONTROLS GUIDE ============== - - Double-click on title bar to collapse window. - - Click upper right corner to close a window, available when 'bool* p_open' is passed to ImGui::Begin(). - - Click and drag on lower right corner to resize window (double-click to auto fit window to its contents). - - Click and drag on any empty space to move window. - - TAB/SHIFT+TAB to cycle through keyboard editable fields. - - CTRL+Click on a slider or drag box to input value as text. - - Use mouse wheel to scroll. - - Text editor: - - Hold SHIFT or use mouse to select text. - - CTRL+Left/Right to word jump. - - CTRL+Shift+Left/Right to select words. - - CTRL+A or Double-Click to select all. - - CTRL+X,CTRL+C,CTRL+V to use OS clipboard/ - - CTRL+Z,CTRL+Y to undo/redo. - - ESCAPE to revert text to its original value. - - Controls are automatically adjusted for OSX to match standard OSX text editing operations. - - General Keyboard controls: enable with ImGuiConfigFlags_NavEnableKeyboard. - - General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. Download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets + - MOUSE CONTROLS + - Mouse wheel: Scroll vertically. + - SHIFT+Mouse wheel: Scroll horizontally. + - Click [X]: Close a window, available when 'bool* p_open' is passed to ImGui::Begin(). + - Click ^, Double-Click title: Collapse window. + - Drag on corner/border: Resize window (double-click to auto fit window to its contents). + - Drag on any empty space: Move window (unless io.ConfigWindowsMoveFromTitleBarOnly = true). + - Left-click outside popup: Close popup stack (right-click over underlying popup: Partially close popup stack). + + - TEXT EDITOR + - Hold SHIFT or Drag Mouse: Select text. + - CTRL+Left/Right: Word jump. + - CTRL+Shift+Left/Right: Select words. + - CTRL+A or Double-Click: Select All. + - CTRL+X, CTRL+C, CTRL+V: Use OS clipboard. + - CTRL+Z, CTRL+Y: Undo, Redo. + - ESCAPE: Revert text to its original value. + - On OSX, controls are automatically adjusted to match standard OSX text editing shortcuts and behaviors. + + - KEYBOARD CONTROLS + - Basic: + - Tab, SHIFT+Tab Cycle through text editable fields. + - CTRL+Tab, CTRL+Shift+Tab Cycle through windows. + - CTRL+Click Input text into a Slider or Drag widget. + - Extended features with `io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard`: + - Tab, SHIFT+Tab: Cycle through every items. + - Arrow keys Move through items using directional navigation. Tweak value. + - Arrow keys + Alt, Shift Tweak slower, tweak faster (when using arrow keys). + - Enter Activate item (prefer text input when possible). + - Space Activate item (prefer tweaking with arrows when possible). + - Escape Deactivate item, leave child window, close popup. + - Page Up, Page Down Previous page, next page. + - Home, End Scroll to top, scroll to bottom. + - Alt Toggle between scrolling layer and menu layer. + - CTRL+Tab then Ctrl+Arrows Move window. Hold SHIFT to resize instead of moving. + - Output when ImGuiConfigFlags_NavEnableKeyboard set, + - io.WantCaptureKeyboard flag is set when keyboard is claimed. + - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set. + - io.NavVisible: true when the navigation cursor is visible (usually goes to back false when mouse is used). + + - GAMEPAD CONTROLS + - Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. + - Particularly useful to use Dear ImGui on a console system (e.g. PlayStation, Switch, Xbox) without a mouse! + - Download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets + - Backend support: backend needs to: + - Set 'io.BackendFlags |= ImGuiBackendFlags_HasGamepad' + call io.AddKeyEvent/AddKeyAnalogEvent() with ImGuiKey_Gamepad_XXX keys. + - For analog values (0.0f to 1.0f), backend is responsible to handling a dead-zone and rescaling inputs accordingly. + Backend code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.). + - BEFORE 1.87, BACKENDS USED TO WRITE TO io.NavInputs[]. This is now obsolete. Please call io functions instead! + - If you need to share inputs between your game and the Dear ImGui interface, the easiest approach is to go all-or-nothing, + with a buttons combo to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved. + + - REMOTE INPUTS SHARING & MOUSE EMULATION + - PS4/PS5 users: Consider emulating a mouse cursor with DualShock touch pad or a spare analog stick as a mouse-emulation fallback. + - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + run examples/libs/synergy/uSynergy.c (on your console/tablet/phone app) + in order to share your PC mouse/keyboard. + - See https://github.com/ocornut/imgui/wiki/Useful-Extensions#remoting for other remoting solutions. + - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag. + Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs Dear ImGui to move your mouse cursor along with navigation movements. + When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved. + When that happens your backend NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the backends in examples/ do that. + (If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, Dear ImGui will misbehave as it will see your mouse moving back & forth!) + (In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want + to set a boolean to ignore your other external mouse positions until the external source is moved again.) PROGRAMMER GUIDE @@ -344,40 +389,6 @@ CODE } - USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS - ------------------------------------------ - - The gamepad/keyboard navigation is fairly functional and keeps being improved. - - Gamepad support is particularly useful to use Dear ImGui on a console system (e.g. PlayStation, Switch, Xbox) without a mouse! - - The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable. - - Keyboard: - - Application: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. - - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), - the io.WantCaptureKeyboard flag will be set. For more advanced uses, you may want to read from: - - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set. - - io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is used). - - or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused() etc. functions. - Please reach out if you think the game vs navigation input sharing could be improved. - - Gamepad: - - Application: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. - - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + call io.AddKeyEvent/AddKeyAnalogEvent() with ImGuiKey_Gamepad_XXX keys. - For analog values (0.0f to 1.0f), backend is responsible to handling a dead-zone and rescaling inputs accordingly. - Backend code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.). - - BEFORE 1.87, BACKENDS USED TO WRITE TO io.NavInputs[]. This is now obsolete. Please call io functions instead! - - You can download PNG/PSD files depicting the gamepad controls for common controllers at: http://dearimgui.org/controls_sheets - - If you need to share inputs between your game and the Dear ImGui interface, the easiest approach is to go all-or-nothing, - with a buttons combo to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved. - - Mouse: - - PS4/PS5 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback. - - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + uSynergy.c (on your console/tablet/phone app) to share your PC mouse/keyboard. - - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag. - Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs dear imgui to move your mouse cursor along with navigation movements. - When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved. - When that happens your backend NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the backends in examples/ do that. - (If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, imgui will misbehave as it will see your mouse moving back and forth!) - (In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want - to set a boolean to ignore your other external mouse positions until the external source is moved again.) - - API BREAKING CHANGES ==================== @@ -386,21 +397,35 @@ CODE When you are not sure about an old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. You can read releases logs https://github.com/ocornut/imgui/releases for more details. - - 2022/10/26 (1.89) - commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79. - - 2022/10/12 (1.89) - removed runtime patching of invalid "%f"/"%0.f" format strings for DragInt()/SliderInt(). This was obsoleted in 1.61 (May 2018). See 1.61 changelog for details. - - 2022/09/26 (1.89) - renamed and merged keyboard modifiers key enums and flags into a same set. Kept inline redirection enums (will obsolete). - - ImGuiKey_ModCtrl and ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl - - ImGuiKey_ModShift and ImGuiModFlags_Shift -> ImGuiMod_Shift - - ImGuiKey_ModAlt and ImGuiModFlags_Alt -> ImGuiMod_Alt - - ImGuiKey_ModSuper and ImGuiModFlags_Super -> ImGuiMod_Super - the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends. - the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions. - exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway. - - 2022/09/20 (1.89) - ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. - this will require uses of legacy backend-dependent indices to be casted, e.g. - - with imgui_impl_glfw: IsKeyPressed(GLFW_KEY_A) -> IsKeyPressed((ImGuiKey)GLFW_KEY_A); - - with imgui_impl_win32: IsKeyPressed('A') -> IsKeyPressed((ImGuiKey)'A') - - etc. However if you are upgrading code you might well use the better, backend-agnostic IsKeyPressed(ImGuiKey_A) now! + - 2023/03/14 (1.89.4) - commented out redirecting enums/functions names that were marked obsolete two years ago: + - ImGuiSliderFlags_ClampOnInput -> use ImGuiSliderFlags_AlwaysClamp + - ImGuiInputTextFlags_AlwaysInsertMode -> use ImGuiInputTextFlags_AlwaysOverwrite + - ImDrawList::AddBezierCurve() -> use ImDrawList::AddBezierCubic() + - ImDrawList::PathBezierCurveTo() -> use ImDrawList::PathBezierCubicCurveTo() + - 2023/03/09 (1.89.4) - renamed PushAllowKeyboardFocus()/PopAllowKeyboardFocus() to PushTabStop()/PopTabStop(). Kept inline redirection functions (will obsolete). + - 2023/03/09 (1.89.4) - tooltips: Added 'bool' return value to BeginTooltip() for API consistency. Please only submit contents and call EndTooltip() if BeginTooltip() returns true. In reality the function will _currently_ always return true, but further changes down the line may change this, best to clarify API sooner. + - 2023/02/15 (1.89.4) - moved the optional "courtesy maths operators" implementation from imgui_internal.h in imgui.h. + Even though we encourage using your own maths types and operators by setting up IM_VEC2_CLASS_EXTRA, + it has been frequently requested by people to use our own. We had an opt-in define which was + previously fulfilled in imgui_internal.h. It is now fulfilled in imgui.h. (#6164) + - OK: #define IMGUI_DEFINE_MATH_OPERATORS / #include "imgui.h" / #include "imgui_internal.h" + - Error: #include "imgui.h" / #define IMGUI_DEFINE_MATH_OPERATORS / #include "imgui_internal.h" + - 2023/02/07 (1.89.3) - backends: renamed "imgui_impl_sdl.cpp" to "imgui_impl_sdl2.cpp" and "imgui_impl_sdl.h" to "imgui_impl_sdl2.h". (#6146) This is in prevision for the future release of SDL3. + - 2022/10/26 (1.89) - commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79. + - 2022/10/12 (1.89) - removed runtime patching of invalid "%f"/"%0.f" format strings for DragInt()/SliderInt(). This was obsoleted in 1.61 (May 2018). See 1.61 changelog for details. + - 2022/09/26 (1.89) - renamed and merged keyboard modifiers key enums and flags into a same set. Kept inline redirection enums (will obsolete). + - ImGuiKey_ModCtrl and ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl + - ImGuiKey_ModShift and ImGuiModFlags_Shift -> ImGuiMod_Shift + - ImGuiKey_ModAlt and ImGuiModFlags_Alt -> ImGuiMod_Alt + - ImGuiKey_ModSuper and ImGuiModFlags_Super -> ImGuiMod_Super + the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends. + the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions. + exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway. + - 2022/09/20 (1.89) - ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. + this will require uses of legacy backend-dependent indices to be casted, e.g. + - with imgui_impl_glfw: IsKeyPressed(GLFW_KEY_A) -> IsKeyPressed((ImGuiKey)GLFW_KEY_A); + - with imgui_impl_win32: IsKeyPressed('A') -> IsKeyPressed((ImGuiKey)'A') + - etc. However if you are upgrading code you might well use the better, backend-agnostic IsKeyPressed(ImGuiKey_A) now! - 2022/09/12 (1.89) - removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)', always pass a pointer value explicitly. NULL/nullptr is ok but require cast, e.g. TreePush((void*)nullptr); - 2022/09/05 (1.89) - commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020): - DragScalar(), DragScalarN(), DragFloat(), DragFloat2(), DragFloat3(), DragFloat4(): For old signatures ending with (..., const char* format, float power = 1.0f) -> use (..., format ImGuiSliderFlags_Logarithmic) if power != 1.0f. @@ -859,12 +884,12 @@ CODE #define _CRT_SECURE_NO_WARNINGS #endif -#include "imgui.h" -#ifndef IMGUI_DISABLE - #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS #endif + +#include "imgui.h" +#ifndef IMGUI_DISABLE #include "imgui_internal.h" // System includes @@ -985,8 +1010,8 @@ static void WindowSettingsHandler_ApplyAll(ImGuiContext*, ImGuiSetti static void WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSettingsHandler*, ImGuiTextBuffer* buf); // Platform Dependents default implementation for IO functions -static const char* GetClipboardTextFn_DefaultImpl(void* user_data); -static void SetClipboardTextFn_DefaultImpl(void* user_data, const char* text); +static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx); +static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text); static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data); namespace ImGui @@ -1005,7 +1030,7 @@ static void NavEndFrame(); static bool NavScoreItem(ImGuiNavItemData* result); static void NavApplyItemToResult(ImGuiNavItemData* result); static void NavProcessItem(); -static void NavProcessItemForTabbingRequest(ImGuiID id); +static void NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flags, ImGuiNavMoveFlags move_flags); static ImVec2 NavCalcPreferredRefPos(); static void NavSaveLastChildNavWindowIntoParent(ImGuiWindow* nav_window); static ImGuiWindow* NavRestoreLastChildNavWindow(ImGuiWindow* window); @@ -1120,6 +1145,9 @@ ImGuiStyle::ImGuiStyle() ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text. SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. + SeparatorTextBorderSize = 3.0f; // Thickkness of border in SeparatorText() + SeparatorTextAlign = ImVec2(0.0f,0.5f);// Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center). + SeparatorTextPadding = ImVec2(20.0f,3.f);// Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y. DisplayWindowPadding = ImVec2(19,19); // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows. DisplaySafeAreaPadding = ImVec2(3,3); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. @@ -1157,6 +1185,7 @@ void ImGuiStyle::ScaleAllSizes(float scale_factor) LogSliderDeadzone = ImFloor(LogSliderDeadzone * scale_factor); TabRounding = ImFloor(TabRounding * scale_factor); TabMinWidthForCloseButton = (TabMinWidthForCloseButton != FLT_MAX) ? ImFloor(TabMinWidthForCloseButton * scale_factor) : FLT_MAX; + SeparatorTextPadding = ImFloor(SeparatorTextPadding * scale_factor); DisplayWindowPadding = ImFloor(DisplayWindowPadding * scale_factor); DisplaySafeAreaPadding = ImFloor(DisplaySafeAreaPadding * scale_factor); MouseCursorScale = ImFloor(MouseCursorScale * scale_factor); @@ -1208,14 +1237,13 @@ ImGuiIO::ImGuiIO() ConfigWindowsResizeFromEdges = true; ConfigWindowsMoveFromTitleBarOnly = false; ConfigMemoryCompactTimer = 60.0f; + ConfigDebugBeginReturnValueOnce = false; + ConfigDebugBeginReturnValueLoop = false; // Platform Functions + // Note: Initialize() will setup default clipboard/ime handlers. BackendPlatformName = BackendRendererName = NULL; BackendPlatformUserData = BackendRendererUserData = BackendLanguageUserData = NULL; - GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations - SetClipboardTextFn = SetClipboardTextFn_DefaultImpl; - ClipboardUserData = NULL; - SetPlatformImeDataFn = SetPlatformImeDataFn_DefaultImpl; // Input (NB: we already have memset zero the entire structure!) MousePos = ImVec2(-FLT_MAX, -FLT_MAX); @@ -1234,8 +1262,8 @@ ImGuiIO::ImGuiIO() // FIXME: Should in theory be called "AddCharacterEvent()" to be consistent with new API void ImGuiIO::AddInputCharacter(unsigned int c) { - ImGuiContext& g = *GImGui; - IM_ASSERT(&g.IO == this && "Can only add events to current context."); + IM_ASSERT(Ctx != NULL); + ImGuiContext& g = *Ctx; if (c == 0 || !AppAcceptingEvents) return; @@ -1347,10 +1375,10 @@ static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) { //if (e->Down) { IMGUI_DEBUG_LOG_IO("AddKeyEvent() Key='%s' %d, NativeKeycode = %d, NativeScancode = %d\n", ImGui::GetKeyName(e->Key), e->Down, e->NativeKeycode, e->NativeScancode); } + IM_ASSERT(Ctx != NULL); if (key == ImGuiKey_None || !AppAcceptingEvents) return; - ImGuiContext& g = *GImGui; - IM_ASSERT(&g.IO == this && "Can only add events to current context."); + ImGuiContext& g = *Ctx; IM_ASSERT(ImGui::IsNamedKeyOrModKey(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API. IM_ASSERT(!ImGui::IsAliasKey(key)); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events. IM_ASSERT(key != ImGuiMod_Shortcut); // We could easily support the translation here but it seems saner to not accept it (TestEngine perform a translation itself) @@ -1425,8 +1453,8 @@ void ImGuiIO::SetAppAcceptingEvents(bool accepting_events) // Queue a mouse move event void ImGuiIO::AddMousePosEvent(float x, float y) { - ImGuiContext& g = *GImGui; - IM_ASSERT(&g.IO == this && "Can only add events to current context."); + IM_ASSERT(Ctx != NULL); + ImGuiContext& g = *Ctx; if (!AppAcceptingEvents) return; @@ -1449,8 +1477,8 @@ void ImGuiIO::AddMousePosEvent(float x, float y) void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down) { - ImGuiContext& g = *GImGui; - IM_ASSERT(&g.IO == this && "Can only add events to current context."); + IM_ASSERT(Ctx != NULL); + ImGuiContext& g = *Ctx; IM_ASSERT(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT); if (!AppAcceptingEvents) return; @@ -1472,8 +1500,8 @@ void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down) // Queue a mouse wheel event (some mouse/API may only have a Y component) void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y) { - ImGuiContext& g = *GImGui; - IM_ASSERT(&g.IO == this && "Can only add events to current context."); + IM_ASSERT(Ctx != NULL); + ImGuiContext& g = *Ctx; // Filter duplicate (unlike most events, wheel values are relative and easy to filter) if (!AppAcceptingEvents || (wheel_x == 0.0f && wheel_y == 0.0f)) @@ -1489,8 +1517,8 @@ void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y) void ImGuiIO::AddFocusEvent(bool focused) { - ImGuiContext& g = *GImGui; - IM_ASSERT(&g.IO == this && "Can only add events to current context."); + IM_ASSERT(Ctx != NULL); + ImGuiContext& g = *Ctx; // Filter duplicate const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Focus); @@ -1865,7 +1893,7 @@ static const ImU32 GCrc32LookupTable[256] = // Known size hash // It is ok to call ImHashData on a string with known length but the ### operator won't be supported. // FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements. -ImGuiID ImHashData(const void* data_p, size_t data_size, ImU32 seed) +ImGuiID ImHashData(const void* data_p, size_t data_size, ImGuiID seed) { ImU32 crc = ~seed; const unsigned char* data = (const unsigned char*)data_p; @@ -1881,7 +1909,7 @@ ImGuiID ImHashData(const void* data_p, size_t data_size, ImU32 seed) // - If we reach ### in the string we discard the hash so far and reset to the seed. // - We don't do 'current += 2; continue;' after handling ### to keep the code smaller/faster (measured ~10% diff in Debug build) // FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements. -ImGuiID ImHashStr(const char* data_p, size_t data_size, ImU32 seed) +ImGuiID ImHashStr(const char* data_p, size_t data_size, ImGuiID seed) { seed = ~seed; ImU32 crc = seed; @@ -2699,6 +2727,8 @@ static void ImGuiListClipper_SeekCursorForItem(ImGuiListClipper* clipper, int it ImGuiListClipper::ImGuiListClipper() { memset(this, 0, sizeof(*this)); + Ctx = ImGui::GetCurrentContext(); + IM_ASSERT(Ctx != NULL); ItemsCount = -1; } @@ -2709,7 +2739,7 @@ ImGuiListClipper::~ImGuiListClipper() void ImGuiListClipper::Begin(int items_count, float items_height) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *Ctx; ImGuiWindow* window = g.CurrentWindow; IMGUI_DEBUG_LOG_CLIPPER("Clipper: Begin(%d,%.2f) in '%s'\n", items_count, items_height, window->Name); @@ -2734,7 +2764,7 @@ void ImGuiListClipper::Begin(int items_count, float items_height) void ImGuiListClipper::End() { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *Ctx; if (ImGuiListClipperData* data = (ImGuiListClipperData*)TempData) { // In theory here we should assert that we are already at the right position, but it seems saner to just seek at the end and not assert/crash the user. @@ -2766,7 +2796,7 @@ void ImGuiListClipper::ForceDisplayRangeByIndices(int item_min, int item_max) static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *clipper->Ctx; ImGuiWindow* window = g.CurrentWindow; ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData; IM_ASSERT(data != NULL && "Called ImGuiListClipper::Step() too many times, or before ImGuiListClipper::Begin() ?"); @@ -2889,7 +2919,7 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) bool ImGuiListClipper::Step() { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *Ctx; bool need_items_height = (ItemsHeight <= 0.0f); bool ret = ImGuiListClipper_StepInternal(this); if (ret && (DisplayStart == DisplayEnd)) @@ -2990,15 +3020,7 @@ void ImGui::PopStyleColor(int count) } } -struct ImGuiStyleVarInfo -{ - ImGuiDataType Type; - ImU32 Count; - ImU32 Offset; - void* GetVarPtr(ImGuiStyle* style) const { return (void*)((unsigned char*)style + Offset); } -}; - -static const ImGuiStyleVarInfo GStyleVarInfo[] = +static const ImGuiDataVarInfo GStyleVarInfo[] = { { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, DisabledAlpha) }, // ImGuiStyleVar_DisabledAlpha @@ -3025,41 +3047,44 @@ static const ImGuiStyleVarInfo GStyleVarInfo[] = { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, TabRounding) }, // ImGuiStyleVar_TabRounding { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SelectableTextAlign) }, // ImGuiStyleVar_SelectableTextAlign + { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, SeparatorTextBorderSize) },// ImGuiStyleVar_SeparatorTextBorderSize + { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SeparatorTextAlign) }, // ImGuiStyleVar_SeparatorTextAlign + { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SeparatorTextPadding) }, // ImGuiStyleVar_SeparatorTextPadding }; -static const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx) +const ImGuiDataVarInfo* ImGui::GetStyleVarInfo(ImGuiStyleVar idx) { IM_ASSERT(idx >= 0 && idx < ImGuiStyleVar_COUNT); - IM_ASSERT(IM_ARRAYSIZE(GStyleVarInfo) == ImGuiStyleVar_COUNT); + IM_STATIC_ASSERT(IM_ARRAYSIZE(GStyleVarInfo) == ImGuiStyleVar_COUNT); return &GStyleVarInfo[idx]; } void ImGui::PushStyleVar(ImGuiStyleVar idx, float val) { - const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx); + ImGuiContext& g = *GImGui; + const ImGuiDataVarInfo* var_info = GetStyleVarInfo(idx); if (var_info->Type == ImGuiDataType_Float && var_info->Count == 1) { - ImGuiContext& g = *GImGui; float* pvar = (float*)var_info->GetVarPtr(&g.Style); g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); *pvar = val; return; } - IM_ASSERT(0 && "Called PushStyleVar() float variant but variable is not a float!"); + IM_ASSERT_USER_ERROR(0, "Called PushStyleVar() variant with wrong type!"); } void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val) { - const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx); + ImGuiContext& g = *GImGui; + const ImGuiDataVarInfo* var_info = GetStyleVarInfo(idx); if (var_info->Type == ImGuiDataType_Float && var_info->Count == 2) { - ImGuiContext& g = *GImGui; ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar)); *pvar = val; return; } - IM_ASSERT(0 && "Called PushStyleVar() ImVec2 variant but variable is not a ImVec2!"); + IM_ASSERT_USER_ERROR(0, "Called PushStyleVar() variant with wrong type!"); } void ImGui::PopStyleVar(int count) @@ -3074,7 +3099,7 @@ void ImGui::PopStyleVar(int count) { // We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the overhead in Debug is not worth it. ImGuiStyleMod& backup = g.StyleVarStack.back(); - const ImGuiStyleVarInfo* info = GetStyleVarInfo(backup.VarIdx); + const ImGuiDataVarInfo* info = GetStyleVarInfo(backup.VarIdx); void* data = info->GetVarPtr(&g.Style); if (info->Type == ImGuiDataType_Float && info->Count == 1) { ((float*)data)[0] = backup.BackupFloat[0]; } else if (info->Type == ImGuiDataType_Float && info->Count == 2) { ((float*)data)[0] = backup.BackupFloat[0]; ((float*)data)[1] = backup.BackupFloat[1]; } @@ -3375,24 +3400,26 @@ void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCurso { ImGuiContext& g = *GImGui; IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT); + ImFontAtlas* font_atlas = g.DrawListSharedData.Font->ContainerAtlas; for (int n = 0; n < g.Viewports.Size; n++) { - ImGuiViewportP* viewport = g.Viewports[n]; - ImDrawList* draw_list = GetForegroundDrawList(viewport); - ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas; + // We scale cursor with current viewport/monitor, however Windows 10 for its own hardware cursor seems to be using a different scale factor. ImVec2 offset, size, uv[4]; - if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2])) - { - const ImVec2 pos = base_pos - offset; - const float scale = base_scale; - ImTextureID tex_id = font_atlas->TexID; - draw_list->PushTextureID(tex_id); - draw_list->AddImage(tex_id, pos + ImVec2(1, 0) * scale, pos + (ImVec2(1, 0) + size) * scale, uv[2], uv[3], col_shadow); - draw_list->AddImage(tex_id, pos + ImVec2(2, 0) * scale, pos + (ImVec2(2, 0) + size) * scale, uv[2], uv[3], col_shadow); - draw_list->AddImage(tex_id, pos, pos + size * scale, uv[2], uv[3], col_border); - draw_list->AddImage(tex_id, pos, pos + size * scale, uv[0], uv[1], col_fill); - draw_list->PopTextureID(); - } + if (!font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2])) + continue; + ImGuiViewportP* viewport = g.Viewports[n]; + const ImVec2 pos = base_pos - offset; + const float scale = base_scale; + if (!viewport->GetMainRect().Overlaps(ImRect(pos, pos + ImVec2(size.x + 2, size.y + 2) * scale))) + continue; + ImDrawList* draw_list = GetForegroundDrawList(viewport); + ImTextureID tex_id = font_atlas->TexID; + draw_list->PushTextureID(tex_id); + draw_list->AddImage(tex_id, pos + ImVec2(1, 0) * scale, pos + (ImVec2(1, 0) + size) * scale, uv[2], uv[3], col_shadow); + draw_list->AddImage(tex_id, pos + ImVec2(2, 0) * scale, pos + (ImVec2(2, 0) + size) * scale, uv[2], uv[3], col_shadow); + draw_list->AddImage(tex_id, pos, pos + size * scale, uv[2], uv[3], col_border); + draw_list->AddImage(tex_id, pos, pos + size * scale, uv[0], uv[1], col_fill); + draw_list->PopTextureID(); } } @@ -3487,6 +3514,12 @@ void ImGui::Initialize() // Setup default localization table LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS)); + // Setup default platform clipboard/IME handlers. + g.IO.GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations + g.IO.SetClipboardTextFn = SetClipboardTextFn_DefaultImpl; + g.IO.ClipboardUserData = (void*)&g; // Default implementation use the ImGuiContext as user data (ideally those would be arguments to the function) + g.IO.SetPlatformImeDataFn = SetPlatformImeDataFn_DefaultImpl; + // Create default viewport ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)(); g.Viewports.push_back(viewport); @@ -3556,6 +3589,7 @@ void ImGui::Shutdown() g.ClipboardHandlerData.clear(); g.MenusIdSubmittedThisFrame.clear(); g.InputTextState.ClearFreeMemory(); + g.InputTextDeactivatedState.ClearFreeMemory(); g.SettingsWindows.clear(); g.SettingsHandlers.clear(); @@ -3611,9 +3645,10 @@ void ImGui::CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType hook_type) //----------------------------------------------------------------------------- // ImGuiWindow is mostly a dumb struct. It merely has a constructor and a few helper methods -ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name) : DrawListInst(NULL) +ImGuiWindow::ImGuiWindow(ImGuiContext* ctx, const char* name) : DrawListInst(NULL) { memset(this, 0, sizeof(*this)); + Ctx = ctx; Name = ImStrdup(name); NameBufLen = (int)strlen(name) + 1; ID = ImHashStr(name); @@ -3623,14 +3658,14 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name) : DrawListInst ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f); AutoFitFramesX = AutoFitFramesY = -1; AutoPosLastDirection = ImGuiDir_None; - SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing; + SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = 0; SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX); LastFrameActive = -1; LastTimeActive = -1.0f; FontWindowScale = 1.0f; SettingsOffset = -1; DrawList = &DrawListInst; - DrawList->_Data = &context->DrawListSharedData; + DrawList->_Data = &Ctx->DrawListSharedData; DrawList->_OwnerName = Name; } @@ -3645,7 +3680,7 @@ ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); - ImGuiContext& g = *GImGui; + ImGuiContext& g = *Ctx; if (g.DebugHookIdInfo == id) ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end); return id; @@ -3655,7 +3690,7 @@ ImGuiID ImGuiWindow::GetID(const void* ptr) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHashData(&ptr, sizeof(void*), seed); - ImGuiContext& g = *GImGui; + ImGuiContext& g = *Ctx; if (g.DebugHookIdInfo == id) ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL); return id; @@ -3665,7 +3700,7 @@ ImGuiID ImGuiWindow::GetID(int n) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHashData(&n, sizeof(n), seed); - ImGuiContext& g = *GImGui; + ImGuiContext& g = *Ctx; if (g.DebugHookIdInfo == id) ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL); return id; @@ -3727,13 +3762,23 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) { ImGuiContext& g = *GImGui; - // While most behaved code would make an effort to not steal active id during window move/drag operations, - // we at least need to be resilient to it. Cancelling the move is rather aggressive and users of 'master' branch - // may prefer the weird ill-defined half working situation ('docking' did assert), so may need to rework that. - if (g.MovingWindow != NULL && g.ActiveId == g.MovingWindow->MoveId) + // Clear previous active id + if (g.ActiveId != 0) { - IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() cancel MovingWindow\n"); - g.MovingWindow = NULL; + // While most behaved code would make an effort to not steal active id during window move/drag operations, + // we at least need to be resilient to it. Canceling the move is rather aggressive and users of 'master' branch + // may prefer the weird ill-defined half working situation ('docking' did assert), so may need to rework that. + if (g.MovingWindow != NULL && g.ActiveId == g.MovingWindow->MoveId) + { + IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() cancel MovingWindow\n"); + g.MovingWindow = NULL; + } + + // This could be written in a more general way (e.g associate a hook to ActiveId), + // but since this is currently quite an exception we'll leave it as is. + // One common scenario leading to this is: pressing Key ->NavMoveRequestApplyResult() -> ClearActiveId() + if (g.InputTextState.ID == g.ActiveId) + InputTextDeactivateHook(g.ActiveId); } // Set active id @@ -3759,7 +3804,8 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) if (id) { g.ActiveIdIsAlive = id; - g.ActiveIdSource = (g.NavActivateId == id || g.NavActivateInputId == id || g.NavJustMovedToId == id) ? (ImGuiInputSource)ImGuiInputSource_Nav : ImGuiInputSource_Mouse; + g.ActiveIdSource = (g.NavActivateId == id || g.NavJustMovedToId == id) ? g.NavInputSource : ImGuiInputSource_Mouse; + IM_ASSERT(g.ActiveIdSource != ImGuiInputSource_None); } // Clear declaration of inputs claimed by the widget @@ -3807,11 +3853,17 @@ void ImGui::MarkItemEdited(ImGuiID id) // This marking is solely to be able to provide info for IsItemDeactivatedAfterEdit(). // ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need to fill the data. ImGuiContext& g = *GImGui; - IM_ASSERT(g.ActiveId == id || g.ActiveId == 0 || g.DragDropActive); - IM_UNUSED(id); // Avoid unused variable warnings when asserts are compiled out. + if (g.ActiveId == id || g.ActiveId == 0) + { + g.ActiveIdHasBeenEditedThisFrame = true; + g.ActiveIdHasBeenEditedBefore = true; + } + + // We accept a MarkItemEdited() on drag and drop targets (see https://github.com/ocornut/imgui/issues/1875#issuecomment-978243343) + // We accept 'ActiveIdPreviousFrame == id' for InputText() returning an edit after it has been taken ActiveId away (#4714) + IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.ActiveIdPreviousFrame == id); + //IM_ASSERT(g.CurrentWindow->DC.LastItemId == id); - g.ActiveIdHasBeenEditedThisFrame = true; - g.ActiveIdHasBeenEditedBefore = true; g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited; } @@ -3887,7 +3939,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) return false; // Special handling for calling after Begin() which represent the title bar or tab. - // When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case. + // When the window is skipped/collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case. if (g.LastItemData.ID == window->MoveId && window->WriteAccessed) return false; } @@ -3982,14 +4034,14 @@ bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id) } // This is also inlined in ItemAdd() -// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set window->DC.LastItemDisplayRect! +// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set g.LastItemData.DisplayRect. void ImGui::SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags item_flags, const ImRect& item_rect) { ImGuiContext& g = *GImGui; g.LastItemData.ID = item_id; g.LastItemData.InFlags = in_flags; g.LastItemData.StatusFlags = item_flags; - g.LastItemData.Rect = item_rect; + g.LastItemData.Rect = g.LastItemData.NavRect = item_rect; } float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x) @@ -4354,6 +4406,11 @@ void ImGui::NewFrame() g.FramerateSecPerFrameCount = ImMin(g.FramerateSecPerFrameCount + 1, IM_ARRAYSIZE(g.FramerateSecPerFrame)); g.IO.Framerate = (g.FramerateSecPerFrameAccum > 0.0f) ? (1.0f / (g.FramerateSecPerFrameAccum / (float)g.FramerateSecPerFrameCount)) : FLT_MAX; + // Process input queue (trickle as many events as possible), turn events into writes to IO structure + g.InputEventsTrail.resize(0); + UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue); + + // Update viewports (after processing input queue, so io.MouseHoveredViewport is set) UpdateViewportsNewFrame(); // Setup current font and draw list shared data @@ -4475,10 +4532,6 @@ void ImGui::NewFrame() //if (g.IO.AppFocusLost) // ClosePopupsExceptModals(); - // Process input queue (trickle as many events as possible) - g.InputEventsTrail.resize(0); - UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue); - // Update keyboard input state UpdateKeyboardInputs(); @@ -4561,6 +4614,11 @@ void ImGui::NewFrame() UpdateDebugToolStackQueries(); if (g.DebugLocateFrames > 0 && --g.DebugLocateFrames == 0) g.DebugLocateId = 0; + if (g.DebugLogClipperAutoDisableFrames > 0 && --g.DebugLogClipperAutoDisableFrames == 0) + { + DebugLog("(Auto-disabled ImGuiDebugLogFlags_EventClipper to avoid spamming)\n"); + g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper; + } // Create implicit/fallback window - which we will only render it if the user has added something to it. // We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags. @@ -4570,6 +4628,13 @@ void ImGui::NewFrame() Begin("Debug##Default"); IM_ASSERT(g.CurrentWindow->IsFallbackWindow == true); + // [DEBUG] When io.ConfigDebugBeginReturnValue is set, we make Begin()/BeginChild() return false at different level of the window-stack, + // allowing to validate correct Begin/End behavior in user code. + if (g.IO.ConfigDebugBeginReturnValueLoop) + g.DebugBeginReturnValueCullDepth = (g.DebugBeginReturnValueCullDepth == -1) ? 0 : ((g.DebugBeginReturnValueCullDepth + ((g.FrameCount % 4) == 0 ? 1 : 0)) % 10); + else + g.DebugBeginReturnValueCullDepth = -1; + CallContextHooks(&g, ImGuiContextHookType_NewFramePost); } @@ -4817,8 +4882,24 @@ void ImGui::EndFrame() ErrorCheckEndFrameSanityChecks(); // Notify Platform/OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME) - if (g.IO.SetPlatformImeDataFn && memcmp(&g.PlatformImeData, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0) - g.IO.SetPlatformImeDataFn(GetMainViewport(), &g.PlatformImeData); + ImGuiPlatformImeData* ime_data = &g.PlatformImeData; + if (g.IO.SetPlatformImeDataFn && memcmp(ime_data, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0) + { + IMGUI_DEBUG_LOG_IO("Calling io.SetPlatformImeDataFn(): WantVisible: %d, InputPos (%.2f,%.2f)\n", ime_data->WantVisible, ime_data->InputPos.x, ime_data->InputPos.y); + ImGuiViewport* viewport = GetMainViewport(); +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + if (viewport->PlatformHandleRaw == NULL && g.IO.ImeWindowHandle != NULL) + { + viewport->PlatformHandleRaw = g.IO.ImeWindowHandle; + g.IO.SetPlatformImeDataFn(viewport, ime_data); + viewport->PlatformHandleRaw = NULL; + } + else +#endif + { + g.IO.SetPlatformImeDataFn(viewport, ime_data); + } + } // Hide implicit/fallback "Debug" window if it hasn't been used g.WithinFrameScopeWithImplicitWindow = false; @@ -5214,7 +5295,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b FocusWindow(child_window); NavInitWindow(child_window, false); SetActiveID(id + 1, child_window); // Steal ActiveId with another arbitrary id so that key-press won't activate child item - g.ActiveIdSource = ImGuiInputSource_Nav; + g.ActiveIdSource = g.NavInputSource; } return ret; } @@ -5347,32 +5428,22 @@ static void UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_created, window->IsExplicitChild = new_is_explicit_child; } -static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) +static void InitOrLoadWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settings) { - ImGuiContext& g = *GImGui; - //IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags); - - // Create window the first time - ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name); - window->Flags = flags; - g.WindowsById.SetVoidPtr(window->ID, window); - - // Default/arbitrary window position. Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window. + // Initial window state with e.g. default/arbitrary window position + // Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window. const ImGuiViewport* main_viewport = ImGui::GetMainViewport(); window->Pos = main_viewport->Pos + ImVec2(60, 60); + window->SetWindowPosAllowFlags = window->SetWindowSizeAllowFlags = window->SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing; - // User can disable loading and saving of settings. Tooltip and child windows also don't store settings. - if (!(flags & ImGuiWindowFlags_NoSavedSettings)) - if (ImGuiWindowSettings* settings = ImGui::FindWindowSettings(window->ID)) - { - // Retrieve settings from .ini file - window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings); - SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false); - ApplyWindowSettings(window, settings); - } + if (settings != NULL) + { + SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false); + ApplyWindowSettings(window, settings); + } window->DC.CursorStartPos = window->DC.CursorMaxPos = window->DC.IdealMaxPos = window->Pos; // So first call to CalcWindowContentSizes() doesn't return crazy values - if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0) + if ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) != 0) { window->AutoFitFramesX = window->AutoFitFramesY = 2; window->AutoFitOnlyGrows = false; @@ -5385,6 +5456,23 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) window->AutoFitFramesY = 2; window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0); } +} + +static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) +{ + // Create window the first time + //IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags); + ImGuiContext& g = *GImGui; + ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name); + window->Flags = flags; + g.WindowsById.SetVoidPtr(window->ID, window); + + ImGuiWindowSettings* settings = NULL; + if (!(flags & ImGuiWindowFlags_NoSavedSettings)) + if ((settings = ImGui::FindWindowSettingsByWindow(window)) != 0) + window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings); + + InitOrLoadWindowSettings(window, settings); if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus) g.Windows.push_front(window); // Quite slow but rare and only once @@ -5778,7 +5866,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar if (window->Collapsed) { // Title bar only - float backup_border_size = style.FrameBorderSize; + const float backup_border_size = style.FrameBorderSize; g.Style.FrameBorderSize = window->WindowBorderSize; ImU32 title_bar_col = GetColorU32((title_bar_is_highlight && !g.NavDisableHighlight) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed); RenderFrame(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, true, window_rounding); @@ -6060,7 +6148,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) ImGuiWindowStackData window_stack_data; window_stack_data.Window = window; window_stack_data.ParentLastItemDataBackup = g.LastItemData; - window_stack_data.StackSizesOnBegin.SetToCurrentState(); + window_stack_data.StackSizesOnBegin.SetToContextState(&g); g.CurrentWindowStack.push_back(window_stack_data); if (flags & ImGuiWindowFlags_ChildMenu) g.BeginMenuCount++; @@ -6369,13 +6457,13 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) } } - // [Test Engine] Register whole window in the item system + // [Test Engine] Register whole window in the item system (before submitting further decorations) #ifdef IMGUI_ENABLE_TEST_ENGINE if (g.TestEngineHookItems) { IM_ASSERT(window->IDStack.Size == 1); window->IDStack.Size = 0; // As window->IDStack[0] == window->ID here, make sure TestEngine doesn't erroneously see window as parent of itself. - IMGUI_TEST_ENGINE_ITEM_ADD(window->Rect(), window->ID); + IMGUI_TEST_ENGINE_ITEM_ADD(window->ID, window->Rect(), NULL); IMGUI_TEST_ENGINE_ITEM_INFO(window->ID, window->Name, (g.HoveredWindow == window) ? ImGuiItemStatusFlags_HoveredRect : 0); window->IDStack.Size = 1; } @@ -6616,10 +6704,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) DebugLocateItemResolveWithLastItem(); #endif - // [Test Engine] Register title bar / tab + // [Test Engine] Register title bar / tab with MoveId. #ifdef IMGUI_ENABLE_TEST_ENGINE if (!(window->Flags & ImGuiWindowFlags_NoTitleBar)) - IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.Rect, g.LastItemData.ID); + IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.ID, g.LastItemData.Rect, &g.LastItemData); #endif } else @@ -6681,6 +6769,15 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->SkipItems = skip_items; } + // [DEBUG] io.ConfigDebugBeginReturnValue override return value to test Begin/End and BeginChild/EndChild behaviors. + // (The implicit fallback window is NOT automatically ended allowing it to always be able to receive commands without crashing) + if (!window->IsFallbackWindow && ((g.IO.ConfigDebugBeginReturnValueOnce && window_just_created) || (g.IO.ConfigDebugBeginReturnValueLoop && g.DebugBeginReturnValueCullDepth == g.CurrentWindowStack.Size))) + { + if (window->AutoFitFramesX > 0) { window->AutoFitFramesX++; } + if (window->AutoFitFramesY > 0) { window->AutoFitFramesY++; } + return false; + } + return !window->SkipItems; } @@ -6720,7 +6817,7 @@ void ImGui::End() g.BeginMenuCount--; if (window->Flags & ImGuiWindowFlags_Popup) g.BeginPopupStack.pop_back(); - g.CurrentWindowStack.back().StackSizesOnBegin.CompareWithCurrentState(); + g.CurrentWindowStack.back().StackSizesOnBegin.CompareWithContextState(&g); g.CurrentWindowStack.pop_back(); SetCurrentWindow(g.CurrentWindowStack.Size == 0 ? NULL : g.CurrentWindowStack.back().Window); } @@ -6965,13 +7062,12 @@ void ImGui::EndDisabled() g.Style.Alpha = g.DisabledAlphaBackup; //PopStyleVar(); } -// FIXME: Look into renaming this once we have settled the new Focus/Activation/TabStop system. -void ImGui::PushAllowKeyboardFocus(bool allow_keyboard_focus) +void ImGui::PushTabStop(bool tab_stop) { - PushItemFlag(ImGuiItemFlags_NoTabStop, !allow_keyboard_focus); + PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); } -void ImGui::PopAllowKeyboardFocus() +void ImGui::PopTabStop() { PopItemFlag(); } @@ -7239,6 +7335,12 @@ void ImGui::SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const I window->HitTestHoleOffset = ImVec2ih(pos - window->Pos); } +void ImGui::SetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow* window) +{ + window->Hidden = window->SkipItems = true; + window->HiddenFramesCanSkipItems = 1; +} + void ImGui::SetWindowCollapsed(bool collapsed, ImGuiCond cond) { SetWindowCollapsed(GImGui->CurrentWindow, collapsed, cond); @@ -7446,7 +7548,7 @@ void ImGui::SetItemDefaultFocus() NavUpdateAnyRequestFlag(); // Scroll could be done in NavInitRequestApplyResult() via an opt-in flag (we however don't want regular init requests to scroll) - if (!IsItemVisible()) + if (!window->ClipRect.Contains(g.LastItemData.Rect)) ScrollToRectEx(window, g.LastItemData.Rect, ImGuiScrollFlags_None); } @@ -7516,6 +7618,15 @@ ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed) return id; } +ImGuiID ImGui::GetIDWithSeed(int n, ImGuiID seed) +{ + ImGuiID id = ImHashData(&n, sizeof(n), seed); + ImGuiContext& g = *GImGui; + if (g.DebugHookIdInfo == id) + DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL); + return id; +} + void ImGui::PopID() { ImGuiWindow* window = GImGui->CurrentWindow; @@ -7625,18 +7736,14 @@ ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key) if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); - int index; #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO IM_ASSERT(key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_NamedKey_END); - if (IsLegacyKey(key)) - index = (g.IO.KeyMap[key] != -1) ? g.IO.KeyMap[key] : key; // Remap native->imgui or imgui->native - else - index = key; + if (IsLegacyKey(key) && g.IO.KeyMap[key] != -1) + key = (ImGuiKey)g.IO.KeyMap[key]; // Remap native->imgui or imgui->native #else IM_ASSERT(IsNamedKey(key) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend & user code."); - index = key - ImGuiKey_NamedKey_BEGIN; #endif - return &g.IO.KeysData[index]; + return &g.IO.KeysData[key - ImGuiKey_KeysData_OFFSET]; } #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO @@ -8551,7 +8658,7 @@ void ImGui::SetNextFrameWantCaptureMouse(bool want_capture_mouse) #ifndef IMGUI_DISABLE_DEBUG_TOOLS static const char* GetInputSourceName(ImGuiInputSource source) { - const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Nav", "Clipboard" }; + const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Clipboard" }; IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT && source >= 0 && source < ImGuiInputSource_COUNT); return input_source_names[source]; } @@ -8930,7 +9037,9 @@ static void ImGui::ErrorCheckEndFrameSanityChecks() { if (g.CurrentWindowStack.Size > 1) { + ImGuiWindow* window = g.CurrentWindowStack.back().Window; // <-- This window was not Ended! IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?"); + IM_UNUSED(window); while (g.CurrentWindowStack.Size > 1) End(); } @@ -9035,9 +9144,9 @@ void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, vo } // Save current stack sizes for later compare -void ImGuiStackSizes::SetToCurrentState() +void ImGuiStackSizes::SetToContextState(ImGuiContext* ctx) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *ctx; ImGuiWindow* window = g.CurrentWindow; SizeOfIDStack = (short)window->IDStack.Size; SizeOfColorStack = (short)g.ColorStack.Size; @@ -9051,9 +9160,9 @@ void ImGuiStackSizes::SetToCurrentState() } // Compare to detect usage errors -void ImGuiStackSizes::CompareWithCurrentState() +void ImGuiStackSizes::CompareWithContextState(ImGuiContext* ctx) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *ctx; ImGuiWindow* window = g.CurrentWindow; IM_UNUSED(window); @@ -9193,7 +9302,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu #ifdef IMGUI_ENABLE_TEST_ENGINE if (id != 0) - IMGUI_TEST_ENGINE_ITEM_ADD(nav_bb_arg ? *nav_bb_arg : bb, id); + IMGUI_TEST_ENGINE_ITEM_ADD(id, g.LastItemData.NavRect, &g.LastItemData); #endif // Clipping test @@ -9203,7 +9312,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu // return false; const bool is_rect_visible = bb.Overlaps(window->ClipRect); if (!is_rect_visible) - if (id == 0 || (id != g.ActiveId && id != g.NavId)) + if (id == 0 || (id != g.ActiveId && id != g.ActiveIdPreviousFrame && id != g.NavId)) if (!g.LogEnabled) return false; @@ -9828,12 +9937,12 @@ void ImGui::SetScrollHereY(float center_y_ratio) // [SECTION] TOOLTIPS //----------------------------------------------------------------------------- -void ImGui::BeginTooltip() +bool ImGui::BeginTooltip() { - BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None); + return BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None); } -void ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags) +bool ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags) { ImGuiContext& g = *GImGui; @@ -9857,12 +9966,17 @@ void ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags ext if (window->Active) { // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one. - window->Hidden = true; - window->HiddenFramesCanSkipItems = 1; // FIXME: This may not be necessary? + SetWindowHiddendAndSkipItemsForCurrentFrame(window); ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount); } ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize; Begin(window_name, NULL, flags | extra_window_flags); + // 2023-03-09: Added bool return value to the API, but currently always returning true. + // If this ever returns false we need to update BeginDragDropSource() accordingly. + //if (!ret) + // End(); + //return ret; + return true; } void ImGui::EndTooltip() @@ -9873,7 +9987,8 @@ void ImGui::EndTooltip() void ImGui::SetTooltipV(const char* fmt, va_list args) { - BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None); + if (!BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None)) + return; TextV(fmt, args); EndTooltip(); } @@ -9955,7 +10070,7 @@ void ImGui::OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags) { ImGuiContext& g = *GImGui; ImGuiID id = g.CurrentWindow->GetID(str_id); - IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopup(\"%s\" -> 0x%08X\n", str_id, id); + IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopup(\"%s\" -> 0x%08X)\n", str_id, id); OpenPopupEx(id, popup_flags); } @@ -9975,7 +10090,7 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags) const int current_stack_size = g.BeginPopupStack.Size; if (popup_flags & ImGuiPopupFlags_NoOpenOverExistingPopup) - if (IsPopupOpen(0u, ImGuiPopupFlags_AnyPopupId)) + if (IsPopupOpen((ImGuiID)0, ImGuiPopupFlags_AnyPopupId)) return; ImGuiPopupData popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack. @@ -10477,7 +10592,7 @@ void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) if (g.LastItemData.ID == id) window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect); - if (g.ActiveIdSource == ImGuiInputSource_Nav) + if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) g.NavDisableMouseHover = true; else g.NavDisableHighlight = true; @@ -10687,30 +10802,25 @@ static void ImGui::NavProcessItem() // Process Move Request (scoring for navigation) // FIXME-NAV: Consider policy for double scoring (scoring from NavScoringRect + scoring from a rect wrapped according to current wrapping policy) - if (g.NavMoveScoringItems) + if (g.NavMoveScoringItems && (item_flags & ImGuiItemFlags_Disabled) == 0) { - const bool is_tab_stop = (item_flags & ImGuiItemFlags_Inputable) && (item_flags & (ImGuiItemFlags_NoTabStop | ImGuiItemFlags_Disabled)) == 0; const bool is_tabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) != 0; if (is_tabbing) { - if (is_tab_stop || (g.NavMoveFlags & ImGuiNavMoveFlags_FocusApi)) - NavProcessItemForTabbingRequest(id); + NavProcessItemForTabbingRequest(id, item_flags, g.NavMoveFlags); } - else if ((g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) && !(item_flags & ImGuiItemFlags_Disabled)) + else if (g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) { ImGuiNavItemData* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; - if (!is_tabbing) - { - if (NavScoreItem(result)) - NavApplyItemToResult(result); + if (NavScoreItem(result)) + NavApplyItemToResult(result); - // Features like PageUp/PageDown need to maintain a separate score for the visible set of items. - const float VISIBLE_RATIO = 0.70f; - if ((g.NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(nav_bb)) - if (ImClamp(nav_bb.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y) >= (nav_bb.Max.y - nav_bb.Min.y) * VISIBLE_RATIO) - if (NavScoreItem(&g.NavMoveResultLocalVisible)) - NavApplyItemToResult(&g.NavMoveResultLocalVisible); - } + // Features like PageUp/PageDown need to maintain a separate score for the visible set of items. + const float VISIBLE_RATIO = 0.70f; + if ((g.NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(nav_bb)) + if (ImClamp(nav_bb.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y) >= (nav_bb.Max.y - nav_bb.Min.y) * VISIBLE_RATIO) + if (NavScoreItem(&g.NavMoveResultLocalVisible)) + NavApplyItemToResult(&g.NavMoveResultLocalVisible); } } @@ -10733,18 +10843,31 @@ static void ImGui::NavProcessItem() // - Case 3: tab forward wrap: set result to first eligible item (preemptively), on ref id set counter, on next frame if counter hasn't elapsed store result. // FIXME-TABBING: Could be done as a next-frame forwarded request // - Case 4: tab backward: store all results, on ref id pick prev, stop storing // - Case 5: tab backward wrap: store all results, on ref id if no result keep storing until last // FIXME-TABBING: Could be done as next-frame forwarded requested -void ImGui::NavProcessItemForTabbingRequest(ImGuiID id) +void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flags, ImGuiNavMoveFlags move_flags) { ImGuiContext& g = *GImGui; + if ((move_flags & ImGuiNavMoveFlags_FocusApi) == 0) + if (g.NavLayer != g.CurrentWindow->DC.NavLayerCurrent) + return; + + // - Can always land on an item when using API call. + // - Tabbing with _NavEnableKeyboard (space/enter/arrows): goes through every item. + // - Tabbing without _NavEnableKeyboard: goes through inputable items only. + bool can_stop; + if (move_flags & ImGuiNavMoveFlags_FocusApi) + can_stop = true; + else + can_stop = (item_flags & ImGuiItemFlags_NoTabStop) == 0 && ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) || (item_flags & ImGuiItemFlags_Inputable)); + // Always store in NavMoveResultLocal (unlike directional request which uses NavMoveResultOther on sibling/flattened windows) ImGuiNavItemData* result = &g.NavMoveResultLocal; if (g.NavTabbingDir == +1) { // Tab Forward or SetKeyboardFocusHere() with >= 0 - if (g.NavTabbingResultFirst.ID == 0) + if (can_stop && g.NavTabbingResultFirst.ID == 0) NavApplyItemToResult(&g.NavTabbingResultFirst); - if (--g.NavTabbingCounter == 0) + if (can_stop && g.NavTabbingCounter > 0 && --g.NavTabbingCounter == 0) NavMoveRequestResolveWithLastItem(result); else if (g.NavId == id) g.NavTabbingCounter = 1; @@ -10760,16 +10883,18 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id) NavUpdateAnyRequestFlag(); } } - else + else if (can_stop) { + // Keep applying until reaching NavId NavApplyItemToResult(result); } } else if (g.NavTabbingDir == 0) { - // Tab Init - if (g.NavTabbingResultFirst.ID == 0) - NavMoveRequestResolveWithLastItem(&g.NavTabbingResultFirst); + if (can_stop && g.NavId == id) + NavMoveRequestResolveWithLastItem(result); + if (can_stop && g.NavTabbingResultFirst.ID == 0) // Tab init + NavApplyItemToResult(&g.NavTabbingResultFirst); } } @@ -11046,7 +11171,7 @@ static void ImGui::NavUpdate() NavUpdateCancelRequest(); // Process manual activation request - g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavActivateInputId = 0; + g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = 0; g.NavActivateFlags = ImGuiActivateFlags_None; if (g.NavId != 0 && !g.NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) { @@ -11061,12 +11186,12 @@ static void ImGui::NavUpdate() } if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && input_pressed) { - g.NavActivateInputId = g.NavId; + g.NavActivateId = g.NavId; g.NavActivateFlags = ImGuiActivateFlags_PreferInput; } - if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_down) + if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && (activate_down || input_down)) g.NavActivateDownId = g.NavId; - if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_pressed) + if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && (activate_pressed || input_pressed)) g.NavActivatePressedId = g.NavId; } if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) @@ -11078,10 +11203,7 @@ static void ImGui::NavUpdate() // FIXME-NAV: Those should eventually be queued (unlike focus they don't cancel each others) if (g.NavNextActivateId != 0) { - if (g.NavNextActivateFlags & ImGuiActivateFlags_PreferInput) - g.NavActivateInputId = g.NavNextActivateId; - else - g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavNextActivateId; + g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavNextActivateId; g.NavActivateFlags = g.NavNextActivateFlags; } g.NavNextActivateId = 0; @@ -11236,16 +11358,21 @@ void ImGui::NavUpdateCreateMoveRequest() } // When using gamepad, we project the reference nav bounding box into window visible area. - // This is to allow resuming navigation inside the visible area after doing a large amount of scrolling, since with gamepad all movements are relative - // (can't focus a visible object like we can with the mouse). + // This is to allow resuming navigation inside the visible area after doing a large amount of scrolling, + // since with gamepad all movements are relative (can't focus a visible object like we can with the mouse). if (g.NavMoveSubmitted && g.NavInputSource == ImGuiInputSource_Gamepad && g.NavLayer == ImGuiNavLayer_Main && window != NULL)// && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded)) { bool clamp_x = (g.NavMoveFlags & (ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapX)) == 0; bool clamp_y = (g.NavMoveFlags & (ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapY)) == 0; ImRect inner_rect_rel = WindowRectAbsToRel(window, ImRect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1))); + + // Take account of changing scroll to handle triggering a new move request on a scrolling frame. (#6171) + // Otherwise 'inner_rect_rel' would be off on the move result frame. + inner_rect_rel.Translate(CalcNextScrollFromScrollTargetAndClamp(window) - window->Scroll); + if ((clamp_x || clamp_y) && !inner_rect_rel.Contains(window->NavRectRel[g.NavLayer])) { - //IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: clamp NavRectRel for gamepad move\n"); + IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: clamp NavRectRel for gamepad move\n"); float pad_x = ImMin(inner_rect_rel.GetWidth(), window->CalcFontSize() * 0.5f); float pad_y = ImMin(inner_rect_rel.GetHeight(), window->CalcFontSize() * 0.5f); // Terrible approximation for the intent of starting navigation from first fully visible item inner_rect_rel.Min.x = clamp_x ? (inner_rect_rel.Min.x + pad_x) : -FLT_MAX; @@ -11290,8 +11417,11 @@ void ImGui::NavUpdateCreateTabbingRequest() // (this is ALWAYS ENABLED, regardless of ImGuiConfigFlags_NavEnableKeyboard flag!) // Initially this was designed to use counters and modulo arithmetic, but that could not work with unsubmitted items (list clipper). Instead we use a strategy close to other move requests. // See NavProcessItemForTabbingRequest() for a description of the various forward/backward tabbing cases with and without wrapping. - //// FIXME: We use (g.ActiveId == 0) but (g.NavDisableHighlight == false) might be righter once we can tab through anything - g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.ActiveId == 0) ? 0 : +1; + const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; + if (nav_keyboard_active) + g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.NavDisableHighlight == true && g.ActiveId == 0) ? 0 : +1; + else + g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.ActiveId == 0) ? 0 : +1; ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY; ImGuiDir clip_dir = (g.NavTabbingDir < 0) ? ImGuiDir_Up : ImGuiDir_Down; NavMoveRequestSubmit(ImGuiDir_None, clip_dir, ImGuiNavMoveFlags_Tabbing, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable. @@ -11311,7 +11441,7 @@ void ImGui::NavMoveRequestApplyResult() ImGuiNavItemData* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : (g.NavMoveResultOther.ID != 0) ? &g.NavMoveResultOther : NULL; // Tabbing forward wrap - if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) + if ((g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) && result == NULL) if ((g.NavTabbingCounter == 1 || g.NavTabbingDir == 0) && g.NavTabbingResultFirst.ID) result = &g.NavTabbingResultFirst; @@ -11981,13 +12111,12 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) { // Target can request the Source to not display its tooltip (we use a dedicated flag to make this request explicit) // We unfortunately can't just modify the source flags and skip the call to BeginTooltip, as caller may be emitting contents. - BeginTooltip(); + bool ret = BeginTooltip(); + IM_ASSERT(ret); // FIXME-NEWBEGIN: If this ever becomes false, we need to Begin("##Hidden", NULL, ImGuiWindowFlags_NoSavedSettings) + SetWindowHiddendAndSkipItemsForCurrentFrame(). + IM_UNUSED(ret); + if (g.DragDropAcceptIdPrev && (g.DragDropAcceptFlags & ImGuiDragDropFlags_AcceptNoPreviewTooltip)) - { - ImGuiWindow* tooltip_window = g.CurrentWindow; - tooltip_window->Hidden = tooltip_window->SkipItems = true; - tooltip_window->HiddenFramesCanSkipItems = 1; - } + SetWindowHiddendAndSkipItemsForCurrentFrame(g.CurrentWindow); } if (!(flags & ImGuiDragDropFlags_SourceNoDisableHover) && !(flags & ImGuiDragDropFlags_SourceExtern)) @@ -12136,12 +12265,13 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop const bool was_accepted_previously = (g.DragDropAcceptIdPrev == g.DragDropTargetId); ImRect r = g.DragDropTargetRect; float r_surface = r.GetWidth() * r.GetHeight(); - if (r_surface <= g.DragDropAcceptIdCurrRectSurface) - { - g.DragDropAcceptFlags = flags; - g.DragDropAcceptIdCurr = g.DragDropTargetId; - g.DragDropAcceptIdCurrRectSurface = r_surface; - } + if (r_surface > g.DragDropAcceptIdCurrRectSurface) + return NULL; + + g.DragDropAcceptFlags = flags; + g.DragDropAcceptIdCurr = g.DragDropTargetId; + g.DragDropAcceptIdCurrRectSurface = r_surface; + //IMGUI_DEBUG_LOG("AcceptDragDropPayload(): %08X: accept\n", g.DragDropTargetId); // Render default drop visuals payload.Preview = was_accepted_previously; @@ -12150,10 +12280,11 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop window->DrawList->AddRect(r.Min - ImVec2(3.5f,3.5f), r.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); g.DragDropAcceptFrameCount = g.FrameCount; - payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() + payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting OS window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery)) return NULL; + //IMGUI_DEBUG_LOG("AcceptDragDropPayload(): %08X: return payload\n", g.DragDropTargetId); return &payload; } @@ -12169,13 +12300,16 @@ const ImGuiPayload* ImGui::GetDragDropPayload() return (g.DragDropActive && g.DragDropPayload.DataFrameCount != -1) ? &g.DragDropPayload : NULL; } -// We don't really use/need this now, but added it for the sake of consistency and because we might need it later. void ImGui::EndDragDropTarget() { ImGuiContext& g = *GImGui; IM_ASSERT(g.DragDropActive); IM_ASSERT(g.DragDropWithinTarget); g.DragDropWithinTarget = false; + + // Clear drag and drop state payload right after delivery + if (g.DragDropPayload.Delivery) + ClearDragDrop(); } //----------------------------------------------------------------------------- @@ -12409,10 +12543,10 @@ void ImGui::LogButtons() #endif const bool log_to_file = Button("Log To File"); SameLine(); const bool log_to_clipboard = Button("Log To Clipboard"); SameLine(); - PushAllowKeyboardFocus(false); + PushTabStop(false); SetNextItemWidth(80.0f); SliderInt("Default Depth", &g.LogDepthToExpandDefault, 0, 9, NULL); - PopAllowKeyboardFocus(); + PopTabStop(); PopID(); // Start logging at the end of the function so that the buttons don't appear in the log @@ -12430,15 +12564,17 @@ void ImGui::LogButtons() //----------------------------------------------------------------------------- // - UpdateSettings() [Internal] // - MarkIniSettingsDirty() [Internal] -// - CreateNewWindowSettings() [Internal] -// - FindWindowSettings() [Internal] -// - FindOrCreateWindowSettings() [Internal] // - FindSettingsHandler() [Internal] // - ClearIniSettings() [Internal] // - LoadIniSettingsFromDisk() // - LoadIniSettingsFromMemory() // - SaveIniSettingsToDisk() // - SaveIniSettingsToMemory() +//----------------------------------------------------------------------------- +// - CreateNewWindowSettings() [Internal] +// - FindWindowSettingsByID() [Internal] +// - FindWindowSettingsByWindow() [Internal] +// - ClearWindowSettings() [Internal] // - WindowSettingsHandler_***() [Internal] //----------------------------------------------------------------------------- @@ -12485,44 +12621,6 @@ void ImGui::MarkIniSettingsDirty(ImGuiWindow* window) g.SettingsDirtyTimer = g.IO.IniSavingRate; } -ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name) -{ - ImGuiContext& g = *GImGui; - -#if !IMGUI_DEBUG_INI_SETTINGS - // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID() - // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier. - if (const char* p = strstr(name, "###")) - name = p; -#endif - const size_t name_len = strlen(name); - - // Allocate chunk - const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1; - ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size); - IM_PLACEMENT_NEW(settings) ImGuiWindowSettings(); - settings->ID = ImHashStr(name, name_len); - memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator - - return settings; -} - -ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id) -{ - ImGuiContext& g = *GImGui; - for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings)) - if (settings->ID == id) - return settings; - return NULL; -} - -ImGuiWindowSettings* ImGui::FindOrCreateWindowSettings(const char* name) -{ - if (ImGuiWindowSettings* settings = FindWindowSettings(ImHashStr(name))) - return settings; - return CreateNewWindowSettings(name); -} - void ImGui::AddSettingsHandler(const ImGuiSettingsHandler* handler) { ImGuiContext& g = *GImGui; @@ -12547,6 +12645,7 @@ ImGuiSettingsHandler* ImGui::FindSettingsHandler(const char* type_name) return NULL; } +// Clear all settings (windows, tables, docking etc.) void ImGui::ClearIniSettings() { ImGuiContext& g = *GImGui; @@ -12671,6 +12770,62 @@ const char* ImGui::SaveIniSettingsToMemory(size_t* out_size) return g.SettingsIniData.c_str(); } +ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name) +{ + ImGuiContext& g = *GImGui; + +#if !IMGUI_DEBUG_INI_SETTINGS + // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID() + // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier. + if (const char* p = strstr(name, "###")) + name = p; +#endif + const size_t name_len = strlen(name); + + // Allocate chunk + const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1; + ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size); + IM_PLACEMENT_NEW(settings) ImGuiWindowSettings(); + settings->ID = ImHashStr(name, name_len); + memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator + + return settings; +} + +// We don't provide a FindWindowSettingsByName() because Docking system doesn't always hold on names. +// This is called once per window .ini entry + once per newly instantiated window. +ImGuiWindowSettings* ImGui::FindWindowSettingsByID(ImGuiID id) +{ + ImGuiContext& g = *GImGui; + for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings)) + if (settings->ID == id) + return settings; + return NULL; +} + +// This is faster if you are holding on a Window already as we don't need to perform a search. +ImGuiWindowSettings* ImGui::FindWindowSettingsByWindow(ImGuiWindow* window) +{ + ImGuiContext& g = *GImGui; + if (window->SettingsOffset != -1) + return g.SettingsWindows.ptr_from_offset(window->SettingsOffset); + return FindWindowSettingsByID(window->ID); +} + +// This will revert window to its initial state, including enabling the ImGuiCond_FirstUseEver/ImGuiCond_Once conditions once more. +void ImGui::ClearWindowSettings(const char* name) +{ + //IMGUI_DEBUG_LOG("ClearWindowSettings('%s')\n", name); + ImGuiWindow* window = FindWindowByName(name); + if (window != NULL) + { + window->Flags |= ImGuiWindowFlags_NoSavedSettings; + InitOrLoadWindowSettings(window, NULL); + } + if (ImGuiWindowSettings* settings = window ? FindWindowSettingsByWindow(window) : FindWindowSettingsByID(ImHashStr(name))) + settings->WantDelete = true; +} + static void WindowSettingsHandler_ClearAll(ImGuiContext* ctx, ImGuiSettingsHandler*) { ImGuiContext& g = *ctx; @@ -12681,9 +12836,12 @@ static void WindowSettingsHandler_ClearAll(ImGuiContext* ctx, ImGuiSettingsHandl static void* WindowSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*, const char* name) { - ImGuiWindowSettings* settings = ImGui::FindOrCreateWindowSettings(name); - ImGuiID id = settings->ID; - *settings = ImGuiWindowSettings(); // Clear existing if recycling previous entry + ImGuiID id = ImHashStr(name); + ImGuiWindowSettings* settings = ImGui::FindWindowSettingsByID(id); + if (settings) + *settings = ImGuiWindowSettings(); // Clear existing if recycling previous entry + else + settings = ImGui::CreateNewWindowSettings(name); settings->ID = id; settings->WantApply = true; return (void*)settings; @@ -12723,7 +12881,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl if (window->Flags & ImGuiWindowFlags_NoSavedSettings) continue; - ImGuiWindowSettings* settings = (window->SettingsOffset != -1) ? g.SettingsWindows.ptr_from_offset(window->SettingsOffset) : ImGui::FindWindowSettings(window->ID); + ImGuiWindowSettings* settings = ImGui::FindWindowSettingsByWindow(window); if (!settings) { settings = ImGui::CreateNewWindowSettings(window->Name); @@ -12734,12 +12892,15 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl settings->Size = ImVec2ih(window->SizeFull); settings->Collapsed = window->Collapsed; + settings->WantDelete = false; } // Write to text buffer buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings)) { + if (settings->WantDelete) + continue; const char* settings_name = settings->GetName(); buf->appendf("[%s][%s]\n", handler->TypeName, settings_name); buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y); @@ -12827,9 +12988,9 @@ static void ImGui::UpdateViewportsNewFrame() // Win32 clipboard implementation // We use g.ClipboardHandlerData for temporary storage to ensure it is freed on Shutdown() -static const char* GetClipboardTextFn_DefaultImpl(void*) +static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *(ImGuiContext*)user_data_ctx; g.ClipboardHandlerData.clear(); if (!::OpenClipboard(NULL)) return NULL; @@ -12890,8 +13051,9 @@ static void SetClipboardTextFn_DefaultImpl(void*, const char* text) } } -static const char* GetClipboardTextFn_DefaultImpl(void*) +static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) { + ImGuiContext& g = *(ImGuiContext*)user_data_ctx; if (!main_clipboard) PasteboardCreate(kPasteboardClipboard, &main_clipboard); PasteboardSynchronize(main_clipboard); @@ -12909,7 +13071,6 @@ static const char* GetClipboardTextFn_DefaultImpl(void*) CFDataRef cf_data; if (PasteboardCopyItemFlavorData(main_clipboard, item_id, CFSTR("public.utf8-plain-text"), &cf_data) == noErr) { - ImGuiContext& g = *GImGui; g.ClipboardHandlerData.clear(); int length = (int)CFDataGetLength(cf_data); g.ClipboardHandlerData.resize(length + 1); @@ -12926,15 +13087,15 @@ static const char* GetClipboardTextFn_DefaultImpl(void*) #else // Local Dear ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers. -static const char* GetClipboardTextFn_DefaultImpl(void*) +static const char* GetClipboardTextFn_DefaultImpl(void* user_data_ctx) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *(ImGuiContext*)user_data_ctx; return g.ClipboardHandlerData.empty() ? NULL : g.ClipboardHandlerData.begin(); } -static void SetClipboardTextFn_DefaultImpl(void*, const char* text) +static void SetClipboardTextFn_DefaultImpl(void* user_data_ctx, const char* text) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *(ImGuiContext*)user_data_ctx; g.ClipboardHandlerData.clear(); const char* text_end = text + strlen(text); g.ClipboardHandlerData.resize((int)(text_end - text) + 1); @@ -12956,10 +13117,6 @@ static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatf { // Notify OS Input Method Editor of text input position HWND hwnd = (HWND)viewport->PlatformHandleRaw; -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - if (hwnd == 0) - hwnd = (HWND)ImGui::GetIO().ImeWindowHandle; -#endif if (hwnd == 0) return; @@ -13151,9 +13308,8 @@ void ImGui::DebugTextEncoding(const char* str) static void MetricsHelpMarker(const char* desc) { ImGui::TextDisabled("(?)"); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort)) + if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort) && ImGui::BeginTooltip()) { - ImGui::BeginTooltip(); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); ImGui::TextUnformatted(desc); ImGui::PopTextWrapPos(); @@ -13349,6 +13505,10 @@ void ImGui::ShowMetricsWindow(bool* p_open) } } + Checkbox("Debug Begin/BeginChild return value", &io.ConfigDebugBeginReturnValueLoop); + SameLine(); + MetricsHelpMarker("Some calls to Begin()/BeginChild() will return false.\n\nWill cycle through window depths then repeat. Windows should be flickering while running."); + TreePop(); } @@ -13517,7 +13677,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) Text("KEYBOARD/GAMEPAD/MOUSE KEYS"); { // We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends. - // User code should never have to go through such hoops: old code may use native keycodes, new code may use ImGuiKey codes. + // User code should never have to go through such hoops! You can generally iterate between ImGuiKey_NamedKey_BEGIN and ImGuiKey_NamedKey_END. Indent(); #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } }; @@ -13633,7 +13793,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) DebugLocateItemOnHover(g.NavId); Text("NavInputSource: %s", GetInputSourceName(g.NavInputSource)); Text("NavActive: %d, NavVisible: %d", g.IO.NavActive, g.IO.NavVisible); - Text("NavActivateId/DownId/PressedId/InputId: %08X/%08X/%08X/%08X", g.NavActivateId, g.NavActivateDownId, g.NavActivatePressedId, g.NavActivateInputId); + Text("NavActivateId/DownId/PressedId: %08X/%08X/%08X", g.NavActivateId, g.NavActivateDownId, g.NavActivatePressedId); Text("NavActivateFlags: %04X", g.NavActivateFlags); Text("NavDisableHighlight: %d, NavDisableMouseHover: %d", g.NavDisableHighlight, g.NavDisableMouseHover); Text("NavFocusScopeId = 0x%08X", g.NavFocusScopeId); @@ -13917,9 +14077,8 @@ void ImGui::DebugNodeFont(ImFont* font) if (!glyph) continue; font->RenderChar(draw_list, cell_size, cell_p1, glyph_col, (ImWchar)(base + n)); - if (IsMouseHoveringRect(cell_p1, cell_p2)) + if (IsMouseHoveringRect(cell_p1, cell_p2) && BeginTooltip()) { - BeginTooltip(); DebugNodeFontGlyph(font, glyph); EndTooltip(); } @@ -13969,7 +14128,7 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label) { ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; p += ImFormatString(p, buf_end - p, "%s'%s'", - tab_n > 0 ? ", " : "", (tab->NameOffset != -1) ? TabBarGetTabName(tab_bar, tab) : "???"); + tab_n > 0 ? ", " : "", TabBarGetTabName(tab_bar, tab)); } p += ImFormatString(p, buf_end - p, (tab_bar->Tabs.Size > 3) ? " ... }" : " } "); if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); } @@ -13991,7 +14150,7 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label) if (SmallButton("<")) { TabBarQueueReorder(tab_bar, tab, -1); } SameLine(0, 2); if (SmallButton(">")) { TabBarQueueReorder(tab_bar, tab, +1); } SameLine(); Text("%02d%c Tab 0x%08X '%s' Offset: %.2f, Width: %.2f/%.2f", - tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, (tab->NameOffset != -1) ? TabBarGetTabName(tab_bar, tab) : "???", tab->Offset, tab->Width, tab->ContentWidth); + tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, TabBarGetTabName(tab_bar, tab), tab->Offset, tab->Width, tab->ContentWidth); PopID(); } TreePop(); @@ -14075,8 +14234,12 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label) void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings* settings) { + if (settings->WantDelete) + BeginDisabled(); Text("0x%08X \"%s\" Pos (%d,%d) Size (%d,%d) Collapsed=%d", settings->ID, settings->GetName(), settings->Pos.x, settings->Pos.y, settings->Size.x, settings->Size.y, settings->Collapsed); + if (settings->WantDelete) + EndDisabled(); } void ImGui::DebugNodeWindowsList(ImVector* windows, const char* label) @@ -14151,7 +14314,7 @@ void ImGui::ShowDebugLogWindow(bool* p_open) SameLine(); CheckboxFlags("Focus", &g.DebugLogFlags, ImGuiDebugLogFlags_EventFocus); SameLine(); CheckboxFlags("Popup", &g.DebugLogFlags, ImGuiDebugLogFlags_EventPopup); SameLine(); CheckboxFlags("Nav", &g.DebugLogFlags, ImGuiDebugLogFlags_EventNav); - SameLine(); CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper); + SameLine(); if (CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper)) { g.DebugLogClipperAutoDisableFrames = 2; } if (IsItemHovered()) SetTooltip("Clipper log auto-disabled after 2 frames"); SameLine(); CheckboxFlags("IO", &g.DebugLogFlags, ImGuiDebugLogFlags_EventIO); if (SmallButton("Clear")) @@ -14252,7 +14415,8 @@ void ImGui::UpdateDebugToolItemPicker() if (change_mapping && IsMouseClicked(mouse_button)) g.DebugItemPickerMouseButton = (ImU8)mouse_button; SetNextWindowBgAlpha(0.70f); - BeginTooltip(); + if (!BeginTooltip()) + return; Text("HoveredId: 0x%08X", hovered_id); Text("Press ESC to abort picking."); const char* mouse_button_names[] = { "Left", "Right", "Middle" }; diff --git a/3rdparty/dear-imgui/imgui.h b/3rdparty/dear-imgui/imgui.h index 39879eea5..a2522aef6 100644 --- a/3rdparty/dear-imgui/imgui.h +++ b/3rdparty/dear-imgui/imgui.h @@ -1,4 +1,4 @@ -// dear imgui, v1.89.3 WIP +// dear imgui, v1.89.5 WIP // (headers) // Help: @@ -22,8 +22,8 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') -#define IMGUI_VERSION "1.89.3 WIP" -#define IMGUI_VERSION_NUM 18926 +#define IMGUI_VERSION "1.89.5 WIP" +#define IMGUI_VERSION_NUM 18942 #define IMGUI_HAS_TABLE /* @@ -37,7 +37,7 @@ Index of this file: // [SECTION] ImGuiStyle // [SECTION] ImGuiIO // [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs) -// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor) +// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor) // [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData) // [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont) // [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport) @@ -405,8 +405,8 @@ namespace ImGui IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame(). IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. always use this if you modify the style after NewFrame(). IMGUI_API void PopStyleVar(int count = 1); - IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets - IMGUI_API void PopAllowKeyboardFocus(); + IMGUI_API void PushTabStop(bool tab_stop); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets + IMGUI_API void PopTabStop(); IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame. IMGUI_API void PopButtonRepeat(); @@ -493,6 +493,7 @@ namespace ImGui IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args) IM_FMTLIST(2); IMGUI_API void BulletText(const char* fmt, ...) IM_FMTARGS(1); // shortcut for Bullet()+Text() IMGUI_API void BulletTextV(const char* fmt, va_list args) IM_FMTLIST(1); + IMGUI_API void SeparatorText(const char* label); // currently: formatted text with an horizontal line // Widgets: Main // - Most widgets return true when the value has been changed or when pressed/selected @@ -664,8 +665,8 @@ namespace ImGui // Tooltips // - Tooltip are windows following the mouse. They do not take focus away. - IMGUI_API void BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items). - IMGUI_API void EndTooltip(); + IMGUI_API bool BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items). + IMGUI_API void EndTooltip(); // only call EndTooltip() if BeginTooltip() returns true! IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip(). IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1); @@ -1014,10 +1015,8 @@ enum ImGuiInputTextFlags_ ImGuiInputTextFlags_CallbackEdit = 1 << 19, // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert) - // Obsolete names (will be removed soon) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior -#endif + // Obsolete names + //ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior }; // Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*() @@ -1352,6 +1351,7 @@ enum ImGuiSortDirection_ // All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87). // Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey. // Read details about the 1.87 and 1.89 transition : https://github.com/ocornut/imgui/issues/4921 +// Note that "Keys" related to physical keys and are not the same concept as input "Characters", the later are submitted via io.AddInputCharacter(). enum ImGuiKey : int { // Keyboard @@ -1459,15 +1459,16 @@ enum ImGuiKey : int // [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array. // We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE) + // If you need to iterate all keys (for e.g. an input mapper) you may use ImGuiKey_NamedKey_BEGIN..ImGuiKey_NamedKey_END. ImGuiKey_NamedKey_BEGIN = 512, ImGuiKey_NamedKey_END = ImGuiKey_COUNT, ImGuiKey_NamedKey_COUNT = ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN, #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO - ImGuiKey_KeysData_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys - ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET). + ImGuiKey_KeysData_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys + ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index. #else - ImGuiKey_KeysData_SIZE = ImGuiKey_COUNT, // Size of KeysData[]: hold legacy 0..512 keycodes + named keys - ImGuiKey_KeysData_OFFSET = 0, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET). + ImGuiKey_KeysData_SIZE = ImGuiKey_COUNT, // Size of KeysData[]: hold legacy 0..512 keycodes + named keys + ImGuiKey_KeysData_OFFSET = 0, // Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index. #endif #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS @@ -1492,7 +1493,7 @@ enum ImGuiNavInput enum ImGuiConfigFlags_ { ImGuiConfigFlags_None = 0, - ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. + ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. Enable full Tabbing + directional arrows + space/enter to activate. ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad. ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth. ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set. @@ -1608,6 +1609,9 @@ enum ImGuiStyleVar_ ImGuiStyleVar_TabRounding, // float TabRounding ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign + ImGuiStyleVar_SeparatorTextBorderSize,// float SeparatorTextBorderSize + ImGuiStyleVar_SeparatorTextAlign, // ImVec2 SeparatorTextAlign + ImGuiStyleVar_SeparatorTextPadding,// ImVec2 SeparatorTextPadding ImGuiStyleVar_COUNT }; @@ -1664,8 +1668,8 @@ enum ImGuiColorEditFlags_ ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar, ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV, - // Obsolete names (will be removed) - // ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69] + // Obsolete names + //ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69] }; // Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. @@ -1680,10 +1684,8 @@ enum ImGuiSliderFlags_ ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed. - // Obsolete names (will be removed) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79] -#endif + // Obsolete names + //ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79] }; // Identify a mouse button. @@ -1862,6 +1864,9 @@ struct ImGuiStyle ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered). ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. + float SeparatorTextBorderSize; // Thickkness of border in SeparatorText() + ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center). + ImVec2 SeparatorTextPadding; // Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y. ImVec2 DisplayWindowPadding; // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows. ImVec2 DisplaySafeAreaPadding; // If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly! float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. @@ -1932,6 +1937,14 @@ struct ImGuiIO bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar. float ConfigMemoryCompactTimer; // = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable. + // Debug options + // - tools to test correct Begin/End and BeginChild/EndChild behaviors. + // - presently Begn()/End() and BeginChild()EndChild() needs to ALWAYS be called in tandem, regardless of return value of BeginXXX() + // this is inconsistent with other BeginXXX functions and create confusion for many users. + // - we expect to update the API eventually. In the meanwhile we provided tools to facilitate checking user-code behavior. + bool ConfigDebugBeginReturnValueOnce; // = false // First-time calls to Begin()/BeginChild() will return false. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don't want to miss windows. + bool ConfigDebugBeginReturnValueLoop; // = false // Some calls to Begin()/BeginChild() will return false. Will cycle through window depths then repeat. Suggested use: add "io.ConfigDebugBeginReturnValue = io.KeyShift" in your main loop then occasionally press SHIFT. Windows should be flickering while running. + //------------------------------------------------------------------ // Platform Functions // (the imgui_impl_xxxx backend files are setting those up for you) @@ -2013,6 +2026,8 @@ struct ImGuiIO // [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed! //------------------------------------------------------------------ + ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent). + // Main Input State // (this block used to be written by backend, since 1.87 it is best to NOT write to those directly, call the AddXXX functions above instead) // (reading from those variables is fair game, as they are extremely unlikely to be moving anywhere) @@ -2068,6 +2083,7 @@ struct ImGuiIO // - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. struct ImGuiInputTextCallbackData { + ImGuiContext* Ctx; // Parent UI context ImGuiInputTextFlags EventFlag; // One ImGuiInputTextFlags_Callback* // Read-only ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only void* UserData; // What user passed to InputText() // Read-only @@ -2152,7 +2168,7 @@ struct ImGuiTableSortSpecs }; //----------------------------------------------------------------------------- -// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor) +// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor) //----------------------------------------------------------------------------- // Helper: Unicode defines @@ -2292,6 +2308,7 @@ struct ImGuiStorage // - The clipper also handles various subtleties related to keyboard/gamepad navigation, wrapping etc. struct ImGuiListClipper { + ImGuiContext* Ctx; // Parent UI context int DisplayStart; // First item to display, updated by each call to Step() int DisplayEnd; // End of items to display (exclusive) int ItemsCount; // [Internal] Number of items @@ -2315,6 +2332,32 @@ struct ImGuiListClipper #endif }; +// Helpers: ImVec2/ImVec4 operators +// - It is important that we are keeping those disabled by default so they don't leak in user space. +// - This is in order to allow user enabling implicit cast operators between ImVec2/ImVec4 and their own types (using IM_VEC2_CLASS_EXTRA in imconfig.h) +// - You can use '#define IMGUI_DEFINE_MATH_OPERATORS' to import our operators, provided as a courtesy. +// - We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself. +#ifdef IMGUI_DEFINE_MATH_OPERATORS +#define IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED +IM_MSVC_RUNTIME_CHECKS_OFF +static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x * rhs, lhs.y * rhs); } +static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x / rhs, lhs.y / rhs); } +static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); } +static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); } +static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); } +static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); } +static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; } +static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; } +static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; } +static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; } +static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; } +static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; } +static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); } +static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); } +static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); } +IM_MSVC_RUNTIME_CHECKS_RESTORE +#endif + // Helpers macros to generate 32-bit encoded colors // User can declare their own format by #defining the 5 _SHIFT/_MASK macros in their imconfig file. #ifndef IM_COL32_R_SHIFT @@ -2602,10 +2645,9 @@ struct ImDrawList inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; } inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } // Write vertex with unique index -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021) - inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021) -#endif + // Obsolete names + //inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021) + //inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021) // [Internal helpers] IMGUI_API void _ResetForNewFrame(); @@ -2657,7 +2699,7 @@ struct ImFontConfig bool PixelSnapH; // false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1. ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now. ImVec2 GlyphOffset; // 0, 0 // Offset all glyphs from this font input. - const ImWchar* GlyphRanges; // NULL // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. + const ImWchar* GlyphRanges; // NULL // THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). float GlyphMinAdvanceX; // 0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font float GlyphMaxAdvanceX; // FLT_MAX // Maximum AdvanceX for glyphs bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights. @@ -2965,6 +3007,9 @@ namespace ImGui #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS namespace ImGui { + // OBSOLETED in 1.89.4 (from March 2023) + static inline void PushAllowKeyboardFocus(bool tab_stop) { PushTabStop(tab_stop); } + static inline void PopAllowKeyboardFocus() { PopTabStop(); } // OBSOLETED in 1.89 (from August 2022) IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Use new ImageButton() signature (explicit item id, regular FramePadding) // OBSOLETED in 1.88 (from May 2022) diff --git a/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/dear-imgui/imgui_demo.cpp index 1c6de1ce0..d83daf9d3 100644 --- a/3rdparty/dear-imgui/imgui_demo.cpp +++ b/3rdparty/dear-imgui/imgui_demo.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.3 WIP +// dear imgui, v1.89.5 WIP // (demo code) // Help: @@ -38,7 +38,7 @@ // - We try to declare static variables in the local scope, as close as possible to the code using them. // - We never use any of the helpers/facilities used internally by Dear ImGui, unless available in the public API. // - We never use maths operators on ImVec2/ImVec4. For our other sources files we use them, and they are provided -// by imgui_internal.h using the IMGUI_DEFINE_MATH_OPERATORS define. For your own sources file they are optional +// by imgui.h using the IMGUI_DEFINE_MATH_OPERATORS define. For your own sources file they are optional // and require you either enable those, either provide your own via IM_VEC2_CLASS_EXTRA in imconfig.h. // Because we can't assume anything about your support of maths operators, we cannot use them in imgui_demo.cpp. @@ -211,9 +211,8 @@ static void ShowDemoWindowInputs(); static void HelpMarker(const char* desc) { ImGui::TextDisabled("(?)"); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort)) + if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort) && ImGui::BeginTooltip()) { - ImGui::BeginTooltip(); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); ImGui::TextUnformatted(desc); ImGui::PopTextWrapPos(); @@ -426,6 +425,7 @@ void ImGui::ShowDemoWindow(bool* p_open) if (ImGui::TreeNode("Configuration##2")) { + ImGui::SeparatorText("General"); ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", &io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard); ImGui::SameLine(); HelpMarker("Enable keyboard controls."); ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", &io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad); @@ -448,6 +448,10 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::SameLine(); HelpMarker("Instruct backend to not alter mouse cursor shape and visibility."); ImGui::Checkbox("io.ConfigInputTrickleEventQueue", &io.ConfigInputTrickleEventQueue); ImGui::SameLine(); HelpMarker("Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates."); + ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor); + ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something)."); + + ImGui::SeparatorText("Widgets"); ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink); ImGui::SameLine(); HelpMarker("Enable blinking cursor (optional as some users consider it to be distracting)."); ImGui::Checkbox("io.ConfigInputTextEnterKeepActive", &io.ConfigInputTextEnterKeepActive); @@ -458,11 +462,18 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback."); ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly); ImGui::Checkbox("io.ConfigMacOSXBehaviors", &io.ConfigMacOSXBehaviors); - ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor); - ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something)."); ImGui::Text("Also see Style->Rendering for rendering options."); + + ImGui::SeparatorText("Debug"); + ImGui::BeginDisabled(); + ImGui::Checkbox("io.ConfigDebugBeginReturnValueOnce", &io.ConfigDebugBeginReturnValueOnce); // . + ImGui::EndDisabled(); + ImGui::SameLine(); HelpMarker("First calls to Begin()/BeginChild() will return false.\n\nTHIS OPTION IS DISABLED because it needs to be set at application boot-time to make sense. Showing the disabled option is a way to make this feature easier to discover"); + ImGui::Checkbox("io.ConfigDebugBeginReturnValueLoop", &io.ConfigDebugBeginReturnValueLoop); + ImGui::SameLine(); HelpMarker("Some calls to Begin()/BeginChild() will return false.\n\nWill cycle through window depths then repeat. Windows should be flickering while running."); + ImGui::TreePop(); - ImGui::Separator(); + ImGui::Spacing(); } IMGUI_DEMO_MARKER("Configuration/Backend Flags"); @@ -480,7 +491,7 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &backend_flags, ImGuiBackendFlags_HasSetMousePos); ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &backend_flags, ImGuiBackendFlags_RendererHasVtxOffset); ImGui::TreePop(); - ImGui::Separator(); + ImGui::Spacing(); } IMGUI_DEMO_MARKER("Configuration/Style"); @@ -489,7 +500,7 @@ void ImGui::ShowDemoWindow(bool* p_open) HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function."); ImGui::ShowStyleEditor(); ImGui::TreePop(); - ImGui::Separator(); + ImGui::Spacing(); } IMGUI_DEMO_MARKER("Configuration/Capture, Logging"); @@ -557,6 +568,8 @@ static void ShowDemoWindowWidgets() IMGUI_DEMO_MARKER("Widgets/Basic"); if (ImGui::TreeNode("Basic")) { + ImGui::SeparatorText("General"); + IMGUI_DEMO_MARKER("Widgets/Basic/Button"); static int clicked = 0; if (ImGui::Button("Button")) @@ -624,9 +637,8 @@ static void ShowDemoWindowWidgets() ImGui::SameLine(); ImGui::SmallButton("Fancy"); - if (ImGui::IsItemHovered()) + if (ImGui::IsItemHovered() && ImGui::BeginTooltip()) { - ImGui::BeginTooltip(); ImGui::Text("I am a fancy tooltip"); static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr)); @@ -646,6 +658,8 @@ static void ShowDemoWindowWidgets() ImGui::LabelText("label", "Value"); + ImGui::SeparatorText("Inputs"); + { // To wire InputText() with std::string or any other custom string type, // see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file. @@ -688,6 +702,8 @@ static void ShowDemoWindowWidgets() ImGui::InputFloat3("input float3", vec4a); } + ImGui::SeparatorText("Drags"); + { IMGUI_DEMO_MARKER("Widgets/Basic/DragInt, DragFloat"); static int i1 = 50, i2 = 42; @@ -704,6 +720,8 @@ static void ShowDemoWindowWidgets() ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns"); } + ImGui::SeparatorText("Sliders"); + { IMGUI_DEMO_MARKER("Widgets/Basic/SliderInt, SliderFloat"); static int i1 = 0; @@ -730,6 +748,8 @@ static void ShowDemoWindowWidgets() ImGui::SameLine(); HelpMarker("Using the format string parameter to display a name instead of the underlying integer."); } + ImGui::SeparatorText("Selectors/Pickers"); + { IMGUI_DEMO_MARKER("Widgets/Basic/ColorEdit3, ColorEdit4"); static float col1[3] = { 1.0f, 0.0f, 0.2f }; @@ -1034,9 +1054,8 @@ static void ShowDemoWindowWidgets() ImVec4 tint_col = use_text_color_for_tint ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint ImVec4 border_col = ImGui::GetStyleColorVec4(ImGuiCol_Border); ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col); - if (ImGui::IsItemHovered()) + if (ImGui::IsItemHovered() && ImGui::BeginTooltip()) { - ImGui::BeginTooltip(); float region_sz = 32.0f; float region_x = io.MousePos.x - pos.x - region_sz * 0.5f; float region_y = io.MousePos.y - pos.y - region_sz * 0.5f; @@ -1690,7 +1709,7 @@ static void ShowDemoWindowWidgets() } // Use functions to generate output - // FIXME: This is rather awkward because current plot API only pass in indices. + // FIXME: This is actually VERY awkward because current plot API only pass in indices. // We probably want an API passing floats and user provide sample rate/count. struct Funcs { @@ -1698,7 +1717,7 @@ static void ShowDemoWindowWidgets() static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; } }; static int func_type = 0, display_count = 70; - ImGui::Separator(); + ImGui::SeparatorText("Functions"); ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); ImGui::Combo("func", &func_type, "Sin\0Saw\0"); ImGui::SameLine(); @@ -1741,6 +1760,7 @@ static void ShowDemoWindowWidgets() static bool drag_and_drop = true; static bool options_menu = true; static bool hdr = false; + ImGui::SeparatorText("Options"); ImGui::Checkbox("With Alpha Preview", &alpha_preview); ImGui::Checkbox("With Half Alpha Preview", &alpha_half_preview); ImGui::Checkbox("With Drag and Drop", &drag_and_drop); @@ -1749,6 +1769,7 @@ static void ShowDemoWindowWidgets() ImGuiColorEditFlags misc_flags = (hdr ? ImGuiColorEditFlags_HDR : 0) | (drag_and_drop ? 0 : ImGuiColorEditFlags_NoDragDrop) | (alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : (alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0)) | (options_menu ? 0 : ImGuiColorEditFlags_NoOptions); IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit"); + ImGui::SeparatorText("Inline color editor"); ImGui::Text("Color widget:"); ImGui::SameLine(); HelpMarker( "Click on the color square to open a color picker.\n" @@ -1846,7 +1867,7 @@ static void ShowDemoWindowWidgets() ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, misc_flags | (no_border ? ImGuiColorEditFlags_NoBorder : 0), ImVec2(80, 80)); IMGUI_DEMO_MARKER("Widgets/Color/ColorPicker"); - ImGui::Text("Color picker:"); + ImGui::SeparatorText("Color picker"); static bool alpha = true; static bool alpha_bar = true; static bool side_preview = true; @@ -2017,7 +2038,7 @@ static void ShowDemoWindowWidgets() const float drag_speed = 0.2f; static bool drag_clamp = false; IMGUI_DEMO_MARKER("Widgets/Data Types/Drags"); - ImGui::Text("Drags:"); + ImGui::SeparatorText("Drags"); ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp); ImGui::SameLine(); HelpMarker( "As with every widget in dear imgui, we never modify values unless there is a user interaction.\n" @@ -2037,7 +2058,7 @@ static void ShowDemoWindowWidgets() ImGui::DragScalar("drag double log",ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", ImGuiSliderFlags_Logarithmic); IMGUI_DEMO_MARKER("Widgets/Data Types/Sliders"); - ImGui::Text("Sliders"); + ImGui::SeparatorText("Sliders"); ImGui::SliderScalar("slider s8 full", ImGuiDataType_S8, &s8_v, &s8_min, &s8_max, "%d"); ImGui::SliderScalar("slider u8 full", ImGuiDataType_U8, &u8_v, &u8_min, &u8_max, "%u"); ImGui::SliderScalar("slider s16 full", ImGuiDataType_S16, &s16_v, &s16_min, &s16_max, "%d"); @@ -2062,7 +2083,7 @@ static void ShowDemoWindowWidgets() ImGui::SliderScalar("slider double low log",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", ImGuiSliderFlags_Logarithmic); ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams"); - ImGui::Text("Sliders (reverse)"); + ImGui::SeparatorText("Sliders (reverse)"); ImGui::SliderScalar("slider s8 reverse", ImGuiDataType_S8, &s8_v, &s8_max, &s8_min, "%d"); ImGui::SliderScalar("slider u8 reverse", ImGuiDataType_U8, &u8_v, &u8_max, &u8_min, "%u"); ImGui::SliderScalar("slider s32 reverse", ImGuiDataType_S32, &s32_v, &s32_fifty, &s32_zero, "%d"); @@ -2072,7 +2093,7 @@ static void ShowDemoWindowWidgets() IMGUI_DEMO_MARKER("Widgets/Data Types/Inputs"); static bool inputs_step = true; - ImGui::Text("Inputs"); + ImGui::SeparatorText("Inputs"); ImGui::Checkbox("Show step buttons", &inputs_step); ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d"); ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u"); @@ -2096,22 +2117,23 @@ static void ShowDemoWindowWidgets() static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f }; static int vec4i[4] = { 1, 5, 100, 255 }; + ImGui::SeparatorText("2-wide"); ImGui::InputFloat2("input float2", vec4f); ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f); ImGui::InputInt2("input int2", vec4i); ImGui::DragInt2("drag int2", vec4i, 1, 0, 255); ImGui::SliderInt2("slider int2", vec4i, 0, 255); - ImGui::Spacing(); + ImGui::SeparatorText("3-wide"); ImGui::InputFloat3("input float3", vec4f); ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f); ImGui::InputInt3("input int3", vec4i); ImGui::DragInt3("drag int3", vec4i, 1, 0, 255); ImGui::SliderInt3("slider int3", vec4i, 0, 255); - ImGui::Spacing(); + ImGui::SeparatorText("4-wide"); ImGui::InputFloat4("input float4", vec4f); ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f); @@ -2528,6 +2550,8 @@ static void ShowDemoWindowLayout() IMGUI_DEMO_MARKER("Layout/Child windows"); if (ImGui::TreeNode("Child windows")) { + ImGui::SeparatorText("Child windows"); + HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window."); static bool disable_mouse_wheel = false; static bool disable_menu = false; @@ -2580,7 +2604,7 @@ static void ShowDemoWindowLayout() ImGui::PopStyleVar(); } - ImGui::Separator(); + ImGui::SeparatorText("Misc/Advanced"); // Demonstrate a few extra things // - Changing ImGuiCol_ChildBg (which is transparent black in default styles) @@ -3344,8 +3368,7 @@ static void ShowDemoWindowPopups() ImGui::TextUnformatted(selected_fish == -1 ? "" : names[selected_fish]); if (ImGui::BeginPopup("my_select_popup")) { - ImGui::Text("Aquarium"); - ImGui::Separator(); + ImGui::SeparatorText("Aquarium"); for (int i = 0; i < IM_ARRAYSIZE(names); i++) if (ImGui::Selectable(names[i])) selected_fish = i; @@ -3522,7 +3545,7 @@ static void ShowDemoWindowPopups() if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { - ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n"); + ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!"); ImGui::Separator(); //static int unused_i = 0; @@ -3705,9 +3728,8 @@ static void EditTableSizingFlags(ImGuiTableFlags* p_flags) } ImGui::SameLine(); ImGui::TextDisabled("(?)"); - if (ImGui::IsItemHovered()) + if (ImGui::IsItemHovered() && ImGui::BeginTooltip()) { - ImGui::BeginTooltip(); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 50.0f); for (int m = 0; m < IM_ARRAYSIZE(policies); m++) { @@ -5719,13 +5741,15 @@ static void ShowDemoWindowInputs() ImGui::Text("Mouse wheel: %.1f", io.MouseWheel); // We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends. - // User code should never have to go through such hoops: old code may use native keycodes, new code may use ImGuiKey codes. + // User code should never have to go through such hoops! You can generally iterate between ImGuiKey_NamedKey_BEGIN and ImGuiKey_NamedKey_END. #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } }; + ImGuiKey start_key = ImGuiKey_NamedKey_BEGIN; #else struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array + ImGuiKey start_key = (ImGuiKey)0; #endif - ImGui::Text("Keys down:"); for (ImGuiKey key = ImGuiKey_KeysData_OFFSET; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); ImGui::SameLine(); ImGui::Text("(%.02f)", ImGui::GetKeyData(key)->DownDuration); } + ImGui::Text("Keys down:"); for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); ImGui::SameLine(); ImGui::Text("(%.02f)", ImGui::GetKeyData(key)->DownDuration); } ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public. @@ -5813,10 +5837,10 @@ static void ShowDemoWindowInputs() ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("3", buf, IM_ARRAYSIZE(buf)); - ImGui::PushAllowKeyboardFocus(false); + ImGui::PushTabStop(false); ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf)); ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab."); - ImGui::PopAllowKeyboardFocus(); + ImGui::PopTabStop(); ImGui::InputText("5", buf, IM_ARRAYSIZE(buf)); ImGui::TreePop(); } @@ -5838,12 +5862,12 @@ static void ShowDemoWindowInputs() ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 2; - ImGui::PushAllowKeyboardFocus(false); + ImGui::PushTabStop(false); if (focus_3) ImGui::SetKeyboardFocusHere(); ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 3; ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab."); - ImGui::PopAllowKeyboardFocus(); + ImGui::PopTabStop(); if (has_focus) ImGui::Text("Item with focus: %d", has_focus); @@ -6146,7 +6170,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) { if (ImGui::BeginTabItem("Sizes")) { - ImGui::Text("Main"); + ImGui::SeparatorText("Main"); ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("CellPadding", (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f"); @@ -6156,13 +6180,15 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f"); ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f"); ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f"); - ImGui::Text("Borders"); + + ImGui::SeparatorText("Borders"); ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::Text("Rounding"); + + ImGui::SeparatorText("Rounding"); ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f"); @@ -6170,7 +6196,8 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f"); - ImGui::Text("Alignment"); + + ImGui::SeparatorText("Widgets"); ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); int window_menu_button_position = style.WindowMenuButtonPosition + 1; if (ImGui::Combo("WindowMenuButtonPosition", (int*)&window_menu_button_position, "None\0Left\0Right\0")) @@ -6180,10 +6207,13 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SameLine(); HelpMarker("Alignment applies when a button is larger than its text content."); ImGui::SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content."); - ImGui::Text("Safe Area Padding"); - ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); - ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); + ImGui::SliderFloat("SeparatorTextBorderSize", &style.SeparatorTextBorderSize, 0.0f, 10.0f, "%.0f"); + ImGui::SliderFloat2("SeparatorTextAlign", (float*)&style.SeparatorTextAlign, 0.0f, 1.0f, "%.2f"); + ImGui::SliderFloat2("SeparatorTextPadding", (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%0.f"); ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f"); + + ImGui::SeparatorText("Misc"); + ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); ImGui::EndTabItem(); } @@ -6293,10 +6323,11 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) // When editing the "Circle Segment Max Error" value, draw a preview of its effect on auto-tessellated circles. ImGui::DragFloat("Circle Tessellation Max Error", &style.CircleTessellationMaxError , 0.005f, 0.10f, 5.0f, "%.2f", ImGuiSliderFlags_AlwaysClamp); - if (ImGui::IsItemActive()) - { + const bool show_samples = ImGui::IsItemActive(); + if (show_samples) ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos()); - ImGui::BeginTooltip(); + if (show_samples && ImGui::BeginTooltip()) + { ImGui::TextUnformatted("(R = radius, N = number of segments)"); ImGui::Spacing(); ImDrawList* draw_list = ImGui::GetWindowDrawList(); @@ -6493,6 +6524,7 @@ static void ShowExampleMenuFile() IM_ASSERT(0); } if (ImGui::MenuItem("Checked", NULL, true)) {} + ImGui::Separator(); if (ImGui::MenuItem("Quit", "Alt+F4")) {} } @@ -7411,7 +7443,7 @@ static void ShowExampleAppFullscreen(bool* p_open) static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings; // We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.) - // Based on your use case you may want one of the other. + // Based on your use case you may want one or the other. const ImGuiViewport* viewport = ImGui::GetMainViewport(); ImGui::SetNextWindowPos(use_work_area ? viewport->WorkPos : viewport->Pos); ImGui::SetNextWindowSize(use_work_area ? viewport->WorkSize : viewport->Size); diff --git a/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/dear-imgui/imgui_draw.cpp index 09db1c6bd..8bfe7a5aa 100644 --- a/3rdparty/dear-imgui/imgui_draw.cpp +++ b/3rdparty/dear-imgui/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.3 WIP +// dear imgui, v1.89.5 WIP // (drawing and font code) /* @@ -26,13 +26,12 @@ Index of this file: #define _CRT_SECURE_NO_WARNINGS #endif -#include "imgui.h" -#ifndef IMGUI_DISABLE - #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS #endif +#include "imgui.h" +#ifndef IMGUI_DISABLE #include "imgui_internal.h" #ifdef IMGUI_ENABLE_FREETYPE #include "misc/freetype/imgui_freetype.h" @@ -389,6 +388,8 @@ void ImDrawList::_ResetForNewFrame() IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0); IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4)); IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID)); + if (_Splitter._Count > 1) + _Splitter.Merge(this); CmdBuffer.resize(0); IdxBuffer.resize(0); @@ -2382,7 +2383,12 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex]; src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault(); for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2) + { + // Check for valid range. This may also help detect *some* dangling pointers, because a common + // user error is to setup ImFontConfig::GlyphRanges with a pointer to data that isn't persistent. + IM_ASSERT(src_range[0] <= src_range[1]); src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]); + } dst_tmp.SrcCount++; dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest); } diff --git a/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/dear-imgui/imgui_internal.h index 571b15986..d74b89ed3 100644 --- a/3rdparty/dear-imgui/imgui_internal.h +++ b/3rdparty/dear-imgui/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.89.3 WIP +// dear imgui, v1.89.5 WIP // (internal structures/api) // You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility. @@ -95,6 +95,12 @@ Index of this file: #pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead #endif +// In 1.89.4, we moved the implementation of "courtesy maths operators" from imgui_internal.h in imgui.h +// As they are frequently requested, we do not want to encourage to many people using imgui_internal.h +#if defined(IMGUI_DEFINE_MATH_OPERATORS) && !defined(IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED) +#error Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h! +#endif + // Legacy defines #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Renamed in 1.74 #error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS @@ -120,9 +126,11 @@ struct ImDrawListSharedData; // Data shared between all ImDrawList instan struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it struct ImGuiContext; // Main Dear ImGui context struct ImGuiContextHook; // Hook for extensions like ImGuiTestEngine +struct ImGuiDataVarInfo; // Variable information (e.g. to avoid style variables from an enum) struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDataType enum struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup() struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box +struct ImGuiInputTextDeactivateData;// Short term storage to backup text of a deactivating InputText() while another is stealing active id struct ImGuiLastItemData; // Status storage for last submitted items struct ImGuiLocEntry; // A localization entry. struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only @@ -318,8 +326,8 @@ namespace ImStb //----------------------------------------------------------------------------- // Helpers: Hashing -IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImU32 seed = 0); -IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImU32 seed = 0); +IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0); +IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0); // Helpers: Sorting #ifndef ImQsort @@ -374,29 +382,6 @@ IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char IMGUI_API int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end); // return number of bytes to express one char in UTF-8 IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string in UTF-8 -// Helpers: ImVec2/ImVec4 operators -// We are keeping those disabled by default so they don't leak in user space, to allow user enabling implicit cast operators between ImVec2 and their own types (using IM_VEC2_CLASS_EXTRA etc.) -// We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself. -#ifdef IMGUI_DEFINE_MATH_OPERATORS -IM_MSVC_RUNTIME_CHECKS_OFF -static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x * rhs, lhs.y * rhs); } -static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x / rhs, lhs.y / rhs); } -static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); } -static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); } -static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); } -static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); } -static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; } -static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; } -static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; } -static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; } -static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; } -static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; } -static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); } -static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); } -static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); } -IM_MSVC_RUNTIME_CHECKS_RESTORE -#endif - // Helpers: File System #ifdef IMGUI_DISABLE_FILE_FUNCTIONS #define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS @@ -805,10 +790,10 @@ enum ImGuiItemFlags_ { // Controlled by user ImGuiItemFlags_None = 0, - ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing (FIXME: should merge with _NoNav) + ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav. ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings. ImGuiItemFlags_Disabled = 1 << 2, // false // Disable interactions but doesn't affect visuals. See BeginDisabled()/EndDisabled(). See github.com/ocornut/imgui/issues/211 - ImGuiItemFlags_NoNav = 1 << 3, // false // Disable keyboard/gamepad directional navigation (FIXME: should merge with _NoTabStop) + ImGuiItemFlags_NoNav = 1 << 3, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls) ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false // Disable item being a candidate for default focus (e.g. used by title bar items) ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // Disable MenuItem/Selectable() automatically closing their popup window ImGuiItemFlags_MixedValue = 1 << 6, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets) @@ -835,11 +820,13 @@ enum ImGuiItemStatusFlags_ ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon) ImGuiItemStatusFlags_Visible = 1 << 9, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()). + // Additional status + semantic for ImGuiTestEngine #ifdef IMGUI_ENABLE_TEST_ENGINE ImGuiItemStatusFlags_Openable = 1 << 20, // Item is an openable (e.g. TreeNode) - ImGuiItemStatusFlags_Opened = 1 << 21, // + ImGuiItemStatusFlags_Opened = 1 << 21, // Opened status ImGuiItemStatusFlags_Checkable = 1 << 22, // Item is a checkable (e.g. CheckBox, MenuItem) - ImGuiItemStatusFlags_Checked = 1 << 23, // + ImGuiItemStatusFlags_Checked = 1 << 23, // Checked status + ImGuiItemStatusFlags_Inputable = 1 << 24, // Item is a text-inputable (e.g. InputText, SliderXXX, DragXXX) #endif }; @@ -968,6 +955,14 @@ enum ImGuiPopupPositionPolicy ImGuiPopupPositionPolicy_Tooltip, }; +struct ImGuiDataVarInfo +{ + ImGuiDataType Type; + ImU32 Count; // 1+ + ImU32 Offset; // Offset in parent structure + void* GetVarPtr(void* parent) const { return (void*)((unsigned char*)parent + Offset); } +}; + struct ImGuiDataTypeTempStorage { ImU8 Data[8]; // Can fit any data up to ImGuiDataType_COUNT @@ -1054,11 +1049,20 @@ struct IMGUI_API ImGuiMenuColumns void CalcNextTotalWidth(bool update_offsets); }; +// Internal temporary state for deactivating InputText() instances. +struct IMGUI_API ImGuiInputTextDeactivatedState +{ + ImGuiID ID; // widget id owning the text state (which just got deactivated) + ImVector TextA; // text buffer + + ImGuiInputTextDeactivatedState() { memset(this, 0, sizeof(*this)); } + void ClearFreeMemory() { ID = 0; TextA.clear(); } +}; // Internal state of the currently focused/edited text input box // For a given item ID, access with ImGui::GetInputTextState() struct IMGUI_API ImGuiInputTextState { - ImGuiContext* Ctx; // parent dear imgui context + ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent). ImGuiID ID; // widget id owning the text state int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not. ImVector TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer. @@ -1074,7 +1078,7 @@ struct IMGUI_API ImGuiInputTextState bool Edited; // edited this frame ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set. - ImGuiInputTextState(ImGuiContext* ctx) { memset(this, 0, sizeof(*this)); Ctx = ctx;} + ImGuiInputTextState() { memset(this, 0, sizeof(*this)); } void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); } void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); } int GetUndoAvailCount() const { return Stb.undostate.undo_point; } @@ -1188,8 +1192,8 @@ struct IMGUI_API ImGuiStackSizes short SizeOfDisabledStack; ImGuiStackSizes() { memset(this, 0, sizeof(*this)); } - void SetToCurrentState(); - void CompareWithCurrentState(); + void SetToContextState(ImGuiContext* ctx); + void CompareWithContextState(ImGuiContext* ctx); }; // Data saved for each window pushed into the stack @@ -1220,6 +1224,7 @@ struct ImGuiPtrOrIndex // [SECTION] Inputs support //----------------------------------------------------------------------------- +// Bit array for named keys typedef ImBitArray ImBitArrayForNamedKeys; // [Internal] Key ranges @@ -1263,7 +1268,6 @@ enum ImGuiInputSource ImGuiInputSource_Keyboard, ImGuiInputSource_Gamepad, ImGuiInputSource_Clipboard, // Currently only used by InputText() - ImGuiInputSource_Nav, // Stored in g.ActiveIdSource only ImGuiInputSource_COUNT }; @@ -1420,8 +1424,8 @@ struct ImGuiListClipperData enum ImGuiActivateFlags_ { ImGuiActivateFlags_None = 0, - ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default if keyboard is available. - ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default if keyboard is not available. + ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default for Enter key. + ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default for Space key and if keyboard is not used. ImGuiActivateFlags_TryToPreserveState = 1 << 2, // Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection) }; @@ -1607,6 +1611,7 @@ struct ImGuiWindowSettings ImVec2ih Size; bool Collapsed; bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context) + bool WantDelete; // Set to invalidate/delete the settings entry ImGuiWindowSettings() { memset(this, 0, sizeof(*this)); } char* GetName() { return (char*)(this + 1); } @@ -1790,7 +1795,7 @@ struct ImGuiContext bool ActiveIdHasBeenEditedThisFrame; ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior) ImGuiWindow* ActiveIdWindow; - ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard) + ImGuiInputSource ActiveIdSource; // Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad int ActiveIdMouseButton; ImGuiID ActiveIdPreviousFrame; bool ActiveIdPreviousFrameIsAlive; @@ -1837,17 +1842,16 @@ struct ImGuiContext ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow' ImGuiID NavId; // Focused item for navigation ImGuiID NavFocusScopeId; // Identify a selection scope (selection code often wants to "clear other items" when landing on an item of the selection set) - ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem() - ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0 - ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat) - ImGuiID NavActivateInputId; // ~~ IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadInput) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0. + ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem() + ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0 + ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat) ImGuiActivateFlags NavActivateFlags; ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest). ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest). ImGuiKeyChord NavJustMovedToKeyMods; ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame. ImGuiActivateFlags NavNextActivateFlags; - ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard. + ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse ImGuiNavLayer NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later. bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default) @@ -1941,12 +1945,15 @@ struct ImGuiContext // Widget state ImVec2 MouseLastValidPos; ImGuiInputTextState InputTextState; + ImGuiInputTextDeactivatedState InputTextDeactivatedState; ImFont InputTextPasswordFont; ImGuiID TempInputId; // Temporary text input when CTRL+clicking on a slider, etc. ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets - float ColorEditLastHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips - float ColorEditLastSat; // Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips - ImU32 ColorEditLastColor; // RGB value with alpha set to 0. + ImGuiID ColorEditCurrentID; // Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others). + ImGuiID ColorEditSavedID; // ID we are saving/restoring HS for + float ColorEditSavedHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips + float ColorEditSavedSat; // Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips + ImU32 ColorEditSavedColor; // RGB value with alpha set to 0. ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker. ImGuiComboPreviewData ComboPreviewData; float SliderGrabClickOffset; @@ -1997,7 +2004,9 @@ struct ImGuiContext ImGuiDebugLogFlags DebugLogFlags; ImGuiTextBuffer DebugLogBuf; ImGuiTextIndex DebugLogIndex; + ImU8 DebugLogClipperAutoDisableFrames; ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above. + ImS8 DebugBeginReturnValueCullDepth; // Cycle between 0..9 then wrap around. bool DebugItemPickerActive; // Item picker is active (started with DebugStartItemPicker()) ImU8 DebugItemPickerMouseButton; ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID @@ -2015,8 +2024,10 @@ struct ImGuiContext ImVector TempBuffer; // Temporary text buffer ImGuiContext(ImFontAtlas* shared_font_atlas) - : InputTextState(this) { + IO.Ctx = this; + InputTextState.Ctx = this; + Initialized = false; FontAtlasOwnedByContext = shared_font_atlas ? false : true; Font = NULL; @@ -2075,11 +2086,11 @@ struct ImGuiContext BeginMenuCount = 0; NavWindow = NULL; - NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavActivateInputId = 0; + NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = 0; NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0; NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None; NavJustMovedToKeyMods = ImGuiMod_None; - NavInputSource = ImGuiInputSource_None; + NavInputSource = ImGuiInputSource_Keyboard; NavLayer = ImGuiNavLayer_Main; NavIdIsAlive = false; NavMousePosDirty = false; @@ -2132,8 +2143,9 @@ struct ImGuiContext TempInputId = 0; ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_; - ColorEditLastHue = ColorEditLastSat = 0.0f; - ColorEditLastColor = 0; + ColorEditCurrentID = ColorEditSavedID = 0; + ColorEditSavedHue = ColorEditSavedSat = 0.0f; + ColorEditSavedColor = 0; SliderGrabClickOffset = 0.0f; SliderCurrentAccum = 0.0f; SliderCurrentAccumDirty = false; @@ -2166,7 +2178,9 @@ struct ImGuiContext DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY; DebugLocateId = 0; + DebugLogClipperAutoDisableFrames = 0; DebugLocateFrames = 0; + DebugBeginReturnValueCullDepth = -1; DebugItemPickerActive = false; DebugItemPickerMouseButton = ImGuiMouseButton_Left; DebugItemPickerBreakId = 0; @@ -2235,6 +2249,7 @@ struct IMGUI_API ImGuiWindowTempData // Storage for one window struct IMGUI_API ImGuiWindow { + ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent). char* Name; // Window name, owned by the window. ImGuiID ID; // == ImHashStr(Name) ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_ @@ -2345,10 +2360,10 @@ public: // We don't use g.FontSize because the window may be != g.CurrentWindow. ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); } - float CalcFontSize() const { ImGuiContext& g = *GImGui; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; } - float TitleBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; } + float CalcFontSize() const { ImGuiContext& g = *Ctx; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; } + float TitleBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; } ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); } - float MenuBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; } + float MenuBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; } ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); } }; @@ -2509,14 +2524,15 @@ struct ImGuiTableCellData ImGuiTableColumnIdx Column; // Column number }; -// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs, does that needs they could be moved to ImGuiTableTempData ?) +// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs. Does that means they could be moved to ImGuiTableTempData?) struct ImGuiTableInstanceData { + ImGuiID TableInstanceID; float LastOuterHeight; // Outer height from last frame float LastFirstRowHeight; // Height of first row from last frame (FIXME: this is used as "header height" and may be reworked) float LastFrozenHeight; // Height of frozen section from last frame - ImGuiTableInstanceData() { LastOuterHeight = LastFirstRowHeight = LastFrozenHeight = 0.0f; } + ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastFirstRowHeight = LastFrozenHeight = 0.0f; } }; // FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs, incoming RowData @@ -2719,6 +2735,7 @@ namespace ImGui IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0); IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0); IMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size); + IMGUI_API void SetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow* window); inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); } inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); } @@ -2762,13 +2779,16 @@ namespace ImGui IMGUI_API void MarkIniSettingsDirty(); IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window); IMGUI_API void ClearIniSettings(); - IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name); - IMGUI_API ImGuiWindowSettings* FindWindowSettings(ImGuiID id); - IMGUI_API ImGuiWindowSettings* FindOrCreateWindowSettings(const char* name); IMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler* handler); IMGUI_API void RemoveSettingsHandler(const char* type_name); IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name); + // Settings - Windows + IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name); + IMGUI_API ImGuiWindowSettings* FindWindowSettingsByID(ImGuiID id); + IMGUI_API ImGuiWindowSettings* FindWindowSettingsByWindow(ImGuiWindow* window); + IMGUI_API void ClearWindowSettings(const char* name); + // Localization IMGUI_API void LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count); inline const char* LocalizeGetMsg(ImGuiLocKey key) { ImGuiContext& g = *GImGui; const char* msg = g.LocalizationTable[key]; return msg ? msg : "*Missing Text*"; } @@ -2801,6 +2821,7 @@ namespace ImGui IMGUI_API void MarkItemEdited(ImGuiID id); // Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function. IMGUI_API void PushOverrideID(ImGuiID id); // Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes) IMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed); + IMGUI_API ImGuiID GetIDWithSeed(int n, ImGuiID seed); // Basic Helpers for widget code IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f); @@ -2819,6 +2840,7 @@ namespace ImGui // Parameter stacks (shared) IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); IMGUI_API void PopItemFlag(); + IMGUI_API const ImGuiDataVarInfo* GetStyleVarInfo(ImGuiStyleVar idx); // Logging/Capture IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name. @@ -2834,7 +2856,7 @@ namespace ImGui IMGUI_API void ClosePopupsExceptModals(); IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags); IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags); - IMGUI_API void BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags); + IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags); IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window); IMGUI_API ImGuiWindow* GetTopMostPopupModal(); IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal(); @@ -2996,7 +3018,8 @@ namespace ImGui IMGUI_API void TableDrawContextMenu(ImGuiTable* table); IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table); IMGUI_API void TableMergeDrawChannels(ImGuiTable* table); - inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; } + inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; } + inline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no) { return TableGetInstanceData(table, instance_no)->TableInstanceID; } IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table); IMGUI_API void TableSortSpecsBuild(ImGuiTable* table); IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column); @@ -3008,7 +3031,7 @@ namespace ImGui IMGUI_API void TableEndCell(ImGuiTable* table); IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n); IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n); - IMGUI_API ImGuiID TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no = 0); + IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0); IMGUI_API float TableGetMaxColumnWidth(const ImGuiTable* table, int column_n); IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n); IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table); @@ -3075,6 +3098,7 @@ namespace ImGui IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0); IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0); IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags); + IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width); IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value); IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value); @@ -3118,6 +3142,7 @@ namespace ImGui // InputText IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); + IMGUI_API void InputTextDeactivateHook(ImGuiID id); IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags); IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL); inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); } @@ -3181,7 +3206,7 @@ namespace ImGui // Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets that used FocusableItemRegister(): // (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool tab_focused = FocusableItemRegister(...)' // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0' - // (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedTabbing) != 0 || g.NavActivateInputId == id' (WIP) + // (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedTabbing) != 0 || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))' (WIP) // Widget code are simplified as there's no need to call FocusableItemUnregister() while managing the transition from regular widget to TempInputText() inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) { IM_ASSERT(0); IM_UNUSED(window); IM_UNUSED(id); return false; } // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd() inline void FocusableItemUnregister(ImGuiWindow* window) { IM_ASSERT(0); IM_UNUSED(window); } // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem @@ -3221,14 +3246,15 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table //----------------------------------------------------------------------------- #ifdef IMGUI_ENABLE_TEST_ENGINE -extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id); +extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, ImGuiID id, const ImRect& bb, const ImGuiLastItemData* item_data); // item_data may be NULL extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags); extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...); extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiID id); -#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // Register item bounding box -#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional) -#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log +// In IMGUI_VERSION_NUM >= 18934: changed IMGUI_TEST_ENGINE_ITEM_ADD(bb,id) to IMGUI_TEST_ENGINE_ITEM_ADD(id,bb,item_data); +#define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box +#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional) +#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log #else #define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0) #define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g) diff --git a/3rdparty/dear-imgui/imgui_tables.cpp b/3rdparty/dear-imgui/imgui_tables.cpp index 89fe8a732..8e92ff2a7 100644 --- a/3rdparty/dear-imgui/imgui_tables.cpp +++ b/3rdparty/dear-imgui/imgui_tables.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.3 WIP +// dear imgui, v1.89.5 WIP // (tables and columns code) /* @@ -188,12 +188,12 @@ Index of this file: #define _CRT_SECURE_NO_WARNINGS #endif -#include "imgui.h" -#ifndef IMGUI_DISABLE - #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS #endif + +#include "imgui.h" +#ifndef IMGUI_DISABLE #include "imgui_internal.h" // System includes @@ -332,11 +332,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG // Acquire storage for the table ImGuiTable* table = g.Tables.GetOrAddByKey(id); - const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1; - const ImGuiID instance_id = id + instance_no; const ImGuiTableFlags table_last_flags = table->Flags; - if (instance_no > 0) - IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID"); // Acquire temporary buffers const int table_idx = g.Tables.GetIndex(table); @@ -352,17 +348,32 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG flags = TableFixFlags(flags, outer_window); // Initialize + const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1; table->ID = id; table->Flags = flags; - table->InstanceCurrent = (ImS16)instance_no; table->LastFrameActive = g.FrameCount; table->OuterWindow = table->InnerWindow = outer_window; table->ColumnsCount = columns_count; table->IsLayoutLocked = false; table->InnerWidth = inner_width; temp_data->UserOuterSize = outer_size; - if (instance_no > 0 && table->InstanceDataExtra.Size < instance_no) - table->InstanceDataExtra.push_back(ImGuiTableInstanceData()); + + // Instance data (for instance 0, TableID == TableInstanceID) + ImGuiID instance_id; + table->InstanceCurrent = (ImS16)instance_no; + if (instance_no > 0) + { + IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID"); + if (table->InstanceDataExtra.Size < instance_no) + table->InstanceDataExtra.push_back(ImGuiTableInstanceData()); + instance_id = GetIDWithSeed(instance_no, GetIDWithSeed("##Instances", NULL, id)); // Push "##Instance" followed by (int)instance_no in ID stack. + } + else + { + instance_id = id; + } + ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); + table_instance->TableInstanceID = instance_id; // When not using a child window, WorkRect.Max will grow as we append contents. if (use_child_window) @@ -412,7 +423,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG } // Push a standardized ID for both child-using and not-child-using tables - PushOverrideID(instance_id); + PushOverrideID(id); + if (instance_no > 0) + PushOverrideID(instance_id); // FIXME: Somehow this is not resolved by stack-tool, even tho GetIDWithSeed() submitted the symbol. // Backup a copy of host window members we will modify ImGuiWindow* inner_window = table->InnerWindow; @@ -1131,12 +1144,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) EndPopup(); } - // [Part 13] Sanitize and build sort specs before we have a change to use them for display. + // [Part 12] Sanitize and build sort specs before we have a change to use them for display. // This path will only be exercised when sort specs are modified before header rows (e.g. init or visibility change) if (table->IsSortSpecsDirty && (table->Flags & ImGuiTableFlags_Sortable)) TableSortSpecsBuild(table); - // [Part 14] Setup inner window decoration size (for scrolling / nav tracking to properly take account of frozen rows/columns) + // [Part 13] Setup inner window decoration size (for scrolling / nav tracking to properly take account of frozen rows/columns) if (table->FreezeColumnsRequest > 0) table->InnerWindow->DecoInnerSizeX1 = table->Columns[table->DisplayOrderToIndex[table->FreezeColumnsRequest - 1]].MaxX - table->OuterRect.Min.x; if (table->FreezeRowsRequest > 0) @@ -1348,8 +1361,10 @@ void ImGui::EndTable() } // Pop from id stack - IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table->ID + table->InstanceCurrent, "Mismatching PushID/PopID!"); + IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table_instance->TableInstanceID, "Mismatching PushID/PopID!"); IM_ASSERT_USER_ERROR(outer_window->DC.ItemWidthStack.Size >= temp_data->HostBackupItemWidthStackSize, "Too many PopItemWidth!"); + if (table->InstanceCurrent > 0) + PopID(); PopID(); // Restore window data that we modified @@ -1619,11 +1634,11 @@ ImRect ImGui::TableGetCellBgRect(const ImGuiTable* table, int column_n) } // Return the resizing ID for the right-side of the given column. -ImGuiID ImGui::TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no) +ImGuiID ImGui::TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no) { IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount); - ImGuiID id = table->ID + 1 + (instance_no * table->ColumnsCount) + column_n; - return id; + ImGuiID instance_id = TableGetInstanceID(table, instance_no); + return instance_id + 1 + column_n; // FIXME: #6140: still not ideal } // Return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. @@ -1984,10 +1999,6 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n) window->WorkRect.Max.x = column->WorkMaxX; window->DC.ItemWidth = column->ItemWidth; - // To allow ImGuiListClipper to function we propagate our row height - if (!column->IsEnabled) - window->DC.CursorPos.y = ImMax(window->DC.CursorPos.y, table->RowPosY2); - window->SkipItems = column->IsSkipItems; if (column->IsSkipItems) { @@ -2034,7 +2045,8 @@ void ImGui::TableEndCell(ImGuiTable* table) else p_max_pos_x = table->IsUnfrozenRows ? &column->ContentMaxXUnfrozen : &column->ContentMaxXFrozen; *p_max_pos_x = ImMax(*p_max_pos_x, window->DC.CursorMaxPos.x); - table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->CellPaddingY); + if (column->IsEnabled) + table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->CellPaddingY); column->ItemWidth = window->DC.ItemWidth; // Propagate text baseline for the entire row @@ -2878,10 +2890,9 @@ void ImGui::TableHeadersRow() continue; // Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them) - // - in your own code you may omit the PushID/PopID all-together, provided you know they won't collide - // - table->InstanceCurrent is only >0 when we use multiple BeginTable/EndTable calls with same identifier. + // In your own code you may omit the PushID/PopID all-together, provided you know they won't collide. const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n); - PushID(table->InstanceCurrent * table->ColumnsCount + column_n); + PushID(column_n); TableHeader(name); PopID(); } diff --git a/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/dear-imgui/imgui_widgets.cpp index 75c45e48d..9b1fdc05a 100644 --- a/3rdparty/dear-imgui/imgui_widgets.cpp +++ b/3rdparty/dear-imgui/imgui_widgets.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.3 WIP +// dear imgui, v1.89.5 WIP // (widgets code) /* @@ -32,12 +32,12 @@ Index of this file: #define _CRT_SECURE_NO_WARNINGS #endif -#include "imgui.h" -#ifndef IMGUI_DISABLE - #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS #endif + +#include "imgui.h" +#ifndef IMGUI_DISABLE #include "imgui_internal.h" // System includes @@ -498,8 +498,9 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool g.HoveredWindow = window; #ifdef IMGUI_ENABLE_TEST_ENGINE + // Alternate registration spot, for when caller didn't use ItemAdd() if (id != 0 && g.LastItemData.ID != id) - IMGUI_TEST_ENGINE_ITEM_ADD(bb, id); + IMGUI_TEST_ENGINE_ITEM_ADD(id, bb, NULL); #endif bool pressed = false; @@ -609,10 +610,11 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool bool nav_activated_by_inputs = (g.NavActivatePressedId == id); if (!nav_activated_by_inputs && (flags & ImGuiButtonFlags_Repeat)) { - // Avoid pressing both keys from triggering double amount of repeat events + // Avoid pressing multiple keys from triggering excessive amount of repeat events const ImGuiKeyData* key1 = GetKeyData(ImGuiKey_Space); - const ImGuiKeyData* key2 = GetKeyData(ImGuiKey_NavGamepadActivate); - const float t1 = ImMax(key1->DownDuration, key2->DownDuration); + const ImGuiKeyData* key2 = GetKeyData(ImGuiKey_Enter); + const ImGuiKeyData* key3 = GetKeyData(ImGuiKey_NavGamepadActivate); + const float t1 = ImMax(ImMax(key1->DownDuration, key2->DownDuration), key3->DownDuration); nav_activated_by_inputs = CalcTypematicRepeatAmount(t1 - g.IO.DeltaTime, t1, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0; } if (nav_activated_by_code || nav_activated_by_inputs) @@ -620,7 +622,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool // Set active id so it can be queried by user via IsItemActive(), equivalent of holding the mouse button. pressed = true; SetActiveID(id, window); - g.ActiveIdSource = ImGuiInputSource_Nav; + g.ActiveIdSource = g.NavInputSource; if (!(flags & ImGuiButtonFlags_NoNavFocus)) SetFocusID(id, window); } @@ -658,7 +660,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool if (!(flags & ImGuiButtonFlags_NoNavFocus)) g.NavDisableHighlight = true; } - else if (g.ActiveIdSource == ImGuiInputSource_Nav) + else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) { // When activated using Nav, we hold on the ActiveID until activation button is released if (g.NavActivateDownId != id) @@ -1384,6 +1386,7 @@ void ImGui::AlignTextToFramePadding() } // Horizontal/vertical separating line +// FIXME: Surprisingly, this seemingly simple widget is adjacent to MANY different legacy/tricky layout issues. void ImGui::SeparatorEx(ImGuiSeparatorFlags flags) { ImGuiWindow* window = GetCurrentWindow(); @@ -1393,20 +1396,19 @@ void ImGui::SeparatorEx(ImGuiSeparatorFlags flags) ImGuiContext& g = *GImGui; IM_ASSERT(ImIsPowerOfTwo(flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical))); // Check that only 1 option is selected - float thickness_draw = 1.0f; - float thickness_layout = 0.0f; + const float thickness = 1.0f; // Cannot use g.Style.SeparatorTextSize yet for various reasons. if (flags & ImGuiSeparatorFlags_Vertical) { - // Vertical separator, for menu bars (use current line height). Not exposed because it is misleading and it doesn't have an effect on regular layout. + // Vertical separator, for menu bars (use current line height). float y1 = window->DC.CursorPos.y; float y2 = window->DC.CursorPos.y + window->DC.CurrLineSize.y; - const ImRect bb(ImVec2(window->DC.CursorPos.x, y1), ImVec2(window->DC.CursorPos.x + thickness_draw, y2)); - ItemSize(ImVec2(thickness_layout, 0.0f)); + const ImRect bb(ImVec2(window->DC.CursorPos.x, y1), ImVec2(window->DC.CursorPos.x + thickness, y2)); + ItemSize(ImVec2(thickness, 0.0f)); if (!ItemAdd(bb, 0)) return; // Draw - window->DrawList->AddLine(ImVec2(bb.Min.x, bb.Min.y), ImVec2(bb.Min.x, bb.Max.y), GetColorU32(ImGuiCol_Separator)); + window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_Separator)); if (g.LogEnabled) LogText(" |"); } @@ -1434,13 +1436,14 @@ void ImGui::SeparatorEx(ImGuiSeparatorFlags flags) // We don't provide our width to the layout so that it doesn't get feed back into AutoFit // FIXME: This prevents ->CursorMaxPos based bounding box evaluation from working (e.g. TableEndCell) - const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y + thickness_draw)); - ItemSize(ImVec2(0.0f, thickness_layout)); + const float thickness_for_layout = (thickness == 1.0f) ? 0.0f : thickness; // FIXME: See 1.70/1.71 Separator() change: makes legacy 1-px separator not affect layout yet. Should change. + const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y + thickness)); + ItemSize(ImVec2(0.0f, thickness_for_layout)); const bool item_visible = ItemAdd(bb, 0); if (item_visible) { // Draw - window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x, bb.Min.y), GetColorU32(ImGuiCol_Separator)); + window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_Separator)); if (g.LogEnabled) LogRenderedText(&bb.Min, "--------------------------------\n"); @@ -1466,6 +1469,71 @@ void ImGui::Separator() SeparatorEx(flags); } +void ImGui::SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_w) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + ImGuiStyle& style = g.Style; + + const ImVec2 label_size = CalcTextSize(label, label_end, false); + const ImVec2 pos = window->DC.CursorPos; + const ImVec2 padding = style.SeparatorTextPadding; + + const float separator_thickness = style.SeparatorTextBorderSize; + const ImVec2 min_size(label_size.x + extra_w + padding.x * 2.0f, ImMax(label_size.y + padding.y * 2.0f, separator_thickness)); + const ImRect bb(pos, ImVec2(window->WorkRect.Max.x, pos.y + min_size.y)); + const float text_baseline_y = ImFloor((bb.GetHeight() - label_size.y) * style.SeparatorTextAlign.y + 0.99999f); //ImMax(padding.y, ImFloor((style.SeparatorTextSize - label_size.y) * 0.5f)); + ItemSize(min_size, text_baseline_y); + if (!ItemAdd(bb, id)) + return; + + const float sep1_x1 = pos.x; + const float sep2_x2 = bb.Max.x; + const float seps_y = ImFloor((bb.Min.y + bb.Max.y) * 0.5f + 0.99999f); + + const float label_avail_w = ImMax(0.0f, sep2_x2 - sep1_x1 - padding.x * 2.0f); + const ImVec2 label_pos(pos.x + padding.x + ImMax(0.0f, (label_avail_w - label_size.x - extra_w) * style.SeparatorTextAlign.x), pos.y + text_baseline_y); // FIXME-ALIGN + + // This allows using SameLine() to position something in the 'extra_w' + window->DC.CursorPosPrevLine.x = label_pos.x + label_size.x; + + const ImU32 separator_col = GetColorU32(ImGuiCol_Separator); + if (label_size.x > 0.0f) + { + const float sep1_x2 = label_pos.x - style.ItemSpacing.x; + const float sep2_x1 = label_pos.x + label_size.x + extra_w + style.ItemSpacing.x; + if (sep1_x2 > sep1_x1 && separator_thickness > 0.0f) + window->DrawList->AddLine(ImVec2(sep1_x1, seps_y), ImVec2(sep1_x2, seps_y), separator_col, separator_thickness); + if (sep2_x2 > sep2_x1 && separator_thickness > 0.0f) + window->DrawList->AddLine(ImVec2(sep2_x1, seps_y), ImVec2(sep2_x2, seps_y), separator_col, separator_thickness); + if (g.LogEnabled) + LogSetNextTextDecoration("---", NULL); + RenderTextEllipsis(window->DrawList, label_pos, ImVec2(bb.Max.x, bb.Max.y + style.ItemSpacing.y), bb.Max.x, bb.Max.x, label, label_end, &label_size); + } + else + { + if (g.LogEnabled) + LogText("---"); + if (separator_thickness > 0.0f) + window->DrawList->AddLine(ImVec2(sep1_x1, seps_y), ImVec2(sep2_x2, seps_y), separator_col, separator_thickness); + } +} + +void ImGui::SeparatorText(const char* label) +{ + ImGuiWindow* window = GetCurrentWindow(); + if (window->SkipItems) + return; + + // The SeparatorText() vs SeparatorTextEx() distinction is designed to be considerate that we may want: + // - allow headers to be draggable items (would require a stable ID + a noticeable highlight) + // - this high-level entry point to allow formatting? (may require ID separate from formatted string) + // - because of this we probably can't turn 'const char* label' into 'const char* fmt, ...' + // Otherwise, we can decide that users wanting to drag this would layout a dedicated drag-item, + // and then we can turn this into a format function. + SeparatorTextEx(0, label, FindRenderedTextEnd(label), 0.0f); +} + // Using 'hover_visibility_delay' allows us to hide the highlight and mouse cursor for a short time, which can be convenient to reduce visual noise. bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend, float hover_visibility_delay, ImU32 bg_col) { @@ -2177,7 +2245,7 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const if (g.IO.KeyShift) adjust_delta *= 10.0f; } - else if (g.ActiveIdSource == ImGuiInputSource_Nav) + else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) { const int decimal_precision = is_floating_point ? ImParseFormatPrecision(format, 3) : 0; const bool tweak_slow = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakSlow : ImGuiKey_NavKeyboardTweakSlow); @@ -2284,7 +2352,7 @@ bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v // Those are the things we can do easily outside the DragBehaviorT<> template, saves code generation. if (g.ActiveIdSource == ImGuiInputSource_Mouse && !g.IO.MouseDown[0]) ClearActiveID(); - else if (g.ActiveIdSource == ImGuiInputSource_Nav && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated) + else if ((g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated) ClearActiveID(); } if (g.ActiveId != id) @@ -2344,18 +2412,18 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0; const bool clicked = hovered && IsMouseClicked(0, id); const bool double_clicked = (hovered && g.IO.MouseClickedCount[0] == 2 && TestKeyOwner(ImGuiKey_MouseLeft, id)); - const bool make_active = (input_requested_by_tabbing || clicked || double_clicked || g.NavActivateId == id || g.NavActivateInputId == id); + const bool make_active = (input_requested_by_tabbing || clicked || double_clicked || g.NavActivateId == id); if (make_active && (clicked || double_clicked)) SetKeyOwner(ImGuiKey_MouseLeft, id); if (make_active && temp_input_allowed) - if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || double_clicked || g.NavActivateInputId == id) + if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || double_clicked || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))) temp_input_is_active = true; // (Optional) simple click (without moving) turns Drag into an InputText if (g.IO.ConfigDragClickToInputText && temp_input_allowed && !temp_input_is_active) if (g.ActiveId == id && hovered && g.IO.MouseReleased[0] && !IsMouseDragPastThreshold(0, g.IO.MouseDragThreshold * DRAG_MOUSE_THRESHOLD_FACTOR)) { - g.NavActivateId = g.NavActivateInputId = id; + g.NavActivateId = id; g.NavActivateFlags = ImGuiActivateFlags_PreferInput; temp_input_is_active = true; } @@ -2396,7 +2464,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, if (label_size.x > 0.0f) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | (temp_input_allowed ? ImGuiItemStatusFlags_Inputable : 0)); return value_changed; } @@ -2768,7 +2836,7 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ set_new_value = true; } } - else if (g.ActiveIdSource == ImGuiInputSource_Nav) + else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) { if (g.ActiveIdIsJustActivated) { @@ -2951,11 +3019,11 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat // Tabbing or CTRL-clicking on Slider turns it into an input box const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0; const bool clicked = hovered && IsMouseClicked(0, id); - const bool make_active = (input_requested_by_tabbing || clicked || g.NavActivateId == id || g.NavActivateInputId == id); + const bool make_active = (input_requested_by_tabbing || clicked || g.NavActivateId == id); if (make_active && clicked) SetKeyOwner(ImGuiKey_MouseLeft, id); if (make_active && temp_input_allowed) - if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || g.NavActivateInputId == id) + if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))) temp_input_is_active = true; if (make_active && !temp_input_is_active) @@ -2999,7 +3067,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat if (label_size.x > 0.0f) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | (temp_input_allowed ? ImGuiItemStatusFlags_Inputable : 0)); return value_changed; } @@ -3113,7 +3181,7 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d const bool hovered = ItemHoverable(frame_bb, id); const bool clicked = hovered && IsMouseClicked(0, id); - if (clicked || g.NavActivateId == id || g.NavActivateInputId == id) + if (clicked || g.NavActivateId == id) { if (clicked) SetKeyOwner(ImGuiKey_MouseLeft, id); @@ -3397,7 +3465,12 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data flags |= ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselves by comparing the actual data rather than the string. bool value_changed = false; - if (p_step != NULL) + if (p_step == NULL) + { + if (InputText(label, buf, IM_ARRAYSIZE(buf), flags)) + value_changed = DataTypeApplyFromText(buf, data_type, p_data, format); + } + else { const float button_size = GetFrameHeight(); @@ -3406,7 +3479,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2)); if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view value_changed = DataTypeApplyFromText(buf, data_type, p_data, format); - IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags); + IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable); // Step buttons const ImVec2 backup_frame_padding = style.FramePadding; @@ -3440,11 +3513,6 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data PopID(); EndGroup(); } - else - { - if (InputText(label, buf, IM_ARRAYSIZE(buf), flags)) - value_changed = DataTypeApplyFromText(buf, data_type, p_data, format); - } if (value_changed) MarkItemEdited(g.LastItemData.ID); @@ -3790,7 +3858,7 @@ void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, cons return; // Contrary to STB_TEXTEDIT_INSERTCHARS() this is working in the UTF8 buffer, hence the mildly similar code (until we remove the U16 buffer altogether!) - ImGuiContext& g = *GImGui; + ImGuiContext& g = *Ctx; ImGuiInputTextState* edit_state = &g.InputTextState; IM_ASSERT(edit_state->ID != 0 && g.ActiveId == edit_state->ID); IM_ASSERT(Buf == edit_state->TextA.Data); @@ -3894,8 +3962,9 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f // Custom callback filter if (flags & ImGuiInputTextFlags_CallbackCharFilter) { + ImGuiContext& g = *GImGui; ImGuiInputTextCallbackData callback_data; - memset(&callback_data, 0, sizeof(ImGuiInputTextCallbackData)); + callback_data.Ctx = &g; callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter; callback_data.EventChar = (ImWchar)c; callback_data.Flags = flags; @@ -3945,6 +4014,21 @@ static void InputTextReconcileUndoStateAfterUserCallback(ImGuiInputTextState* st p[i] = ImStb::STB_TEXTEDIT_GETCHAR(state, first_diff + i); } +// As InputText() retain textual data and we currently provide a path for user to not retain it (via local variables) +// we need some form of hook to reapply data back to user buffer on deactivation frame. (#4714) +// It would be more desirable that we discourage users from taking advantage of the "user not retaining data" trick, +// but that more likely be attractive when we do have _NoLiveEdit flag available. +void ImGui::InputTextDeactivateHook(ImGuiID id) +{ + ImGuiContext& g = *GImGui; + ImGuiInputTextState* state = &g.InputTextState; + if (id == 0 || state->ID != id) + return; + g.InputTextDeactivatedState.ID = state->ID; + g.InputTextDeactivatedState.TextA.resize(state->CurLenA + 1); + memcpy(g.InputTextDeactivatedState.TextA.Data, state->TextA.Data, state->CurLenA + 1); +} + // Edit a string of text // - buf_size account for the zero-terminator, so a buf_size of 6 can hold "Hello" but not "Hello!". // This is so we can easily call InputText() on static arrays using ARRAYSIZE() and to match @@ -4040,7 +4124,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ ImGuiInputTextState* state = GetInputTextState(id); const bool input_requested_by_tabbing = (item_status_flags & ImGuiItemStatusFlags_FocusedByTabbing) != 0; - const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateInputId == id) || (g.NavActivateId == id && g.NavInputSource == ImGuiInputSource_Keyboard)); + const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard))); const bool user_clicked = hovered && io.MouseClicked[0]; const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y); @@ -4050,7 +4134,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ float scroll_y = is_multiline ? draw_window->Scroll.y : FLT_MAX; - const bool init_changed_specs = (state != NULL && state->Stb.single_line != !is_multiline); + const bool init_changed_specs = (state != NULL && state->Stb.single_line != !is_multiline); // state != NULL means its our state. const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav || input_requested_by_tabbing); const bool init_state = (init_make_active || user_scroll_active); if ((init_state && g.ActiveId != id) || init_changed_specs) @@ -4059,6 +4143,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ state = &g.InputTextState; state->CursorAnimReset(); + // Backup state of deactivating item so they'll have a chance to do a write to output buffer on the same frame they report IsItemDeactivatedAfterEdit (#4714) + InputTextDeactivateHook(state->ID); + // Take a copy of the initial buffer value (both in original UTF-8 format and converted to wchar) // From the moment we focused we are ignoring the content of 'buf' (unless we are in read-only mode) const int buf_len = (int)strlen(buf); @@ -4132,7 +4219,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (is_osx) SetKeyOwner(ImGuiMod_Alt, id); if (flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_AllowTabInput)) // Disable keyboard tabbing out as we will use the \t character. - SetKeyOwner(ImGuiKey_Tab, id); + SetShortcutRouting(ImGuiKey_Tab, id); } // We have an edge case if ActiveId was set through another widget (e.g. widget being swapped), clear id immediately (don't wait until the end of the function) @@ -4262,8 +4349,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // We expect backends to emit a Tab key but some also emit a Tab character which we ignore (#2467, #1336) // (For Tab and Enter: Win32/SFML/Allegro are sending both keys and chars, GLFW and SDL are only sending keys. For Space they all send all threes) - const bool ignore_char_inputs = (io.KeyCtrl && !io.KeyAlt) || (is_osx && io.KeySuper); - if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressed(ImGuiKey_Tab) && !ignore_char_inputs && !io.KeyShift && !is_readonly) + if ((flags & ImGuiInputTextFlags_AllowTabInput) && Shortcut(ImGuiKey_Tab, id) && !is_readonly) { unsigned int c = '\t'; // Insert TAB if (InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard)) @@ -4272,6 +4358,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Process regular text input (before we check for Return because using some IME will effectively send a Return?) // We ignore CTRL inputs, but need to allow ALT+CTRL as some keyboards (e.g. German) use AltGR (which _is_ Alt+Ctrl) to input certain characters. + const bool ignore_char_inputs = (io.KeyCtrl && !io.KeyAlt) || (is_osx && io.KeySuper); if (io.InputQueueCharacters.Size > 0) { if (!ignore_char_inputs && !is_readonly && !input_requested_by_nav) @@ -4471,6 +4558,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Push records into the undo stack so we can CTRL+Z the revert operation itself apply_new_text = state->InitialTextA.Data; apply_new_text_length = state->InitialTextA.Size - 1; + value_changed = true; ImVector w_text; if (apply_new_text_length > 0) { @@ -4508,7 +4596,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // The reason we specify the usage semantic (Completion/History) is that Completion needs to disable keyboard TABBING at the moment. ImGuiInputTextFlags event_flag = 0; ImGuiKey event_key = ImGuiKey_None; - if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && IsKeyPressed(ImGuiKey_Tab)) + if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && Shortcut(ImGuiKey_Tab, id)) { event_flag = ImGuiInputTextFlags_CallbackCompletion; event_key = ImGuiKey_Tab; @@ -4535,7 +4623,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (event_flag) { ImGuiInputTextCallbackData callback_data; - memset(&callback_data, 0, sizeof(ImGuiInputTextCallbackData)); + callback_data.Ctx = &g; callback_data.EventFlag = event_flag; callback_data.Flags = flags; callback_data.UserData = callback_user_data; @@ -4584,10 +4672,24 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ { apply_new_text = state->TextA.Data; apply_new_text_length = state->CurLenA; + value_changed = true; } } } + // Handle reapplying final data on deactivation (see InputTextDeactivateHook() for details) + if (g.InputTextDeactivatedState.ID == id) + { + if (g.ActiveId != id && IsItemDeactivatedAfterEdit() && !is_readonly) + { + apply_new_text = g.InputTextDeactivatedState.TextA.Data; + apply_new_text_length = g.InputTextDeactivatedState.TextA.Size - 1; + value_changed |= (strcmp(g.InputTextDeactivatedState.TextA.Data, buf) != 0); + //IMGUI_DEBUG_LOG("InputText(): apply Deactivated data for 0x%08X: \"%.*s\".\n", id, apply_new_text_length, apply_new_text); + } + g.InputTextDeactivatedState.ID = 0; + } + // Copy result to user buffer. This can currently only happen when (g.ActiveId == id) if (apply_new_text != NULL) { @@ -4598,6 +4700,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (is_resizable) { ImGuiInputTextCallbackData callback_data; + callback_data.Ctx = &g; callback_data.EventFlag = ImGuiInputTextFlags_CallbackResize; callback_data.Flags = flags; callback_data.Buf = buf; @@ -4614,7 +4717,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // If the underlying buffer resize was denied or not carried to the next frame, apply_new_text_length+1 may be >= buf_size. ImStrncpy(buf, apply_new_text, ImMin(apply_new_text_length + 1, buf_size)); - value_changed = true; } // Release active ID at the end of the function (so e.g. pressing Return still does a final application of the value) @@ -4864,7 +4966,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (value_changed && !(flags & ImGuiInputTextFlags_NoMarkEdited)) MarkItemEdited(id); - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable); if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0) return validated; else @@ -4879,7 +4981,7 @@ void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state) ImStb::StbUndoState* undo_state = &stb_state->undostate; Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId); DebugLocateItemOnHover(state->ID); - Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenA, state->CurLenW, stb_state->cursor, stb_state->select_start, stb_state->select_end); + Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenW, state->CurLenA, stb_state->cursor, stb_state->select_start, stb_state->select_end); Text("has_preferred_x: %d (%.2f)", stb_state->has_preferred_x, stb_state->preferred_x); Text("undo_point: %d, redo_point: %d, undo_char_point: %d, redo_char_point: %d", undo_state->undo_point, undo_state->redo_point, undo_state->undo_char_point, undo_state->redo_char_point); if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 15), true)) // Visualize undo state @@ -4927,28 +5029,32 @@ bool ImGui::ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flag return ColorEdit4(label, col, flags | ImGuiColorEditFlags_NoAlpha); } +static void ColorEditRestoreH(const float* col, float* H) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(g.ColorEditCurrentID != 0); + if (g.ColorEditSavedID != g.ColorEditCurrentID || g.ColorEditSavedColor != ImGui::ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0))) + return; + *H = g.ColorEditSavedHue; +} + // ColorEdit supports RGB and HSV inputs. In case of RGB input resulting color may have undefined hue and/or saturation. // Since widget displays both RGB and HSV values we must preserve hue and saturation to prevent these values resetting. static void ColorEditRestoreHS(const float* col, float* H, float* S, float* V) { - // This check is optional. Suppose we have two color widgets side by side, both widgets display different colors, but both colors have hue and/or saturation undefined. - // With color check: hue/saturation is preserved in one widget. Editing color in one widget would reset hue/saturation in another one. - // Without color check: common hue/saturation would be displayed in all widgets that have hue/saturation undefined. - // g.ColorEditLastColor is stored as ImU32 RGB value: this essentially gives us color equality check with reduced precision. - // Tiny external color changes would not be detected and this check would still pass. This is OK, since we only restore hue/saturation _only_ if they are undefined, - // therefore this change flipping hue/saturation from undefined to a very tiny value would still be represented in color picker. ImGuiContext& g = *GImGui; - if (g.ColorEditLastColor != ImGui::ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0))) + IM_ASSERT(g.ColorEditCurrentID != 0); + if (g.ColorEditSavedID != g.ColorEditCurrentID || g.ColorEditSavedColor != ImGui::ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0))) return; // When S == 0, H is undefined. // When H == 1 it wraps around to 0. - if (*S == 0.0f || (*H == 0.0f && g.ColorEditLastHue == 1)) - *H = g.ColorEditLastHue; + if (*S == 0.0f || (*H == 0.0f && g.ColorEditSavedHue == 1)) + *H = g.ColorEditSavedHue; // When V == 0, S is undefined. if (*V == 0.0f) - *S = g.ColorEditLastSat; + *S = g.ColorEditSavedSat; } // Edit colors components (each component in 0.0f..1.0f range). @@ -4971,6 +5077,9 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag BeginGroup(); PushID(label); + const bool set_current_color_edit_id = (g.ColorEditCurrentID == 0); + if (set_current_color_edit_id) + g.ColorEditCurrentID = window->IDStack.back(); // If we're not showing any slider there's no point in doing any HSV conversions const ImGuiColorEditFlags flags_untouched = flags; @@ -5004,7 +5113,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]); else if ((flags & ImGuiColorEditFlags_InputRGB) && (flags & ImGuiColorEditFlags_DisplayHSV)) { - // Hue is lost when converting from greyscale rgb (saturation=0). Restore it. + // Hue is lost when converting from grayscale rgb (saturation=0). Restore it. ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]); ColorEditRestoreHS(col, &f[0], &f[1], &f[2]); } @@ -5143,10 +5252,11 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag f[n] = i[n] / 255.0f; if ((flags & ImGuiColorEditFlags_DisplayHSV) && (flags & ImGuiColorEditFlags_InputRGB)) { - g.ColorEditLastHue = f[0]; - g.ColorEditLastSat = f[1]; + g.ColorEditSavedHue = f[0]; + g.ColorEditSavedSat = f[1]; ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]); - g.ColorEditLastColor = ColorConvertFloat4ToU32(ImVec4(f[0], f[1], f[2], 0)); + g.ColorEditSavedID = g.ColorEditCurrentID; + g.ColorEditSavedColor = ColorConvertFloat4ToU32(ImVec4(f[0], f[1], f[2], 0)); } if ((flags & ImGuiColorEditFlags_DisplayRGB) && (flags & ImGuiColorEditFlags_InputHSV)) ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]); @@ -5158,6 +5268,8 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag col[3] = f[3]; } + if (set_current_color_edit_id) + g.ColorEditCurrentID = 0; PopID(); EndGroup(); @@ -5231,6 +5343,9 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl g.NextItemData.ClearFlags(); PushID(label); + const bool set_current_color_edit_id = (g.ColorEditCurrentID == 0); + if (set_current_color_edit_id) + g.ColorEditCurrentID = window->IDStack.back(); BeginGroup(); if (!(flags & ImGuiColorEditFlags_NoSidePreview)) @@ -5279,7 +5394,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl float R = col[0], G = col[1], B = col[2]; if (flags & ImGuiColorEditFlags_InputRGB) { - // Hue is lost when converting from greyscale rgb (saturation=0). Restore it. + // Hue is lost when converting from grayscale rgb (saturation=0). Restore it. ColorConvertRGBtoHSV(R, G, B, H, S, V); ColorEditRestoreHS(col, &H, &S, &V); } @@ -5334,10 +5449,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl { S = ImSaturate((io.MousePos.x - picker_pos.x) / (sv_picker_size - 1)); V = 1.0f - ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size - 1)); - - // Greatly reduces hue jitter and reset to 0 when hue == 255 and color is rapidly modified using SV square. - if (g.ColorEditLastColor == ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0))) - H = g.ColorEditLastHue; + ColorEditRestoreH(col, &H); // Greatly reduces hue jitter and reset to 0 when hue == 255 and color is rapidly modified using SV square. value_changed = value_changed_sv = true; } if (!(flags & ImGuiColorEditFlags_NoOptions)) @@ -5412,9 +5524,10 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl if (flags & ImGuiColorEditFlags_InputRGB) { ColorConvertHSVtoRGB(H, S, V, col[0], col[1], col[2]); - g.ColorEditLastHue = H; - g.ColorEditLastSat = S; - g.ColorEditLastColor = ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0)); + g.ColorEditSavedHue = H; + g.ColorEditSavedSat = S; + g.ColorEditSavedID = g.ColorEditCurrentID; + g.ColorEditSavedColor = ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0)); } else if (flags & ImGuiColorEditFlags_InputHSV) { @@ -5578,6 +5691,8 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId MarkItemEdited(g.LastItemData.ID); + if (set_current_color_edit_id) + g.ColorEditCurrentID = 0; PopID(); return value_changed; @@ -5691,7 +5806,8 @@ void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags { ImGuiContext& g = *GImGui; - BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None); + if (!BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None)) + return; const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text; if (text_end > text) { @@ -7675,6 +7791,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) { ImGuiTabItem* tab = &tab_bar->Tabs[section_tab_index + tab_n]; tab->Offset = tab_offset; + tab->NameOffset = -1; tab_offset += tab->Width + (tab_n < section->TabCount - 1 ? g.Style.ItemInnerSpacing.x : 0.0f); } tab_bar->WidthAllTabs += ImMax(section->Width + section->Spacing, 0.0f); @@ -7682,6 +7799,9 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) section_tab_index += section->TabCount; } + // Clear name buffers + tab_bar->TabsNames.Buf.resize(0); + // If we have lost the selected tab, select the next most recently active one if (found_selected_tab_id == false) tab_bar->SelectedTabId = 0; @@ -7713,10 +7833,6 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) tab_bar->ScrollingRectMinX = tab_bar->BarRect.Min.x + sections[0].Width + sections[0].Spacing; tab_bar->ScrollingRectMaxX = tab_bar->BarRect.Max.x - sections[2].Width - sections[1].Spacing; - // Clear name buffers - if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0) - tab_bar->TabsNames.Buf.resize(0); - // Actual layout in host window (we don't do it in BeginTabBar() so as not to waste an extra frame) ImGuiWindow* window = g.CurrentWindow; window->DC.CursorPos = tab_bar->BarRect.Min; @@ -7774,7 +7890,9 @@ ImGuiTabItem* ImGui::TabBarGetCurrentTab(ImGuiTabBar* tab_bar) const char* ImGui::TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) { - IM_ASSERT(tab->NameOffset != -1 && tab->NameOffset < tab_bar->TabsNames.Buf.Size); + if (tab->NameOffset == -1) + return "N/A"; + IM_ASSERT(tab->NameOffset < tab_bar->TabsNames.Buf.Size); return tab_bar->TabsNames.Buf.Data + tab->NameOffset; } diff --git a/3rdparty/dear-imgui/widgets/memory_editor.inl b/3rdparty/dear-imgui/widgets/memory_editor.inl index ce34f5d64..4ca722f4e 100644 --- a/3rdparty/dear-imgui/widgets/memory_editor.inl +++ b/3rdparty/dear-imgui/widgets/memory_editor.inl @@ -207,7 +207,7 @@ namespace ImGui AlignTextToFramePadding(); PushItemWidth(50); - PushAllowKeyboardFocus(false); + PushTabStop(false); int rows_backup = Rows; if (DragInt("##rows", &Rows, 0.2f, 4, 32, "%.0f rows")) { @@ -216,7 +216,7 @@ namespace ImGui SetWindowSize(new_window_size); } - PopAllowKeyboardFocus(); + PopTabStop(); PopItemWidth(); SameLine(); Text("Range %0*x..%0*x", addr_digits_count, (int)base_display_addr, addr_digits_count, (int)base_display_addr+mem_size-1); From bae9021d05edfe9af7b0c9dbc607bdb2b68ccabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:04:22 -0700 Subject: [PATCH 45/86] Updated meshoptimizer. --- 3rdparty/meshoptimizer/src/meshoptimizer.h | 15 ++- 3rdparty/meshoptimizer/src/vertexfilter.cpp | 104 ++++++++++++++++---- 2 files changed, 98 insertions(+), 21 deletions(-) diff --git a/3rdparty/meshoptimizer/src/meshoptimizer.h b/3rdparty/meshoptimizer/src/meshoptimizer.h index f3dcac277..71088c462 100644 --- a/3rdparty/meshoptimizer/src/meshoptimizer.h +++ b/3rdparty/meshoptimizer/src/meshoptimizer.h @@ -304,13 +304,22 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_decodeFilterExp(void* buffer, size_t cou * Input data must contain 4 floats for every quaternion (count*4 total). * * meshopt_encodeFilterExp encodes arbitrary (finite) floating-point data with 8-bit exponent and K-bit integer mantissa (1 <= K <= 24). - * Mantissa is shared between all components of a given vector as defined by stride; stride must be divisible by 4. + * Exponent can be shared between all components of a given vector as defined by stride or all values of a given component; stride must be divisible by 4. * Input data must contain stride/4 floats for every vector (count*stride/4 total). - * When individual (scalar) encoding is desired, simply pass stride=4 and adjust count accordingly. */ +enum meshopt_EncodeExpMode +{ + /* When encoding exponents, use separate values for each component (maximum quality) */ + meshopt_EncodeExpSeparate, + /* When encoding exponents, use shared value for all components of each vector (better compression) */ + meshopt_EncodeExpSharedVector, + /* When encoding exponents, use shared value for each component of all vectors (best compression) */ + meshopt_EncodeExpSharedComponent, +}; + MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterOct(void* destination, size_t count, size_t stride, int bits, const float* data); MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterQuat(void* destination, size_t count, size_t stride, int bits, const float* data); -MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterExp(void* destination, size_t count, size_t stride, int bits, const float* data); +MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterExp(void* destination, size_t count, size_t stride, int bits, const float* data, enum meshopt_EncodeExpMode mode); /** * Simplification options diff --git a/3rdparty/meshoptimizer/src/vertexfilter.cpp b/3rdparty/meshoptimizer/src/vertexfilter.cpp index 14a73b1dd..5c7589cc0 100644 --- a/3rdparty/meshoptimizer/src/vertexfilter.cpp +++ b/3rdparty/meshoptimizer/src/vertexfilter.cpp @@ -63,6 +63,10 @@ #define wasmx_unziphi_v32x4(a, b) wasm_v32x4_shuffle(a, b, 1, 3, 5, 7) #endif +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + namespace meshopt { @@ -185,9 +189,7 @@ inline uint64_t rotateleft64(uint64_t v, int x) { #if defined(_MSC_VER) && !defined(__clang__) return _rotl64(v, x); -// Apple's Clang 8 is actually vanilla Clang 3.9, there we need to look for -// version 11 instead: https://en.wikipedia.org/wiki/Xcode#Toolchain_versions -#elif defined(__clang__) && ((!defined(__apple_build_version__) && __clang_major__ >= 8) || __clang_major__ >= 11) +#elif defined(__clang__) && __has_builtin(__builtin_rotateleft64) return __builtin_rotateleft64(v, x); #else return (v << (x & 63)) | (v >> ((64 - x) & 63)); @@ -791,6 +793,33 @@ static void decodeFilterExpSimd(unsigned int* data, size_t count) } #endif +// optimized variant of frexp +inline int optlog2(float v) +{ + union + { + float f; + unsigned int ui; + } u; + + u.f = v; + // +1 accounts for implicit 1. in mantissa; denormalized numbers will end up clamped to min_exp by calling code + return u.ui == 0 ? 0 : int((u.ui >> 23) & 0xff) - 127 + 1; +} + +// optimized variant of ldexp +inline float optexp2(int e) +{ + union + { + float f; + unsigned int ui; + } u; + + u.ui = unsigned(e + 127) << 23; + return u.f; +} + } // namespace meshopt void meshopt_decodeFilterOct(void* buffer, size_t count, size_t stride) @@ -918,39 +947,78 @@ void meshopt_encodeFilterQuat(void* destination_, size_t count, size_t stride, i } } -void meshopt_encodeFilterExp(void* destination_, size_t count, size_t stride, int bits, const float* data) +void meshopt_encodeFilterExp(void* destination_, size_t count, size_t stride, int bits, const float* data, enum meshopt_EncodeExpMode mode) { - assert(stride > 0 && stride % 4 == 0); + using namespace meshopt; + + assert(stride > 0 && stride % 4 == 0 && stride <= 256); assert(bits >= 1 && bits <= 24); unsigned int* destination = static_cast(destination_); size_t stride_float = stride / sizeof(float); + int component_exp[64]; + assert(stride_float <= sizeof(component_exp) / sizeof(int)); + + const int min_exp = -100; + + if (mode == meshopt_EncodeExpSharedComponent) + { + for (size_t j = 0; j < stride_float; ++j) + component_exp[j] = min_exp; + + for (size_t i = 0; i < count; ++i) + { + const float* v = &data[i * stride_float]; + + // use maximum exponent to encode values; this guarantees that mantissa is [-1, 1] + for (size_t j = 0; j < stride_float; ++j) + { + int e = optlog2(v[j]); + + component_exp[j] = (component_exp[j] < e) ? e : component_exp[j]; + } + } + } + for (size_t i = 0; i < count; ++i) { const float* v = &data[i * stride_float]; unsigned int* d = &destination[i * stride_float]; - // use maximum exponent to encode values; this guarantees that mantissa is [-1, 1] - int exp = -100; + int vector_exp = min_exp; - for (size_t j = 0; j < stride_float; ++j) + if (mode == meshopt_EncodeExpSharedVector) { - int e; - frexp(v[j], &e); + // use maximum exponent to encode values; this guarantees that mantissa is [-1, 1] + for (size_t j = 0; j < stride_float; ++j) + { + int e = optlog2(v[j]); - exp = (exp < e) ? e : exp; + vector_exp = (vector_exp < e) ? e : vector_exp; + } + } + else if (mode == meshopt_EncodeExpSeparate) + { + for (size_t j = 0; j < stride_float; ++j) + { + int e = optlog2(v[j]); + + component_exp[j] = (min_exp < e) ? e : min_exp; + } } - // note that we additionally scale the mantissa to make it a K-bit signed integer (K-1 bits for magnitude) - exp -= (bits - 1); - - // compute renormalized rounded mantissa for each component - int mmask = (1 << 24) - 1; - for (size_t j = 0; j < stride_float; ++j) { - int m = int(ldexp(v[j], -exp) + (v[j] >= 0 ? 0.5f : -0.5f)); + int exp = (mode == meshopt_EncodeExpSharedVector) ? vector_exp : component_exp[j]; + + // note that we additionally scale the mantissa to make it a K-bit signed integer (K-1 bits for magnitude) + exp -= (bits - 1); + + // compute renormalized rounded mantissa for each component + int mmask = (1 << 24) - 1; + + int m = int(v[j] * optexp2(-exp) + (v[j] >= 0 ? 0.5f : -0.5f)); d[j] = (m & mmask) | (unsigned(exp) << 24); } From ea6510a9a7b1991bc9e5158fb757ce1d38090f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:18:50 -0700 Subject: [PATCH 46/86] Updated glslang. --- .../glslang/glslang/HLSL/hlslParseables.cpp | 4 +- .../MachineIndependent/ParseContextBase.cpp | 6 +-- .../glslang/MachineIndependent/ShaderLang.cpp | 5 +-- .../ResourceLimits}/ResourceLimits.cpp | 0 .../ResourceLimits}/resource_limits_c.cpp | 0 3rdparty/glslang/hlsl/stub.cpp | 41 ------------------- 6 files changed, 7 insertions(+), 49 deletions(-) rename 3rdparty/glslang/{StandAlone => glslang/ResourceLimits}/ResourceLimits.cpp (100%) rename 3rdparty/glslang/{StandAlone => glslang/ResourceLimits}/resource_limits_c.cpp (100%) delete mode 100644 3rdparty/glslang/hlsl/stub.cpp diff --git a/3rdparty/glslang/glslang/HLSL/hlslParseables.cpp b/3rdparty/glslang/glslang/HLSL/hlslParseables.cpp index 15918dc37..8fb1d2909 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslParseables.cpp +++ b/3rdparty/glslang/glslang/HLSL/hlslParseables.cpp @@ -564,8 +564,8 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "GetRenderTargetSamplePosition", "V2", "F", "V1", "I", EShLangAll, false }, { "GroupMemoryBarrier", nullptr, nullptr, "-", "-", EShLangCS, false }, { "GroupMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS, false }, - { "InterlockedAdd", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, - { "InterlockedAdd", "-", "-", "SVM,", "UI,", EShLangPSCS, false }, + { "InterlockedAdd", "-", "-", "SVM,,>", "FUI,,", EShLangPSCS, false }, + { "InterlockedAdd", "-", "-", "SVM,", "FUI,", EShLangPSCS, false }, { "InterlockedAnd", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false }, { "InterlockedAnd", "-", "-", "SVM,", "UI,", EShLangPSCS, false }, { "InterlockedCompareExchange", "-", "-", "SVM,,,>", "UI,,,", EShLangPSCS, false }, diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 758572bb8..c34c04f6c 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -235,12 +235,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, // Test for and give an error if the node can't be read from. void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node) { - TIntermBinary* binaryNode = node->getAsBinaryNode(); - const TIntermSymbol* symNode = node->getAsSymbolNode(); - if (! node) return; + TIntermBinary* binaryNode = node->getAsBinaryNode(); + const TIntermSymbol* symNode = node->getAsSymbolNode(); + if (node->getQualifier().isWriteOnly()) { const TIntermTyped* leftMostTypeNode = TIntermediate::findLValueBase(node, true); diff --git a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp index ed40c3669..5d16361cc 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -1542,11 +1542,10 @@ int ShLinkExt( TShHandleBase* base = reinterpret_cast(linkHandle); TLinker* linker = static_cast(base->getAsLinker()); - SetThreadPoolAllocator(linker->getPool()); - if (linker == nullptr) return 0; - + + SetThreadPoolAllocator(linker->getPool()); linker->infoSink.info.erase(); for (int i = 0; i < numHandles; ++i) { diff --git a/3rdparty/glslang/StandAlone/ResourceLimits.cpp b/3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp similarity index 100% rename from 3rdparty/glslang/StandAlone/ResourceLimits.cpp rename to 3rdparty/glslang/glslang/ResourceLimits/ResourceLimits.cpp diff --git a/3rdparty/glslang/StandAlone/resource_limits_c.cpp b/3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp similarity index 100% rename from 3rdparty/glslang/StandAlone/resource_limits_c.cpp rename to 3rdparty/glslang/glslang/ResourceLimits/resource_limits_c.cpp diff --git a/3rdparty/glslang/hlsl/stub.cpp b/3rdparty/glslang/hlsl/stub.cpp deleted file mode 100644 index f1d39c151..000000000 --- a/3rdparty/glslang/hlsl/stub.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright (C) 2020 Google, Inc. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// -// Neither the name of Google, Inc., nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -// The HLSL source is directly embedded into the glslang target when ENABLE_HLSL -// is set. -// This source now lives at: glslang/HLSL/ -// The HLSL target is now just a stub that exists for backwards compatibility -// for projects that referenced this target. As a target requires at least one -// source file to build, this file acts as that stub. From 9f162a8cf32762e31369a505b0f2b46bcf76e86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:26:58 -0700 Subject: [PATCH 47/86] Updated spirv-headers. --- .../spirv/unified1/spirv.core.grammar.json | 162 ++++++++++++++++++ .../include/spirv/unified1/spirv.h | 23 +++ .../include/spirv/unified1/spirv.hpp11 | 23 +++ .../include/spirv/unified1/spirv.json | 17 ++ 4 files changed, 225 insertions(+) diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json index 3e4f81ea6..c740663f6 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json @@ -4592,6 +4592,66 @@ "extensions" : [ "SPV_KHR_ray_query" ], "version" : "None" }, + { + "opname" : "OpImageSampleWeightedQCOM", + "class" : "Image", + "opcode" : 4480, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Texture'" }, + { "kind" : "IdRef", "name" : "'Coordinates'" }, + { "kind" : "IdRef", "name" : "'Weights'" } + ], + "capabilities" : [ "TextureSampleWeightedQCOM" ], + "version" : "None" + }, + { + "opname" : "OpImageBoxFilterQCOM", + "class" : "Image", + "opcode" : 4481, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Texture'" }, + { "kind" : "IdRef", "name" : "'Coordinates'" }, + { "kind" : "IdRef", "name" : "'Box Size'" } + ], + "capabilities" : [ "TextureBoxFilterQCOM" ], + "version" : "None" + }, + { + "opname" : "OpImageBlockMatchSSDQCOM", + "class" : "Image", + "opcode" : 4482, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Target Coordinates'" }, + { "kind" : "IdRef", "name" : "'Reference'" }, + { "kind" : "IdRef", "name" : "'Reference Coordinates'" }, + { "kind" : "IdRef", "name" : "'Block Size'" } + ], + "capabilities" : [ "TextureBlockMatchQCOM" ], + "version" : "None" + }, + { + "opname" : "OpImageBlockMatchSADQCOM", + "class" : "Image", + "opcode" : 4483, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Target'" }, + { "kind" : "IdRef", "name" : "'Target Coordinates'" }, + { "kind" : "IdRef", "name" : "'Reference'" }, + { "kind" : "IdRef", "name" : "'Reference Coordinates'" }, + { "kind" : "IdRef", "name" : "'Block Size'" } + ], + "capabilities" : [ "TextureBlockMatchQCOM" ], + "version" : "None" + }, { "opname" : "OpGroupIAddNonUniformAMD", "class" : "Group", @@ -9043,6 +9103,30 @@ "capabilities" : [ "LongConstantCompositeINTEL" ], "version" : "None" }, + { + "opname" : "OpConvertFToBF16INTEL", + "class" : "Conversion", + "opcode" : 6116, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Float Value'" } + ], + "capabilities" : [ "BFloat16ConversionINTEL" ], + "version" : "None" + }, + { + "opname" : "OpConvertBF16ToFINTEL", + "class" : "Conversion", + "opcode" : 6117, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'BFloat16 Value'" } + ], + "capabilities" : [ "BFloat16ConversionINTEL" ], + "version" : "None" + }, { "opname" : "OpControlBarrierArriveINTEL", "class" : "Barrier", @@ -10715,6 +10799,15 @@ "capabilities" : [ "FPGAKernelAttributesINTEL" ], "version" : "None" }, + { + "enumerant" : "RegisterMapInterfaceINTEL", + "value" : 6160, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'WaitForDoneWrite'" } + ], + "capabilities" : [ "FPGAKernelAttributesv2INTEL" ], + "version" : "None" + }, { "enumerant" : "NamedBarrierCountINTEL", "value" : 6417, @@ -11986,6 +12079,18 @@ "extensions" : [ "SPV_KHR_no_integer_wrap_decoration" ], "version" : "1.4" }, + { + "enumerant" : "WeightTextureQCOM", + "value" : 4487, + "extensions" : [ "SPV_QCOM_image_processing" ], + "version" : "None" + }, + { + "enumerant" : "BlockMatchTextureQCOM", + "value" : 4488, + "extensions" : [ "SPV_QCOM_image_processing" ], + "version" : "None" + }, { "enumerant" : "ExplicitInterpAMD", "value" : 4999, @@ -12517,6 +12622,26 @@ "capabilities" : [ "VectorComputeINTEL" ], "version" : "None" }, + { + "enumerant" : "LatencyControlLabelINTEL", + "value" : 6172, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Latency Label'" } + ], + "capabilities" : [ "FPGALatencyControlINTEL" ], + "version" : "None" + }, + { + "enumerant" : "LatencyControlConstraintINTEL", + "value" : 6173, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Relative To'" }, + { "kind" : "LiteralInteger", "name" : "'Control Type'" }, + { "kind" : "LiteralInteger", "name" : "'Relative Cycle'" } + ], + "capabilities" : [ "FPGALatencyControlINTEL" ], + "version" : "None" + }, { "enumerant" : "ConduitKernelArgumentINTEL", "value" : 6175, @@ -14082,6 +14207,24 @@ "extensions" : [ "SPV_KHR_ray_tracing" ], "version" : "None" }, + { + "enumerant" : "TextureSampleWeightedQCOM", + "value" : 4484, + "extensions" : [ "SPV_QCOM_image_processing" ], + "version" : "None" + }, + { + "enumerant" : "TextureBoxFilterQCOM", + "value" : 4485, + "extensions" : [ "SPV_QCOM_image_processing" ], + "version" : "None" + }, + { + "enumerant" : "TextureBlockMatchQCOM", + "value" : 4486, + "extensions" : [ "SPV_QCOM_image_processing" ], + "version" : "None" + }, { "enumerant" : "Float16ImageAMD", "value" : 5008, @@ -14887,12 +15030,31 @@ "extensions" : [ "SPV_INTEL_debug_module" ], "version" : "None" }, + { + "enumerant" : "BFloat16ConversionINTEL", + "value" : 6115, + "extensions" : [ "SPV_INTEL_bfloat16_conversion" ], + "version" : "None" + }, { "enumerant" : "SplitBarrierINTEL", "value" : 6141, "extensions" : [ "SPV_INTEL_split_barrier" ], "version" : "None" }, + { + "enumerant" : "FPGAKernelAttributesv2INTEL", + "value" : 6161, + "capabilities" : [ "FPGAKernelAttributesINTEL" ], + "extensions" : [ "SPV_INTEL_kernel_attributes" ], + "version" : "None" + }, + { + "enumerant" : "FPGALatencyControlINTEL", + "value" : 6171, + "extensions" : [ "SPV_INTEL_fpga_latency_control" ], + "version" : "None" + }, { "enumerant" : "FPGAArgumentInterfacesINTEL", "value" : 6174, diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h index f6b77aed7..28eb8ff49 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h @@ -200,6 +200,7 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeNumSIMDWorkitemsINTEL = 5896, SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, SpvExecutionModeStreamingInterfaceINTEL = 6154, + SpvExecutionModeRegisterMapInterfaceINTEL = 6160, SpvExecutionModeNamedBarrierCountINTEL = 6417, SpvExecutionModeMax = 0x7fffffff, } SpvExecutionMode; @@ -512,6 +513,8 @@ typedef enum SpvDecoration_ { SpvDecorationMaxByteOffsetId = 47, SpvDecorationNoSignedWrap = 4469, SpvDecorationNoUnsignedWrap = 4470, + SpvDecorationWeightTextureQCOM = 4487, + SpvDecorationBlockMatchTextureQCOM = 4488, SpvDecorationExplicitInterpAMD = 4999, SpvDecorationOverrideCoverageNV = 5248, SpvDecorationPassthroughNV = 5250, @@ -580,6 +583,8 @@ typedef enum SpvDecoration_ { SpvDecorationSingleElementVectorINTEL = 6085, SpvDecorationVectorComputeCallableFunctionINTEL = 6087, SpvDecorationMediaBlockIOINTEL = 6140, + SpvDecorationLatencyControlLabelINTEL = 6172, + SpvDecorationLatencyControlConstraintINTEL = 6173, SpvDecorationConduitKernelArgumentINTEL = 6175, SpvDecorationRegisterMapKernelArgumentINTEL = 6176, SpvDecorationMMHostInterfaceAddressWidthINTEL = 6177, @@ -1018,6 +1023,9 @@ typedef enum SpvCapability_ { SpvCapabilityRayQueryKHR = 4472, SpvCapabilityRayTraversalPrimitiveCullingKHR = 4478, SpvCapabilityRayTracingKHR = 4479, + SpvCapabilityTextureSampleWeightedQCOM = 4484, + SpvCapabilityTextureBoxFilterQCOM = 4485, + SpvCapabilityTextureBlockMatchQCOM = 4486, SpvCapabilityFloat16ImageAMD = 5008, SpvCapabilityImageGatherBiasLodAMD = 5009, SpvCapabilityFragmentMaskAMD = 5010, @@ -1145,7 +1153,10 @@ typedef enum SpvCapability_ { SpvCapabilityOptNoneINTEL = 6094, SpvCapabilityAtomicFloat16AddEXT = 6095, SpvCapabilityDebugInfoModuleINTEL = 6114, + SpvCapabilityBFloat16ConversionINTEL = 6115, SpvCapabilitySplitBarrierINTEL = 6141, + SpvCapabilityFPGAKernelAttributesv2INTEL = 6161, + SpvCapabilityFPGALatencyControlINTEL = 6171, SpvCapabilityFPGAArgumentInterfacesINTEL = 6174, SpvCapabilityGroupUniformArithmeticKHR = 6400, SpvCapabilityMax = 0x7fffffff, @@ -1631,6 +1642,10 @@ typedef enum SpvOp_ { SpvOpRayQueryConfirmIntersectionKHR = 4476, SpvOpRayQueryProceedKHR = 4477, SpvOpRayQueryGetIntersectionTypeKHR = 4479, + SpvOpImageSampleWeightedQCOM = 4480, + SpvOpImageBoxFilterQCOM = 4481, + SpvOpImageBlockMatchSSDQCOM = 4482, + SpvOpImageBlockMatchSADQCOM = 4483, SpvOpGroupIAddNonUniformAMD = 5000, SpvOpGroupFAddNonUniformAMD = 5001, SpvOpGroupFMinNonUniformAMD = 5002, @@ -1948,6 +1963,8 @@ typedef enum SpvOp_ { SpvOpTypeStructContinuedINTEL = 6090, SpvOpConstantCompositeContinuedINTEL = 6091, SpvOpSpecConstantCompositeContinuedINTEL = 6092, + SpvOpConvertFToBF16INTEL = 6116, + SpvOpConvertBF16ToFINTEL = 6117, SpvOpControlBarrierArriveINTEL = 6142, SpvOpControlBarrierWaitINTEL = 6143, SpvOpGroupIMulKHR = 6401, @@ -2339,6 +2356,10 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; case SpvOpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; case SpvOpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case SpvOpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; case SpvOpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case SpvOpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case SpvOpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; @@ -2651,6 +2672,8 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; case SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 index b7d041a37..362e8faeb 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 @@ -196,6 +196,7 @@ enum class ExecutionMode : unsigned { NumSIMDWorkitemsINTEL = 5896, SchedulerTargetFmaxMhzINTEL = 5903, StreamingInterfaceINTEL = 6154, + RegisterMapInterfaceINTEL = 6160, NamedBarrierCountINTEL = 6417, Max = 0x7fffffff, }; @@ -508,6 +509,8 @@ enum class Decoration : unsigned { MaxByteOffsetId = 47, NoSignedWrap = 4469, NoUnsignedWrap = 4470, + WeightTextureQCOM = 4487, + BlockMatchTextureQCOM = 4488, ExplicitInterpAMD = 4999, OverrideCoverageNV = 5248, PassthroughNV = 5250, @@ -576,6 +579,8 @@ enum class Decoration : unsigned { SingleElementVectorINTEL = 6085, VectorComputeCallableFunctionINTEL = 6087, MediaBlockIOINTEL = 6140, + LatencyControlLabelINTEL = 6172, + LatencyControlConstraintINTEL = 6173, ConduitKernelArgumentINTEL = 6175, RegisterMapKernelArgumentINTEL = 6176, MMHostInterfaceAddressWidthINTEL = 6177, @@ -1014,6 +1019,9 @@ enum class Capability : unsigned { RayQueryKHR = 4472, RayTraversalPrimitiveCullingKHR = 4478, RayTracingKHR = 4479, + TextureSampleWeightedQCOM = 4484, + TextureBoxFilterQCOM = 4485, + TextureBlockMatchQCOM = 4486, Float16ImageAMD = 5008, ImageGatherBiasLodAMD = 5009, FragmentMaskAMD = 5010, @@ -1141,7 +1149,10 @@ enum class Capability : unsigned { OptNoneINTEL = 6094, AtomicFloat16AddEXT = 6095, DebugInfoModuleINTEL = 6114, + BFloat16ConversionINTEL = 6115, SplitBarrierINTEL = 6141, + FPGAKernelAttributesv2INTEL = 6161, + FPGALatencyControlINTEL = 6171, FPGAArgumentInterfacesINTEL = 6174, GroupUniformArithmeticKHR = 6400, Max = 0x7fffffff, @@ -1627,6 +1638,10 @@ enum class Op : unsigned { OpRayQueryConfirmIntersectionKHR = 4476, OpRayQueryProceedKHR = 4477, OpRayQueryGetIntersectionTypeKHR = 4479, + OpImageSampleWeightedQCOM = 4480, + OpImageBoxFilterQCOM = 4481, + OpImageBlockMatchSSDQCOM = 4482, + OpImageBlockMatchSADQCOM = 4483, OpGroupIAddNonUniformAMD = 5000, OpGroupFAddNonUniformAMD = 5001, OpGroupFMinNonUniformAMD = 5002, @@ -1944,6 +1959,8 @@ enum class Op : unsigned { OpTypeStructContinuedINTEL = 6090, OpConstantCompositeContinuedINTEL = 6091, OpSpecConstantCompositeContinuedINTEL = 6092, + OpConvertFToBF16INTEL = 6116, + OpConvertBF16ToFINTEL = 6117, OpControlBarrierArriveINTEL = 6142, OpControlBarrierWaitINTEL = 6143, OpGroupIMulKHR = 6401, @@ -2335,6 +2352,10 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; case Op::OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; case Op::OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; @@ -2647,6 +2668,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json index 06e3a909b..5cad41c5e 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json @@ -215,6 +215,7 @@ "NumSIMDWorkitemsINTEL": 5896, "SchedulerTargetFmaxMhzINTEL": 5903, "StreamingInterfaceINTEL": 6154, + "RegisterMapInterfaceINTEL": 6160, "NamedBarrierCountINTEL": 6417 } }, @@ -534,6 +535,8 @@ "MaxByteOffsetId": 47, "NoSignedWrap": 4469, "NoUnsignedWrap": 4470, + "WeightTextureQCOM": 4487, + "BlockMatchTextureQCOM": 4488, "ExplicitInterpAMD": 4999, "OverrideCoverageNV": 5248, "PassthroughNV": 5250, @@ -602,6 +605,8 @@ "SingleElementVectorINTEL": 6085, "VectorComputeCallableFunctionINTEL": 6087, "MediaBlockIOINTEL": 6140, + "LatencyControlLabelINTEL": 6172, + "LatencyControlConstraintINTEL": 6173, "ConduitKernelArgumentINTEL": 6175, "RegisterMapKernelArgumentINTEL": 6176, "MMHostInterfaceAddressWidthINTEL": 6177, @@ -994,6 +999,9 @@ "RayQueryKHR": 4472, "RayTraversalPrimitiveCullingKHR": 4478, "RayTracingKHR": 4479, + "TextureSampleWeightedQCOM": 4484, + "TextureBoxFilterQCOM": 4485, + "TextureBlockMatchQCOM": 4486, "Float16ImageAMD": 5008, "ImageGatherBiasLodAMD": 5009, "FragmentMaskAMD": 5010, @@ -1121,7 +1129,10 @@ "OptNoneINTEL": 6094, "AtomicFloat16AddEXT": 6095, "DebugInfoModuleINTEL": 6114, + "BFloat16ConversionINTEL": 6115, "SplitBarrierINTEL": 6141, + "FPGAKernelAttributesv2INTEL": 6161, + "FPGALatencyControlINTEL": 6171, "FPGAArgumentInterfacesINTEL": 6174, "GroupUniformArithmeticKHR": 6400 } @@ -1617,6 +1628,10 @@ "OpRayQueryConfirmIntersectionKHR": 4476, "OpRayQueryProceedKHR": 4477, "OpRayQueryGetIntersectionTypeKHR": 4479, + "OpImageSampleWeightedQCOM": 4480, + "OpImageBoxFilterQCOM": 4481, + "OpImageBlockMatchSSDQCOM": 4482, + "OpImageBlockMatchSADQCOM": 4483, "OpGroupIAddNonUniformAMD": 5000, "OpGroupFAddNonUniformAMD": 5001, "OpGroupFMinNonUniformAMD": 5002, @@ -1934,6 +1949,8 @@ "OpTypeStructContinuedINTEL": 6090, "OpConstantCompositeContinuedINTEL": 6091, "OpSpecConstantCompositeContinuedINTEL": 6092, + "OpConvertFToBF16INTEL": 6116, + "OpConvertBF16ToFINTEL": 6117, "OpControlBarrierArriveINTEL": 6142, "OpControlBarrierWaitINTEL": 6143, "OpGroupIMulKHR": 6401, From 8c9826c7a387e694f65e9d95e4f4408fc2210b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:27:10 -0700 Subject: [PATCH 48/86] Updated spirv-tools. --- .../include/generated/build-version.inc | 2 +- .../include/generated/core.insts-unified1.inc | 10 ++++++ .../include/generated/enum_string_mapping.inc | 22 ++++++++++-- .../include/generated/extension_enum.inc | 3 ++ .../generated/operand.kinds-unified1.inc | 16 +++++++++ .../include/spirv-tools/libspirv.h | 13 +++++++ .../include/spirv-tools/libspirv.hpp | 22 ++++++++++++ .../include/spirv-tools/optimizer.hpp | 6 ++-- 3rdparty/spirv-tools/source/libspirv.cpp | 34 +++++++++++++++++++ 3rdparty/spirv-tools/source/opcode.cpp | 1 + .../source/opt/const_folding_rules.cpp | 15 +++++--- .../opt/eliminate_dead_functions_util.cpp | 4 ++- .../spirv-tools/source/opt/folding_rules.cpp | 7 ++-- 3rdparty/spirv-tools/source/opt/instruction.h | 2 +- 3rdparty/spirv-tools/source/opt/optimizer.cpp | 10 ++++++ 3rdparty/spirv-tools/source/opt/reflect.h | 22 +++--------- .../spirv-tools/source/spirv_target_env.cpp | 1 + .../spirv-tools/source/val/validate_cfg.cpp | 3 +- .../spirv-tools/source/val/validate_type.cpp | 9 +++++ 19 files changed, 170 insertions(+), 32 deletions(-) diff --git a/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/spirv-tools/include/generated/build-version.inc index f5411dcee..b2e3cdd2e 100644 --- a/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2023.2-dev", "SPIRV-Tools v2023.2-dev v2022.4-89-g4ee97c03" +"v2023.2", "SPIRV-Tools v2023.2 v2022.4-143-g3a7146da" diff --git a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc index d2ca74927..19617a5f7 100644 --- a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc @@ -7,6 +7,7 @@ static const spv::Capability pygen_variable_caps_ArbitraryPrecisionFloatingPoint static const spv::Capability pygen_variable_caps_AsmINTEL[] = {spv::Capability::AsmINTEL}; static const spv::Capability pygen_variable_caps_AtomicFloat16AddEXTAtomicFloat32AddEXTAtomicFloat64AddEXT[] = {spv::Capability::AtomicFloat16AddEXT, spv::Capability::AtomicFloat32AddEXT, spv::Capability::AtomicFloat64AddEXT}; static const spv::Capability pygen_variable_caps_AtomicFloat16MinMaxEXTAtomicFloat32MinMaxEXTAtomicFloat64MinMaxEXT[] = {spv::Capability::AtomicFloat16MinMaxEXT, spv::Capability::AtomicFloat32MinMaxEXT, spv::Capability::AtomicFloat64MinMaxEXT}; +static const spv::Capability pygen_variable_caps_BFloat16ConversionINTEL[] = {spv::Capability::BFloat16ConversionINTEL}; static const spv::Capability pygen_variable_caps_BindlessTextureNV[] = {spv::Capability::BindlessTextureNV}; static const spv::Capability pygen_variable_caps_BlockingPipesINTEL[] = {spv::Capability::BlockingPipesINTEL}; static const spv::Capability pygen_variable_caps_CooperativeMatrixNV[] = {spv::Capability::CooperativeMatrixNV}; @@ -72,6 +73,9 @@ static const spv::Capability pygen_variable_caps_SubgroupImageBlockIOINTEL[] = { static const spv::Capability pygen_variable_caps_SubgroupImageMediaBlockIOINTEL[] = {spv::Capability::SubgroupImageMediaBlockIOINTEL}; static const spv::Capability pygen_variable_caps_SubgroupShuffleINTEL[] = {spv::Capability::SubgroupShuffleINTEL}; static const spv::Capability pygen_variable_caps_SubgroupVoteKHR[] = {spv::Capability::SubgroupVoteKHR}; +static const spv::Capability pygen_variable_caps_TextureBlockMatchQCOM[] = {spv::Capability::TextureBlockMatchQCOM}; +static const spv::Capability pygen_variable_caps_TextureBoxFilterQCOM[] = {spv::Capability::TextureBoxFilterQCOM}; +static const spv::Capability pygen_variable_caps_TextureSampleWeightedQCOM[] = {spv::Capability::TextureSampleWeightedQCOM}; static const spv::Capability pygen_variable_caps_USMStorageClassesINTEL[] = {spv::Capability::USMStorageClassesINTEL}; static const spv::Capability pygen_variable_caps_UnstructuredLoopControlsINTEL[] = {spv::Capability::UnstructuredLoopControlsINTEL}; static const spv::Capability pygen_variable_caps_VariableLengthArrayINTEL[] = {spv::Capability::VariableLengthArrayINTEL}; @@ -483,6 +487,10 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = { {"RayQueryConfirmIntersectionKHR", spv::Op::OpRayQueryConfirmIntersectionKHR, 1, pygen_variable_caps_RayQueryKHR, 1, {SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, {"RayQueryProceedKHR", spv::Op::OpRayQueryProceedKHR, 1, pygen_variable_caps_RayQueryKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, {"RayQueryGetIntersectionTypeKHR", spv::Op::OpRayQueryGetIntersectionTypeKHR, 1, pygen_variable_caps_RayQueryKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, + {"ImageSampleWeightedQCOM", spv::Op::OpImageSampleWeightedQCOM, 1, pygen_variable_caps_TextureSampleWeightedQCOM, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBoxFilterQCOM", spv::Op::OpImageBoxFilterQCOM, 1, pygen_variable_caps_TextureBoxFilterQCOM, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchSSDQCOM", spv::Op::OpImageBlockMatchSSDQCOM, 1, pygen_variable_caps_TextureBlockMatchQCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ImageBlockMatchSADQCOM", spv::Op::OpImageBlockMatchSADQCOM, 1, pygen_variable_caps_TextureBlockMatchQCOM, 7, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"GroupIAddNonUniformAMD", spv::Op::OpGroupIAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, {"GroupFAddNonUniformAMD", spv::Op::OpGroupFAddNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, {"GroupFMinNonUniformAMD", spv::Op::OpGroupFMinNonUniformAMD, 1, pygen_variable_caps_Groups, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_AMD_shader_ballot, 0xffffffffu, 0xffffffffu}, @@ -800,6 +808,8 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = { {"TypeStructContinuedINTEL", spv::Op::OpTypeStructContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"ConstantCompositeContinuedINTEL", spv::Op::OpConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"SpecConstantCompositeContinuedINTEL", spv::Op::OpSpecConstantCompositeContinuedINTEL, 1, pygen_variable_caps_LongConstantCompositeINTEL, 1, {SPV_OPERAND_TYPE_VARIABLE_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertFToBF16INTEL", spv::Op::OpConvertFToBF16INTEL, 1, pygen_variable_caps_BFloat16ConversionINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"ConvertBF16ToFINTEL", spv::Op::OpConvertBF16ToFINTEL, 1, pygen_variable_caps_BFloat16ConversionINTEL, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"ControlBarrierArriveINTEL", spv::Op::OpControlBarrierArriveINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"ControlBarrierWaitINTEL", spv::Op::OpControlBarrierWaitINTEL, 1, pygen_variable_caps_SplitBarrierINTEL, 3, {SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID}, 0, 0, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"GroupIMulKHR", spv::Op::OpGroupIMulKHR, 1, pygen_variable_caps_GroupUniformArithmeticKHR, 5, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_SCOPE_ID, SPV_OPERAND_TYPE_GROUP_OPERATION, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, diff --git a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc index 18344e8d7..669b831e8 100644 --- a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc +++ b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc @@ -64,6 +64,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_arbitrary_precision_floating_point"; case Extension::kSPV_INTEL_arbitrary_precision_integers: return "SPV_INTEL_arbitrary_precision_integers"; + case Extension::kSPV_INTEL_bfloat16_conversion: + return "SPV_INTEL_bfloat16_conversion"; case Extension::kSPV_INTEL_blocking_pipes: return "SPV_INTEL_blocking_pipes"; case Extension::kSPV_INTEL_debug_module: @@ -84,6 +86,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_INTEL_fpga_dsp_control"; case Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes: return "SPV_INTEL_fpga_invocation_pipelining_attributes"; + case Extension::kSPV_INTEL_fpga_latency_control: + return "SPV_INTEL_fpga_latency_control"; case Extension::kSPV_INTEL_fpga_loop_controls: return "SPV_INTEL_fpga_loop_controls"; case Extension::kSPV_INTEL_fpga_memory_accesses: @@ -222,6 +226,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_NV_stereo_view_rendering"; case Extension::kSPV_NV_viewport_array2: return "SPV_NV_viewport_array2"; + case Extension::kSPV_QCOM_image_processing: + return "SPV_QCOM_image_processing"; case Extension::kSPV_VALIDATOR_ignore_type_decl_unique: return "SPV_VALIDATOR_ignore_type_decl_unique"; } @@ -231,8 +237,8 @@ const char* ExtensionToString(Extension extension) { bool GetExtensionFromString(const char* str, Extension* extension) { - static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_argument_interfaces", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_VALIDATOR_ignore_type_decl_unique" }; - static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_argument_interfaces, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; + static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_bfloat16_conversion", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_argument_interfaces", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_latency_control", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_QCOM_image_processing", "SPV_VALIDATOR_ignore_type_decl_unique" }; + static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_bfloat16_conversion, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_argument_interfaces, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_latency_control, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_QCOM_image_processing, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; const auto b = std::begin(known_ext_strs); const auto e = std::end(known_ext_strs); const auto found = std::equal_range( @@ -448,6 +454,12 @@ const char* CapabilityToString(spv::Capability capability) { return "RayTraversalPrimitiveCullingKHR"; case spv::Capability::RayTracingKHR: return "RayTracingKHR"; + case spv::Capability::TextureSampleWeightedQCOM: + return "TextureSampleWeightedQCOM"; + case spv::Capability::TextureBoxFilterQCOM: + return "TextureBoxFilterQCOM"; + case spv::Capability::TextureBlockMatchQCOM: + return "TextureBlockMatchQCOM"; case spv::Capability::Float16ImageAMD: return "Float16ImageAMD"; case spv::Capability::ImageGatherBiasLodAMD: @@ -656,8 +668,14 @@ const char* CapabilityToString(spv::Capability capability) { return "AtomicFloat16AddEXT"; case spv::Capability::DebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case spv::Capability::BFloat16ConversionINTEL: + return "BFloat16ConversionINTEL"; case spv::Capability::SplitBarrierINTEL: return "SplitBarrierINTEL"; + case spv::Capability::FPGAKernelAttributesv2INTEL: + return "FPGAKernelAttributesv2INTEL"; + case spv::Capability::FPGALatencyControlINTEL: + return "FPGALatencyControlINTEL"; case spv::Capability::FPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; case spv::Capability::GroupUniformArithmeticKHR: diff --git a/3rdparty/spirv-tools/include/generated/extension_enum.inc b/3rdparty/spirv-tools/include/generated/extension_enum.inc index 68c36bb41..92f489b63 100644 --- a/3rdparty/spirv-tools/include/generated/extension_enum.inc +++ b/3rdparty/spirv-tools/include/generated/extension_enum.inc @@ -30,6 +30,7 @@ kSPV_GOOGLE_user_type, kSPV_INTEL_arbitrary_precision_fixed_point, kSPV_INTEL_arbitrary_precision_floating_point, kSPV_INTEL_arbitrary_precision_integers, +kSPV_INTEL_bfloat16_conversion, kSPV_INTEL_blocking_pipes, kSPV_INTEL_debug_module, kSPV_INTEL_device_side_avc_motion_estimation, @@ -40,6 +41,7 @@ kSPV_INTEL_fpga_buffer_location, kSPV_INTEL_fpga_cluster_attributes, kSPV_INTEL_fpga_dsp_control, kSPV_INTEL_fpga_invocation_pipelining_attributes, +kSPV_INTEL_fpga_latency_control, kSPV_INTEL_fpga_loop_controls, kSPV_INTEL_fpga_memory_accesses, kSPV_INTEL_fpga_memory_attributes, @@ -109,4 +111,5 @@ kSPV_NV_shader_subgroup_partitioned, kSPV_NV_shading_rate, kSPV_NV_stereo_view_rendering, kSPV_NV_viewport_array2, +kSPV_QCOM_image_processing, kSPV_VALIDATOR_ignore_type_decl_unique \ No newline at end of file diff --git a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc index 003a5a588..684eb6489 100644 --- a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc @@ -21,6 +21,8 @@ static const spv::Capability pygen_variable_caps_FPGAClusterAttributesINTEL[] = static const spv::Capability pygen_variable_caps_FPGADSPControlINTEL[] = {spv::Capability::FPGADSPControlINTEL}; static const spv::Capability pygen_variable_caps_FPGAInvocationPipeliningAttributesINTEL[] = {spv::Capability::FPGAInvocationPipeliningAttributesINTEL}; static const spv::Capability pygen_variable_caps_FPGAKernelAttributesINTEL[] = {spv::Capability::FPGAKernelAttributesINTEL}; +static const spv::Capability pygen_variable_caps_FPGAKernelAttributesv2INTEL[] = {spv::Capability::FPGAKernelAttributesv2INTEL}; +static const spv::Capability pygen_variable_caps_FPGALatencyControlINTEL[] = {spv::Capability::FPGALatencyControlINTEL}; static const spv::Capability pygen_variable_caps_FPGALoopControlsINTEL[] = {spv::Capability::FPGALoopControlsINTEL}; static const spv::Capability pygen_variable_caps_FPGAMemoryAccessesINTEL[] = {spv::Capability::FPGAMemoryAccessesINTEL}; static const spv::Capability pygen_variable_caps_FPGAMemoryAttributesINTEL[] = {spv::Capability::FPGAMemoryAttributesINTEL}; @@ -160,6 +162,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_GOOGLE_user_type[] = {s static const spvtools::Extension pygen_variable_exts_SPV_INTEL_arbitrary_precision_fixed_point[] = {spvtools::Extension::kSPV_INTEL_arbitrary_precision_fixed_point}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_arbitrary_precision_floating_point[] = {spvtools::Extension::kSPV_INTEL_arbitrary_precision_floating_point}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_arbitrary_precision_integers[] = {spvtools::Extension::kSPV_INTEL_arbitrary_precision_integers}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_bfloat16_conversion[] = {spvtools::Extension::kSPV_INTEL_bfloat16_conversion}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_blocking_pipes[] = {spvtools::Extension::kSPV_INTEL_blocking_pipes}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_debug_module[] = {spvtools::Extension::kSPV_INTEL_debug_module}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_device_side_avc_motion_estimation[] = {spvtools::Extension::kSPV_INTEL_device_side_avc_motion_estimation}; @@ -170,6 +173,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_buffer_locat static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_cluster_attributes[] = {spvtools::Extension::kSPV_INTEL_fpga_cluster_attributes}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_dsp_control[] = {spvtools::Extension::kSPV_INTEL_fpga_dsp_control}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_invocation_pipelining_attributes[] = {spvtools::Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes}; +static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_latency_control[] = {spvtools::Extension::kSPV_INTEL_fpga_latency_control}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_loop_controls[] = {spvtools::Extension::kSPV_INTEL_fpga_loop_controls}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_memory_accesses[] = {spvtools::Extension::kSPV_INTEL_fpga_memory_accesses}; static const spvtools::Extension pygen_variable_exts_SPV_INTEL_fpga_memory_attributes[] = {spvtools::Extension::kSPV_INTEL_fpga_memory_attributes}; @@ -238,6 +242,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_sm_builtins[] static const spvtools::Extension pygen_variable_exts_SPV_NV_shader_subgroup_partitioned[] = {spvtools::Extension::kSPV_NV_shader_subgroup_partitioned}; static const spvtools::Extension pygen_variable_exts_SPV_NV_stereo_view_rendering[] = {spvtools::Extension::kSPV_NV_stereo_view_rendering}; static const spvtools::Extension pygen_variable_exts_SPV_NV_viewport_array2[] = {spvtools::Extension::kSPV_NV_viewport_array2}; +static const spvtools::Extension pygen_variable_exts_SPV_QCOM_image_processing[] = {spvtools::Extension::kSPV_QCOM_image_processing}; static const spv_operand_desc_t pygen_variable_ImageOperandsEntries[] = { {"None", 0x0000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, @@ -508,6 +513,7 @@ static const spv_operand_desc_t pygen_variable_ExecutionModeEntries[] = { {"NumSIMDWorkitemsINTEL", 5896, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"SchedulerTargetFmaxMhzINTEL", 5903, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"StreamingInterfaceINTEL", 6154, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"RegisterMapInterfaceINTEL", 6160, 1, pygen_variable_caps_FPGAKernelAttributesv2INTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"NamedBarrierCountINTEL", 6417, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu} }; @@ -766,6 +772,8 @@ static const spv_operand_desc_t pygen_variable_DecorationEntries[] = { {"MaxByteOffsetId", 47, 1, pygen_variable_caps_Addresses, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, {"NoSignedWrap", 4469, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, {"NoUnsignedWrap", 4470, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"WeightTextureQCOM", 4487, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"BlockMatchTextureQCOM", 4488, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, {"ExplicitInterpAMD", 4999, 0, nullptr, 1, pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter, {}, 0xffffffffu, 0xffffffffu}, {"OverrideCoverageNV", 5248, 1, pygen_variable_caps_SampleMaskOverrideCoverageNV, 1, pygen_variable_exts_SPV_NV_sample_mask_override_coverage, {}, 0xffffffffu, 0xffffffffu}, {"PassthroughNV", 5250, 1, pygen_variable_caps_GeometryShaderPassthroughNV, 1, pygen_variable_exts_SPV_NV_geometry_shader_passthrough, {}, 0xffffffffu, 0xffffffffu}, @@ -834,6 +842,8 @@ static const spv_operand_desc_t pygen_variable_DecorationEntries[] = { {"SingleElementVectorINTEL", 6085, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"VectorComputeCallableFunctionINTEL", 6087, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"MediaBlockIOINTEL", 6140, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"LatencyControlLabelINTEL", 6172, 1, pygen_variable_caps_FPGALatencyControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, + {"LatencyControlConstraintINTEL", 6173, 1, pygen_variable_caps_FPGALatencyControlINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, {"ConduitKernelArgumentINTEL", 6175, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"RegisterMapKernelArgumentINTEL", 6176, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"MMHostInterfaceAddressWidthINTEL", 6177, 1, pygen_variable_caps_FPGAArgumentInterfacesINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu}, @@ -1109,6 +1119,9 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"RayQueryKHR", 4472, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_query, {}, 0xffffffffu, 0xffffffffu}, {"RayTraversalPrimitiveCullingKHR", 4478, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_querySPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"RayTracingKHR", 4479, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, + {"TextureSampleWeightedQCOM", 4484, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"TextureBoxFilterQCOM", 4485, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, + {"TextureBlockMatchQCOM", 4486, 0, nullptr, 1, pygen_variable_exts_SPV_QCOM_image_processing, {}, 0xffffffffu, 0xffffffffu}, {"Float16ImageAMD", 5008, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_gpu_shader_half_float_fetch, {}, 0xffffffffu, 0xffffffffu}, {"ImageGatherBiasLodAMD", 5009, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_texture_gather_bias_lod, {}, 0xffffffffu, 0xffffffffu}, {"FragmentMaskAMD", 5010, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_fragment_mask, {}, 0xffffffffu, 0xffffffffu}, @@ -1236,7 +1249,10 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"OptNoneINTEL", 6094, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_optnone, {}, 0xffffffffu, 0xffffffffu}, {"AtomicFloat16AddEXT", 6095, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float16_add, {}, 0xffffffffu, 0xffffffffu}, {"DebugInfoModuleINTEL", 6114, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_debug_module, {}, 0xffffffffu, 0xffffffffu}, + {"BFloat16ConversionINTEL", 6115, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_bfloat16_conversion, {}, 0xffffffffu, 0xffffffffu}, {"SplitBarrierINTEL", 6141, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_split_barrier, {}, 0xffffffffu, 0xffffffffu}, + {"FPGAKernelAttributesv2INTEL", 6161, 1, pygen_variable_caps_FPGAKernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {}, 0xffffffffu, 0xffffffffu}, + {"FPGALatencyControlINTEL", 6171, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_latency_control, {}, 0xffffffffu, 0xffffffffu}, {"FPGAArgumentInterfacesINTEL", 6174, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_fpga_argument_interfaces, {}, 0xffffffffu, 0xffffffffu}, {"GroupUniformArithmeticKHR", 6400, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_uniform_group_instructions, {}, 0xffffffffu, 0xffffffffu} }; diff --git a/3rdparty/spirv-tools/include/spirv-tools/libspirv.h b/3rdparty/spirv-tools/include/spirv-tools/libspirv.h index 10102cc39..912d02ba3 100644 --- a/3rdparty/spirv-tools/include/spirv-tools/libspirv.h +++ b/3rdparty/spirv-tools/include/spirv-tools/libspirv.h @@ -403,6 +403,19 @@ typedef struct spv_parsed_instruction_t { uint16_t num_operands; } spv_parsed_instruction_t; +typedef struct spv_parsed_header_t { + // The magic number of the SPIR-V module. + uint32_t magic; + // Version number. + uint32_t version; + // Generator's magic number. + uint32_t generator; + // IDs bound for this module (0 < id < bound). + uint32_t bound; + // reserved. + uint32_t reserved; +} spv_parsed_header_t; + typedef struct spv_const_binary_t { const uint32_t* code; const size_t wordCount; diff --git a/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp b/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp index 408e3ebb2..ee6c8469a 100644 --- a/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp +++ b/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp @@ -31,6 +31,11 @@ using MessageConsumer = std::function; +using HeaderParser = std::function; +using InstructionParser = + std::function; + // C++ RAII wrapper around the C context object spv_context. class Context { public: @@ -336,6 +341,23 @@ class SpirvTools { std::string* text, uint32_t options = kDefaultDisassembleOption) const; + // Parses a SPIR-V binary, specified as counted sequence of 32-bit words. + // Parsing feedback is provided via two callbacks provided as std::function. + // In a valid parse the parsed-header callback is called once, and + // then the parsed-instruction callback is called once for each instruction + // in the stream. + // Returns true on successful parsing. + // If diagnostic is non-null, a diagnostic is emitted on failed parsing. + // If diagnostic is null the context's message consumer + // will be used to emit any errors. If a callback returns anything other than + // SPV_SUCCESS, then that status code is returned, no further callbacks are + // issued, and no additional diagnostics are emitted. + // This is a wrapper around the C API spvBinaryParse. + bool Parse(const std::vector& binary, + const HeaderParser& header_parser, + const InstructionParser& instruction_parser, + spv_diagnostic* diagnostic = nullptr); + // Validates the given SPIR-V |binary|. Returns true if no issues are found. // Otherwise, returns false and communicates issues via the message consumer // registered. diff --git a/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp b/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp index aa6a614ea..8bdd4e826 100644 --- a/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp +++ b/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp @@ -525,8 +525,10 @@ Optimizer::PassToken CreateDeadInsertElimPass(); // If |remove_outputs| is true, allow outputs to be removed from the interface. // This is only safe if the caller knows that there is no corresponding input // variable in the following shader. It is false by default. -Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface = false, - bool remove_outputs = false); +Optimizer::PassToken CreateAggressiveDCEPass(); +Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface); +Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface, + bool remove_outputs); // Creates a remove-unused-interface-variables pass. // Removes variables referenced on the |OpEntryPoint| instruction that are not diff --git a/3rdparty/spirv-tools/source/libspirv.cpp b/3rdparty/spirv-tools/source/libspirv.cpp index be76caaa8..83e8629b7 100644 --- a/3rdparty/spirv-tools/source/libspirv.cpp +++ b/3rdparty/spirv-tools/source/libspirv.cpp @@ -108,6 +108,40 @@ bool SpirvTools::Disassemble(const uint32_t* binary, const size_t binary_size, return status == SPV_SUCCESS; } +struct CxxParserContext { + const HeaderParser& header_parser; + const InstructionParser& instruction_parser; +}; + +bool SpirvTools::Parse(const std::vector& binary, + const HeaderParser& header_parser, + const InstructionParser& instruction_parser, + spv_diagnostic* diagnostic) { + CxxParserContext parser_context = {header_parser, instruction_parser}; + + spv_parsed_header_fn_t header_fn_wrapper = + [](void* user_data, spv_endianness_t endianness, uint32_t magic, + uint32_t version, uint32_t generator, uint32_t id_bound, + uint32_t reserved) { + CxxParserContext* ctx = reinterpret_cast(user_data); + spv_parsed_header_t header = {magic, version, generator, id_bound, + reserved}; + + return ctx->header_parser(endianness, header); + }; + + spv_parsed_instruction_fn_t instruction_fn_wrapper = + [](void* user_data, const spv_parsed_instruction_t* instruction) { + CxxParserContext* ctx = reinterpret_cast(user_data); + return ctx->instruction_parser(*instruction); + }; + + spv_result_t status = spvBinaryParse( + impl_->context, &parser_context, binary.data(), binary.size(), + header_fn_wrapper, instruction_fn_wrapper, diagnostic); + return status == SPV_SUCCESS; +} + bool SpirvTools::Validate(const std::vector& binary) const { return Validate(binary.data(), binary.size()); } diff --git a/3rdparty/spirv-tools/source/opcode.cpp b/3rdparty/spirv-tools/source/opcode.cpp index b1785cccc..d26024abb 100644 --- a/3rdparty/spirv-tools/source/opcode.cpp +++ b/3rdparty/spirv-tools/source/opcode.cpp @@ -240,6 +240,7 @@ int32_t spvOpcodeIsConstant(const spv::Op opcode) { case spv::Op::OpConstantComposite: case spv::Op::OpConstantSampler: case spv::Op::OpConstantNull: + case spv::Op::OpConstantFunctionPointerINTEL: case spv::Op::OpSpecConstantTrue: case spv::Op::OpSpecConstantFalse: case spv::Op::OpSpecConstant: diff --git a/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp b/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp index 14f22089b..516c34b3b 100644 --- a/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp +++ b/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp @@ -145,12 +145,17 @@ ConstantFoldingRule FoldInsertWithConstants() { if (composite->AsNullConstant()) { // Make new composite so it can be inserted in the index with the // non-null value - const auto new_composite = const_mgr->GetNullCompositeConstant(type); - // Keep track of any indexes along the way to last index - if (i != final_index) { - chain.push_back(new_composite); + if (const auto new_composite = + const_mgr->GetNullCompositeConstant(type)) { + // Keep track of any indexes along the way to last index + if (i != final_index) { + chain.push_back(new_composite); + } + components = new_composite->AsCompositeConstant()->GetComponents(); + } else { + // Unsupported input type (such as structs) + return nullptr; } - components = new_composite->AsCompositeConstant()->GetComponents(); } else { // Keep track of any indexes along the way to last index if (i != final_index) { diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp index cf7f92f55..e95b7f6a8 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_functions_util.cpp @@ -37,7 +37,9 @@ Module::iterator EliminateFunction(IRContext* context, assert(inst->IsNonSemanticInstruction()); if (to_kill.find(inst) != to_kill.end()) return; std::unique_ptr clone(inst->Clone(context)); - context->ForgetUses(inst); + // Clear uses of "inst" to in case this moves a dependent chain of + // instructions. + context->get_def_use_mgr()->ClearInst(inst); context->AnalyzeDefUse(clone.get()); if (first_func) { context->AddGlobalValue(std::move(clone)); diff --git a/3rdparty/spirv-tools/source/opt/folding_rules.cpp b/3rdparty/spirv-tools/source/opt/folding_rules.cpp index 1a4c03d7e..a2260ccb2 100644 --- a/3rdparty/spirv-tools/source/opt/folding_rules.cpp +++ b/3rdparty/spirv-tools/source/opt/folding_rules.cpp @@ -1656,8 +1656,11 @@ std::vector GetExtractOperandsForElementOfCompositeConstruct( analysis::Type* result_type = type_mgr->GetType(inst->type_id()); if (result_type->AsVector() == nullptr) { - uint32_t id = inst->GetSingleWordInOperand(result_index); - return {Operand(SPV_OPERAND_TYPE_ID, {id})}; + if (result_index < inst->NumInOperands()) { + uint32_t id = inst->GetSingleWordInOperand(result_index); + return {Operand(SPV_OPERAND_TYPE_ID, {id})}; + } + return {}; } // If the result type is a vector, then vector operands are concatenated. diff --git a/3rdparty/spirv-tools/source/opt/instruction.h b/3rdparty/spirv-tools/source/opt/instruction.h index 22736bff8..d50e62517 100644 --- a/3rdparty/spirv-tools/source/opt/instruction.h +++ b/3rdparty/spirv-tools/source/opt/instruction.h @@ -906,7 +906,7 @@ bool Instruction::IsAtomicWithLoad() const { bool Instruction::IsAtomicOp() const { return spvOpcodeIsAtomicOp(opcode()); } bool Instruction::IsConstant() const { - return IsCompileTimeConstantInst(opcode()); + return IsConstantInst(opcode()) && !IsSpecConstantInst(opcode()); } } // namespace opt } // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/optimizer.cpp b/3rdparty/spirv-tools/source/opt/optimizer.cpp index cbc4b82f7..46a92dd90 100644 --- a/3rdparty/spirv-tools/source/opt/optimizer.cpp +++ b/3rdparty/spirv-tools/source/opt/optimizer.cpp @@ -785,6 +785,16 @@ Optimizer::PassToken CreateLocalMultiStoreElimPass() { MakeUnique()); } +Optimizer::PassToken CreateAggressiveDCEPass() { + return MakeUnique( + MakeUnique(false, false)); +} + +Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface) { + return MakeUnique( + MakeUnique(preserve_interface, false)); +} + Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface, bool remove_outputs) { return MakeUnique( diff --git a/3rdparty/spirv-tools/source/opt/reflect.h b/3rdparty/spirv-tools/source/opt/reflect.h index 45bb5c57c..ec7c2dd07 100644 --- a/3rdparty/spirv-tools/source/opt/reflect.h +++ b/3rdparty/spirv-tools/source/opt/reflect.h @@ -16,6 +16,7 @@ #define SOURCE_OPT_REFLECT_H_ #include "source/latest_version_spirv_header.h" +#include "source/opcode.h" namespace spvtools { namespace opt { @@ -46,27 +47,14 @@ inline bool IsAnnotationInst(spv::Op opcode) { opcode == spv::Op::OpMemberDecorateStringGOOGLE; } inline bool IsTypeInst(spv::Op opcode) { - return (opcode >= spv::Op::OpTypeVoid && - opcode <= spv::Op::OpTypeForwardPointer) || - opcode == spv::Op::OpTypePipeStorage || - opcode == spv::Op::OpTypeNamedBarrier || - opcode == spv::Op::OpTypeAccelerationStructureNV || - opcode == spv::Op::OpTypeAccelerationStructureKHR || - opcode == spv::Op::OpTypeRayQueryKHR || - opcode == spv::Op::OpTypeCooperativeMatrixNV || - opcode == spv::Op::OpTypeHitObjectNV; + return spvOpcodeGeneratesType(opcode) || + opcode == spv::Op::OpTypeForwardPointer; } inline bool IsConstantInst(spv::Op opcode) { - return (opcode >= spv::Op::OpConstantTrue && - opcode <= spv::Op::OpSpecConstantOp) || - opcode == spv::Op::OpConstantFunctionPointerINTEL; -} -inline bool IsCompileTimeConstantInst(spv::Op opcode) { - return opcode >= spv::Op::OpConstantTrue && opcode <= spv::Op::OpConstantNull; + return spvOpcodeIsConstant(opcode); } inline bool IsSpecConstantInst(spv::Op opcode) { - return opcode >= spv::Op::OpSpecConstantTrue && - opcode <= spv::Op::OpSpecConstantOp; + return spvOpcodeIsSpecConstant(opcode); } } // namespace opt diff --git a/3rdparty/spirv-tools/source/spirv_target_env.cpp b/3rdparty/spirv-tools/source/spirv_target_env.cpp index 9a0381742..585f8b65a 100644 --- a/3rdparty/spirv-tools/source/spirv_target_env.cpp +++ b/3rdparty/spirv-tools/source/spirv_target_env.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "source/spirv_constant.h" #include "spirv-tools/libspirv.h" diff --git a/3rdparty/spirv-tools/source/val/validate_cfg.cpp b/3rdparty/spirv-tools/source/val/validate_cfg.cpp index 9ba66f422..a29b5fd07 100644 --- a/3rdparty/spirv-tools/source/val/validate_cfg.cpp +++ b/3rdparty/spirv-tools/source/val/validate_cfg.cpp @@ -671,7 +671,8 @@ spv_result_t ValidateStructuredSelections( // previously. const bool true_label_unseen = seen.insert(true_label).second; const bool false_label_unseen = seen.insert(false_label).second; - if (!merge && true_label_unseen && false_label_unseen) { + if ((!merge || merge->opcode() == spv::Op::OpLoopMerge) && + true_label_unseen && false_label_unseen) { return _.diag(SPV_ERROR_INVALID_CFG, terminator) << "Selection must be structured"; } diff --git a/3rdparty/spirv-tools/source/val/validate_type.cpp b/3rdparty/spirv-tools/source/val/validate_type.cpp index e7adab80f..430d81908 100644 --- a/3rdparty/spirv-tools/source/val/validate_type.cpp +++ b/3rdparty/spirv-tools/source/val/validate_type.cpp @@ -349,6 +349,15 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) { << ", OpTypeRuntimeArray must only be used for the last member " "of an OpTypeStruct"; } + + if (!_.HasDecoration(inst->id(), spv::Decoration::Block) && + !_.HasDecoration(inst->id(), spv::Decoration::BufferBlock)) { + return _.diag(SPV_ERROR_INVALID_ID, inst) + << _.VkErrorID(4680) + << spvLogStringForEnv(_.context()->target_env) + << ", OpTypeStruct containing an OpTypeRuntimeArray " + << "must be decorated with Block or BufferBlock."; + } } } From c10fd5ed24f6a30915981ed1346155dc069a7067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:27:23 -0700 Subject: [PATCH 49/86] Updated spirv-cross. --- 3rdparty/spirv-cross/main.cpp | 8 +++ 3rdparty/spirv-cross/spirv_cross_c.cpp | 4 ++ 3rdparty/spirv-cross/spirv_cross_c.h | 3 +- 3rdparty/spirv-cross/spirv_glsl.cpp | 5 +- 3rdparty/spirv-cross/spirv_hlsl.cpp | 4 +- 3rdparty/spirv-cross/spirv_msl.cpp | 79 +++++++++++++++++++++++--- 3rdparty/spirv-cross/spirv_msl.hpp | 9 +++ 7 files changed, 101 insertions(+), 11 deletions(-) diff --git a/3rdparty/spirv-cross/main.cpp b/3rdparty/spirv-cross/main.cpp index 3605a54a2..776fcd326 100644 --- a/3rdparty/spirv-cross/main.cpp +++ b/3rdparty/spirv-cross/main.cpp @@ -675,6 +675,7 @@ struct CLIArguments bool msl_force_sample_rate_shading = false; bool msl_manual_helper_invocation_updates = true; bool msl_check_discarded_frag_stores = false; + bool msl_sample_dref_lod_array_as_grad = false; const char *msl_combined_sampler_suffix = nullptr; bool glsl_emit_push_constant_as_ubo = false; bool glsl_emit_ubo_as_plain_uniforms = false; @@ -947,6 +948,10 @@ static void print_help_msl() "\t\tSome Metal devices have a bug where stores to resources from a fragment shader\n" "\t\tcontinue to execute, even when the fragment is discarded. These checks\n" "\t\tprevent these stores from executing.\n" + "\t[--msl-sample-dref-lod-array-as-grad]:\n\t\tUse a gradient instead of a level argument.\n" + "\t\tSome Metal devices have a bug where the level() argument to\n" + "\t\tdepth2d_array::sample_compare() in a fragment shader is biased by some\n" + "\t\tunknown amount. This prevents the bias from being added.\n" "\t[--msl-combined-sampler-suffix ]:\n\t\tUses a custom suffix for combined samplers.\n"); // clang-format on } @@ -1221,6 +1226,7 @@ static string compile_iteration(const CLIArguments &args, std::vector msl_opts.force_sample_rate_shading = args.msl_force_sample_rate_shading; msl_opts.manual_helper_invocation_updates = args.msl_manual_helper_invocation_updates; msl_opts.check_discarded_frag_stores = args.msl_check_discarded_frag_stores; + msl_opts.sample_dref_lod_array_as_grad = args.msl_sample_dref_lod_array_as_grad; msl_opts.ios_support_base_vertex_instance = true; msl_comp->set_msl_options(msl_opts); for (auto &v : args.msl_discrete_descriptor_sets) @@ -1774,6 +1780,8 @@ static int main_inner(int argc, char *argv[]) cbs.add("--msl-no-manual-helper-invocation-updates", [&args](CLIParser &) { args.msl_manual_helper_invocation_updates = false; }); cbs.add("--msl-check-discarded-frag-stores", [&args](CLIParser &) { args.msl_check_discarded_frag_stores = true; }); + cbs.add("--msl-sample-dref-lod-array-as-grad", + [&args](CLIParser &) { args.msl_sample_dref_lod_array_as_grad = true; }); cbs.add("--msl-combined-sampler-suffix", [&args](CLIParser &parser) { args.msl_combined_sampler_suffix = parser.next_string(); }); diff --git a/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/spirv-cross/spirv_cross_c.cpp index 72614d78e..c8ebbe4ca 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.cpp +++ b/3rdparty/spirv-cross/spirv_cross_c.cpp @@ -738,6 +738,10 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c case SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER: options->msl.argument_buffers_tier = static_cast(value); break; + + case SPVC_COMPILER_OPTION_MSL_SAMPLE_DREF_LOD_ARRAY_AS_GRAD: + options->msl.sample_dref_lod_array_as_grad = value != 0; + break; #endif default: diff --git a/3rdparty/spirv-cross/spirv_cross_c.h b/3rdparty/spirv-cross/spirv_cross_c.h index 826e25a74..e39ff2c4e 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.h +++ b/3rdparty/spirv-cross/spirv_cross_c.h @@ -40,7 +40,7 @@ extern "C" { /* Bumped if ABI or API breaks backwards compatibility. */ #define SPVC_C_API_VERSION_MAJOR 0 /* Bumped if APIs or enumerations are added in a backwards compatible way. */ -#define SPVC_C_API_VERSION_MINOR 54 +#define SPVC_C_API_VERSION_MINOR 55 /* Bumped if internal implementation details change. */ #define SPVC_C_API_VERSION_PATCH 0 @@ -724,6 +724,7 @@ typedef enum spvc_compiler_option SPVC_COMPILER_OPTION_GLSL_ENABLE_ROW_MAJOR_LOAD_WORKAROUND = 83 | SPVC_COMPILER_OPTION_GLSL_BIT, SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER = 84 | SPVC_COMPILER_OPTION_MSL_BIT, + SPVC_COMPILER_OPTION_MSL_SAMPLE_DREF_LOD_ARRAY_AS_GRAD = 85 | SPVC_COMPILER_OPTION_MSL_BIT, SPVC_COMPILER_OPTION_INT_MAX = 0x7fffffff } spvc_compiler_option; diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 319cfac6f..48ed5efec 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -6467,7 +6467,10 @@ void CompilerGLSL::emit_unary_func_op(uint32_t result_type, uint32_t result_id, void CompilerGLSL::emit_binary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op) { - bool forward = should_forward(op0) && should_forward(op1); + // Opaque types (e.g. OpTypeSampledImage) must always be forwarded in GLSL + const auto &type = get_type(result_type); + bool must_forward = type_is_opaque_value(type); + bool forward = must_forward || (should_forward(op0) && should_forward(op1)); emit_op(result_type, result_id, join(op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), ")"), forward); inherit_expression_dependencies(result_id, op0); diff --git a/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/spirv-cross/spirv_hlsl.cpp index 5c885bd86..23ad2bf1d 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -3494,9 +3494,9 @@ void CompilerHLSL::emit_texture_op(const Instruction &i, bool sparse) else { auto &imgformat = get(imgtype.image.type); - if (imgformat.basetype != SPIRType::Float) + if (hlsl_options.shader_model < 67 && imgformat.basetype != SPIRType::Float) { - SPIRV_CROSS_THROW("Sampling non-float textures is not supported in HLSL."); + SPIRV_CROSS_THROW("Sampling non-float textures is not supported in HLSL SM < 6.7."); } if (hlsl_options.shader_model >= 40) diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index ac862c351..8f71c1699 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -1856,6 +1856,7 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: case OpAtomicIIncrement: case OpAtomicIDecrement: case OpAtomicIAdd: + case OpAtomicFAddEXT: case OpAtomicISub: case OpAtomicSMin: case OpAtomicUMin: @@ -7344,6 +7345,15 @@ void CompilerMSL::emit_specialization_constants_and_structs() emitted = false; declared_structs.clear(); + // It is possible to have multiple spec constants that use the same spec constant ID. + // The most common cause of this is defining spec constants in GLSL while also declaring + // the workgroup size to use those spec constants. But, Metal forbids declaring more than + // one variable with the same function constant ID. + // In this case, we must only declare one variable with the [[function_constant(id)]] + // attribute, and use its initializer to initialize all the spec constants with + // that ID. + std::unordered_map unique_func_constants; + for (auto &id_ : ir.ids_for_constant_undef_or_type) { auto &id = ir.ids[id_]; @@ -7367,7 +7377,11 @@ void CompilerMSL::emit_specialization_constants_and_structs() string sc_type_name = type_to_glsl(type); add_resource_name(c.self); string sc_name = to_name(c.self); - string sc_tmp_name = sc_name + "_tmp"; + uint32_t constant_id = get_decoration(c.self, DecorationSpecId); + if (!unique_func_constants.count(constant_id)) + unique_func_constants.insert(make_pair(constant_id, c.self)); + SPIRType::BaseType sc_tmp_type = expression_type(unique_func_constants[constant_id]).basetype; + string sc_tmp_name = to_name(unique_func_constants[constant_id]) + "_tmp"; // Function constants are only supported in MSL 1.2 and later. // If we don't support it just declare the "default" directly. @@ -7377,12 +7391,13 @@ void CompilerMSL::emit_specialization_constants_and_structs() if (msl_options.supports_msl_version(1, 2) && has_decoration(c.self, DecorationSpecId) && !c.is_used_as_array_length) { - uint32_t constant_id = get_decoration(c.self, DecorationSpecId); // Only scalar, non-composite values can be function constants. - statement("constant ", sc_type_name, " ", sc_tmp_name, " [[function_constant(", constant_id, - ")]];"); + if (unique_func_constants[constant_id] == c.self) + statement("constant ", sc_type_name, " ", sc_tmp_name, " [[function_constant(", constant_id, + ")]];"); statement("constant ", sc_type_name, " ", sc_name, " = is_function_constant_defined(", sc_tmp_name, - ") ? ", sc_tmp_name, " : ", constant_expression(c), ";"); + ") ? ", bitcast_expression(type, sc_tmp_type, sc_tmp_name), " : ", constant_expression(c), + ";"); } else if (has_decoration(c.self, DecorationSpecId)) { @@ -8593,6 +8608,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) break; case OpAtomicIAdd: + case OpAtomicFAddEXT: MSL_AFMO(add); break; @@ -10823,7 +10839,8 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool // We will detect a compile-time constant 0 value for gradient and promote that to level(0) on MSL. bool constant_zero_x = !grad_x || expression_is_constant_null(grad_x); bool constant_zero_y = !grad_y || expression_is_constant_null(grad_y); - if (constant_zero_x && constant_zero_y) + if (constant_zero_x && constant_zero_y && + (!imgtype.image.arrayed || !msl_options.sample_dref_lod_array_as_grad)) { lod = 0; grad_x = 0; @@ -10869,6 +10886,52 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool { farg_str += ", " + to_expression(lod); } + else if (msl_options.sample_dref_lod_array_as_grad && args.dref && imgtype.image.arrayed) + { + if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 3)) + SPIRV_CROSS_THROW("Using non-constant 0.0 gradient() qualifier for sample_compare. This is not " + "supported on macOS prior to MSL 2.3."); + // Some Metal devices have a bug where the LoD is erroneously biased upward + // when using a level() argument. Since this doesn't happen as much with gradient2d(), + // if we perform the LoD calculation in reverse, we can pass a gradient + // instead. + // lod = log2(rhoMax/eta) -> exp2(lod) = rhoMax/eta + // If we make all of the scale factors the same, eta will be 1 and + // exp2(lod) = rho. + // rhoX = dP/dx * extent; rhoY = dP/dy * extent + // Therefore, dP/dx = dP/dy = exp2(lod)/extent. + // (Subtracting 0.5 before exponentiation gives better results.) + string grad_opt, extent; + switch (imgtype.image.dim) + { + case Dim1D: + grad_opt = "2d"; + extent = join("float2(", to_expression(img), ".get_width(), 1.0)"); + break; + case Dim2D: + grad_opt = "2d"; + extent = join("float2(", to_expression(img), ".get_width(), ", to_expression(img), ".get_height())"); + break; + case DimCube: + if (imgtype.image.arrayed && msl_options.emulate_cube_array) + { + grad_opt = "2d"; + extent = join("float2(", to_expression(img), ".get_width())"); + } + else + { + grad_opt = "cube"; + extent = join("float3(", to_expression(img), ".get_width())"); + } + break; + default: + grad_opt = "unsupported_gradient_dimension"; + extent = "float3(1.0)"; + break; + } + farg_str += join(", gradient", grad_opt, "(exp2(", to_expression(lod), " - 0.5) / ", extent, ", exp2(", + to_expression(lod), " - 0.5) / ", extent, ")"); + } else { farg_str += ", level(" + to_expression(lod) + ")"; @@ -11002,7 +11065,7 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool // If the texture coordinates are floating point, invokes MSL round() function to round them. string CompilerMSL::round_fp_tex_coords(string tex_coords, bool coord_is_fp) { - return coord_is_fp ? ("round(" + tex_coords + ")") : tex_coords; + return coord_is_fp ? ("rint(" + tex_coords + ")") : tex_coords; } // Returns a string to use in an image sampling function argument. @@ -16253,6 +16316,7 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui case OpAtomicIIncrement: case OpAtomicIDecrement: case OpAtomicIAdd: + case OpAtomicFAddEXT: case OpAtomicISub: case OpAtomicSMin: case OpAtomicUMin: @@ -16458,6 +16522,7 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o case OpAtomicIIncrement: case OpAtomicIDecrement: case OpAtomicIAdd: + case OpAtomicFAddEXT: case OpAtomicISub: case OpAtomicSMin: case OpAtomicUMin: diff --git a/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/spirv-cross/spirv_msl.hpp index 9493219e0..2bc17b122 100644 --- a/3rdparty/spirv-cross/spirv_msl.hpp +++ b/3rdparty/spirv-cross/spirv_msl.hpp @@ -487,6 +487,15 @@ public: // only when the bug is present. bool check_discarded_frag_stores = false; + // If set, Lod operands to OpImageSample*DrefExplicitLod for 1D and 2D array images + // will be implemented using a gradient instead of passing the level operand directly. + // Some Metal devices have a bug where the level() argument to depth2d_array::sample_compare() + // in a fragment shader is biased by some unknown amount, possibly dependent on the + // partial derivatives of the texture coordinates. This is a workaround that is only + // expected to be needed until the bug is fixed in Metal; it is provided as an option + // so it can be enabled only when the bug is present. + bool sample_dref_lod_array_as_grad = false; + bool is_ios() const { return platform == iOS; From b9d0d5474f110d29e251b9ea99faf5e857fc2a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:29:34 -0700 Subject: [PATCH 50/86] Updated vulkan headers. --- 3rdparty/khronos/vulkan-local/vk_layer.h | 8 - 3rdparty/khronos/vulkan-local/vk_platform.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan.h | 10 +- .../khronos/vulkan-local/vulkan_android.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_beta.h | 227 +++++++----------- 3rdparty/khronos/vulkan-local/vulkan_core.h | 147 +++++++++--- .../khronos/vulkan-local/vulkan_directfb.h | 2 +- .../khronos/vulkan-local/vulkan_fuchsia.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_ggp.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_ios.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_macos.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_metal.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_screen.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_vi.h | 2 +- .../khronos/vulkan-local/vulkan_wayland.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_win32.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_xcb.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_xlib.h | 2 +- .../khronos/vulkan-local/vulkan_xlib_xrandr.h | 2 +- 19 files changed, 222 insertions(+), 200 deletions(-) diff --git a/3rdparty/khronos/vulkan-local/vk_layer.h b/3rdparty/khronos/vulkan-local/vk_layer.h index 6bd1c9a03..7954f71d8 100644 --- a/3rdparty/khronos/vulkan-local/vk_layer.h +++ b/3rdparty/khronos/vulkan-local/vk_layer.h @@ -28,14 +28,6 @@ #include "vulkan_core.h" -#if defined(__GNUC__) && __GNUC__ >= 4 -#define VK_LAYER_EXPORT __attribute__((visibility("default"))) -#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) -#define VK_LAYER_EXPORT __attribute__((visibility("default"))) -#else -#define VK_LAYER_EXPORT -#endif - #define MAX_NUM_UNKNOWN_EXTS 250 // Loader-Layer version negotiation API. Versions add the following features: diff --git a/3rdparty/khronos/vulkan-local/vk_platform.h b/3rdparty/khronos/vulkan-local/vk_platform.h index 3ff8c5d14..ed67a6004 100644 --- a/3rdparty/khronos/vulkan-local/vk_platform.h +++ b/3rdparty/khronos/vulkan-local/vk_platform.h @@ -2,7 +2,7 @@ // File: vk_platform.h // /* -** Copyright 2014-2022 The Khronos Group Inc. +** Copyright 2014-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan.h b/3rdparty/khronos/vulkan-local/vulkan.h index 3510ac912..426cff58d 100644 --- a/3rdparty/khronos/vulkan-local/vulkan.h +++ b/3rdparty/khronos/vulkan-local/vulkan.h @@ -2,7 +2,7 @@ #define VULKAN_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -84,6 +84,14 @@ #include "vulkan_screen.h" #endif + +#ifdef VK_USE_PLATFORM_SCI +#include +#include +#include "vulkan_sci.h" +#endif + + #ifdef VK_ENABLE_BETA_EXTENSIONS #include "vulkan_beta.h" #endif diff --git a/3rdparty/khronos/vulkan-local/vulkan_android.h b/3rdparty/khronos/vulkan-local/vulkan_android.h index 11f539796..2e1dfa9ba 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_android.h +++ b/3rdparty/khronos/vulkan-local/vulkan_android.h @@ -2,7 +2,7 @@ #define VULKAN_ANDROID_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_beta.h b/3rdparty/khronos/vulkan-local/vulkan_beta.h index cfeda0eb3..a118d7721 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_beta.h +++ b/3rdparty/khronos/vulkan-local/vulkan_beta.h @@ -2,7 +2,7 @@ #define VULKAN_BETA_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -51,7 +51,7 @@ typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR { #define VK_KHR_video_encode_queue 1 -#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 7 +#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 8 #define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" typedef enum VkVideoEncodeTuningModeKHR { @@ -71,13 +71,21 @@ typedef enum VkVideoEncodeCapabilityFlagBitsKHR { typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; typedef enum VkVideoEncodeRateControlModeFlagBitsKHR { - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR = 0, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 1, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 2, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0x00000004, VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkVideoEncodeRateControlModeFlagBitsKHR; typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; +typedef enum VkVideoEncodeFeedbackFlagBitsKHR { + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_FEEDBACK_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeFeedbackFlagBitsKHR; +typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; + typedef enum VkVideoEncodeUsageFlagBitsKHR { VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0, VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, @@ -102,9 +110,9 @@ typedef struct VkVideoEncodeInfoKHR { const void* pNext; VkVideoEncodeFlagsKHR flags; uint32_t qualityLevel; - VkBuffer dstBitstreamBuffer; - VkDeviceSize dstBitstreamBufferOffset; - VkDeviceSize dstBitstreamBufferMaxRange; + VkBuffer dstBuffer; + VkDeviceSize dstBufferOffset; + VkDeviceSize dstBufferRange; VkVideoPictureResourceInfoKHR srcPictureResource; const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; uint32_t referenceSlotCount; @@ -117,11 +125,18 @@ typedef struct VkVideoEncodeCapabilitiesKHR { void* pNext; VkVideoEncodeCapabilityFlagsKHR flags; VkVideoEncodeRateControlModeFlagsKHR rateControlModes; - uint8_t rateControlLayerCount; - uint8_t qualityLevelCount; + uint32_t maxRateControlLayers; + uint32_t maxQualityLevels; VkExtent2D inputImageDataFillAlignment; + VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags; } VkVideoEncodeCapabilitiesKHR; +typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags; +} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR; + typedef struct VkVideoEncodeUsageInfoKHR { VkStructureType sType; const void* pNext; @@ -133,8 +148,8 @@ typedef struct VkVideoEncodeUsageInfoKHR { typedef struct VkVideoEncodeRateControlLayerInfoKHR { VkStructureType sType; const void* pNext; - uint32_t averageBitrate; - uint32_t maxBitrate; + uint64_t averageBitrate; + uint64_t maxBitrate; uint32_t frameRateNumerator; uint32_t frameRateDenominator; uint32_t virtualBufferSizeInMs; @@ -146,8 +161,8 @@ typedef struct VkVideoEncodeRateControlInfoKHR { const void* pNext; VkVideoEncodeRateControlFlagsKHR flags; VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode; - uint8_t layerCount; - const VkVideoEncodeRateControlLayerInfoKHR* pLayerConfigs; + uint32_t layerCount; + const VkVideoEncodeRateControlLayerInfoKHR* pLayers; } VkVideoEncodeRateControlInfoKHR; typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo); @@ -162,7 +177,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR( #define VK_EXT_video_encode_h264 1 #include "vk_video/vulkan_video_codec_h264std.h" #include "vk_video/vulkan_video_codec_h264std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 9 +#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 10 #define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264" typedef enum VkVideoEncodeH264RateControlStructureEXT { @@ -198,34 +213,17 @@ typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT { VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT = 0x00400000, VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x00800000, VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x01000000, + VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_REFERENCE_FINAL_LISTS_BIT_EXT = 0x02000000, VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF } VkVideoEncodeH264CapabilityFlagBitsEXT; typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT; - -typedef enum VkVideoEncodeH264InputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_INPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264InputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264InputModeFlagsEXT; - -typedef enum VkVideoEncodeH264OutputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264OutputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264OutputModeFlagsEXT; typedef struct VkVideoEncodeH264CapabilitiesEXT { VkStructureType sType; void* pNext; VkVideoEncodeH264CapabilityFlagsEXT flags; - VkVideoEncodeH264InputModeFlagsEXT inputModeFlags; - VkVideoEncodeH264OutputModeFlagsEXT outputModeFlags; - uint8_t maxPPictureL0ReferenceCount; - uint8_t maxBPictureL0ReferenceCount; - uint8_t maxL1ReferenceCount; + uint32_t maxPPictureL0ReferenceCount; + uint32_t maxBPictureL0ReferenceCount; + uint32_t maxL1ReferenceCount; VkBool32 motionVectorsOverPicBoundariesFlag; uint32_t maxBytesPerPicDenom; uint32_t maxBitsPerMbDenom; @@ -250,48 +248,28 @@ typedef struct VkVideoEncodeH264SessionParametersCreateInfoEXT { const VkVideoEncodeH264SessionParametersAddInfoEXT* pParametersAddInfo; } VkVideoEncodeH264SessionParametersCreateInfoEXT; -typedef struct VkVideoEncodeH264DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - int8_t slotIndex; - const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo; -} VkVideoEncodeH264DpbSlotInfoEXT; - -typedef struct VkVideoEncodeH264ReferenceListsInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t referenceList0EntryCount; - const VkVideoEncodeH264DpbSlotInfoEXT* pReferenceList0Entries; - uint8_t referenceList1EntryCount; - const VkVideoEncodeH264DpbSlotInfoEXT* pReferenceList1Entries; - const StdVideoEncodeH264RefMemMgmtCtrlOperations* pMemMgmtCtrlOperations; -} VkVideoEncodeH264ReferenceListsInfoEXT; - typedef struct VkVideoEncodeH264NaluSliceInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t mbCount; - const VkVideoEncodeH264ReferenceListsInfoEXT* pReferenceFinalLists; - const StdVideoEncodeH264SliceHeader* pSliceHeaderStd; + VkStructureType sType; + const void* pNext; + uint32_t mbCount; + const StdVideoEncodeH264ReferenceListsInfo* pStdReferenceFinalLists; + const StdVideoEncodeH264SliceHeader* pStdSliceHeader; } VkVideoEncodeH264NaluSliceInfoEXT; typedef struct VkVideoEncodeH264VclFrameInfoEXT { - VkStructureType sType; - const void* pNext; - const VkVideoEncodeH264ReferenceListsInfoEXT* pReferenceFinalLists; - uint32_t naluSliceEntryCount; - const VkVideoEncodeH264NaluSliceInfoEXT* pNaluSliceEntries; - const StdVideoEncodeH264PictureInfo* pCurrentPictureInfo; + VkStructureType sType; + const void* pNext; + const StdVideoEncodeH264ReferenceListsInfo* pStdReferenceFinalLists; + uint32_t naluSliceEntryCount; + const VkVideoEncodeH264NaluSliceInfoEXT* pNaluSliceEntries; + const StdVideoEncodeH264PictureInfo* pStdPictureInfo; } VkVideoEncodeH264VclFrameInfoEXT; -typedef struct VkVideoEncodeH264EmitPictureParametersInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t spsId; - VkBool32 emitSpsEnable; - uint32_t ppsIdEntryCount; - const uint8_t* ppsIdEntries; -} VkVideoEncodeH264EmitPictureParametersInfoEXT; +typedef struct VkVideoEncodeH264DpbSlotInfoEXT { + VkStructureType sType; + const void* pNext; + const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo; +} VkVideoEncodeH264DpbSlotInfoEXT; typedef struct VkVideoEncodeH264ProfileInfoEXT { VkStructureType sType; @@ -306,7 +284,7 @@ typedef struct VkVideoEncodeH264RateControlInfoEXT { uint32_t idrPeriod; uint32_t consecutiveBFrameCount; VkVideoEncodeH264RateControlStructureEXT rateControlStructure; - uint8_t temporalLayerCount; + uint32_t temporalLayerCount; } VkVideoEncodeH264RateControlInfoEXT; typedef struct VkVideoEncodeH264QpEXT { @@ -324,7 +302,7 @@ typedef struct VkVideoEncodeH264FrameSizeEXT { typedef struct VkVideoEncodeH264RateControlLayerInfoEXT { VkStructureType sType; const void* pNext; - uint8_t temporalLayerId; + uint32_t temporalLayerId; VkBool32 useInitialRcQp; VkVideoEncodeH264QpEXT initialRcQp; VkBool32 useMinQp; @@ -340,7 +318,7 @@ typedef struct VkVideoEncodeH264RateControlLayerInfoEXT { #define VK_EXT_video_encode_h265 1 #include "vk_video/vulkan_video_codec_h265std.h" #include "vk_video/vulkan_video_codec_h265std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 9 +#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 10 #define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265" typedef enum VkVideoEncodeH265RateControlStructureEXT { @@ -377,26 +355,11 @@ typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT { VK_VIDEO_ENCODE_H265_CAPABILITY_DEPENDENT_SLICE_SEGMENT_BIT_EXT = 0x00800000, VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x01000000, VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x02000000, + VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_REFERENCE_FINAL_LISTS_BIT_EXT = 0x04000000, VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF } VkVideoEncodeH265CapabilityFlagBitsEXT; typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT; -typedef enum VkVideoEncodeH265InputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_INPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265InputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265InputModeFlagsEXT; - -typedef enum VkVideoEncodeH265OutputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265OutputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265OutputModeFlagsEXT; - typedef enum VkVideoEncodeH265CtbSizeFlagBitsEXT { VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0x00000001, VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0x00000002, @@ -417,25 +380,23 @@ typedef struct VkVideoEncodeH265CapabilitiesEXT { VkStructureType sType; void* pNext; VkVideoEncodeH265CapabilityFlagsEXT flags; - VkVideoEncodeH265InputModeFlagsEXT inputModeFlags; - VkVideoEncodeH265OutputModeFlagsEXT outputModeFlags; VkVideoEncodeH265CtbSizeFlagsEXT ctbSizes; VkVideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes; - uint8_t maxPPictureL0ReferenceCount; - uint8_t maxBPictureL0ReferenceCount; - uint8_t maxL1ReferenceCount; - uint8_t maxSubLayersCount; - uint8_t minLog2MinLumaCodingBlockSizeMinus3; - uint8_t maxLog2MinLumaCodingBlockSizeMinus3; - uint8_t minLog2MinLumaTransformBlockSizeMinus2; - uint8_t maxLog2MinLumaTransformBlockSizeMinus2; - uint8_t minMaxTransformHierarchyDepthInter; - uint8_t maxMaxTransformHierarchyDepthInter; - uint8_t minMaxTransformHierarchyDepthIntra; - uint8_t maxMaxTransformHierarchyDepthIntra; - uint8_t maxDiffCuQpDeltaDepth; - uint8_t minMaxNumMergeCand; - uint8_t maxMaxNumMergeCand; + uint32_t maxPPictureL0ReferenceCount; + uint32_t maxBPictureL0ReferenceCount; + uint32_t maxL1ReferenceCount; + uint32_t maxSubLayersCount; + uint32_t minLog2MinLumaCodingBlockSizeMinus3; + uint32_t maxLog2MinLumaCodingBlockSizeMinus3; + uint32_t minLog2MinLumaTransformBlockSizeMinus2; + uint32_t maxLog2MinLumaTransformBlockSizeMinus2; + uint32_t minMaxTransformHierarchyDepthInter; + uint32_t maxMaxTransformHierarchyDepthInter; + uint32_t minMaxTransformHierarchyDepthIntra; + uint32_t maxMaxTransformHierarchyDepthIntra; + uint32_t maxDiffCuQpDeltaDepth; + uint32_t minMaxNumMergeCand; + uint32_t maxMaxNumMergeCand; } VkVideoEncodeH265CapabilitiesEXT; typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT { @@ -458,50 +419,28 @@ typedef struct VkVideoEncodeH265SessionParametersCreateInfoEXT { const VkVideoEncodeH265SessionParametersAddInfoEXT* pParametersAddInfo; } VkVideoEncodeH265SessionParametersCreateInfoEXT; -typedef struct VkVideoEncodeH265DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - int8_t slotIndex; - const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo; -} VkVideoEncodeH265DpbSlotInfoEXT; - -typedef struct VkVideoEncodeH265ReferenceListsInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t referenceList0EntryCount; - const VkVideoEncodeH265DpbSlotInfoEXT* pReferenceList0Entries; - uint8_t referenceList1EntryCount; - const VkVideoEncodeH265DpbSlotInfoEXT* pReferenceList1Entries; - const StdVideoEncodeH265ReferenceModifications* pReferenceModifications; -} VkVideoEncodeH265ReferenceListsInfoEXT; - typedef struct VkVideoEncodeH265NaluSliceSegmentInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t ctbCount; - const VkVideoEncodeH265ReferenceListsInfoEXT* pReferenceFinalLists; - const StdVideoEncodeH265SliceSegmentHeader* pSliceSegmentHeaderStd; + VkStructureType sType; + const void* pNext; + uint32_t ctbCount; + const StdVideoEncodeH265ReferenceListsInfo* pStdReferenceFinalLists; + const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader; } VkVideoEncodeH265NaluSliceSegmentInfoEXT; typedef struct VkVideoEncodeH265VclFrameInfoEXT { VkStructureType sType; const void* pNext; - const VkVideoEncodeH265ReferenceListsInfoEXT* pReferenceFinalLists; + const StdVideoEncodeH265ReferenceListsInfo* pStdReferenceFinalLists; uint32_t naluSliceSegmentEntryCount; const VkVideoEncodeH265NaluSliceSegmentInfoEXT* pNaluSliceSegmentEntries; - const StdVideoEncodeH265PictureInfo* pCurrentPictureInfo; + const StdVideoEncodeH265PictureInfo* pStdPictureInfo; } VkVideoEncodeH265VclFrameInfoEXT; -typedef struct VkVideoEncodeH265EmitPictureParametersInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t vpsId; - uint8_t spsId; - VkBool32 emitVpsEnable; - VkBool32 emitSpsEnable; - uint32_t ppsIdEntryCount; - const uint8_t* ppsIdEntries; -} VkVideoEncodeH265EmitPictureParametersInfoEXT; +typedef struct VkVideoEncodeH265DpbSlotInfoEXT { + VkStructureType sType; + const void* pNext; + const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo; +} VkVideoEncodeH265DpbSlotInfoEXT; typedef struct VkVideoEncodeH265ProfileInfoEXT { VkStructureType sType; @@ -516,7 +455,7 @@ typedef struct VkVideoEncodeH265RateControlInfoEXT { uint32_t idrPeriod; uint32_t consecutiveBFrameCount; VkVideoEncodeH265RateControlStructureEXT rateControlStructure; - uint8_t subLayerCount; + uint32_t subLayerCount; } VkVideoEncodeH265RateControlInfoEXT; typedef struct VkVideoEncodeH265QpEXT { @@ -534,7 +473,7 @@ typedef struct VkVideoEncodeH265FrameSizeEXT { typedef struct VkVideoEncodeH265RateControlLayerInfoEXT { VkStructureType sType; const void* pNext; - uint8_t temporalId; + uint32_t temporalId; VkBool32 useInitialRcQp; VkVideoEncodeH265QpEXT initialRcQp; VkBool32 useMinQp; diff --git a/3rdparty/khronos/vulkan-local/vulkan_core.h b/3rdparty/khronos/vulkan-local/vulkan_core.h index e8fe54828..eee2051e8 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_core.h +++ b/3rdparty/khronos/vulkan-local/vulkan_core.h @@ -2,7 +2,7 @@ #define VULKAN_CORE_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -58,37 +58,37 @@ extern "C" { #endif #endif -// DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. -#define VK_MAKE_VERSION(major, minor, patch) \ - ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) +#define VK_MAKE_API_VERSION(variant, major, minor, patch) \ + ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) // DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. -//#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 - -#define VK_MAKE_API_VERSION(variant, major, minor, patch) \ - ((((uint32_t)(variant)) << 29) | (((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) +//#define VK_API_VERSION VK_MAKE_API_VERSION(0, 1, 0, 0) // Patch version should always be set to 0 // Vulkan 1.0 version number #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 240 +#define VK_HEADER_VERSION 243 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) +// DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. +#define VK_MAKE_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) + // DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead. -#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22U) // DEPRECATED: This define is deprecated. VK_API_VERSION_MINOR should be used instead. -#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3FFU) +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) // DEPRECATED: This define is deprecated. VK_API_VERSION_PATCH should be used instead. #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) -#define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29) -#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22) & 0x7FU) -#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3FFU) +#define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U) +#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) +#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) #define VK_API_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) typedef uint32_t VkBool32; typedef uint64_t VkDeviceAddress; @@ -181,6 +181,9 @@ typedef enum VkResult { VK_THREAD_DONE_KHR = 1000268001, VK_OPERATION_DEFERRED_KHR = 1000268002, VK_OPERATION_NOT_DEFERRED_KHR = 1000268003, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR = -1000299000, +#endif VK_ERROR_COMPRESSION_EXHAUSTED_EXT = -1000338000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, @@ -480,9 +483,6 @@ typedef enum VkStructureType { #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT = 1000038005, #endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT = 1000038006, -#endif #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT = 1000038007, #endif @@ -492,9 +492,6 @@ typedef enum VkStructureType { #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT = 1000038009, #endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_REFERENCE_LISTS_INFO_EXT = 1000038010, -#endif #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT = 1000039000, #endif @@ -513,15 +510,9 @@ typedef enum VkStructureType { #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT = 1000039005, #endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_INFO_EXT = 1000039006, -#endif #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT = 1000039007, #endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_REFERENCE_LISTS_INFO_EXT = 1000039008, -#endif #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT = 1000039009, #endif @@ -828,9 +819,13 @@ typedef enum VkStructureType { #endif #ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR = 1000299004, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR = 1000299005, #endif VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV = 1000300000, VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV = 1000300001, + VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV = 1000310000, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT = 1000311000, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT = 1000311001, VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT = 1000311002, @@ -951,6 +946,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = 1000411001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = 1000412000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM = 1000415000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT = 1000418000, + VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT = 1000418001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE = 1000420000, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE = 1000420001, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE = 1000420002, @@ -1002,6 +1000,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM = 1000510000, + VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM = 1000510001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, @@ -1292,6 +1292,7 @@ typedef enum VkVendorId { VK_VENDOR_ID_CODEPLAY = 0x10004, VK_VENDOR_ID_MESA = 0x10005, VK_VENDOR_ID_POCL = 0x10006, + VK_VENDOR_ID_MOBILEYE = 0x10007, VK_VENDOR_ID_MAX_ENUM = 0x7FFFFFFF } VkVendorId; @@ -1650,7 +1651,7 @@ typedef enum VkQueryType { VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000, VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL = 1000210000, #ifdef VK_ENABLE_BETA_EXTENSIONS - VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR = 1000299000, + VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR = 1000299000, #endif VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT = 1000328000, VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT = 1000382000, @@ -1806,10 +1807,13 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE = 1000377004, VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT = 1000099001, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT = 1000099002, VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR = 1000347000, VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1000164004, VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1000164006, + VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV = 1000205000, VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001, VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR = 1000226000, VK_DYNAMIC_STATE_LINE_STIPPLE_EXT = 1000259000, @@ -11165,7 +11169,7 @@ typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { #define VK_EXT_discard_rectangles 1 -#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 +#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 2 #define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" typedef enum VkDiscardRectangleModeEXT { @@ -11190,6 +11194,8 @@ typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { } VkPipelineDiscardRectangleStateCreateInfoEXT; typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleModeEXT)(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( @@ -11197,6 +11203,14 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 discardRectangleEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleModeEXT( + VkCommandBuffer commandBuffer, + VkDiscardRectangleModeEXT discardRectangleMode); #endif @@ -12617,7 +12631,7 @@ typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV { #define VK_NV_scissor_exclusive 1 -#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 1 +#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 2 #define VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME "VK_NV_scissor_exclusive" typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV { VkStructureType sType; @@ -12632,9 +12646,16 @@ typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV { VkBool32 exclusiveScissor; } VkPhysicalDeviceExclusiveScissorFeaturesNV; +typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorEnableNV)(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32* pExclusiveScissorEnables); typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorNV)(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors); #ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetExclusiveScissorEnableNV( + VkCommandBuffer commandBuffer, + uint32_t firstExclusiveScissor, + uint32_t exclusiveScissorCount, + const VkBool32* pExclusiveScissorEnables); + VKAPI_ATTR void VKAPI_CALL vkCmdSetExclusiveScissorNV( VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, @@ -13527,21 +13548,21 @@ typedef struct VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT { typedef struct VkSwapchainPresentFenceInfoEXT { VkStructureType sType; - void* pNext; + const void* pNext; uint32_t swapchainCount; const VkFence* pFences; } VkSwapchainPresentFenceInfoEXT; typedef struct VkSwapchainPresentModesCreateInfoEXT { VkStructureType sType; - void* pNext; + const void* pNext; uint32_t presentModeCount; const VkPresentModeKHR* pPresentModes; } VkSwapchainPresentModesCreateInfoEXT; typedef struct VkSwapchainPresentModeInfoEXT { VkStructureType sType; - void* pNext; + const void* pNext; uint32_t swapchainCount; const VkPresentModeKHR* pPresentModes; } VkSwapchainPresentModeInfoEXT; @@ -14041,6 +14062,17 @@ typedef struct VkDeviceDiagnosticsConfigCreateInfoNV { #define VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME "VK_QCOM_render_pass_store_ops" +#define VK_NV_low_latency 1 +#define VK_NV_LOW_LATENCY_SPEC_VERSION 1 +#define VK_NV_LOW_LATENCY_EXTENSION_NAME "VK_NV_low_latency" +typedef struct VkQueryLowLatencySupportNV { + VkStructureType sType; + const void* pNext; + void* pQueriedLowLatencyData; +} VkQueryLowLatencySupportNV; + + + #define VK_EXT_descriptor_buffer 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR) #define VK_EXT_DESCRIPTOR_BUFFER_SPEC_VERSION 1 @@ -15439,6 +15471,7 @@ typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI { uint32_t maxWorkGroupCount[3]; uint32_t maxWorkGroupSize[3]; uint32_t maxOutputClusterCount; + VkDeviceSize indirectBufferOffsetAlignment; } VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI; typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterHUAWEI)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); @@ -15496,6 +15529,38 @@ VKAPI_ATTR void VKAPI_CALL vkSetDeviceMemoryPriorityEXT( #endif +#define VK_ARM_shader_core_properties 1 +#define VK_ARM_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 +#define VK_ARM_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_ARM_shader_core_properties" +typedef struct VkPhysicalDeviceShaderCorePropertiesARM { + VkStructureType sType; + void* pNext; + uint32_t pixelRate; + uint32_t texelRate; + uint32_t fmaRate; +} VkPhysicalDeviceShaderCorePropertiesARM; + + + +#define VK_EXT_image_sliced_view_of_3d 1 +#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_SPEC_VERSION 1 +#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_sliced_view_of_3d" +#define VK_REMAINING_3D_SLICES_EXT (~0U) +typedef struct VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 imageSlicedViewOf3D; +} VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT; + +typedef struct VkImageViewSlicedCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t sliceOffset; + uint32_t sliceCount; +} VkImageViewSlicedCreateInfoEXT; + + + #define VK_VALVE_descriptor_set_host_mapping 1 #define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION 1 #define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME "VK_VALVE_descriptor_set_host_mapping" @@ -16414,6 +16479,24 @@ typedef struct VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT { +#define VK_QCOM_multiview_per_view_render_areas 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_SPEC_VERSION 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_EXTENSION_NAME "VK_QCOM_multiview_per_view_render_areas" +typedef struct VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 multiviewPerViewRenderAreas; +} VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM; + +typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM { + VkStructureType sType; + const void* pNext; + uint32_t perViewRenderAreaCount; + const VkRect2D* pPerViewRenderAreas; +} VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM; + + + #define VK_KHR_acceleration_structure 1 #define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 #define VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME "VK_KHR_acceleration_structure" diff --git a/3rdparty/khronos/vulkan-local/vulkan_directfb.h b/3rdparty/khronos/vulkan-local/vulkan_directfb.h index ab3504efa..81d22fa7a 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_directfb.h +++ b/3rdparty/khronos/vulkan-local/vulkan_directfb.h @@ -2,7 +2,7 @@ #define VULKAN_DIRECTFB_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h b/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h index 61774ff9c..c11d9e65b 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h +++ b/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h @@ -2,7 +2,7 @@ #define VULKAN_FUCHSIA_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_ggp.h b/3rdparty/khronos/vulkan-local/vulkan_ggp.h index 19dfd2261..2c0d5edf1 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_ggp.h +++ b/3rdparty/khronos/vulkan-local/vulkan_ggp.h @@ -2,7 +2,7 @@ #define VULKAN_GGP_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_ios.h b/3rdparty/khronos/vulkan-local/vulkan_ios.h index 579220543..8c6d9e72a 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_ios.h +++ b/3rdparty/khronos/vulkan-local/vulkan_ios.h @@ -2,7 +2,7 @@ #define VULKAN_IOS_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_macos.h b/3rdparty/khronos/vulkan-local/vulkan_macos.h index 8e197c7cf..3310e11ab 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_macos.h +++ b/3rdparty/khronos/vulkan-local/vulkan_macos.h @@ -2,7 +2,7 @@ #define VULKAN_MACOS_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_metal.h b/3rdparty/khronos/vulkan-local/vulkan_metal.h index 11b964091..7127651c1 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_metal.h +++ b/3rdparty/khronos/vulkan-local/vulkan_metal.h @@ -2,7 +2,7 @@ #define VULKAN_METAL_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_screen.h b/3rdparty/khronos/vulkan-local/vulkan_screen.h index f0ef40a6c..1067c0463 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_screen.h +++ b/3rdparty/khronos/vulkan-local/vulkan_screen.h @@ -2,7 +2,7 @@ #define VULKAN_SCREEN_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_vi.h b/3rdparty/khronos/vulkan-local/vulkan_vi.h index 0355e7a16..672647053 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_vi.h +++ b/3rdparty/khronos/vulkan-local/vulkan_vi.h @@ -2,7 +2,7 @@ #define VULKAN_VI_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_wayland.h b/3rdparty/khronos/vulkan-local/vulkan_wayland.h index 9afd0b76d..42b280184 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_wayland.h +++ b/3rdparty/khronos/vulkan-local/vulkan_wayland.h @@ -2,7 +2,7 @@ #define VULKAN_WAYLAND_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_win32.h b/3rdparty/khronos/vulkan-local/vulkan_win32.h index a8e46c89b..5b65a36a6 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_win32.h +++ b/3rdparty/khronos/vulkan-local/vulkan_win32.h @@ -2,7 +2,7 @@ #define VULKAN_WIN32_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_xcb.h b/3rdparty/khronos/vulkan-local/vulkan_xcb.h index 68e61b88f..b49aa4e2c 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_xcb.h +++ b/3rdparty/khronos/vulkan-local/vulkan_xcb.h @@ -2,7 +2,7 @@ #define VULKAN_XCB_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_xlib.h b/3rdparty/khronos/vulkan-local/vulkan_xlib.h index ea5360ab6..186cdd5ef 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_xlib.h +++ b/3rdparty/khronos/vulkan-local/vulkan_xlib.h @@ -2,7 +2,7 @@ #define VULKAN_XLIB_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h b/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h index 8fc35cfc5..9a3b62991 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h +++ b/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h @@ -2,7 +2,7 @@ #define VULKAN_XLIB_XRANDR_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2023 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ From 954c18b41743e706c28cf1cdfb8eb4ccc215c6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 16 Mar 2023 20:29:57 -0700 Subject: [PATCH 51/86] Updated version number. --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index 4f2407d61..c618aeb63 100644 --- a/src/version.h +++ b/src/version.h @@ -9,5 +9,5 @@ * */ -#define BGFX_REV_NUMBER 8427 -#define BGFX_REV_SHA1 "dcf926f624b9642769f8486e789ec26c74e34f4b" +#define BGFX_REV_NUMBER 8444 +#define BGFX_REV_SHA1 "b9d0d5474f110d29e251b9ea99faf5e857fc2a3b" From bd7a01aa8a6a001191da4bbfdddb3fdf057912fb Mon Sep 17 00:00:00 2001 From: simon chen Date: Sat, 18 Mar 2023 10:49:42 +0800 Subject: [PATCH 52/86] fix unused uniforms replace when multi uniform defined in one line and there is some unused uniforms in that line. (#3056) --- tools/shaderc/shaderc_hlsl.cpp | 63 ++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 2397304cd..2d43e3514 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -704,39 +704,52 @@ namespace bgfx { namespace hlsl while (!reader.isDone() ) { bx::StringView strLine = reader.next(); - bool found = false; - - for (UniformNameList::iterator it = unusedUniforms.begin(), itEnd = unusedUniforms.end(); it != itEnd; ++it) + std::string replaceOutput; + bx::StringView str = strFind(strLine, "uniform "); + if (!str.isEmpty()) { - bx::StringView str = strFind(strLine, "uniform "); - if (str.isEmpty() ) + std::string lineToReplace(strLine.getPtr(), 0, strLine.getLength()); + for (UniformNameList::iterator it = unusedUniforms.begin(); it != unusedUniforms.end();) { - continue; - } - - // matching lines like: uniform u_name; - // we want to replace "uniform" with "static" so that it's no longer - // included in the uniform blob that the application must upload - // we can't just remove them, because unused functions might still reference - // them and cause a compile error when they're gone - if (!bx::findIdentifierMatch(strLine, it->c_str() ).isEmpty() ) - { - output.append(strLine.getPtr(), str.getPtr() ); - output += "static "; - output.append(str.getTerm(), strLine.getTerm() ); - output += "\n"; - found = true; - - unusedUniforms.erase(it); - break; + // matching lines like: uniform u_name; + // we want to replace "uniform" with "static" so that it's no longer + // included in the uniform blob that the application must upload + // we can't just remove them, because unused functions might still reference + // them and cause a compile error when they're gone + auto identifier = bx::findIdentifierMatch(strLine, it->c_str()); + if (!identifier.isEmpty()) + { + bx::StringView definePrefix = bx::StringView(strLine.getPtr(), identifier.getPtr()); + bx::StringView semicolon = strRFind(definePrefix, ';'); + if (!semicolon.isEmpty()) + { + bx::StringView uniformDefine = bx::StringView(semicolon.getPtr(), strLine.getTerm()); + str = strFind(uniformDefine, "uniform "); + } + replaceOutput.clear(); + replaceOutput.append(strLine.getPtr(), str.getPtr()); + replaceOutput += "static "; + replaceOutput.append(str.getTerm(), strLine.getTerm()); + lineToReplace = replaceOutput; + strLine = bx::StringView(lineToReplace.c_str()); + it = unusedUniforms.erase(it); + } + else + { + ++it; + } } } - if (!found) + if (!replaceOutput.empty()) + { + output.append(replaceOutput); + } + else { output.append(strLine.getPtr(), strLine.getTerm() ); - output += "\n"; } + output += "\n"; } // recompile with the unused uniforms converted to statics From b0bb4fc578cf1e9e6f446ee0c718a2305846b207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 17 Mar 2023 19:57:51 -0700 Subject: [PATCH 53/86] Revert "fix unused uniforms replace when multi uniform defined in one line and there is some unused uniforms in that line. (#3056)" (#3064) This reverts commit bd7a01aa8a6a001191da4bbfdddb3fdf057912fb. --- tools/shaderc/shaderc_hlsl.cpp | 63 ++++++++++++++-------------------- 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 2d43e3514..2397304cd 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -704,52 +704,39 @@ namespace bgfx { namespace hlsl while (!reader.isDone() ) { bx::StringView strLine = reader.next(); - std::string replaceOutput; - bx::StringView str = strFind(strLine, "uniform "); - if (!str.isEmpty()) + bool found = false; + + for (UniformNameList::iterator it = unusedUniforms.begin(), itEnd = unusedUniforms.end(); it != itEnd; ++it) { - std::string lineToReplace(strLine.getPtr(), 0, strLine.getLength()); - for (UniformNameList::iterator it = unusedUniforms.begin(); it != unusedUniforms.end();) + bx::StringView str = strFind(strLine, "uniform "); + if (str.isEmpty() ) { - // matching lines like: uniform u_name; - // we want to replace "uniform" with "static" so that it's no longer - // included in the uniform blob that the application must upload - // we can't just remove them, because unused functions might still reference - // them and cause a compile error when they're gone - auto identifier = bx::findIdentifierMatch(strLine, it->c_str()); - if (!identifier.isEmpty()) - { - bx::StringView definePrefix = bx::StringView(strLine.getPtr(), identifier.getPtr()); - bx::StringView semicolon = strRFind(definePrefix, ';'); - if (!semicolon.isEmpty()) - { - bx::StringView uniformDefine = bx::StringView(semicolon.getPtr(), strLine.getTerm()); - str = strFind(uniformDefine, "uniform "); - } - replaceOutput.clear(); - replaceOutput.append(strLine.getPtr(), str.getPtr()); - replaceOutput += "static "; - replaceOutput.append(str.getTerm(), strLine.getTerm()); - lineToReplace = replaceOutput; - strLine = bx::StringView(lineToReplace.c_str()); - it = unusedUniforms.erase(it); - } - else - { - ++it; - } + continue; + } + + // matching lines like: uniform u_name; + // we want to replace "uniform" with "static" so that it's no longer + // included in the uniform blob that the application must upload + // we can't just remove them, because unused functions might still reference + // them and cause a compile error when they're gone + if (!bx::findIdentifierMatch(strLine, it->c_str() ).isEmpty() ) + { + output.append(strLine.getPtr(), str.getPtr() ); + output += "static "; + output.append(str.getTerm(), strLine.getTerm() ); + output += "\n"; + found = true; + + unusedUniforms.erase(it); + break; } } - if (!replaceOutput.empty()) - { - output.append(replaceOutput); - } - else + if (!found) { output.append(strLine.getPtr(), strLine.getTerm() ); + output += "\n"; } - output += "\n"; } // recompile with the unused uniforms converted to statics From 2c07181c1ecd4f1b4d604c17421f9054bea06a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:02:20 -0700 Subject: [PATCH 54/86] Updated cgltf. --- 3rdparty/cgltf/cgltf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/cgltf/cgltf.h b/3rdparty/cgltf/cgltf.h index f38fd665d..d2a909777 100644 --- a/3rdparty/cgltf/cgltf.h +++ b/3rdparty/cgltf/cgltf.h @@ -2218,7 +2218,7 @@ static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_typ case cgltf_component_type_r_32u: return *((const uint32_t*) in); case cgltf_component_type_r_32f: - return (cgltf_size)*((const float*) in); + return (cgltf_size)((cgltf_ssize)*((const float*) in)); case cgltf_component_type_r_8u: return *((const uint8_t*) in); default: From d87baafbcc8d7e9f39ec17079bf617923be719de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:02:32 -0700 Subject: [PATCH 55/86] Updated ImGui. --- 3rdparty/dear-imgui/imgui.cpp | 90 ++++++++++++++++----------- 3rdparty/dear-imgui/imgui.h | 7 ++- 3rdparty/dear-imgui/imgui_demo.cpp | 4 +- 3rdparty/dear-imgui/imgui_draw.cpp | 1 + 3rdparty/dear-imgui/imgui_internal.h | 11 ++-- 3rdparty/dear-imgui/imgui_widgets.cpp | 90 ++++++++++++++++++++------- 6 files changed, 134 insertions(+), 69 deletions(-) diff --git a/3rdparty/dear-imgui/imgui.cpp b/3rdparty/dear-imgui/imgui.cpp index 40f96216f..8f5913df0 100644 --- a/3rdparty/dear-imgui/imgui.cpp +++ b/3rdparty/dear-imgui/imgui.cpp @@ -1351,9 +1351,9 @@ void ImGuiIO::ClearInputKeys() MouseWheel = MouseWheelH = 0.0f; } -static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = -1) +static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *ctx; for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--) { ImGuiInputEvent* e = &g.InputEventsQueue[n]; @@ -1372,6 +1372,8 @@ static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = // - ImGuiKey key: Translated key (as in, generally ImGuiKey_A matches the key end-user would use to emit an 'A' character) // - bool down: Is the key down? use false to signify a key release. // - float analog_value: 0.0f..1.0f +// IMPORTANT: THIS FUNCTION AND OTHER "ADD" GRABS THE CONTEXT FROM OUR INSTANCE. +// WE NEED TO ENSURE THAT ALL FUNCTION CALLS ARE FULLFILLING THIS, WHICH IS WHY GetKeyData() HAS AN EXPLICIT CONTEXT. void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) { //if (e->Down) { IMGUI_DEBUG_LOG_IO("AddKeyEvent() Key='%s' %d, NativeKeycode = %d, NativeScancode = %d\n", ImGui::GetKeyName(e->Key), e->Down, e->NativeKeycode, e->NativeScancode); } @@ -1380,7 +1382,7 @@ void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) return; ImGuiContext& g = *Ctx; IM_ASSERT(ImGui::IsNamedKeyOrModKey(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API. - IM_ASSERT(!ImGui::IsAliasKey(key)); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events. + IM_ASSERT(ImGui::IsAliasKey(key) == false); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events. IM_ASSERT(key != ImGuiMod_Shortcut); // We could easily support the translation here but it seems saner to not accept it (TestEngine perform a translation itself) // Verify that backend isn't mixing up using new io.AddKeyEvent() api and old io.KeysDown[] + io.KeyMap[] data. @@ -1395,8 +1397,8 @@ void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) BackendUsingLegacyNavInputArray = false; // Filter duplicate (in particular: key mods and gamepad analog values are commonly spammed) - const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Key, (int)key); - const ImGuiKeyData* key_data = ImGui::GetKeyData(key); + const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_Key, (int)key); + const ImGuiKeyData* key_data = ImGui::GetKeyData(&g, key); const bool latest_key_down = latest_event ? latest_event->Key.Down : key_data->Down; const float latest_key_analog = latest_event ? latest_event->Key.AnalogValue : key_data->AnalogValue; if (latest_key_down == down && latest_key_analog == analog_value) @@ -1462,7 +1464,7 @@ void ImGuiIO::AddMousePosEvent(float x, float y) ImVec2 pos((x > -FLT_MAX) ? ImFloorSigned(x) : x, (y > -FLT_MAX) ? ImFloorSigned(y) : y); // Filter duplicate - const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MousePos); + const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_MousePos); const ImVec2 latest_pos = latest_event ? ImVec2(latest_event->MousePos.PosX, latest_event->MousePos.PosY) : g.IO.MousePos; if (latest_pos.x == pos.x && latest_pos.y == pos.y) return; @@ -1484,7 +1486,7 @@ void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down) return; // Filter duplicate - const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MouseButton, (int)mouse_button); + const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_MouseButton, (int)mouse_button); const bool latest_button_down = latest_event ? latest_event->MouseButton.Down : g.IO.MouseDown[mouse_button]; if (latest_button_down == down) return; @@ -1521,7 +1523,7 @@ void ImGuiIO::AddFocusEvent(bool focused) ImGuiContext& g = *Ctx; // Filter duplicate - const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Focus); + const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_Focus); const bool latest_focused = latest_event ? latest_event->AppFocused.Focused : !g.IO.AppFocusLost; if (latest_focused == focused) return; @@ -3867,7 +3869,7 @@ void ImGui::MarkItemEdited(ImGuiID id) g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited; } -static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags) +bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags) { // An active popup disable hovering on other windows (apart from its own children) // FIXME-OPT: This could be cached/stored within the window. @@ -7728,13 +7730,13 @@ bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) // - Shortcut() [Internal] //----------------------------------------------------------------------------- -ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key) +ImGuiKeyData* ImGui::GetKeyData(ImGuiContext* ctx, ImGuiKey key) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *ctx; // Special storage location for mods if (key & ImGuiMod_Mask_) - key = ConvertSingleModFlagToKey(key); + key = ConvertSingleModFlagToKey(ctx, key); #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO IM_ASSERT(key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_NamedKey_END); @@ -7783,22 +7785,22 @@ IM_STATIC_ASSERT(ImGuiKey_NamedKey_COUNT == IM_ARRAYSIZE(GKeyNames)); const char* ImGui::GetKeyName(ImGuiKey key) { + ImGuiContext& g = *GImGui; #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO IM_ASSERT((IsNamedKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); #else if (IsLegacyKey(key)) { - ImGuiIO& io = GetIO(); - if (io.KeyMap[key] == -1) + if (g.IO.KeyMap[key] == -1) return "N/A"; - IM_ASSERT(IsNamedKey((ImGuiKey)io.KeyMap[key])); - key = (ImGuiKey)io.KeyMap[key]; + IM_ASSERT(IsNamedKey((ImGuiKey)g.IO.KeyMap[key])); + key = (ImGuiKey)g.IO.KeyMap[key]; } #endif if (key == ImGuiKey_None) return "None"; if (key & ImGuiMod_Mask_) - key = ConvertSingleModFlagToKey(key); + key = ConvertSingleModFlagToKey(&g, key); if (!IsNamedKey(key)) return "Unknown"; @@ -7893,7 +7895,7 @@ static void ImGui::UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt) // Apply routing to owner if there's no owner already (RoutingCurr == None at this point) if (routing_entry->Mods == g.IO.KeyMods) { - ImGuiKeyOwnerData* owner_data = ImGui::GetKeyOwnerData(key); + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); if (owner_data->OwnerCurr == ImGuiKeyOwner_None) owner_data->OwnerCurr = routing_entry->RoutingCurr; } @@ -7930,7 +7932,7 @@ ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord) ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); if (key == ImGuiKey_None) - key = ConvertSingleModFlagToKey(mods); + key = ConvertSingleModFlagToKey(&g, mods); IM_ASSERT(IsNamedKey(key)); // Get (in the majority of case, the linked list will have one element so this should be 2 reads. @@ -8436,6 +8438,13 @@ static void ImGui::UpdateMouseInputs() ImGuiContext& g = *GImGui; ImGuiIO& io = g.IO; + // Mouse Wheel swapping flag + // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead + // - We avoid doing it on OSX as it the OS input layer handles this already. + // - FIXME: However this means when running on OSX over Emscripten, Shift+WheelY will incur two swapping (1 in OS, 1 here), canceling the feature. + // - FIXME: When we can distinguish e.g. touchpad scroll events from mouse ones, we'll set this accordingly based on input source. + io.MouseWheelRequestAxisSwap = io.KeyShift && !io.ConfigMacOSXBehaviors; + // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well) if (IsMousePosValid(&io.MousePos)) io.MousePos = g.MouseLastValidPos = ImFloorSigned(io.MousePos); @@ -8596,15 +8605,9 @@ void ImGui::UpdateMouseWheel() return; // Mouse wheel scrolling - // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead - // - We avoid doing it on OSX as it the OS input layer handles this already. - // - However this means when running on OSX over Emcripten, Shift+WheelY will incur two swappings (1 in OS, 1 here), cancelling the feature. - const bool swap_axis = g.IO.KeyShift && !g.IO.ConfigMacOSXBehaviors; - if (swap_axis) - { - wheel.x = wheel.y; - wheel.y = 0.0f; - } + // Read about io.MouseWheelRequestAxisSwap and its issue on Mac+Emscripten in UpdateMouseInputs() + if (g.IO.MouseWheelRequestAxisSwap) + wheel = ImVec2(wheel.y, 0.0f); // Maintain a rough average of moving magnitude on both axises // FIXME: should by based on wall clock time rather than frame-counter @@ -8800,7 +8803,7 @@ ImGuiID ImGui::GetKeyOwner(ImGuiKey key) return ImGuiKeyOwner_None; ImGuiContext& g = *GImGui; - ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); ImGuiID owner_id = owner_data->OwnerCurr; if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId && owner_id != ImGuiKeyOwner_Any) @@ -8824,7 +8827,7 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id) if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END) return false; - ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); if (owner_id == ImGuiKeyOwner_Any) return (owner_data->LockThisFrame == false); @@ -8852,7 +8855,8 @@ void ImGui::SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags) IM_ASSERT(IsNamedKeyOrModKey(key) && (owner_id != ImGuiKeyOwner_Any || (flags & (ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease)))); // Can only use _Any with _LockXXX flags (to eat a key away without an ID to retrieve it) IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetKeyOwner) == 0); // Passing flags not supported by this function! - ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + ImGuiContext& g = *GImGui; + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); owner_data->OwnerCurr = owner_data->OwnerNext = owner_id; // We cannot lock by default as it would likely break lots of legacy code. @@ -8861,6 +8865,17 @@ void ImGui::SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags) owner_data->LockThisFrame = (flags & ImGuiInputFlags_LockThisFrame) != 0 || (owner_data->LockUntilRelease); } +// Rarely used helper +void ImGui::SetKeyOwnersForKeyChord(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags) +{ + if (key_chord & ImGuiMod_Ctrl) { SetKeyOwner(ImGuiMod_Ctrl, owner_id, flags); } + if (key_chord & ImGuiMod_Shift) { SetKeyOwner(ImGuiMod_Shift, owner_id, flags); } + if (key_chord & ImGuiMod_Alt) { SetKeyOwner(ImGuiMod_Alt, owner_id, flags); } + if (key_chord & ImGuiMod_Super) { SetKeyOwner(ImGuiMod_Super, owner_id, flags); } + if (key_chord & ImGuiMod_Shortcut) { SetKeyOwner(ImGuiMod_Shortcut, owner_id, flags); } + if (key_chord & ~ImGuiMod_Mask_) { SetKeyOwner((ImGuiKey)(key_chord & ~ImGuiMod_Mask_), owner_id, flags); } +} + // This is more or less equivalent to: // if (IsItemHovered() || IsItemActive()) // SetKeyOwner(key, GetItemID()); @@ -8901,7 +8916,7 @@ bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags // Special storage location for mods ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); if (key == ImGuiKey_None) - key = ConvertSingleModFlagToKey(mods); + key = ConvertSingleModFlagToKey(&g, mods); if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | (ImGuiInputFlags)ImGuiInputFlags_RepeatRateMask_)))) return false; @@ -11781,10 +11796,11 @@ static void ImGui::NavUpdateWindowing() } // Start CTRL+Tab or Square+L/R window selection + const ImGuiID owner_id = ImHashStr("###NavUpdateWindowing"); const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; - const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); - const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); + const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, owner_id, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); + const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, owner_id, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); const bool start_windowing_with_gamepad = allow_windowing && nav_gamepad_active && !g.NavWindowingTarget && IsKeyPressed(ImGuiKey_NavGamepadMenu, 0, ImGuiInputFlags_None); const bool start_windowing_with_keyboard = allow_windowing && !g.NavWindowingTarget && (keyboard_next_window || keyboard_prev_window); // Note: enabled even without NavEnableKeyboard! if (start_windowing_with_gamepad || start_windowing_with_keyboard) @@ -11795,6 +11811,10 @@ static void ImGui::NavUpdateWindowing() g.NavWindowingAccumDeltaPos = g.NavWindowingAccumDeltaSize = ImVec2(0.0f, 0.0f); g.NavWindowingToggleLayer = start_windowing_with_gamepad ? true : false; // Gamepad starts toggling layer g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_Keyboard : ImGuiInputSource_Gamepad; + + // Register ownership of our mods. Using ImGuiInputFlags_RouteGlobalHigh in the Shortcut() calls instead would probably be correct but may have more side-effects. + if (keyboard_next_window || keyboard_prev_window) + SetKeyOwnersForKeyChord((g.ConfigNavWindowingKeyNext | g.ConfigNavWindowingKeyPrev) & ImGuiMod_Mask_, owner_id); } // Gamepad update @@ -13727,7 +13747,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) { for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { - ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key); if (owner_data->OwnerCurr == ImGuiKeyOwner_None) continue; Text("%s: 0x%08X%s", GetKeyName(key), owner_data->OwnerCurr, diff --git a/3rdparty/dear-imgui/imgui.h b/3rdparty/dear-imgui/imgui.h index a2522aef6..a90a4dc95 100644 --- a/3rdparty/dear-imgui/imgui.h +++ b/3rdparty/dear-imgui/imgui.h @@ -23,7 +23,7 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') #define IMGUI_VERSION "1.89.5 WIP" -#define IMGUI_VERSION_NUM 18942 +#define IMGUI_VERSION_NUM 18946 #define IMGUI_HAS_TABLE /* @@ -255,8 +255,8 @@ struct ImVec2 float x, y; constexpr ImVec2() : x(0.0f), y(0.0f) { } constexpr ImVec2(float _x, float _y) : x(_x), y(_y) { } - float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. - float& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. + float& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return ((float*)(char*)this)[idx]; } // We very rarely use this [] operator, so the assert overhead is fine. + float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return ((const float*)(const char*)this)[idx]; } #ifdef IM_VEC2_CLASS_EXTRA IM_VEC2_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2. #endif @@ -2054,6 +2054,7 @@ struct ImGuiIO bool MouseReleased[5]; // Mouse button went from Down to !Down bool MouseDownOwned[5]; // Track if button was clicked inside a dear imgui window or over void blocked by a popup. We don't request mouse capture from the application if click started outside ImGui bounds. bool MouseDownOwnedUnlessPopupClose[5]; // Track if button was clicked inside a dear imgui window. + bool MouseWheelRequestAxisSwap; // On a non-Mac system, holding SHIFT requests WheelY to perform the equivalent of a WheelX event. On a Mac system this is already enforced by the system. float MouseDownDuration[5]; // Duration the mouse button has been down (0.0f == just clicked) float MouseDownDurationPrev[5]; // Previous time the mouse button has been down float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point (used for moving thresholds) diff --git a/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/dear-imgui/imgui_demo.cpp index d83daf9d3..5f29b626a 100644 --- a/3rdparty/dear-imgui/imgui_demo.cpp +++ b/3rdparty/dear-imgui/imgui_demo.cpp @@ -5713,8 +5713,6 @@ static void ShowDemoWindowColumns() ImGui::TreePop(); } -namespace ImGui { extern ImGuiKeyData* GetKeyData(ImGuiKey key); } - static void ShowDemoWindowInputs() { IMGUI_DEMO_MARKER("Inputs & Focus"); @@ -5749,7 +5747,7 @@ static void ShowDemoWindowInputs() struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array ImGuiKey start_key = (ImGuiKey)0; #endif - ImGui::Text("Keys down:"); for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); ImGui::SameLine(); ImGui::Text("(%.02f)", ImGui::GetKeyData(key)->DownDuration); } + ImGui::Text("Keys down:"); for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); } ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public. diff --git a/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/dear-imgui/imgui_draw.cpp index 8bfe7a5aa..5bf034604 100644 --- a/3rdparty/dear-imgui/imgui_draw.cpp +++ b/3rdparty/dear-imgui/imgui_draw.cpp @@ -3790,6 +3790,7 @@ void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir d void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col) { + // FIXME-OPT: This should be baked in font. draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8); } diff --git a/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/dear-imgui/imgui_internal.h index d74b89ed3..bc9dd2337 100644 --- a/3rdparty/dear-imgui/imgui_internal.h +++ b/3rdparty/dear-imgui/imgui_internal.h @@ -2828,6 +2828,7 @@ namespace ImGui inline void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); } // FIXME: This is a misleading API since we expect CursorPos to be bb.Min. IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0); IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id); + IMGUI_API bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags = 0); IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id); IMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect); IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h); @@ -2897,9 +2898,9 @@ namespace ImGui inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; } inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; } inline ImGuiKeyChord ConvertShortcutMod(ImGuiKeyChord key_chord) { ImGuiContext& g = *GImGui; IM_ASSERT_PARANOID(key_chord & ImGuiMod_Shortcut); return (key_chord & ~ImGuiMod_Shortcut) | (g.IO.ConfigMacOSXBehaviors ? ImGuiMod_Super : ImGuiMod_Ctrl); } - inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key) + inline ImGuiKey ConvertSingleModFlagToKey(ImGuiContext* ctx, ImGuiKey key) { - ImGuiContext& g = *GImGui; + ImGuiContext& g = *ctx; if (key == ImGuiMod_Ctrl) return ImGuiKey_ReservedForModCtrl; if (key == ImGuiMod_Shift) return ImGuiKey_ReservedForModShift; if (key == ImGuiMod_Alt) return ImGuiKey_ReservedForModAlt; @@ -2908,7 +2909,8 @@ namespace ImGui return key; } - IMGUI_API ImGuiKeyData* GetKeyData(ImGuiKey key); + IMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key); + inline ImGuiKeyData* GetKeyData(ImGuiKey key) { ImGuiContext& g = *GImGui; return GetKeyData(&g, key); } IMGUI_API void GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size); inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); return (ImGuiKey)(ImGuiKey_MouseLeft + button); } IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f); @@ -2932,9 +2934,10 @@ namespace ImGui // Please open a GitHub Issue to submit your usage scenario or if there's a use case you need solved. IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key); IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0); + IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0); IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'. IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id' - inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key)); return &GImGui->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; } + inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(ctx, key); IM_ASSERT(IsNamedKey(key)); return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; } // [EXPERIMENTAL] High-Level: Input Access functions w/ support for Key/Input Ownership // - Important: legacy IsKeyPressed(ImGuiKey, bool repeat=true) _DEFAULTS_ to repeat, new IsKeyPressed() requires _EXPLICIT_ ImGuiInputFlags_Repeat flag. diff --git a/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/dear-imgui/imgui_widgets.cpp index 9b1fdc05a..d22fbbda6 100644 --- a/3rdparty/dear-imgui/imgui_widgets.cpp +++ b/3rdparty/dear-imgui/imgui_widgets.cpp @@ -827,7 +827,7 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos) ImU32 col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered); ImVec2 center = bb.GetCenter(); if (hovered) - window->DrawList->AddCircleFilled(center, ImMax(2.0f, g.FontSize * 0.5f + 1.0f), col, 12); + window->DrawList->AddCircleFilled(center, ImMax(2.0f, g.FontSize * 0.5f + 1.0f), col); float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f; ImU32 cross_col = GetColorU32(ImGuiCol_Text); @@ -852,7 +852,7 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos) ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); ImU32 text_col = GetColorU32(ImGuiCol_Text); if (hovered || held) - window->DrawList->AddCircleFilled(bb.GetCenter()/*+ ImVec2(0.0f, -0.5f)*/, g.FontSize * 0.5f + 1.0f, bg_col, 12); + window->DrawList->AddCircleFilled(bb.GetCenter()/*+ ImVec2(0.0f, -0.5f)*/, g.FontSize * 0.5f + 1.0f, bg_col); RenderArrow(window->DrawList, bb.Min + g.Style.FramePadding, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f); // Switch to moving the window after mouse is moved beyond the initial drag threshold @@ -1233,17 +1233,18 @@ bool ImGui::RadioButton(const char* label, bool active) MarkItemEdited(id); RenderNavHighlight(total_bb, id); - window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), 16); + const int num_segment = window->DrawList->_CalcCircleAutoSegmentCount(radius); + window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), num_segment); if (active) { const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); - window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark), 16); + window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark)); } if (style.FrameBorderSize > 0.0f) { - window->DrawList->AddCircle(center + ImVec2(1, 1), radius, GetColorU32(ImGuiCol_BorderShadow), 16, style.FrameBorderSize); - window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), 16, style.FrameBorderSize); + window->DrawList->AddCircle(center + ImVec2(1, 1), radius, GetColorU32(ImGuiCol_BorderShadow), num_segment, style.FrameBorderSize); + window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), num_segment, style.FrameBorderSize); } ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y); @@ -3315,7 +3316,7 @@ void ImParseFormatSanitizeForPrinting(const char* fmt_in, char* fmt_out, size_t *fmt_out = 0; // Zero-terminate } -// - For scanning we need to remove all width and precision fields "%3.7f" -> "%f". BUT don't strip types like "%I64d" which includes digits. ! "%07I64d" -> "%I64d" +// - For scanning we need to remove all width and precision fields and flags "%+3.7f" -> "%f". BUT don't strip types like "%I64d" which includes digits. ! "%07I64d" -> "%I64d" const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, size_t fmt_out_size) { const char* fmt_end = ImParseFormatFindEnd(fmt_in); @@ -3326,7 +3327,7 @@ const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, while (fmt_in < fmt_end) { char c = *fmt_in++; - if (!has_type && ((c >= '0' && c <= '9') || c == '.')) + if (!has_type && ((c >= '0' && c <= '9') || c == '.' || c == '+' || c == '#')) continue; has_type |= ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); // Stop skipping digits if (c != '\'' && c != '$' && c != '_') // Custom flags provided by stb_sprintf.h. POSIX 2008 also supports '. @@ -3714,10 +3715,34 @@ static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTextState* ob r->num_chars = (int)(text_remaining - (text + line_start_idx)); } -// When ImGuiInputTextFlags_Password is set, we don't want actions such as CTRL+Arrow to leak the fact that underlying data are blanks or separators. -static bool is_separator(unsigned int c) { return ImCharIsBlankW(c) || c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|' || c=='\n' || c=='\r'; } -static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx) { if (obj->Flags & ImGuiInputTextFlags_Password) return 0; return idx > 0 ? (is_separator(obj->TextW[idx - 1]) && !is_separator(obj->TextW[idx]) ) : 1; } -static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) { if (obj->Flags & ImGuiInputTextFlags_Password) return 0; return idx > 0 ? (!is_separator(obj->TextW[idx - 1]) && is_separator(obj->TextW[idx])) : 1; } +static bool is_separator(unsigned int c) +{ + return c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|' || c=='\n' || c=='\r' || c=='.' || c=='!'; +} + +static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx) +{ + // When ImGuiInputTextFlags_Password is set, we don't want actions such as CTRL+Arrow to leak the fact that underlying data are blanks or separators. + if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0) + return 0; + + bool prev_white = ImCharIsBlankW(obj->TextW[idx - 1]); + bool prev_separ = is_separator(obj->TextW[idx - 1]); + bool curr_white = ImCharIsBlankW(obj->TextW[idx]); + bool curr_separ = is_separator(obj->TextW[idx]); + return ((prev_white || prev_separ) && !(curr_separ || curr_white)) || (curr_separ && !prev_separ); +} +static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) +{ + if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0) + return 0; + + bool prev_white = ImCharIsBlankW(obj->TextW[idx]); + bool prev_separ = is_separator(obj->TextW[idx]); + bool curr_white = ImCharIsBlankW(obj->TextW[idx - 1]); + bool curr_separ = is_separator(obj->TextW[idx - 1]); + return ((prev_white) && !(curr_separ || curr_white)) || (curr_separ && !prev_separ); +} static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; } static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; } static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; } @@ -5629,7 +5654,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl float sin_hue_angle = ImSin(H * 2.0f * IM_PI); ImVec2 hue_cursor_pos(wheel_center.x + cos_hue_angle * (wheel_r_inner + wheel_r_outer) * 0.5f, wheel_center.y + sin_hue_angle * (wheel_r_inner + wheel_r_outer) * 0.5f); float hue_cursor_rad = value_changed_h ? wheel_thickness * 0.65f : wheel_thickness * 0.55f; - int hue_cursor_segments = ImClamp((int)(hue_cursor_rad / 1.4f), 9, 32); + int hue_cursor_segments = draw_list->_CalcCircleAutoSegmentCount(hue_cursor_rad); // Lock segment count so the +1 one matches others. draw_list->AddCircleFilled(hue_cursor_pos, hue_cursor_rad, hue_color32, hue_cursor_segments); draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad + 1, col_midgrey, hue_cursor_segments); draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad, col_white, hue_cursor_segments); @@ -5639,13 +5664,10 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl ImVec2 trb = wheel_center + ImRotate(triangle_pb, cos_hue_angle, sin_hue_angle); ImVec2 trc = wheel_center + ImRotate(triangle_pc, cos_hue_angle, sin_hue_angle); ImVec2 uv_white = GetFontTexUvWhitePixel(); - draw_list->PrimReserve(6, 6); + draw_list->PrimReserve(3, 3); draw_list->PrimVtx(tra, uv_white, hue_color32); - draw_list->PrimVtx(trb, uv_white, hue_color32); - draw_list->PrimVtx(trc, uv_white, col_white); - draw_list->PrimVtx(tra, uv_white, 0); draw_list->PrimVtx(trb, uv_white, col_black); - draw_list->PrimVtx(trc, uv_white, 0); + draw_list->PrimVtx(trc, uv_white, col_white); draw_list->AddTriangle(tra, trb, trc, col_midgrey, 1.5f); sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V)); } @@ -5668,9 +5690,10 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl // Render cursor/preview circle (clamp S/V within 0..1 range because floating points colors may lead HSV values to be out of range) float sv_cursor_rad = value_changed_sv ? 10.0f : 6.0f; - draw_list->AddCircleFilled(sv_cursor_pos, sv_cursor_rad, user_col32_striped_of_alpha, 12); - draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad + 1, col_midgrey, 12); - draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad, col_white, 12); + int sv_cursor_segments = draw_list->_CalcCircleAutoSegmentCount(sv_cursor_rad); // Lock segment count so the +1 one matches others. + draw_list->AddCircleFilled(sv_cursor_pos, sv_cursor_rad, user_col32_striped_of_alpha, sv_cursor_segments); + draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad + 1, col_midgrey, sv_cursor_segments); + draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad, col_white, sv_cursor_segments); // Render alpha bar if (alpha_bar) @@ -7610,6 +7633,12 @@ void ImGui::EndTabBar() g.CurrentTabBar = g.CurrentTabBarStack.empty() ? NULL : GetTabBarFromTabBarRef(g.CurrentTabBarStack.back()); } +// Scrolling happens only in the central section (leading/trailing sections are not scrolling) +static float TabBarCalcScrollableWidth(ImGuiTabBar* tab_bar, ImGuiTabBarSection* sections) +{ + return tab_bar->BarRect.GetWidth() - sections[0].Width - sections[2].Width - sections[1].Spacing; +} + // This is called only once a frame before by the first call to ItemTab() // The reason we're not calling it in BeginTabBar() is to leave a chance to the user to call the SetTabItemClosed() functions. static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) @@ -7812,9 +7841,23 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar) tab_bar->VisibleTabId = tab_bar->SelectedTabId; tab_bar->VisibleTabWasSubmitted = false; - // Update scrolling + // Apply request requests if (scroll_to_tab_id != 0) TabBarScrollToTab(tab_bar, scroll_to_tab_id, sections); + else if ((tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyScroll) && IsMouseHoveringRect(tab_bar->BarRect.Min, tab_bar->BarRect.Max, true) && IsWindowContentHoverable(g.CurrentWindow)) + { + const float wheel = g.IO.MouseWheelRequestAxisSwap ? g.IO.MouseWheel : g.IO.MouseWheelH; + const ImGuiKey wheel_key = g.IO.MouseWheelRequestAxisSwap ? ImGuiKey_MouseWheelY : ImGuiKey_MouseWheelX; + if (TestKeyOwner(wheel_key, tab_bar->ID) && wheel != 0.0f) + { + const float scroll_step = wheel * TabBarCalcScrollableWidth(tab_bar, sections) / 3.0f; + tab_bar->ScrollingTargetDistToVisibility = 0.0f; + tab_bar->ScrollingTarget = TabBarScrollClamp(tab_bar, tab_bar->ScrollingTarget - scroll_step); + } + SetKeyOwner(wheel_key, tab_bar->ID); + } + + // Update scrolling tab_bar->ScrollingAnim = TabBarScrollClamp(tab_bar, tab_bar->ScrollingAnim); tab_bar->ScrollingTarget = TabBarScrollClamp(tab_bar, tab_bar->ScrollingTarget); if (tab_bar->ScrollingAnim != tab_bar->ScrollingTarget) @@ -7951,8 +7994,7 @@ static void ImGui::TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGui int order = TabBarGetTabOrder(tab_bar, tab); // Scrolling happens only in the central section (leading/trailing sections are not scrolling) - // FIXME: This is all confusing. - float scrollable_width = tab_bar->BarRect.GetWidth() - sections[0].Width - sections[2].Width - sections[1].Spacing; + float scrollable_width = TabBarCalcScrollableWidth(tab_bar, sections); // We make all tabs positions all relative Sections[0].Width to make code simpler float tab_x1 = tab->Offset - sections[0].Width + (order > sections[0].TabCount - 1 ? -margin : 0.0f); From 5b5774fbc1910f5cc621897c83d8a54fcc7afa61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:02:41 -0700 Subject: [PATCH 56/86] Updated glslang. --- 3rdparty/glslang/build_info.h | 2 +- .../MachineIndependent/preprocessor/Pp.cpp | 17 +++++++++----- .../preprocessor/PpContext.h | 23 +++++++++++++++---- .../preprocessor/PpScanner.cpp | 4 +--- .../preprocessor/PpTokens.cpp | 4 ++-- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/3rdparty/glslang/build_info.h b/3rdparty/glslang/build_info.h index 9327e840e..e006f30cb 100644 --- a/3rdparty/glslang/build_info.h +++ b/3rdparty/glslang/build_info.h @@ -35,7 +35,7 @@ #define GLSLANG_BUILD_INFO #define GLSLANG_VERSION_MAJOR 12 -#define GLSLANG_VERSION_MINOR 0 +#define GLSLANG_VERSION_MINOR 1 #define GLSLANG_VERSION_PATCH 0 #define GLSLANG_VERSION_FLAVOR "" diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index aa1e0d745..d5a710918 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -1126,9 +1126,6 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken) pasting = true; } - // HLSL does expand macros before concatenation - if (pasting && pp->parseContext.isReadingHLSL()) - pasting = false; // TODO: preprocessor: properly handle whitespace (or lack of it) between tokens when expanding if (token == PpAtomIdentifier) { @@ -1138,9 +1135,12 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken) break; if (i >= 0) { TokenStream* arg = expandedArgs[i]; - if (arg == nullptr || pasting) + bool expanded = !!arg && !pasting; + // HLSL does expand macros before concatenation + if (arg == nullptr || (pasting && !pp->parseContext.isReadingHLSL()) ) { arg = args[i]; - pp->pushTokenStreamInput(*arg, prepaste); + } + pp->pushTokenStreamInput(*arg, prepaste, expanded); return pp->scanToken(ppToken); } @@ -1183,6 +1183,9 @@ MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, b { ppToken->space = false; int macroAtom = atomStrings.getAtom(ppToken->name); + if (ppToken->fullyExpanded) + return MacroExpandNotStarted; + switch (macroAtom) { case PpAtomLineMacro: // Arguments which are macro have been replaced in the first stage. @@ -1214,8 +1217,10 @@ MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, b MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom); // no recursive expansions - if (macro != nullptr && macro->busy) + if (macro != nullptr && macro->busy) { + ppToken->fullyExpanded = true; return MacroExpandNotStarted; + } // not expanding undefined macros if ((macro == nullptr || macro->undef) && ! expandUndef) diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 714b5eadb..590eab6b2 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -102,6 +102,7 @@ public: i64val = 0; loc.init(); name[0] = 0; + fullyExpanded = false; } // Used for comparing macro definitions, so checks what is relevant for that. @@ -117,6 +118,8 @@ public: // True if a space (for white space or a removed comment) should also be // recognized, in front of the token returned: bool space; + + bool fullyExpanded; // Numeric value of the token: union { int ival; @@ -475,16 +478,27 @@ protected: // // From PpTokens.cpp // - void pushTokenStreamInput(TokenStream&, bool pasting = false); + void pushTokenStreamInput(TokenStream&, bool pasting = false, bool expanded = false); void UngetToken(int token, TPpToken*); class tTokenInput : public tInput { public: - tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting) : + tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting, bool expanded) : tInput(pp), tokens(t), - lastTokenPastes(prepasting) { } - virtual int scan(TPpToken *ppToken) override { return tokens->getToken(pp->parseContext, ppToken); } + lastTokenPastes(prepasting), + preExpanded(expanded) { } + virtual int scan(TPpToken *ppToken) override { + int token = tokens->getToken(pp->parseContext, ppToken); + ppToken->fullyExpanded = preExpanded; + if (tokens->atEnd() && token == PpAtomIdentifier) { + int macroAtom = pp->atomStrings.getAtom(ppToken->name); + MacroSymbol* macro = macroAtom == 0 ? nullptr : pp->lookupMacroDef(macroAtom); + if (macro && macro->functionLike) + ppToken->fullyExpanded = false; + } + return token; + } virtual int getch() override { assert(0); return EndOfInput; } virtual void ungetch() override { assert(0); } virtual bool peekPasting() override { return tokens->peekTokenizedPasting(lastTokenPastes); } @@ -492,6 +506,7 @@ protected: protected: TokenStream* tokens; bool lastTokenPastes; // true if the last token in the input is to be pasted, rather than consumed as a token + bool preExpanded; }; class tUngotTokenInput : public tInput { diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index ad1179200..d4d4de9f6 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -480,9 +480,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) E_GL_EXT_shader_explicit_arithmetic_types_int16 }; static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]); - ppToken->ival = 0; - ppToken->i64val = 0; - ppToken->space = false; + ppToken->clear(); ch = getch(); for (;;) { while (ch == ' ' || ch == '\t') { diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index e17eeafda..ac1ea7a8e 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -195,9 +195,9 @@ bool TPpContext::TokenStream::peekUntokenizedPasting() return pasting; } -void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting) +void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting, bool expanded) { - pushInput(new tTokenInput(this, &ts, prepasting)); + pushInput(new tTokenInput(this, &ts, prepasting, expanded)); ts.reset(); } From 379300facd4d1b09583d9f6245772b2f4a861415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:02:54 -0700 Subject: [PATCH 57/86] Updated spirv-headers. --- 3rdparty/spirv-headers/include/spirv/spir-v.xml | 6 ++++-- .../include/spirv/unified1/spirv.core.grammar.json | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/3rdparty/spirv-headers/include/spirv/spir-v.xml b/3rdparty/spirv-headers/include/spirv/spir-v.xml index 642fdf3b6..6648b3374 100644 --- a/3rdparty/spirv-headers/include/spirv/spir-v.xml +++ b/3rdparty/spirv-headers/include/spirv/spir-v.xml @@ -140,13 +140,14 @@ + - + @@ -170,13 +171,14 @@ + - + diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json index c740663f6..8f1e29a48 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json @@ -11032,12 +11032,11 @@ { "enumerant" : "1D", "value" : 0, - "capabilities" : [ "Sampled1D", "Image1D" ] + "capabilities" : [ "Sampled1D" ] }, { "enumerant" : "2D", - "value" : 1, - "capabilities" : [ "Shader", "Kernel", "ImageMSArray" ] + "value" : 1 }, { "enumerant" : "3D", @@ -11046,17 +11045,17 @@ { "enumerant" : "Cube", "value" : 3, - "capabilities" : [ "Shader", "ImageCubeArray" ] + "capabilities" : [ "Shader" ] }, { "enumerant" : "Rect", "value" : 4, - "capabilities" : [ "SampledRect", "ImageRect" ] + "capabilities" : [ "SampledRect" ] }, { "enumerant" : "Buffer", "value" : 5, - "capabilities" : [ "SampledBuffer", "ImageBuffer" ] + "capabilities" : [ "SampledBuffer" ] }, { "enumerant" : "SubpassData", From b3cfedc79e6231f73d49c87796d5c0913dbaf0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:03:03 -0700 Subject: [PATCH 58/86] Updated spirv-tools. --- .../include/generated/build-version.inc | 2 +- .../generated/operand.kinds-unified1.inc | 15 +-- .../opt/aggressive_dead_code_elim_pass.cpp | 2 - .../spirv-tools/source/opt/basic_block.cpp | 2 - .../source/opt/block_merge_pass.cpp | 3 - 3rdparty/spirv-tools/source/opt/ccp_pass.cpp | 1 - .../source/opt/cfg_cleanup_pass.cpp | 4 - 3rdparty/spirv-tools/source/opt/code_sink.cpp | 2 - 3rdparty/spirv-tools/source/opt/constants.cpp | 1 - .../source/opt/control_dependence.cpp | 2 - .../opt/convert_to_sampled_image_pass.cpp | 1 - 3rdparty/spirv-tools/source/opt/dataflow.cpp | 1 - .../source/opt/dead_branch_elim_pass.cpp | 1 - .../opt/eliminate_dead_constant_pass.cpp | 1 - .../opt/eliminate_dead_io_components_pass.cpp | 2 - .../opt/eliminate_dead_output_stores_pass.cpp | 2 +- .../opt/eliminate_dead_output_stores_pass.h | 6 - .../source/opt/feature_manager.cpp | 2 - 3rdparty/spirv-tools/source/opt/fold.cpp | 1 - ...ld_spec_constant_op_and_composite_pass.cpp | 3 - .../spirv-tools/source/opt/folding_rules.cpp | 1 - 3rdparty/spirv-tools/source/opt/function.cpp | 2 - .../opt/graphics_robust_access_pass.cpp | 6 - .../source/opt/interface_var_sroa.h | 4 - .../source/opt/interp_fixup_pass.cpp | 1 - .../spirv-tools/source/opt/ir_context.cpp | 1 - 3rdparty/spirv-tools/source/opt/ir_context.h | 11 ++ 3rdparty/spirv-tools/source/opt/licm_pass.cpp | 1 - 3rdparty/spirv-tools/source/opt/liveness.cpp | 2 +- .../opt/local_access_chain_convert_pass.cpp | 85 +++++--------- .../opt/local_single_block_elim_pass.cpp | 108 +++++++++--------- .../opt/local_single_store_elim_pass.cpp | 103 ++++++++--------- .../source/opt/loop_dependence.cpp | 2 - .../source/opt/loop_dependence_helpers.cpp | 4 +- .../source/opt/loop_descriptor.cpp | 3 - .../source/opt/loop_fusion_pass.cpp | 1 - .../spirv-tools/source/opt/loop_peeling.cpp | 5 +- .../spirv-tools/source/opt/loop_unroller.cpp | 1 - .../source/opt/loop_unswitch_pass.cpp | 2 - 3rdparty/spirv-tools/source/opt/mem_pass.cpp | 2 - .../source/opt/remove_duplicates_pass.cpp | 3 - .../remove_unused_interface_variables_pass.h | 7 +- .../source/opt/replace_invalid_opc.cpp | 3 +- .../source/opt/scalar_analysis.cpp | 1 - .../opt/scalar_analysis_simplification.cpp | 5 +- .../source/opt/scalar_replacement_pass.cpp | 2 - .../set_spec_constant_default_value_pass.cpp | 2 - .../source/opt/simplification_pass.cpp | 1 - .../source/opt/spread_volatile_semantics.cpp | 1 - .../source/opt/ssa_rewrite_pass.cpp | 1 - .../source/opt/strength_reduction_pass.cpp | 4 - .../opt/strip_nonsemantic_info_pass.cpp | 1 - 3rdparty/spirv-tools/source/opt/types.cpp | 1 - .../source/opt/unify_const_pass.cpp | 1 - .../spirv-tools/source/val/basic_block.cpp | 1 - 3rdparty/spirv-tools/source/val/construct.cpp | 1 - 3rdparty/spirv-tools/source/val/function.cpp | 1 - 3rdparty/spirv-tools/source/val/validate.cpp | 8 -- 3rdparty/spirv-tools/source/val/validate.h | 5 - .../source/val/validate_adjacency.cpp | 5 +- .../source/val/validate_arithmetics.cpp | 4 +- .../source/val/validate_atomics.cpp | 4 +- .../source/val/validate_barriers.cpp | 3 - .../source/val/validate_bitwise.cpp | 1 - .../source/val/validate_builtins.cpp | 2 - .../source/val/validate_capability.cpp | 2 - .../spirv-tools/source/val/validate_cfg.cpp | 3 - .../source/val/validate_composites.cpp | 4 +- .../source/val/validate_conversion.cpp | 1 - .../spirv-tools/source/val/validate_debug.cpp | 4 +- .../source/val/validate_decorations.cpp | 8 -- .../source/val/validate_derivatives.cpp | 4 +- .../val/validate_execution_limitations.cpp | 2 - .../source/val/validate_extensions.cpp | 6 +- .../spirv-tools/source/val/validate_id.cpp | 13 +-- .../spirv-tools/source/val/validate_image.cpp | 5 +- .../source/val/validate_instruction.cpp | 6 - .../source/val/validate_interfaces.cpp | 1 - .../source/val/validate_layout.cpp | 3 - .../source/val/validate_literals.cpp | 5 +- .../source/val/validate_logicals.cpp | 4 +- .../source/val/validate_memory_semantics.cpp | 1 - .../source/val/validate_non_uniform.cpp | 5 +- .../source/val/validate_primitives.cpp | 4 +- .../source/val/validate_scopes.cpp | 3 +- .../source/val/validation_state.cpp | 4 +- 86 files changed, 182 insertions(+), 373 deletions(-) diff --git a/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/spirv-tools/include/generated/build-version.inc index b2e3cdd2e..e10c2bcb9 100644 --- a/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2023.2", "SPIRV-Tools v2023.2 v2022.4-143-g3a7146da" +"v2023.2", "SPIRV-Tools v2023.2 v2022.4-165-g574d9da4" diff --git a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc index 684eb6489..7a9318c55 100644 --- a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc @@ -95,17 +95,12 @@ static const spv::Capability pygen_variable_caps_SampleMaskOverrideCoverageNV[] static const spv::Capability pygen_variable_caps_SampleMaskPostDepthCoverage[] = {spv::Capability::SampleMaskPostDepthCoverage}; static const spv::Capability pygen_variable_caps_SampleRateShading[] = {spv::Capability::SampleRateShading}; static const spv::Capability pygen_variable_caps_Sampled1D[] = {spv::Capability::Sampled1D}; -static const spv::Capability pygen_variable_caps_Sampled1DImage1D[] = {spv::Capability::Sampled1D, spv::Capability::Image1D}; static const spv::Capability pygen_variable_caps_SampledBuffer[] = {spv::Capability::SampledBuffer}; -static const spv::Capability pygen_variable_caps_SampledBufferImageBuffer[] = {spv::Capability::SampledBuffer, spv::Capability::ImageBuffer}; static const spv::Capability pygen_variable_caps_SampledBufferShaderNonUniform[] = {spv::Capability::SampledBuffer, spv::Capability::ShaderNonUniform}; static const spv::Capability pygen_variable_caps_SampledCubeArray[] = {spv::Capability::SampledCubeArray}; static const spv::Capability pygen_variable_caps_SampledRect[] = {spv::Capability::SampledRect}; -static const spv::Capability pygen_variable_caps_SampledRectImageRect[] = {spv::Capability::SampledRect, spv::Capability::ImageRect}; static const spv::Capability pygen_variable_caps_Shader[] = {spv::Capability::Shader}; -static const spv::Capability pygen_variable_caps_ShaderImageCubeArray[] = {spv::Capability::Shader, spv::Capability::ImageCubeArray}; static const spv::Capability pygen_variable_caps_ShaderKernel[] = {spv::Capability::Shader, spv::Capability::Kernel}; -static const spv::Capability pygen_variable_caps_ShaderKernelImageMSArray[] = {spv::Capability::Shader, spv::Capability::Kernel, spv::Capability::ImageMSArray}; static const spv::Capability pygen_variable_caps_ShaderUniformDecoration[] = {spv::Capability::Shader, spv::Capability::UniformDecoration}; static const spv::Capability pygen_variable_caps_ShaderVectorComputeINTEL[] = {spv::Capability::Shader, spv::Capability::VectorComputeINTEL}; static const spv::Capability pygen_variable_caps_ShaderInvocationReorderNV[] = {spv::Capability::ShaderInvocationReorderNV}; @@ -553,12 +548,12 @@ static const spv_operand_desc_t pygen_variable_StorageClassEntries[] = { }; static const spv_operand_desc_t pygen_variable_DimEntries[] = { - {"1D", 0, 2, pygen_variable_caps_Sampled1DImage1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"2D", 1, 3, pygen_variable_caps_ShaderKernelImageMSArray, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"1D", 0, 1, pygen_variable_caps_Sampled1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"2D", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"3D", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Cube", 3, 2, pygen_variable_caps_ShaderImageCubeArray, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Rect", 4, 2, pygen_variable_caps_SampledRectImageRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"Buffer", 5, 2, pygen_variable_caps_SampledBufferImageBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Cube", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Rect", 4, 1, pygen_variable_caps_SampledRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"Buffer", 5, 1, pygen_variable_caps_SampledBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"SubpassData", 6, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} }; diff --git a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp index 53d13f18b..51a65245f 100644 --- a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp @@ -21,10 +21,8 @@ #include #include "source/cfa.h" -#include "source/latest_version_glsl_std_450_header.h" #include "source/opt/eliminate_dead_functions_util.h" #include "source/opt/ir_builder.h" -#include "source/opt/iterator.h" #include "source/opt/reflect.h" #include "source/spirv_constant.h" #include "source/util/string_utils.h" diff --git a/3rdparty/spirv-tools/source/opt/basic_block.cpp b/3rdparty/spirv-tools/source/opt/basic_block.cpp index d12178ebe..a9fc8e2f7 100644 --- a/3rdparty/spirv-tools/source/opt/basic_block.cpp +++ b/3rdparty/spirv-tools/source/opt/basic_block.cpp @@ -16,9 +16,7 @@ #include -#include "source/opt/function.h" #include "source/opt/ir_context.h" -#include "source/opt/module.h" #include "source/opt/reflect.h" #include "source/util/make_unique.h" diff --git a/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp b/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp index ef7f31fe0..d6c33e52b 100644 --- a/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp @@ -16,11 +16,8 @@ #include "source/opt/block_merge_pass.h" -#include - #include "source/opt/block_merge_util.h" #include "source/opt/ir_context.h" -#include "source/opt/iterator.h" namespace spvtools { namespace opt { diff --git a/3rdparty/spirv-tools/source/opt/ccp_pass.cpp b/3rdparty/spirv-tools/source/opt/ccp_pass.cpp index 63627a2f7..46bfc907d 100644 --- a/3rdparty/spirv-tools/source/opt/ccp_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/ccp_pass.cpp @@ -24,7 +24,6 @@ #include "source/opt/fold.h" #include "source/opt/function.h" -#include "source/opt/module.h" #include "source/opt/propagator.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/cfg_cleanup_pass.cpp b/3rdparty/spirv-tools/source/opt/cfg_cleanup_pass.cpp index 6d48637a4..26fed89fb 100644 --- a/3rdparty/spirv-tools/source/opt/cfg_cleanup_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/cfg_cleanup_pass.cpp @@ -16,13 +16,9 @@ // constructs (e.g., unreachable basic blocks, empty control flow structures, // etc) -#include -#include - #include "source/opt/cfg_cleanup_pass.h" #include "source/opt/function.h" -#include "source/opt/module.h" namespace spvtools { namespace opt { diff --git a/3rdparty/spirv-tools/source/opt/code_sink.cpp b/3rdparty/spirv-tools/source/opt/code_sink.cpp index 35a8df23b..90231791e 100644 --- a/3rdparty/spirv-tools/source/opt/code_sink.cpp +++ b/3rdparty/spirv-tools/source/opt/code_sink.cpp @@ -14,11 +14,9 @@ #include "code_sink.h" -#include #include #include "source/opt/instruction.h" -#include "source/opt/ir_builder.h" #include "source/opt/ir_context.h" #include "source/util/bit_vector.h" diff --git a/3rdparty/spirv-tools/source/opt/constants.cpp b/3rdparty/spirv-tools/source/opt/constants.cpp index d70e27bb2..9b4c89a65 100644 --- a/3rdparty/spirv-tools/source/opt/constants.cpp +++ b/3rdparty/spirv-tools/source/opt/constants.cpp @@ -14,7 +14,6 @@ #include "source/opt/constants.h" -#include #include #include "source/opt/ir_context.h" diff --git a/3rdparty/spirv-tools/source/opt/control_dependence.cpp b/3rdparty/spirv-tools/source/opt/control_dependence.cpp index a153cabfc..3d4813963 100644 --- a/3rdparty/spirv-tools/source/opt/control_dependence.cpp +++ b/3rdparty/spirv-tools/source/opt/control_dependence.cpp @@ -16,8 +16,6 @@ #include #include -#include -#include #include "source/opt/basic_block.h" #include "source/opt/cfg.h" diff --git a/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp b/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp index 2effc3e4c..c82db41ce 100644 --- a/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/convert_to_sampled_image_pass.cpp @@ -16,7 +16,6 @@ #include #include -#include #include "source/opt/ir_builder.h" #include "source/util/make_unique.h" diff --git a/3rdparty/spirv-tools/source/opt/dataflow.cpp b/3rdparty/spirv-tools/source/opt/dataflow.cpp index 8d74e4137..63737f198 100644 --- a/3rdparty/spirv-tools/source/opt/dataflow.cpp +++ b/3rdparty/spirv-tools/source/opt/dataflow.cpp @@ -14,7 +14,6 @@ #include "source/opt/dataflow.h" -#include #include namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp index 319b8d161..1526b9e05 100644 --- a/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp @@ -23,7 +23,6 @@ #include "source/cfa.h" #include "source/opt/ir_context.h" -#include "source/opt/iterator.h" #include "source/opt/struct_cfg_analysis.h" #include "source/util/make_unique.h" diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp index d02151560..500fd8af9 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_constant_pass.cpp @@ -20,7 +20,6 @@ #include #include "source/opt/def_use_manager.h" -#include "source/opt/ir_context.h" #include "source/opt/log.h" #include "source/opt/reflect.h" diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp index 916fc27a3..5553a3362 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_io_components_pass.cpp @@ -15,11 +15,9 @@ #include "source/opt/eliminate_dead_io_components_pass.h" -#include #include #include "source/opt/instruction.h" -#include "source/opt/ir_builder.h" #include "source/opt/ir_context.h" #include "source/util/bit_vector.h" diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp index f2f64f812..99711a16e 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.cpp @@ -219,7 +219,7 @@ Pass::Status EliminateDeadOutputStoresPass::DoDeadOutputStoreElimination() { var_id, [this, &var, is_builtin](Instruction* user) { auto op = user->opcode(); if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || - op == spv::Op::OpDecorate) + op == spv::Op::OpDecorate || user->IsNonSemanticInstruction()) return; if (is_builtin) KillAllDeadStoresOfBuiltinRef(user, &var); diff --git a/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h index 13785f349..676d4f4f0 100644 --- a/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h +++ b/3rdparty/spirv-tools/source/opt/eliminate_dead_output_stores_pass.h @@ -50,15 +50,9 @@ class EliminateDeadOutputStoresPass : public Pass { // Initialize elimination void InitializeElimination(); - // Do dead output store analysis - Status DoDeadOutputStoreAnalysis(); - // Do dead output store analysis Status DoDeadOutputStoreElimination(); - // Mark all locations live - void MarkAllLocsLive(); - // Kill all stores resulting from |ref|. void KillAllStoresOfRef(Instruction* ref); diff --git a/3rdparty/spirv-tools/source/opt/feature_manager.cpp b/3rdparty/spirv-tools/source/opt/feature_manager.cpp index 2a1c00664..07e053b8e 100644 --- a/3rdparty/spirv-tools/source/opt/feature_manager.cpp +++ b/3rdparty/spirv-tools/source/opt/feature_manager.cpp @@ -14,8 +14,6 @@ #include "source/opt/feature_manager.h" -#include -#include #include #include "source/enum_string_mapping.h" diff --git a/3rdparty/spirv-tools/source/opt/fold.cpp b/3rdparty/spirv-tools/source/opt/fold.cpp index 3c234c4e3..453756f8c 100644 --- a/3rdparty/spirv-tools/source/opt/fold.cpp +++ b/3rdparty/spirv-tools/source/opt/fold.cpp @@ -21,7 +21,6 @@ #include "source/opt/const_folding_rules.h" #include "source/opt/def_use_manager.h" #include "source/opt/folding_rules.h" -#include "source/opt/ir_builder.h" #include "source/opt/ir_context.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp b/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp index 132be0c4b..f6d61554a 100644 --- a/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp @@ -15,12 +15,9 @@ #include "source/opt/fold_spec_constant_op_and_composite_pass.h" #include -#include #include #include "source/opt/constants.h" -#include "source/opt/fold.h" -#include "source/opt/ir_context.h" #include "source/util/make_unique.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/folding_rules.cpp b/3rdparty/spirv-tools/source/opt/folding_rules.cpp index a2260ccb2..7730ac1d2 100644 --- a/3rdparty/spirv-tools/source/opt/folding_rules.cpp +++ b/3rdparty/spirv-tools/source/opt/folding_rules.cpp @@ -14,7 +14,6 @@ #include "source/opt/folding_rules.h" -#include #include #include #include diff --git a/3rdparty/spirv-tools/source/opt/function.cpp b/3rdparty/spirv-tools/source/opt/function.cpp index 6c7c949fd..2ee88eca8 100644 --- a/3rdparty/spirv-tools/source/opt/function.cpp +++ b/3rdparty/spirv-tools/source/opt/function.cpp @@ -15,9 +15,7 @@ #include "source/opt/function.h" #include -#include -#include "function.h" #include "ir_context.h" #include "source/util/bit_vector.h" diff --git a/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp b/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp index da2764fc8..8fff8a032 100644 --- a/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp @@ -141,18 +141,12 @@ #include "graphics_robust_access_pass.h" -#include -#include #include #include -#include #include -#include "constants.h" -#include "def_use_manager.h" #include "function.h" #include "ir_context.h" -#include "module.h" #include "pass.h" #include "source/diagnostic.h" #include "source/util/make_unique.h" diff --git a/3rdparty/spirv-tools/source/opt/interface_var_sroa.h b/3rdparty/spirv-tools/source/opt/interface_var_sroa.h index df7511bf3..45ed3717a 100644 --- a/3rdparty/spirv-tools/source/opt/interface_var_sroa.h +++ b/3rdparty/spirv-tools/source/opt/interface_var_sroa.h @@ -90,10 +90,6 @@ class InterfaceVariableScalarReplacement : public Pass { // |component|. Returns true whether the component exists or not. bool GetVariableComponent(Instruction* var, uint32_t* component); - // Returns the interface variable instruction whose result id is - // |interface_var_id|. - Instruction* GetInterfaceVariable(uint32_t interface_var_id); - // Returns the type of |var| as an instruction. Instruction* GetTypeOfVariable(Instruction* var); diff --git a/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp b/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp index bb6f6108c..2ec2147d6 100644 --- a/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp @@ -19,7 +19,6 @@ #include #include -#include "ir_builder.h" #include "source/opt/ir_context.h" #include "type_manager.h" diff --git a/3rdparty/spirv-tools/source/opt/ir_context.cpp b/3rdparty/spirv-tools/source/opt/ir_context.cpp index 889a671d0..26501c2cc 100644 --- a/3rdparty/spirv-tools/source/opt/ir_context.cpp +++ b/3rdparty/spirv-tools/source/opt/ir_context.cpp @@ -19,7 +19,6 @@ #include "OpenCLDebugInfo100.h" #include "source/latest_version_glsl_std_450_header.h" #include "source/opt/log.h" -#include "source/opt/mem_pass.h" #include "source/opt/reflect.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/ir_context.h b/3rdparty/spirv-tools/source/opt/ir_context.h index 35075de17..8419ee7e9 100644 --- a/3rdparty/spirv-tools/source/opt/ir_context.h +++ b/3rdparty/spirv-tools/source/opt/ir_context.h @@ -645,6 +645,17 @@ class IRContext { // all have the same stage. spv::ExecutionModel GetStage(); + // Returns true of the current target environment is at least that of the + // given environment. + bool IsTargetEnvAtLeast(spv_target_env env) { + // A bit of a hack. We assume that the target environments are appended to + // the enum, so that there is an appropriate order. + return syntax_context_->target_env >= env; + } + + // Return the target environment for the current context. + spv_target_env GetTargetEnv() const { return syntax_context_->target_env; } + private: // Builds the def-use manager from scratch, even if it was already valid. void BuildDefUseManager() { diff --git a/3rdparty/spirv-tools/source/opt/licm_pass.cpp b/3rdparty/spirv-tools/source/opt/licm_pass.cpp index 514518b46..c485115fe 100644 --- a/3rdparty/spirv-tools/source/opt/licm_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/licm_pass.cpp @@ -15,7 +15,6 @@ #include "source/opt/licm_pass.h" #include -#include #include "source/opt/module.h" #include "source/opt/pass.h" diff --git a/3rdparty/spirv-tools/source/opt/liveness.cpp b/3rdparty/spirv-tools/source/opt/liveness.cpp index fdf3f4e11..336f3ae52 100644 --- a/3rdparty/spirv-tools/source/opt/liveness.cpp +++ b/3rdparty/spirv-tools/source/opt/liveness.cpp @@ -309,7 +309,7 @@ void LivenessManager::ComputeLiveness() { def_use_mgr->ForEachUser(var_id, [this, &var](Instruction* user) { auto op = user->opcode(); if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || - op == spv::Op::OpDecorate) { + op == spv::Op::OpDecorate || user->IsNonSemanticInstruction()) { return; } MarkRefLive(user, &var); diff --git a/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp b/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp index 66e881336..6ec0c2d38 100644 --- a/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp @@ -16,7 +16,6 @@ #include "source/opt/local_access_chain_convert_pass.h" -#include "ir_builder.h" #include "ir_context.h" #include "iterator.h" #include "source/util/string_utils.h" @@ -398,60 +397,36 @@ Pass::Status LocalAccessChainConvertPass::Process() { void LocalAccessChainConvertPass::InitExtensions() { extensions_allowlist_.clear(); - extensions_allowlist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_8bit_storage", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - // SPV_KHR_variable_pointers - // Currently do not support extended pointer expressions - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - "SPV_EXT_shader_stencil_export", - "SPV_EXT_shader_viewport_index_layer", - "SPV_AMD_shader_image_load_store_lod", - "SPV_AMD_shader_fragment_mask", - "SPV_EXT_fragment_fully_covered", - "SPV_AMD_gpu_shader_half_float_fetch", - "SPV_GOOGLE_decorate_string", - "SPV_GOOGLE_hlsl_functionality1", - "SPV_GOOGLE_user_type", - "SPV_NV_shader_subgroup_partitioned", - "SPV_EXT_demote_to_helper_invocation", - "SPV_EXT_descriptor_indexing", - "SPV_NV_fragment_shader_barycentric", - "SPV_NV_compute_shader_derivatives", - "SPV_NV_shader_image_footprint", - "SPV_NV_shading_rate", - "SPV_NV_mesh_shader", - "SPV_NV_ray_tracing", - "SPV_KHR_ray_tracing", - "SPV_KHR_ray_query", - "SPV_EXT_fragment_invocation_density", - "SPV_KHR_terminate_invocation", - "SPV_KHR_subgroup_uniform_control_flow", - "SPV_KHR_integer_dot_product", - "SPV_EXT_shader_image_int64", - "SPV_KHR_non_semantic_info", - "SPV_KHR_uniform_group_instructions", - "SPV_KHR_fragment_shader_barycentric", - }); + extensions_allowlist_.insert( + {"SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", "SPV_KHR_8bit_storage", "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + // SPV_KHR_variable_pointers + // Currently do not support extended pointer expressions + "SPV_AMD_gpu_shader_int16", "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", + "SPV_GOOGLE_user_type", "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", + "SPV_NV_fragment_shader_barycentric", + "SPV_NV_compute_shader_derivatives", "SPV_NV_shader_image_footprint", + "SPV_NV_shading_rate", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", + "SPV_KHR_ray_tracing", "SPV_KHR_ray_query", + "SPV_EXT_fragment_invocation_density", "SPV_KHR_terminate_invocation", + "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product", + "SPV_EXT_shader_image_int64", "SPV_KHR_non_semantic_info", + "SPV_KHR_uniform_group_instructions", + "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model"}); } bool LocalAccessChainConvertPass::AnyIndexIsOutOfBounds( diff --git a/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp index c1789c885..063d1b95c 100644 --- a/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp @@ -18,7 +18,6 @@ #include -#include "source/opt/iterator.h" #include "source/util/string_utils.h" namespace spvtools { @@ -234,60 +233,59 @@ Pass::Status LocalSingleBlockLoadStoreElimPass::Process() { void LocalSingleBlockLoadStoreElimPass::InitExtensions() { extensions_allowlist_.clear(); - extensions_allowlist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_8bit_storage", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers", - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - "SPV_EXT_shader_stencil_export", - "SPV_EXT_shader_viewport_index_layer", - "SPV_AMD_shader_image_load_store_lod", - "SPV_AMD_shader_fragment_mask", - "SPV_EXT_fragment_fully_covered", - "SPV_AMD_gpu_shader_half_float_fetch", - "SPV_GOOGLE_decorate_string", - "SPV_GOOGLE_hlsl_functionality1", - "SPV_GOOGLE_user_type", - "SPV_NV_shader_subgroup_partitioned", - "SPV_EXT_demote_to_helper_invocation", - "SPV_EXT_descriptor_indexing", - "SPV_NV_fragment_shader_barycentric", - "SPV_NV_compute_shader_derivatives", - "SPV_NV_shader_image_footprint", - "SPV_NV_shading_rate", - "SPV_NV_mesh_shader", - "SPV_NV_ray_tracing", - "SPV_KHR_ray_tracing", - "SPV_KHR_ray_query", - "SPV_EXT_fragment_invocation_density", - "SPV_EXT_physical_storage_buffer", - "SPV_KHR_terminate_invocation", - "SPV_KHR_subgroup_uniform_control_flow", - "SPV_KHR_integer_dot_product", - "SPV_EXT_shader_image_int64", - "SPV_KHR_non_semantic_info", - "SPV_KHR_uniform_group_instructions", - "SPV_KHR_fragment_shader_barycentric", - }); + extensions_allowlist_.insert({"SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_8bit_storage", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + "SPV_KHR_variable_pointers", + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_GOOGLE_user_type", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_demote_to_helper_invocation", + "SPV_EXT_descriptor_indexing", + "SPV_NV_fragment_shader_barycentric", + "SPV_NV_compute_shader_derivatives", + "SPV_NV_shader_image_footprint", + "SPV_NV_shading_rate", + "SPV_NV_mesh_shader", + "SPV_NV_ray_tracing", + "SPV_KHR_ray_tracing", + "SPV_KHR_ray_query", + "SPV_EXT_fragment_invocation_density", + "SPV_EXT_physical_storage_buffer", + "SPV_KHR_terminate_invocation", + "SPV_KHR_subgroup_uniform_control_flow", + "SPV_KHR_integer_dot_product", + "SPV_EXT_shader_image_int64", + "SPV_KHR_non_semantic_info", + "SPV_KHR_uniform_group_instructions", + "SPV_KHR_fragment_shader_barycentric", + "SPV_KHR_vulkan_memory_model"}); } } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp index e494689fa..a0de44c70 100644 --- a/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp @@ -17,8 +17,6 @@ #include "source/opt/local_single_store_elim_pass.h" #include "source/cfa.h" -#include "source/latest_version_glsl_std_450_header.h" -#include "source/opt/iterator.h" #include "source/util/string_utils.h" namespace spvtools { @@ -88,57 +86,56 @@ Pass::Status LocalSingleStoreElimPass::Process() { } void LocalSingleStoreElimPass::InitExtensionAllowList() { - extensions_allowlist_.insert({ - "SPV_AMD_shader_explicit_vertex_parameter", - "SPV_AMD_shader_trinary_minmax", - "SPV_AMD_gcn_shader", - "SPV_KHR_shader_ballot", - "SPV_AMD_shader_ballot", - "SPV_AMD_gpu_shader_half_float", - "SPV_KHR_shader_draw_parameters", - "SPV_KHR_subgroup_vote", - "SPV_KHR_8bit_storage", - "SPV_KHR_16bit_storage", - "SPV_KHR_device_group", - "SPV_KHR_multiview", - "SPV_NVX_multiview_per_view_attributes", - "SPV_NV_viewport_array2", - "SPV_NV_stereo_view_rendering", - "SPV_NV_sample_mask_override_coverage", - "SPV_NV_geometry_shader_passthrough", - "SPV_AMD_texture_gather_bias_lod", - "SPV_KHR_storage_buffer_storage_class", - "SPV_KHR_variable_pointers", - "SPV_AMD_gpu_shader_int16", - "SPV_KHR_post_depth_coverage", - "SPV_KHR_shader_atomic_counter_ops", - "SPV_EXT_shader_stencil_export", - "SPV_EXT_shader_viewport_index_layer", - "SPV_AMD_shader_image_load_store_lod", - "SPV_AMD_shader_fragment_mask", - "SPV_EXT_fragment_fully_covered", - "SPV_AMD_gpu_shader_half_float_fetch", - "SPV_GOOGLE_decorate_string", - "SPV_GOOGLE_hlsl_functionality1", - "SPV_NV_shader_subgroup_partitioned", - "SPV_EXT_descriptor_indexing", - "SPV_NV_fragment_shader_barycentric", - "SPV_NV_compute_shader_derivatives", - "SPV_NV_shader_image_footprint", - "SPV_NV_shading_rate", - "SPV_NV_mesh_shader", - "SPV_NV_ray_tracing", - "SPV_KHR_ray_query", - "SPV_EXT_fragment_invocation_density", - "SPV_EXT_physical_storage_buffer", - "SPV_KHR_terminate_invocation", - "SPV_KHR_subgroup_uniform_control_flow", - "SPV_KHR_integer_dot_product", - "SPV_EXT_shader_image_int64", - "SPV_KHR_non_semantic_info", - "SPV_KHR_uniform_group_instructions", - "SPV_KHR_fragment_shader_barycentric", - }); + extensions_allowlist_.insert({"SPV_AMD_shader_explicit_vertex_parameter", + "SPV_AMD_shader_trinary_minmax", + "SPV_AMD_gcn_shader", + "SPV_KHR_shader_ballot", + "SPV_AMD_shader_ballot", + "SPV_AMD_gpu_shader_half_float", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_subgroup_vote", + "SPV_KHR_8bit_storage", + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_multiview", + "SPV_NVX_multiview_per_view_attributes", + "SPV_NV_viewport_array2", + "SPV_NV_stereo_view_rendering", + "SPV_NV_sample_mask_override_coverage", + "SPV_NV_geometry_shader_passthrough", + "SPV_AMD_texture_gather_bias_lod", + "SPV_KHR_storage_buffer_storage_class", + "SPV_KHR_variable_pointers", + "SPV_AMD_gpu_shader_int16", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_shader_atomic_counter_ops", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + "SPV_AMD_shader_image_load_store_lod", + "SPV_AMD_shader_fragment_mask", + "SPV_EXT_fragment_fully_covered", + "SPV_AMD_gpu_shader_half_float_fetch", + "SPV_GOOGLE_decorate_string", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_NV_shader_subgroup_partitioned", + "SPV_EXT_descriptor_indexing", + "SPV_NV_fragment_shader_barycentric", + "SPV_NV_compute_shader_derivatives", + "SPV_NV_shader_image_footprint", + "SPV_NV_shading_rate", + "SPV_NV_mesh_shader", + "SPV_NV_ray_tracing", + "SPV_KHR_ray_query", + "SPV_EXT_fragment_invocation_density", + "SPV_EXT_physical_storage_buffer", + "SPV_KHR_terminate_invocation", + "SPV_KHR_subgroup_uniform_control_flow", + "SPV_KHR_integer_dot_product", + "SPV_EXT_shader_image_int64", + "SPV_KHR_non_semantic_info", + "SPV_KHR_uniform_group_instructions", + "SPV_KHR_fragment_shader_barycentric", + "SPV_KHR_vulkan_memory_model"}); } bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) { std::vector users; diff --git a/3rdparty/spirv-tools/source/opt/loop_dependence.cpp b/3rdparty/spirv-tools/source/opt/loop_dependence.cpp index d7256bf84..e41c044af 100644 --- a/3rdparty/spirv-tools/source/opt/loop_dependence.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_dependence.cpp @@ -15,14 +15,12 @@ #include "source/opt/loop_dependence.h" #include -#include #include #include #include #include #include "source/opt/instruction.h" -#include "source/opt/scalar_analysis.h" #include "source/opt/scalar_analysis_nodes.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp b/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp index 929c9404b..5d7d99403 100644 --- a/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_dependence_helpers.cpp @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "source/opt/loop_dependence.h" - #include #include #include @@ -23,7 +21,7 @@ #include "source/opt/basic_block.h" #include "source/opt/instruction.h" -#include "source/opt/scalar_analysis.h" +#include "source/opt/loop_dependence.h" #include "source/opt/scalar_analysis_nodes.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp b/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp index 172b97815..2a9f90594 100644 --- a/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp @@ -15,17 +15,14 @@ #include "source/opt/loop_descriptor.h" #include -#include #include #include -#include #include #include #include "source/opt/cfg.h" #include "source/opt/constants.h" #include "source/opt/dominator_tree.h" -#include "source/opt/ir_builder.h" #include "source/opt/ir_context.h" #include "source/opt/iterator.h" #include "source/opt/tree_iterator.h" diff --git a/3rdparty/spirv-tools/source/opt/loop_fusion_pass.cpp b/3rdparty/spirv-tools/source/opt/loop_fusion_pass.cpp index bd8444ae5..097430fcf 100644 --- a/3rdparty/spirv-tools/source/opt/loop_fusion_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_fusion_pass.cpp @@ -14,7 +14,6 @@ #include "source/opt/loop_fusion_pass.h" -#include "source/opt/ir_context.h" #include "source/opt/loop_descriptor.h" #include "source/opt/loop_fusion.h" #include "source/opt/register_pressure.h" diff --git a/3rdparty/spirv-tools/source/opt/loop_peeling.cpp b/3rdparty/spirv-tools/source/opt/loop_peeling.cpp index d51227303..25c6db120 100644 --- a/3rdparty/spirv-tools/source/opt/loop_peeling.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_peeling.cpp @@ -12,17 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include "source/opt/loop_peeling.h" + #include #include -#include #include #include #include "source/opt/ir_builder.h" #include "source/opt/ir_context.h" #include "source/opt/loop_descriptor.h" -#include "source/opt/loop_peeling.h" #include "source/opt/loop_utils.h" #include "source/opt/scalar_analysis.h" #include "source/opt/scalar_analysis_nodes.h" diff --git a/3rdparty/spirv-tools/source/opt/loop_unroller.cpp b/3rdparty/spirv-tools/source/opt/loop_unroller.cpp index 07b529d49..d9e34f242 100644 --- a/3rdparty/spirv-tools/source/opt/loop_unroller.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_unroller.cpp @@ -15,7 +15,6 @@ #include "source/opt/loop_unroller.h" #include -#include #include #include #include diff --git a/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp b/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp index b00d66de8..41f1a804b 100644 --- a/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -31,7 +30,6 @@ #include "source/opt/ir_builder.h" #include "source/opt/ir_context.h" #include "source/opt/loop_descriptor.h" - #include "source/opt/loop_utils.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/mem_pass.cpp b/3rdparty/spirv-tools/source/opt/mem_pass.cpp index 5f5929186..9f9578569 100644 --- a/3rdparty/spirv-tools/source/opt/mem_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/mem_pass.cpp @@ -22,9 +22,7 @@ #include "source/cfa.h" #include "source/opt/basic_block.h" -#include "source/opt/dominator_analysis.h" #include "source/opt/ir_context.h" -#include "source/opt/iterator.h" namespace spvtools { namespace opt { diff --git a/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp b/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp index 90c3acff2..0df559b34 100644 --- a/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp @@ -15,8 +15,6 @@ #include "source/opt/remove_duplicates_pass.h" #include -#include -#include #include #include #include @@ -25,7 +23,6 @@ #include "source/opcode.h" #include "source/opt/decoration_manager.h" #include "source/opt/ir_context.h" -#include "source/opt/reflect.h" namespace spvtools { namespace opt { diff --git a/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.h b/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.h index 7f11187ca..a4cb1085a 100644 --- a/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.h +++ b/3rdparty/spirv-tools/source/opt/remove_unused_interface_variables_pass.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifndef SOURCE_OPT_REMOVE_UNUSED_INTERFACE_VARIABLES_PASS_H_ +#define SOURCE_OPT_REMOVE_UNUSED_INTERFACE_VARIABLES_PASS_H_ + #include "source/opt/pass.h" namespace spvtools { namespace opt { @@ -23,4 +26,6 @@ class RemoveUnusedInterfaceVariablesPass : public Pass { Status Process() override; }; } // namespace opt -} // namespace spvtools \ No newline at end of file +} // namespace spvtools + +#endif // SOURCE_OPT_REMOVE_UNUSED_INTERFACE_VARIABLES_PASS_H_ \ No newline at end of file diff --git a/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp b/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp index 214097398..1b97c0e84 100644 --- a/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp +++ b/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp @@ -86,7 +86,8 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function, } if (model != spv::ExecutionModel::TessellationControl && - model != spv::ExecutionModel::GLCompute) { + model != spv::ExecutionModel::GLCompute && + !context()->IsTargetEnvAtLeast(SPV_ENV_UNIVERSAL_1_3)) { if (inst->opcode() == spv::Op::OpControlBarrier) { assert(model != spv::ExecutionModel::Kernel && "Expecting to be working on a shader module."); diff --git a/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp b/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp index 0c8babe8a..26cc8b303 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp +++ b/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp @@ -14,7 +14,6 @@ #include "source/opt/scalar_analysis.h" -#include #include #include #include diff --git a/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp b/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp index 3c1ecc082..3c0947cda 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp +++ b/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp @@ -12,16 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "source/opt/scalar_analysis.h" - #include #include #include #include -#include #include #include +#include "source/opt/scalar_analysis.h" + // Simplifies scalar analysis DAGs. // // 1. Given a node passed to SimplifyExpression we first simplify the graph by diff --git a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp index bfebb01c8..ae1a2a363 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp @@ -19,12 +19,10 @@ #include #include -#include "source/enum_string_mapping.h" #include "source/extensions.h" #include "source/opt/reflect.h" #include "source/opt/types.h" #include "source/util/make_unique.h" -#include "types.h" namespace spvtools { namespace opt { diff --git a/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp b/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp index 5125bd153..d2aa9b1da 100644 --- a/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp @@ -21,8 +21,6 @@ #include #include "source/opt/def_use_manager.h" -#include "source/opt/ir_context.h" -#include "source/opt/type_manager.h" #include "source/opt/types.h" #include "source/util/make_unique.h" #include "source/util/parse_number.h" diff --git a/3rdparty/spirv-tools/source/opt/simplification_pass.cpp b/3rdparty/spirv-tools/source/opt/simplification_pass.cpp index dbda39728..f8ffc03c2 100644 --- a/3rdparty/spirv-tools/source/opt/simplification_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/simplification_pass.cpp @@ -14,7 +14,6 @@ #include "source/opt/simplification_pass.h" -#include #include #include diff --git a/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp b/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp index 3037274d3..e552ba5e7 100644 --- a/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp +++ b/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp @@ -15,7 +15,6 @@ #include "source/opt/spread_volatile_semantics.h" #include "source/opt/decoration_manager.h" -#include "source/opt/ir_builder.h" #include "source/spirv_constant.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp b/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp index b8e22908d..3eb4ec3f8 100644 --- a/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp @@ -48,7 +48,6 @@ #include "source/opt/cfg.h" #include "source/opt/mem_pass.h" #include "source/opt/types.h" -#include "source/util/make_unique.h" // Debug logging (0: Off, 1-N: Verbosity level). Replace this with the // implementation done for diff --git a/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp b/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp index f2e849871..16a7869ec 100644 --- a/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/strength_reduction_pass.cpp @@ -14,12 +14,8 @@ #include "source/opt/strength_reduction_pass.h" -#include -#include #include #include -#include -#include #include #include diff --git a/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp b/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp index 889969007..3886835ad 100644 --- a/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp @@ -14,7 +14,6 @@ #include "source/opt/strip_nonsemantic_info_pass.h" -#include #include #include "source/opt/instruction.h" diff --git a/3rdparty/spirv-tools/source/opt/types.cpp b/3rdparty/spirv-tools/source/opt/types.cpp index ab95906b6..2f1836281 100644 --- a/3rdparty/spirv-tools/source/opt/types.cpp +++ b/3rdparty/spirv-tools/source/opt/types.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include #include diff --git a/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp b/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp index f774aa6b6..83dd438b6 100644 --- a/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp @@ -20,7 +20,6 @@ #include #include "source/opt/def_use_manager.h" -#include "source/opt/ir_context.h" #include "source/util/make_unique.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/basic_block.cpp b/3rdparty/spirv-tools/source/val/basic_block.cpp index da05db3a8..9a358fcb9 100644 --- a/3rdparty/spirv-tools/source/val/basic_block.cpp +++ b/3rdparty/spirv-tools/source/val/basic_block.cpp @@ -15,7 +15,6 @@ #include "source/val/basic_block.h" #include -#include #include namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/construct.cpp b/3rdparty/spirv-tools/source/val/construct.cpp index 1ca81d416..10af155da 100644 --- a/3rdparty/spirv-tools/source/val/construct.cpp +++ b/3rdparty/spirv-tools/source/val/construct.cpp @@ -16,7 +16,6 @@ #include #include -#include #include "source/val/function.h" #include "source/val/validation_state.h" diff --git a/3rdparty/spirv-tools/source/val/function.cpp b/3rdparty/spirv-tools/source/val/function.cpp index 8b4423a1f..290574b85 100644 --- a/3rdparty/spirv-tools/source/val/function.cpp +++ b/3rdparty/spirv-tools/source/val/function.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "source/cfa.h" diff --git a/3rdparty/spirv-tools/source/val/validate.cpp b/3rdparty/spirv-tools/source/val/validate.cpp index 52cb0d8bb..e73e46602 100644 --- a/3rdparty/spirv-tools/source/val/validate.cpp +++ b/3rdparty/spirv-tools/source/val/validate.cpp @@ -14,13 +14,9 @@ #include "source/val/validate.h" -#include -#include -#include #include #include #include -#include #include #include @@ -28,15 +24,11 @@ #include "source/diagnostic.h" #include "source/enum_string_mapping.h" #include "source/extensions.h" -#include "source/instruction.h" #include "source/opcode.h" -#include "source/operand.h" #include "source/spirv_constant.h" #include "source/spirv_endian.h" #include "source/spirv_target_env.h" -#include "source/spirv_validator_options.h" #include "source/val/construct.h" -#include "source/val/function.h" #include "source/val/instruction.h" #include "source/val/validation_state.h" #include "spirv-tools/libspirv.h" diff --git a/3rdparty/spirv-tools/source/val/validate.h b/3rdparty/spirv-tools/source/val/validate.h index 898743859..2cd229f96 100644 --- a/3rdparty/spirv-tools/source/val/validate.h +++ b/3rdparty/spirv-tools/source/val/validate.h @@ -31,11 +31,6 @@ class ValidationState_t; class BasicBlock; class Instruction; -/// A function that returns a vector of BasicBlocks given a BasicBlock. Used to -/// get the successor and predecessor nodes of a CFG block -using get_blocks_func = - std::function*(const BasicBlock*)>; - /// @brief Performs the Control Flow Graph checks /// /// @param[in] _ the validation state of the module diff --git a/3rdparty/spirv-tools/source/val/validate_adjacency.cpp b/3rdparty/spirv-tools/source/val/validate_adjacency.cpp index 50c2e92ae..7e371c2f9 100644 --- a/3rdparty/spirv-tools/source/val/validate_adjacency.cpp +++ b/3rdparty/spirv-tools/source/val/validate_adjacency.cpp @@ -15,13 +15,10 @@ // Validates correctness of the intra-block preconditions of SPIR-V // instructions. -#include "source/val/validate.h" - #include -#include "source/diagnostic.h" -#include "source/opcode.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp b/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp index a082eebc9..4e7dd5e88 100644 --- a/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp +++ b/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp @@ -14,13 +14,11 @@ // Performs validation of arithmetic instructions. -#include "source/val/validate.h" - #include -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_atomics.cpp b/3rdparty/spirv-tools/source/val/validate_atomics.cpp index d6b094c4a..b745a9ec1 100644 --- a/3rdparty/spirv-tools/source/val/validate_atomics.cpp +++ b/3rdparty/spirv-tools/source/val/validate_atomics.cpp @@ -16,13 +16,11 @@ // Validates correctness of atomic SPIR-V instructions. -#include "source/val/validate.h" - -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_target_env.h" #include "source/util/bitutils.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validate_memory_semantics.h" #include "source/val/validate_scopes.h" #include "source/val/validation_state.h" diff --git a/3rdparty/spirv-tools/source/val/validate_barriers.cpp b/3rdparty/spirv-tools/source/val/validate_barriers.cpp index 59d886a11..0abd5c859 100644 --- a/3rdparty/spirv-tools/source/val/validate_barriers.cpp +++ b/3rdparty/spirv-tools/source/val/validate_barriers.cpp @@ -16,11 +16,8 @@ #include -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_constant.h" -#include "source/spirv_target_env.h" -#include "source/util/bitutils.h" #include "source/val/instruction.h" #include "source/val/validate.h" #include "source/val/validate_memory_semantics.h" diff --git a/3rdparty/spirv-tools/source/val/validate_bitwise.cpp b/3rdparty/spirv-tools/source/val/validate_bitwise.cpp index 6ab1faebc..d8d995814 100644 --- a/3rdparty/spirv-tools/source/val/validate_bitwise.cpp +++ b/3rdparty/spirv-tools/source/val/validate_bitwise.cpp @@ -14,7 +14,6 @@ // Validates correctness of bitwise instructions. -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_target_env.h" #include "source/val/instruction.h" diff --git a/3rdparty/spirv-tools/source/val/validate_builtins.cpp b/3rdparty/spirv-tools/source/val/validate_builtins.cpp index c07dcaddd..3e8171250 100644 --- a/3rdparty/spirv-tools/source/val/validate_builtins.cpp +++ b/3rdparty/spirv-tools/source/val/validate_builtins.cpp @@ -24,10 +24,8 @@ #include #include #include -#include #include -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_target_env.h" #include "source/util/bitutils.h" diff --git a/3rdparty/spirv-tools/source/val/validate_capability.cpp b/3rdparty/spirv-tools/source/val/validate_capability.cpp index d70c8273c..98dab4237 100644 --- a/3rdparty/spirv-tools/source/val/validate_capability.cpp +++ b/3rdparty/spirv-tools/source/val/validate_capability.cpp @@ -16,9 +16,7 @@ #include #include -#include -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/val/instruction.h" #include "source/val/validate.h" diff --git a/3rdparty/spirv-tools/source/val/validate_cfg.cpp b/3rdparty/spirv-tools/source/val/validate_cfg.cpp index a29b5fd07..7b3f7480f 100644 --- a/3rdparty/spirv-tools/source/val/validate_cfg.cpp +++ b/3rdparty/spirv-tools/source/val/validate_cfg.cpp @@ -12,11 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include #include #include -#include #include #include #include @@ -28,7 +26,6 @@ #include "source/cfa.h" #include "source/opcode.h" #include "source/spirv_constant.h" -#include "source/spirv_target_env.h" #include "source/spirv_validator_options.h" #include "source/val/basic_block.h" #include "source/val/construct.h" diff --git a/3rdparty/spirv-tools/source/val/validate_composites.cpp b/3rdparty/spirv-tools/source/val/validate_composites.cpp index e777f1640..2b83c63dd 100644 --- a/3rdparty/spirv-tools/source/val/validate_composites.cpp +++ b/3rdparty/spirv-tools/source/val/validate_composites.cpp @@ -14,12 +14,10 @@ // Validates correctness of composite SPIR-V instructions. -#include "source/val/validate.h" - -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_target_env.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_conversion.cpp b/3rdparty/spirv-tools/source/val/validate_conversion.cpp index c67b19685..476c1fe8b 100644 --- a/3rdparty/spirv-tools/source/val/validate_conversion.cpp +++ b/3rdparty/spirv-tools/source/val/validate_conversion.cpp @@ -14,7 +14,6 @@ // Validates correctness of conversion instructions. -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_constant.h" #include "source/spirv_target_env.h" diff --git a/3rdparty/spirv-tools/source/val/validate_debug.cpp b/3rdparty/spirv-tools/source/val/validate_debug.cpp index c433c939f..ef537ea02 100644 --- a/3rdparty/spirv-tools/source/val/validate_debug.cpp +++ b/3rdparty/spirv-tools/source/val/validate_debug.cpp @@ -12,11 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "source/val/validate.h" - -#include "source/opcode.h" #include "source/spirv_target_env.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_decorations.cpp b/3rdparty/spirv-tools/source/val/validate_decorations.cpp index f9c843521..c1fca45f9 100644 --- a/3rdparty/spirv-tools/source/val/validate_decorations.cpp +++ b/3rdparty/spirv-tools/source/val/validate_decorations.cpp @@ -21,7 +21,6 @@ #include #include -#include "source/binary.h" #include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_constant.h" @@ -48,13 +47,6 @@ struct PairHash { } }; -// A functor for hashing decoration types. -struct SpvDecorationHash { - std::size_t operator()(spv::Decoration dec) const { - return static_cast(dec); - } -}; - // Struct member layout attributes that are inherited through arrays. struct LayoutConstraints { explicit LayoutConstraints( diff --git a/3rdparty/spirv-tools/source/val/validate_derivatives.cpp b/3rdparty/spirv-tools/source/val/validate_derivatives.cpp index d87240f60..90cf6645c 100644 --- a/3rdparty/spirv-tools/source/val/validate_derivatives.cpp +++ b/3rdparty/spirv-tools/source/val/validate_derivatives.cpp @@ -14,13 +14,11 @@ // Validates correctness of derivative SPIR-V instructions. -#include "source/val/validate.h" - #include -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp b/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp index 00c660358..0221d7ef2 100644 --- a/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp +++ b/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp @@ -13,8 +13,6 @@ // limitations under the License. #include "source/val/validate.h" - -#include "source/val/function.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_extensions.cpp b/3rdparty/spirv-tools/source/val/validate_extensions.cpp index fa58e0f94..0ac62bfc8 100644 --- a/3rdparty/spirv-tools/source/val/validate_extensions.cpp +++ b/3rdparty/spirv-tools/source/val/validate_extensions.cpp @@ -18,22 +18,18 @@ #include #include -#include "spirv/unified1/NonSemanticClspvReflection.h" - #include "NonSemanticShaderDebugInfo100.h" #include "OpenCLDebugInfo100.h" #include "source/common_debug_info.h" -#include "source/diagnostic.h" #include "source/enum_string_mapping.h" #include "source/extensions.h" #include "source/latest_version_glsl_std_450_header.h" #include "source/latest_version_opencl_std_header.h" -#include "source/opcode.h" #include "source/spirv_constant.h" -#include "source/spirv_target_env.h" #include "source/val/instruction.h" #include "source/val/validate.h" #include "source/val/validation_state.h" +#include "spirv/unified1/NonSemanticClspvReflection.h" namespace spvtools { namespace val { diff --git a/3rdparty/spirv-tools/source/val/validate_id.cpp b/3rdparty/spirv-tools/source/val/validate_id.cpp index 89a5ddd79..92a4e8e33 100644 --- a/3rdparty/spirv-tools/source/val/validate_id.cpp +++ b/3rdparty/spirv-tools/source/val/validate_id.cpp @@ -12,25 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "source/val/validate.h" - -#include - -#include -#include -#include -#include -#include #include -#include #include -#include "source/diagnostic.h" #include "source/instruction.h" #include "source/opcode.h" #include "source/operand.h" -#include "source/spirv_validator_options.h" #include "source/val/function.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" #include "spirv-tools/libspirv.h" diff --git a/3rdparty/spirv-tools/source/val/validate_image.cpp b/3rdparty/spirv-tools/source/val/validate_image.cpp index 8f0e6c4d4..ebcd8c3b7 100644 --- a/3rdparty/spirv-tools/source/val/validate_image.cpp +++ b/3rdparty/spirv-tools/source/val/validate_image.cpp @@ -18,7 +18,6 @@ #include -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_constant.h" #include "source/spirv_target_env.h" @@ -1996,11 +1995,11 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _, << " components, but given only " << actual_coord_size; } - // The operad is a sampled image. + // The operand is a sampled image. // The sampled image type is already checked to be parameterized by an image // type with Sampled=0 or Sampled=1. Vulkan bans Sampled=0, and so we have // Sampled=1. So the validator already enforces Vulkan VUID 4659: - // OpImageQuerySizeLod must only consume an “Image†operand whose type has + // OpImageQuerySizeLod must only consume an "Image" operand whose type has // its "Sampled" operand set to 1 return SPV_SUCCESS; } diff --git a/3rdparty/spirv-tools/source/val/validate_instruction.cpp b/3rdparty/spirv-tools/source/val/validate_instruction.cpp index 1b7847cac..fde6e52e5 100644 --- a/3rdparty/spirv-tools/source/val/validate_instruction.cpp +++ b/3rdparty/spirv-tools/source/val/validate_instruction.cpp @@ -14,26 +14,20 @@ // Performs validation on instructions that appear inside of a SPIR-V block. -#include #include -#include #include #include #include -#include "source/binary.h" -#include "source/diagnostic.h" #include "source/enum_set.h" #include "source/enum_string_mapping.h" #include "source/extensions.h" #include "source/opcode.h" #include "source/operand.h" #include "source/spirv_constant.h" -#include "source/spirv_definition.h" #include "source/spirv_target_env.h" #include "source/spirv_validator_options.h" #include "source/util/string_utils.h" -#include "source/val/function.h" #include "source/val/validate.h" #include "source/val/validation_state.h" diff --git a/3rdparty/spirv-tools/source/val/validate_interfaces.cpp b/3rdparty/spirv-tools/source/val/validate_interfaces.cpp index 00a5999bd..35666984d 100644 --- a/3rdparty/spirv-tools/source/val/validate_interfaces.cpp +++ b/3rdparty/spirv-tools/source/val/validate_interfaces.cpp @@ -15,7 +15,6 @@ #include #include -#include "source/diagnostic.h" #include "source/spirv_constant.h" #include "source/spirv_target_env.h" #include "source/val/function.h" diff --git a/3rdparty/spirv-tools/source/val/validate_layout.cpp b/3rdparty/spirv-tools/source/val/validate_layout.cpp index 238dd9b2f..dbc1f1e5d 100644 --- a/3rdparty/spirv-tools/source/val/validate_layout.cpp +++ b/3rdparty/spirv-tools/source/val/validate_layout.cpp @@ -14,12 +14,9 @@ // Source code for logical layout validation as described in section 2.4 -#include - #include "DebugInfo.h" #include "NonSemanticShaderDebugInfo100.h" #include "OpenCLDebugInfo100.h" -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/operand.h" #include "source/val/function.h" diff --git a/3rdparty/spirv-tools/source/val/validate_literals.cpp b/3rdparty/spirv-tools/source/val/validate_literals.cpp index 53aae0767..15cc27a92 100644 --- a/3rdparty/spirv-tools/source/val/validate_literals.cpp +++ b/3rdparty/spirv-tools/source/val/validate_literals.cpp @@ -14,13 +14,10 @@ // Validates literal numbers. -#include "source/val/validate.h" - #include -#include "source/diagnostic.h" -#include "source/opcode.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_logicals.cpp b/3rdparty/spirv-tools/source/val/validate_logicals.cpp index dd66ce948..4479e4395 100644 --- a/3rdparty/spirv-tools/source/val/validate_logicals.cpp +++ b/3rdparty/spirv-tools/source/val/validate_logicals.cpp @@ -14,11 +14,9 @@ // Validates correctness of logical SPIR-V instructions. -#include "source/val/validate.h" - -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp b/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp index 748b23861..c4f22a611 100644 --- a/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp +++ b/3rdparty/spirv-tools/source/val/validate_memory_semantics.cpp @@ -14,7 +14,6 @@ #include "source/val/validate_memory_semantics.h" -#include "source/diagnostic.h" #include "source/spirv_target_env.h" #include "source/util/bitutils.h" #include "source/val/instruction.h" diff --git a/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp b/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp index 5c5e9bd8b..af04e76af 100644 --- a/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp +++ b/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp @@ -14,14 +14,11 @@ // Validates correctness of barrier SPIR-V instructions. -#include "source/val/validate.h" - -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/spirv_constant.h" #include "source/spirv_target_env.h" -#include "source/util/bitutils.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validate_scopes.h" #include "source/val/validation_state.h" diff --git a/3rdparty/spirv-tools/source/val/validate_primitives.cpp b/3rdparty/spirv-tools/source/val/validate_primitives.cpp index 5e598c3ae..6769090db 100644 --- a/3rdparty/spirv-tools/source/val/validate_primitives.cpp +++ b/3rdparty/spirv-tools/source/val/validate_primitives.cpp @@ -14,13 +14,11 @@ // Validates correctness of primitive SPIR-V instructions. -#include "source/val/validate.h" - #include -#include "source/diagnostic.h" #include "source/opcode.h" #include "source/val/instruction.h" +#include "source/val/validate.h" #include "source/val/validation_state.h" namespace spvtools { diff --git a/3rdparty/spirv-tools/source/val/validate_scopes.cpp b/3rdparty/spirv-tools/source/val/validate_scopes.cpp index fa1dad9ec..40c49d1ff 100644 --- a/3rdparty/spirv-tools/source/val/validate_scopes.cpp +++ b/3rdparty/spirv-tools/source/val/validate_scopes.cpp @@ -14,7 +14,6 @@ #include "source/val/validate_scopes.h" -#include "source/diagnostic.h" #include "source/spirv_target_env.h" #include "source/val/instruction.h" #include "source/val/validation_state.h" @@ -240,7 +239,7 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst, !_.HasCapability(spv::Capability::SubgroupBallotKHR) && !_.HasCapability(spv::Capability::SubgroupVoteKHR)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) - << _.VkErrorID(6997) << spvOpcodeString(opcode) + << _.VkErrorID(7951) << spvOpcodeString(opcode) << ": in Vulkan 1.0 environment Memory Scope is can not be " "Subgroup without SubgroupBallotKHR or SubgroupVoteKHR " "declared"; diff --git a/3rdparty/spirv-tools/source/val/validation_state.cpp b/3rdparty/spirv-tools/source/val/validation_state.cpp index c95eec366..e43517850 100644 --- a/3rdparty/spirv-tools/source/val/validation_state.cpp +++ b/3rdparty/spirv-tools/source/val/validation_state.cpp @@ -2163,8 +2163,6 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-PushConstant-06808); case 6925: return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06925); - case 6997: - return VUID_WRAP(VUID-StandaloneSpirv-SubgroupVoteKHR-06997); case 7102: return VUID_WRAP(VUID-StandaloneSpirv-MeshEXT-07102); case 7320: @@ -2179,6 +2177,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-Base-07652); case 7703: return VUID_WRAP(VUID-StandaloneSpirv-Component-07703); + case 7951: + return VUID_WRAP(VUID-StandaloneSpirv-SubgroupVoteKHR-07951); default: return ""; // unknown id } From 49cc81e149fc54f96fd3b38938008e7de9bc792a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:03:12 -0700 Subject: [PATCH 59/86] Updated spirv-cross. --- 3rdparty/spirv-cross/main.cpp | 2 +- 3rdparty/spirv-cross/spirv_cross_c.cpp | 45 ++++++++++++ 3rdparty/spirv-cross/spirv_cross_c.h | 15 +++- .../spirv-cross/spirv_cross_containers.hpp | 1 + 3rdparty/spirv-cross/spirv_glsl.cpp | 28 ++++++-- 3rdparty/spirv-cross/spirv_glsl.hpp | 2 + 3rdparty/spirv-cross/spirv_hlsl.cpp | 30 ++++++-- 3rdparty/spirv-cross/spirv_hlsl.hpp | 1 + 3rdparty/spirv-cross/spirv_msl.cpp | 69 ++++++++++--------- 9 files changed, 146 insertions(+), 47 deletions(-) diff --git a/3rdparty/spirv-cross/main.cpp b/3rdparty/spirv-cross/main.cpp index 776fcd326..1f21c4c08 100644 --- a/3rdparty/spirv-cross/main.cpp +++ b/3rdparty/spirv-cross/main.cpp @@ -860,7 +860,7 @@ static void print_help_msl() "\t[--msl-domain-lower-left]:\n\t\tUse a lower-left tessellation domain.\n" "\t[--msl-argument-buffers]:\n\t\tEmit Metal argument buffers instead of discrete resource bindings.\n" "\t\tRequires MSL 2.0 to be enabled.\n" - "\t[--msl-argument-buffers-tier]:\n\t\tWhen using Metal argument buffers, indicate the Metal argument buffer tier level supported by the Metal platform.\n" + "\t[--msl-argument-buffer-tier]:\n\t\tWhen using Metal argument buffers, indicate the Metal argument buffer tier level supported by the Metal platform.\n" "\t\tUses same values as Metal MTLArgumentBuffersTier enumeration (0 = Tier1, 1 = Tier2).\n" "\t\tSetting this value also enables msl-argument-buffers.\n" "\t[--msl-texture-buffer-native]:\n\t\tEnable native support for texel buffers. Otherwise, it is emulated as a normal texture.\n" diff --git a/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/spirv-cross/spirv_cross_c.cpp index c8ebbe4ca..f76c14c0d 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.cpp +++ b/3rdparty/spirv-cross/spirv_cross_c.cpp @@ -2535,6 +2535,51 @@ spvc_type_id spvc_constant_get_type(spvc_constant constant) return constant->constant_type; } +void spvc_constant_set_scalar_fp16(spvc_constant constant, unsigned column, unsigned row, unsigned short value) +{ + constant->m.c[column].r[row].u32 = value; +} + +void spvc_constant_set_scalar_fp32(spvc_constant constant, unsigned column, unsigned row, float value) +{ + constant->m.c[column].r[row].f32 = value; +} + +void spvc_constant_set_scalar_fp64(spvc_constant constant, unsigned column, unsigned row, double value) +{ + constant->m.c[column].r[row].f64 = value; +} + +void spvc_constant_set_scalar_u32(spvc_constant constant, unsigned column, unsigned row, unsigned value) +{ + constant->m.c[column].r[row].u32 = value; +} + +void spvc_constant_set_scalar_i32(spvc_constant constant, unsigned column, unsigned row, int value) +{ + constant->m.c[column].r[row].i32 = value; +} + +void spvc_constant_set_scalar_u16(spvc_constant constant, unsigned column, unsigned row, unsigned short value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + +void spvc_constant_set_scalar_i16(spvc_constant constant, unsigned column, unsigned row, signed short value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + +void spvc_constant_set_scalar_u8(spvc_constant constant, unsigned column, unsigned row, unsigned char value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + +void spvc_constant_set_scalar_i8(spvc_constant constant, unsigned column, unsigned row, signed char value) +{ + constant->m.c[column].r[row].u32 = uint32_t(value); +} + spvc_bool spvc_compiler_get_binary_offset_for_decoration(spvc_compiler compiler, spvc_variable_id id, SpvDecoration decoration, unsigned *word_offset) diff --git a/3rdparty/spirv-cross/spirv_cross_c.h b/3rdparty/spirv-cross/spirv_cross_c.h index e39ff2c4e..7f8c6fad2 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.h +++ b/3rdparty/spirv-cross/spirv_cross_c.h @@ -40,7 +40,7 @@ extern "C" { /* Bumped if ABI or API breaks backwards compatibility. */ #define SPVC_C_API_VERSION_MAJOR 0 /* Bumped if APIs or enumerations are added in a backwards compatible way. */ -#define SPVC_C_API_VERSION_MINOR 55 +#define SPVC_C_API_VERSION_MINOR 56 /* Bumped if internal implementation details change. */ #define SPVC_C_API_VERSION_PATCH 0 @@ -1049,6 +1049,19 @@ SPVC_PUBLIC_API int spvc_constant_get_scalar_i8(spvc_constant constant, unsigned SPVC_PUBLIC_API void spvc_constant_get_subconstants(spvc_constant constant, const spvc_constant_id **constituents, size_t *count); SPVC_PUBLIC_API spvc_type_id spvc_constant_get_type(spvc_constant constant); +/* + * C implementation of the C++ api. + */ +SPVC_PUBLIC_API void spvc_constant_set_scalar_fp16(spvc_constant constant, unsigned column, unsigned row, unsigned short value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_fp32(spvc_constant constant, unsigned column, unsigned row, float value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_fp64(spvc_constant constant, unsigned column, unsigned row, double value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u32(spvc_constant constant, unsigned column, unsigned row, unsigned value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i32(spvc_constant constant, unsigned column, unsigned row, int value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u16(spvc_constant constant, unsigned column, unsigned row, unsigned short value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i16(spvc_constant constant, unsigned column, unsigned row, signed short value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_u8(spvc_constant constant, unsigned column, unsigned row, unsigned char value); +SPVC_PUBLIC_API void spvc_constant_set_scalar_i8(spvc_constant constant, unsigned column, unsigned row, signed char value); + /* * Misc reflection * Maps to C++ API. diff --git a/3rdparty/spirv-cross/spirv_cross_containers.hpp b/3rdparty/spirv-cross/spirv_cross_containers.hpp index 50513f49e..e79b32093 100644 --- a/3rdparty/spirv-cross/spirv_cross_containers.hpp +++ b/3rdparty/spirv-cross/spirv_cross_containers.hpp @@ -26,6 +26,7 @@ #include "spirv_cross_error_handling.hpp" #include +#include #include #include #include diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 48ed5efec..2ccc1a472 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -4688,7 +4688,7 @@ void CompilerGLSL::strip_enclosed_expression(string &expr) expr.erase(begin(expr)); } -string CompilerGLSL::enclose_expression(const string &expr) +bool CompilerGLSL::needs_enclose_expression(const std::string &expr) { bool need_parens = false; @@ -4722,10 +4722,15 @@ string CompilerGLSL::enclose_expression(const string &expr) assert(paren_count == 0); } + return need_parens; +} + +string CompilerGLSL::enclose_expression(const string &expr) +{ // If this expression contains any spaces which are not enclosed by parentheses, // we need to enclose it so we can treat the whole string as an expression. // This happens when two expressions have been part of a binary op earlier. - if (need_parens) + if (needs_enclose_expression(expr)) return join('(', expr, ')'); else return expr; @@ -6280,6 +6285,14 @@ void CompilerGLSL::emit_unary_op_cast(uint32_t result_type, uint32_t result_id, inherit_expression_dependencies(result_id, op0); } +void CompilerGLSL::emit_mesh_tasks(SPIRBlock &block) +{ + statement("EmitMeshTasksEXT(", + to_unpacked_expression(block.mesh.groups[0]), ", ", + to_unpacked_expression(block.mesh.groups[1]), ", ", + to_unpacked_expression(block.mesh.groups[2]), ");"); +} + void CompilerGLSL::emit_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op) { // Various FP arithmetic opcodes such as add, sub, mul will hit this. @@ -10889,6 +10902,12 @@ bool CompilerGLSL::optimize_read_modify_write(const SPIRType &type, const string char bop = rhs[op]; auto expr = rhs.substr(lhs.size() + 3); + + // Avoids false positives where we get a = a * b + c. + // Normally, these expressions are always enclosed, but unexpected code paths may end up hitting this. + if (needs_enclose_expression(expr)) + return false; + // Try to find increments and decrements. Makes it look neater as += 1, -= 1 is fairly rare to see in real code. // Find some common patterns which are equivalent. if ((bop == '+' || bop == '-') && (expr == "1" || expr == "uint(1)" || expr == "1u" || expr == "int(1u)")) @@ -16873,10 +16892,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) break; case SPIRBlock::EmitMeshTasks: - statement("EmitMeshTasksEXT(", - to_unpacked_expression(block.mesh.groups[0]), ", ", - to_unpacked_expression(block.mesh.groups[1]), ", ", - to_unpacked_expression(block.mesh.groups[2]), ");"); + emit_mesh_tasks(block); break; default: diff --git a/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/spirv-cross/spirv_glsl.hpp index d48ca8fd0..0b40ed801 100644 --- a/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/3rdparty/spirv-cross/spirv_glsl.hpp @@ -708,6 +708,7 @@ protected: void emit_unary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op); void emit_unary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op); + virtual void emit_mesh_tasks(SPIRBlock &block); bool expression_is_forwarded(uint32_t id) const; bool expression_suppresses_usage_tracking(uint32_t id) const; bool expression_read_implies_multiple_reads(uint32_t id) const; @@ -768,6 +769,7 @@ protected: std::string to_extract_component_expression(uint32_t id, uint32_t index); std::string to_extract_constant_composite_expression(uint32_t result_type, const SPIRConstant &c, const uint32_t *chain, uint32_t length); + static bool needs_enclose_expression(const std::string &expr); std::string enclose_expression(const std::string &expr); std::string dereference_expression(const SPIRType &expression_type, const std::string &expr); std::string address_of_expression(const std::string &expr); diff --git a/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/spirv-cross/spirv_hlsl.cpp index 23ad2bf1d..5763b5ffa 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -1808,8 +1808,10 @@ void CompilerHLSL::emit_resources() if (is_hidden_variable(var, true)) continue; - if (var.storage != StorageClassOutput && - var.storage != StorageClassTaskPayloadWorkgroupEXT) + if (var.storage == StorageClassTaskPayloadWorkgroupEXT && is_mesh_shader) + continue; + + if (var.storage != StorageClassOutput) { if (!variable_is_lut(var)) { @@ -1819,6 +1821,7 @@ void CompilerHLSL::emit_resources() switch (var.storage) { case StorageClassWorkgroup: + case StorageClassTaskPayloadWorkgroupEXT: storage = "groupshared"; break; @@ -2573,6 +2576,19 @@ void CompilerHLSL::emit_rayquery_function(const char *commited, const char *cand emit_op(ops[0], ops[1], join(to_expression(ops[2]), is_commited ? commited : candidate), false); } +void CompilerHLSL::emit_mesh_tasks(SPIRBlock &block) +{ + if (block.mesh.payload != 0) + { + statement("DispatchMesh(", to_unpacked_expression(block.mesh.groups[0]), ", ", to_unpacked_expression(block.mesh.groups[1]), ", ", + to_unpacked_expression(block.mesh.groups[2]), ", ", to_unpacked_expression(block.mesh.payload), ");"); + } + else + { + SPIRV_CROSS_THROW("Amplification shader in HLSL must have payload"); + } +} + void CompilerHLSL::emit_buffer_block(const SPIRVariable &var) { auto &type = get(var.basetype); @@ -2818,6 +2834,8 @@ string CompilerHLSL::get_inner_entry_point_name() const return "comp_main"; else if (execution.model == ExecutionModelMeshEXT) return "mesh_main"; + else if (execution.model == ExecutionModelTaskEXT) + return "task_main"; else SPIRV_CROSS_THROW("Unsupported execution model."); } @@ -2931,8 +2949,8 @@ void CompilerHLSL::emit_hlsl_entry_point() switch (execution.model) { + case ExecutionModelTaskEXT: case ExecutionModelMeshEXT: - case ExecutionModelMeshNV: case ExecutionModelGLCompute: { if (execution.model == ExecutionModelMeshEXT) @@ -3205,7 +3223,8 @@ void CompilerHLSL::emit_hlsl_entry_point() if (execution.model == ExecutionModelVertex || execution.model == ExecutionModelFragment || execution.model == ExecutionModelGLCompute || - execution.model == ExecutionModelMeshEXT) + execution.model == ExecutionModelMeshEXT || + execution.model == ExecutionModelTaskEXT) { // For mesh shaders, we receive special arguments that we must pass down as function arguments. // HLSL does not support proper reference types for passing these IO blocks, @@ -6243,7 +6262,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) case OpRayQueryGenerateIntersectionKHR: { flush_variable_declaration(ops[0]); - statement(to_expression(ops[0]), ".CommitProceduralPrimitiveHit(", ops[1], ");"); + statement(to_expression(ops[0]), ".CommitProceduralPrimitiveHit(", to_expression(ops[1]), ");"); break; } case OpRayQueryConfirmIntersectionKHR: @@ -6355,7 +6374,6 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) statement("SetMeshOutputCounts(", to_unpacked_expression(ops[0]), ", ", to_unpacked_expression(ops[1]), ");"); break; } - default: CompilerGLSL::emit_instruction(instruction); break; diff --git a/3rdparty/spirv-cross/spirv_hlsl.hpp b/3rdparty/spirv-cross/spirv_hlsl.hpp index 2e16ebd30..51af5bf07 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.hpp +++ b/3rdparty/spirv-cross/spirv_hlsl.hpp @@ -280,6 +280,7 @@ private: void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, const std::string &qualifier, uint32_t base_offset = 0) override; void emit_rayquery_function(const char *commited, const char *candidate, const uint32_t *ops); + void emit_mesh_tasks(SPIRBlock &block) override; const char *to_storage_qualifiers_glsl(const SPIRVariable &var) override; void replace_illegal_names() override; diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index 8f71c1699..5ff98b7be 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -17280,41 +17280,44 @@ void CompilerMSL::analyze_argument_buffers() // member_index and next_arg_buff_index are incremented when padding members are added. if (msl_options.pad_argument_buffer_resources) { - while (resource.index > next_arg_buff_index) + if (!resource.descriptor_alias) { - auto &rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index); - switch (rez_bind.basetype) + while (resource.index > next_arg_buff_index) { - case SPIRType::Void: - case SPIRType::Boolean: - case SPIRType::SByte: - case SPIRType::UByte: - case SPIRType::Short: - case SPIRType::UShort: - case SPIRType::Int: - case SPIRType::UInt: - case SPIRType::Int64: - case SPIRType::UInt64: - case SPIRType::AtomicCounter: - case SPIRType::Half: - case SPIRType::Float: - case SPIRType::Double: - add_argument_buffer_padding_buffer_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - case SPIRType::Image: - add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - case SPIRType::Sampler: - add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - case SPIRType::SampledImage: - if (next_arg_buff_index == rez_bind.msl_sampler) - add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - else + auto &rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index); + switch (rez_bind.basetype) + { + case SPIRType::Void: + case SPIRType::Boolean: + case SPIRType::SByte: + case SPIRType::UByte: + case SPIRType::Short: + case SPIRType::UShort: + case SPIRType::Int: + case SPIRType::UInt: + case SPIRType::Int64: + case SPIRType::UInt64: + case SPIRType::AtomicCounter: + case SPIRType::Half: + case SPIRType::Float: + case SPIRType::Double: + add_argument_buffer_padding_buffer_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::Image: add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); - break; - default: - break; + break; + case SPIRType::Sampler: + add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + case SPIRType::SampledImage: + if (next_arg_buff_index == rez_bind.msl_sampler) + add_argument_buffer_padding_sampler_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + else + add_argument_buffer_padding_image_type(buffer_type, member_index, next_arg_buff_index, rez_bind); + break; + default: + break; + } } } @@ -17595,7 +17598,7 @@ string CompilerMSL::additional_fixed_sample_mask_str() const #pragma warning(push) #pragma warning(disable : 4996) #endif -#if _WIN32 +#if defined(_WIN32) sprintf(print_buffer, "0x%x", msl_options.additional_fixed_sample_mask); #else snprintf(print_buffer, sizeof(print_buffer), "0x%x", msl_options.additional_fixed_sample_mask); From 6b29d8ee2be8383edd49c11026f5dc2cce0f907d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:03:34 -0700 Subject: [PATCH 60/86] Updated vulkan headers. --- 3rdparty/khronos/vulkan-local/vk_icd.h | 2 +- 3rdparty/khronos/vulkan-local/vulkan_beta.h | 45 +++++ 3rdparty/khronos/vulkan-local/vulkan_core.h | 172 +++++++++++++++++++- 3 files changed, 217 insertions(+), 2 deletions(-) diff --git a/3rdparty/khronos/vulkan-local/vk_icd.h b/3rdparty/khronos/vulkan-local/vk_icd.h index 1133fa367..2cd6c3d33 100644 --- a/3rdparty/khronos/vulkan-local/vk_icd.h +++ b/3rdparty/khronos/vulkan-local/vk_icd.h @@ -78,7 +78,7 @@ extern "C" { #endif VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pVersion); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName); - VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance isntance, const char* pName); + VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance instance, const char* pName); #if defined(VK_USE_PLATFORM_WIN32_KHR) VKAPI_ATTR VkResult VKAPI_CALL vk_icdEnumerateAdapterPhysicalDevices(VkInstance instance, LUID adapterLUID, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); diff --git a/3rdparty/khronos/vulkan-local/vulkan_beta.h b/3rdparty/khronos/vulkan-local/vulkan_beta.h index a118d7721..b0729cc37 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_beta.h +++ b/3rdparty/khronos/vulkan-local/vulkan_beta.h @@ -485,6 +485,51 @@ typedef struct VkVideoEncodeH265RateControlLayerInfoEXT { } VkVideoEncodeH265RateControlLayerInfoEXT; + +#define VK_NV_displacement_micromap 1 +#define VK_NV_DISPLACEMENT_MICROMAP_SPEC_VERSION 1 +#define VK_NV_DISPLACEMENT_MICROMAP_EXTENSION_NAME "VK_NV_displacement_micromap" + +typedef enum VkDisplacementMicromapFormatNV { + VK_DISPLACEMENT_MICROMAP_FORMAT_64_TRIANGLES_64_BYTES_NV = 1, + VK_DISPLACEMENT_MICROMAP_FORMAT_256_TRIANGLES_128_BYTES_NV = 2, + VK_DISPLACEMENT_MICROMAP_FORMAT_1024_TRIANGLES_128_BYTES_NV = 3, + VK_DISPLACEMENT_MICROMAP_FORMAT_MAX_ENUM_NV = 0x7FFFFFFF +} VkDisplacementMicromapFormatNV; +typedef struct VkPhysicalDeviceDisplacementMicromapFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 displacementMicromap; +} VkPhysicalDeviceDisplacementMicromapFeaturesNV; + +typedef struct VkPhysicalDeviceDisplacementMicromapPropertiesNV { + VkStructureType sType; + void* pNext; + uint32_t maxDisplacementMicromapSubdivisionLevel; +} VkPhysicalDeviceDisplacementMicromapPropertiesNV; + +typedef struct VkAccelerationStructureTrianglesDisplacementMicromapNV { + VkStructureType sType; + void* pNext; + VkFormat displacementBiasAndScaleFormat; + VkFormat displacementVectorFormat; + VkDeviceOrHostAddressConstKHR displacementBiasAndScaleBuffer; + VkDeviceSize displacementBiasAndScaleStride; + VkDeviceOrHostAddressConstKHR displacementVectorBuffer; + VkDeviceSize displacementVectorStride; + VkDeviceOrHostAddressConstKHR displacedMicromapPrimitiveFlags; + VkDeviceSize displacedMicromapPrimitiveFlagsStride; + VkIndexType indexType; + VkDeviceOrHostAddressConstKHR indexBuffer; + VkDeviceSize indexStride; + uint32_t baseTriangle; + uint32_t usageCountsCount; + const VkMicromapUsageEXT* pUsageCounts; + const VkMicromapUsageEXT* const* ppUsageCounts; + VkMicromapEXT micromap; +} VkAccelerationStructureTrianglesDisplacementMicromapNV; + + #ifdef __cplusplus } #endif diff --git a/3rdparty/khronos/vulkan-local/vulkan_core.h b/3rdparty/khronos/vulkan-local/vulkan_core.h index eee2051e8..c09369640 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_core.h +++ b/3rdparty/khronos/vulkan-local/vulkan_core.h @@ -68,7 +68,7 @@ extern "C" { #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 243 +#define VK_HEADER_VERSION 246 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) @@ -185,6 +185,7 @@ typedef enum VkResult { VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR = -1000299000, #endif VK_ERROR_COMPRESSION_EXHAUSTED_EXT = -1000338000, + VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT = 1000482000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, VK_ERROR_FRAGMENTATION_EXT = VK_ERROR_FRAGMENTATION, @@ -768,6 +769,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR = 1000269003, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR = 1000269004, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR = 1000269005, + VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR = 1000271000, + VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR = 1000271001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT = 1000273000, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT = 1000274000, VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT = 1000274001, @@ -931,6 +934,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT = 1000392000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT = 1000392001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT = 1000393000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT = 1000395000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT = 1000395001, VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT = 1000396000, VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT = 1000396001, VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT = 1000396002, @@ -941,6 +946,15 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT = 1000396007, VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT = 1000396008, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT = 1000396009, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_FEATURES_NV = 1000397000, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_PROPERTIES_NV = 1000397001, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_DISPLACEMENT_MICROMAP_NV = 1000397002, +#endif VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI = 1000404000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI = 1000404001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, @@ -988,6 +1002,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV = 1000464010, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT = 1000465000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT = 1000466000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT = 1000482000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT = 1000482001, + VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT = 1000482002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM = 1000484000, VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM = 1000484001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC = 1000485000, @@ -1175,6 +1192,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES, VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, + VK_STRUCTURE_TYPE_SHADER_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF } VkStructureType; @@ -1279,6 +1297,7 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA = 1000366000, VK_OBJECT_TYPE_MICROMAP_EXT = 1000396000, VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV = 1000464000, + VK_OBJECT_TYPE_SHADER_EXT = 1000482000, VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT = VK_OBJECT_TYPE_PRIVATE_DATA_SLOT, @@ -2480,6 +2499,9 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x02000000, VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x04000000, VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT = 0x01000000, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV = 0x10000000, +#endif VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT = 0x08000000, VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000, VK_PIPELINE_CREATE_DISPATCH_BASE = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT, @@ -9835,6 +9857,41 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineExecutableInternalRepresentationsKHR #endif +#define VK_KHR_map_memory2 1 +#define VK_KHR_MAP_MEMORY_2_SPEC_VERSION 1 +#define VK_KHR_MAP_MEMORY_2_EXTENSION_NAME "VK_KHR_map_memory2" +typedef VkFlags VkMemoryUnmapFlagsKHR; +typedef struct VkMemoryMapInfoKHR { + VkStructureType sType; + const void* pNext; + VkMemoryMapFlags flags; + VkDeviceMemory memory; + VkDeviceSize offset; + VkDeviceSize size; +} VkMemoryMapInfoKHR; + +typedef struct VkMemoryUnmapInfoKHR { + VkStructureType sType; + const void* pNext; + VkMemoryUnmapFlagsKHR flags; + VkDeviceMemory memory; +} VkMemoryUnmapInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkMapMemory2KHR)(VkDevice device, const VkMemoryMapInfoKHR* pMemoryMapInfo, void** ppData); +typedef VkResult (VKAPI_PTR *PFN_vkUnmapMemory2KHR)(VkDevice device, const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory2KHR( + VkDevice device, + const VkMemoryMapInfoKHR* pMemoryMapInfo, + void** ppData); + +VKAPI_ATTR VkResult VKAPI_CALL vkUnmapMemory2KHR( + VkDevice device, + const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo); +#endif + + #define VK_KHR_shader_integer_dot_product 1 #define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_SPEC_VERSION 1 #define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME "VK_KHR_shader_integer_dot_product" @@ -12030,6 +12087,9 @@ typedef enum VkBuildAccelerationStructureFlagBitsKHR { VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_EXT = 0x00000040, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000080, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXT = 0x00000100, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISPLACEMENT_MICROMAP_UPDATE_NV = 0x00000200, +#endif VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR, VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR, @@ -15182,6 +15242,27 @@ typedef struct VkPhysicalDeviceImage2DViewOf3DFeaturesEXT { +#define VK_EXT_shader_tile_image 1 +#define VK_EXT_SHADER_TILE_IMAGE_SPEC_VERSION 1 +#define VK_EXT_SHADER_TILE_IMAGE_EXTENSION_NAME "VK_EXT_shader_tile_image" +typedef struct VkPhysicalDeviceShaderTileImageFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderTileImageColorReadAccess; + VkBool32 shaderTileImageDepthReadAccess; + VkBool32 shaderTileImageStencilReadAccess; +} VkPhysicalDeviceShaderTileImageFeaturesEXT; + +typedef struct VkPhysicalDeviceShaderTileImagePropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderTileImageCoherentReadAccelerated; + VkBool32 shaderTileImageReadSampleFromPixelRateInvocation; + VkBool32 shaderTileImageReadFromHelperInvocation; +} VkPhysicalDeviceShaderTileImagePropertiesEXT; + + + #define VK_EXT_opacity_micromap 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT) #define VK_EXT_OPACITY_MICROMAP_SPEC_VERSION 2 @@ -15189,6 +15270,9 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT) typedef enum VkMicromapTypeEXT { VK_MICROMAP_TYPE_OPACITY_MICROMAP_EXT = 0, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_MICROMAP_TYPE_DISPLACEMENT_MICROMAP_NV = 1000397000, +#endif VK_MICROMAP_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF } VkMicromapTypeEXT; @@ -16358,6 +16442,92 @@ typedef struct VkPhysicalDevicePipelineProtectedAccessFeaturesEXT { +#define VK_EXT_shader_object 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderEXT) +#define VK_EXT_SHADER_OBJECT_SPEC_VERSION 1 +#define VK_EXT_SHADER_OBJECT_EXTENSION_NAME "VK_EXT_shader_object" + +typedef enum VkShaderCodeTypeEXT { + VK_SHADER_CODE_TYPE_BINARY_EXT = 0, + VK_SHADER_CODE_TYPE_SPIRV_EXT = 1, + VK_SHADER_CODE_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkShaderCodeTypeEXT; + +typedef enum VkShaderCreateFlagBitsEXT { + VK_SHADER_CREATE_LINK_STAGE_BIT_EXT = 0x00000001, + VK_SHADER_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = 0x00000002, + VK_SHADER_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = 0x00000004, + VK_SHADER_CREATE_NO_TASK_SHADER_BIT_EXT = 0x00000008, + VK_SHADER_CREATE_DISPATCH_BASE_BIT_EXT = 0x00000010, + VK_SHADER_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_EXT = 0x00000020, + VK_SHADER_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00000040, + VK_SHADER_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkShaderCreateFlagBitsEXT; +typedef VkFlags VkShaderCreateFlagsEXT; +typedef struct VkPhysicalDeviceShaderObjectFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderObject; +} VkPhysicalDeviceShaderObjectFeaturesEXT; + +typedef struct VkPhysicalDeviceShaderObjectPropertiesEXT { + VkStructureType sType; + void* pNext; + uint8_t shaderBinaryUUID[VK_UUID_SIZE]; + uint32_t shaderBinaryVersion; +} VkPhysicalDeviceShaderObjectPropertiesEXT; + +typedef struct VkShaderCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkShaderCreateFlagsEXT flags; + VkShaderStageFlagBits stage; + VkShaderStageFlags nextStage; + VkShaderCodeTypeEXT codeType; + size_t codeSize; + const void* pCode; + const char* pName; + uint32_t setLayoutCount; + const VkDescriptorSetLayout* pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange* pPushConstantRanges; + const VkSpecializationInfo* pSpecializationInfo; +} VkShaderCreateInfoEXT; + +typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkShaderRequiredSubgroupSizeCreateInfoEXT; + +typedef VkResult (VKAPI_PTR *PFN_vkCreateShadersEXT)(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkShaderEXT* pShaders); +typedef void (VKAPI_PTR *PFN_vkDestroyShaderEXT)(VkDevice device, VkShaderEXT shader, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetShaderBinaryDataEXT)(VkDevice device, VkShaderEXT shader, size_t* pDataSize, void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdBindShadersEXT)(VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateShadersEXT( + VkDevice device, + uint32_t createInfoCount, + const VkShaderCreateInfoEXT* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkShaderEXT* pShaders); + +VKAPI_ATTR void VKAPI_CALL vkDestroyShaderEXT( + VkDevice device, + VkShaderEXT shader, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderBinaryDataEXT( + VkDevice device, + VkShaderEXT shader, + size_t* pDataSize, + void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindShadersEXT( + VkCommandBuffer commandBuffer, + uint32_t stageCount, + const VkShaderStageFlagBits* pStages, + const VkShaderEXT* pShaders); +#endif + + #define VK_QCOM_tile_properties 1 #define VK_QCOM_TILE_PROPERTIES_SPEC_VERSION 1 #define VK_QCOM_TILE_PROPERTIES_EXTENSION_NAME "VK_QCOM_tile_properties" From 538c9a05eb65d78e56a7bed2810b6be1fca5cfb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 31 Mar 2023 19:04:14 -0700 Subject: [PATCH 61/86] Updated version number. --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index c618aeb63..f3e90aa40 100644 --- a/src/version.h +++ b/src/version.h @@ -9,5 +9,5 @@ * */ -#define BGFX_REV_NUMBER 8444 -#define BGFX_REV_SHA1 "b9d0d5474f110d29e251b9ea99faf5e857fc2a3b" +#define BGFX_REV_NUMBER 8454 +#define BGFX_REV_SHA1 "6b29d8ee2be8383edd49c11026f5dc2cce0f907d" From c43c4479de1ba4290b8e9d4c4df1ed4b760e84dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 2 Apr 2023 09:00:18 -0700 Subject: [PATCH 62/86] Fixed issue #3067. --- src/renderer_mtl.mm | 67 ++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index e4933b6bf..bfc0a4286 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -553,19 +553,23 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa { if ([m_device respondsToSelector: @selector(supportsFamily:)]) { - if ([m_device supportsFamily: MTLGPUFamily(1004) /*MTLGPUFamilyApple4*/]) + if ([m_device supportsFamily: MTLGPUFamilyApple4]) { g_caps.vendorId = BGFX_PCI_ID_APPLE; - if ([m_device supportsFamily: MTLGPUFamily(1007) /*MTLGPUFamilyApple7*/]) + if ([m_device supportsFamily: MTLGPUFamilyApple8]) + { + g_caps.deviceId = 1008; + } + else if ([m_device supportsFamily: MTLGPUFamilyApple7]) { g_caps.deviceId = 1007; } - else if ([m_device supportsFamily: MTLGPUFamily(1006) /*MTLGPUFamilyApple6*/]) + else if ([m_device supportsFamily: MTLGPUFamilyApple6]) { g_caps.deviceId = 1006; } - else if ([m_device supportsFamily: MTLGPUFamily(1005) /*MTLGPUFamilyApple5*/]) + else if ([m_device supportsFamily: MTLGPUFamilyApple5]) { g_caps.deviceId = 1005; } @@ -622,48 +626,23 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa | BGFX_CAPS_TEXTURE_2D_ARRAY | BGFX_CAPS_TEXTURE_3D | BGFX_CAPS_TEXTURE_BLIT - | BGFX_CAPS_TEXTURE_COMPARE_ALL - | BGFX_CAPS_TEXTURE_COMPARE_LEQUAL | BGFX_CAPS_TEXTURE_READ_BACK | BGFX_CAPS_VERTEX_ATTRIB_HALF | BGFX_CAPS_VERTEX_ATTRIB_UINT10 | BGFX_CAPS_VERTEX_ID ); - if (BX_ENABLED(BX_PLATFORM_IOS) ) - { - if (iOSVersionEqualOrGreater("9.0.0") ) - { - g_caps.limits.maxTextureSize = m_device.supportsFamily( (MTLGPUFamily)4 /* iOS_GPUFamily3_v1 */) ? 16384 : 8192; - } - else - { - g_caps.limits.maxTextureSize = 4096; - } - - g_caps.limits.maxFBAttachments = uint8_t(bx::uint32_min(m_device.supportsFamily( (MTLGPUFamily)1 /* MTLGPUFamily_iOS_GPUFamily2_v1 */) ? 8 : 4, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) ); - - g_caps.supported |= m_device.supportsFamily( (MTLGPUFamily)4 /* MTLGPUFamily_iOS_GPUFamily3_v1 */) - ? BGFX_CAPS_DRAW_INDIRECT - : 0 - ; - - g_caps.supported |= m_device.supportsFamily( (MTLGPUFamily)11 /* MTLGPUFamily_iOS_GPUFamily4_v1 */) - ? BGFX_CAPS_TEXTURE_CUBE_ARRAY - : 0 - ; - } - else if (BX_ENABLED(BX_PLATFORM_OSX) ) - { - g_caps.limits.maxTextureSize = 16384; - g_caps.limits.maxFBAttachments = 8; - g_caps.supported |= BGFX_CAPS_TEXTURE_CUBE_ARRAY; - - g_caps.supported |= m_device.supportsFamily( (MTLGPUFamily)10001 /* MTLGPUFamily_macOS_GPUFamily1_v2 */) - ? BGFX_CAPS_DRAW_INDIRECT - : 0 - ; - } + // Reference(s): + // - Metal feature set tables + // https://web.archive.org/web/20230330111145/https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf + g_caps.limits.maxTextureSize = m_device.supportsFamily(MTLGPUFamilyApple3) ? 16384 : 8192; + g_caps.limits.maxFBAttachments = 8; + g_caps.supported |= m_device.supportsFamily(MTLGPUFamilyCommon2) + ? BGFX_CAPS_DRAW_INDIRECT + | BGFX_CAPS_TEXTURE_CUBE_ARRAY + | BGFX_CAPS_TEXTURE_COMPARE_ALL + : 0 + ; g_caps.limits.maxTextureLayers = 2048; g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS; @@ -2432,10 +2411,12 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa m_samplerDescriptor.lodMinClamp = 0; m_samplerDescriptor.lodMaxClamp = FLT_MAX; m_samplerDescriptor.normalizedCoordinates = TRUE; - m_samplerDescriptor.maxAnisotropy = (0 != (_flags & (BGFX_SAMPLER_MIN_ANISOTROPIC|BGFX_SAMPLER_MAG_ANISOTROPIC) ) ) ? m_mainFrameBuffer.m_swapChain->m_maxAnisotropy : 1; + m_samplerDescriptor.maxAnisotropy = (0 != (_flags & (BGFX_SAMPLER_MIN_ANISOTROPIC|BGFX_SAMPLER_MAG_ANISOTROPIC) ) ) + ? m_mainFrameBuffer.m_swapChain->m_maxAnisotropy + : 1 + ; - if (m_macOS11Runtime - || [m_device supportsFamily:(MTLGPUFamily)4 /*MTLGPUFamily_iOS_GPUFamily3_v1*/]) + if (0 != (g_caps.supported & BGFX_CAPS_TEXTURE_COMPARE_ALL) ) { const uint32_t cmpFunc = (_flags&BGFX_SAMPLER_COMPARE_MASK)>>BGFX_SAMPLER_COMPARE_SHIFT; m_samplerDescriptor.compareFunction = 0 == cmpFunc From ecbff2ad301d0c1f6102c8ab90417bebbdb40977 Mon Sep 17 00:00:00 2001 From: IchorDev <15670465+ichordev@users.noreply.github.com> Date: Mon, 3 Apr 2023 14:47:38 +1000 Subject: [PATCH 63/86] Update Apple platform naming in readme (#3072) * Fixed some platform naming * Update build.rst * Update internals.rst * Update overview.rst --- README.md | 4 ++-- docs/build.rst | 4 ++-- docs/internals.rst | 2 +- docs/overview.rst | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 20d1979ff..7ff159b0b 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,10 @@ Supported platforms: * Android (14+, ARM, x86, MIPS) * FreeBSD - * iOS (iPhone, iPad, AppleTV) + * iOS/iPadOS/tvOS (iPhone, iPad, AppleTV) * Linux * MIPS Creator CI20 - * OSX (11+) + * macOS (11+) * PlayStation 4 * RaspberryPi * UWP (Universal Windows, Xbox One) diff --git a/docs/build.rst b/docs/build.rst index 9f3324a78..04bf628ae 100644 --- a/docs/build.rst +++ b/docs/build.rst @@ -83,7 +83,7 @@ Build ----- bgfx uses `GENie - Project generator tool `__ -to generate project files for various platform. Binaries for Linux, OSX, and Windows are included in +to generate project files for various platform. Binaries for Linux, macOS, and Windows are included in bx repository. General @@ -174,7 +174,7 @@ Amalgamated Build For ease of integration to other build system bgfx library can be built with single .cpp file. It's only necessary to build `src/amalgamated.cpp `__ -(for OSX/iOS use +(for macOS/iOS/iPadOS/tvOS use `src/amalgamated.mm `__ instead) inside different build system. diff --git a/docs/internals.rst b/docs/internals.rst index 8e71d76eb..00b2fd187 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -35,7 +35,7 @@ Encoder API can be obtained by calling ``bgfx::begin``. bgfx by default allows 8 Customization ------------- -By default each platform has sane default values. For example on Windows default renderer is DirectX, on Linux it is OpenGL, and on OSX it's Metal. On Windows platform almost all rendering backends are available. For OpenGL ES on desktop you can find more information at:- `OpenGL ES 2.0 and EGL on desktop `__ +By default each platform has sane default values. For example on Windows default renderer is DirectX, on Linux it is OpenGL, and on macOS it's Metal. On Windows platform almost all rendering backends are available. For OpenGL ES on desktop you can find more information at:- `OpenGL ES 2.0 and EGL on desktop `__ If you're targeting specific mobile hardware, you can find GLES support in their official SDKs: `Adreno SDK `__, `Mali SDK `__, `PowerVR SDK `__. diff --git a/docs/overview.rst b/docs/overview.rst index f7f164f2c..e99888913 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -36,10 +36,10 @@ Supported Platforms - Android (14+, ARM, x86, MIPS) - FreeBSD -- iOS (iPhone, iPad, AppleTV) +- iOS/iPadOS/tvOS (iPhone, iPad, AppleTV) - Linux - MIPS Creator CI20 -- OSX (11+) +- macOS (11+) - PlayStation 4 - RaspberryPi - UWP (Universal Windows, Xbox One) @@ -124,13 +124,13 @@ Other Debuggers and Profilers +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ | Name | OS | DX9 | DX11 | DX12 | Metal | GL | GLES | Vulkan| Source | +=============+=================+=======+========+======+=======+======+======+=======+========+ -| APITrace | Linux/OSX/Win | |x| | |x| | | | |x| | |x| | | |x| | +| APITrace | Linux/macOS/Win | |x| | |x| | | | |x| | |x| | | |x| | +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ | CodeXL | Linux/Win | | | | | |x| | | | | +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ | Dissector | Win | |x| | | | | | | | |x| | +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ -| IntelGPA | Linux/OSX/Win | |x| | |x| | | | | |x| | | | +| IntelGPA | Linux/macOS/Win | |x| | |x| | | | | |x| | | | +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ | Nsight | Win | |x| | |x| | | | |x| | | | | +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+ @@ -197,7 +197,7 @@ Contributors Chronological order: - Branimir Karadžić (`@bkaradzic `__) - - Garett Bass (`@garettbass `__) - OSX port. + - Garett Bass (`@garettbass `__) - macOS port. - Jeremie Roy (`@jeremieroy `__) - `10-font `__, and `11-fontsdf `__ examples. @@ -222,7 +222,7 @@ Chronological order: - Andre Weissflog (`@floooh `__) - Alternative build system fips. - Andrew Johnson (`@ajohnson23 `__) - TeamCity build. - Tony McCrary (`@enleeten `__) - Java language API bindings. - - Attila Kocsis (`@attilaz `__) - Metal rendering backend, various OSX + - Attila Kocsis (`@attilaz `__) - Metal rendering backend, various macOS and iOS improvements and bug fixes, `39-assao `__ example. - Richard Gale (`@RichardGale `__) - Emscripten entry input handling. From 4d11ad55f30e35ed5e9d8f4b8c1e5872487c6adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 3 Apr 2023 07:23:49 -0700 Subject: [PATCH 64/86] Cleanup. --- examples/25-c99/helloworld.c | 4 ++-- examples/common/entry/entry_ios.mm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/25-c99/helloworld.c b/examples/25-c99/helloworld.c index 29b1a65d0..44879f97d 100644 --- a/examples/25-c99/helloworld.c +++ b/examples/25-c99/helloworld.c @@ -7,8 +7,8 @@ #include "../00-helloworld/logo.h" extern bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32_t* _debug, uint32_t* _reset); -extern void* entry_get_default_native_window_handle(); -extern void* entry_get_native_display_handle(); +extern void* entry_get_default_native_window_handle(void); +extern void* entry_get_native_display_handle(void); uint16_t uint16_max(uint16_t _a, uint16_t _b) { diff --git a/examples/common/entry/entry_ios.mm b/examples/common/entry/entry_ios.mm index aa4a9b8e6..44acb7ad8 100644 --- a/examples/common/entry/entry_ios.mm +++ b/examples/common/entry/entry_ios.mm @@ -150,7 +150,7 @@ namespace entry { if (kDefaultWindowHandle.idx == _handle.idx) { - return s_ctx.m_window; + return s_ctx->m_window; } return NULL; From 27a801ea8e231a4f11b51aac2e2e62b3b5db3fa3 Mon Sep 17 00:00:00 2001 From: Francis Hart Date: Mon, 3 Apr 2023 20:15:25 +0300 Subject: [PATCH 65/86] Ensure bgfx::init() respects BGFX_RESET_FLIP_AFTER_RENDER (#3073) This updates the behaviour of bgfx::init() to ensure that it checks for the BGFX_RESET_FLIP_AFTER_RENDER flag. --- src/bgfx.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index b27ec2d8a..3c980282f 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1913,6 +1913,7 @@ namespace bgfx m_flipped = true; m_debug = BGFX_DEBUG_NONE; m_frameTimeLast = bx::getHPCounter(); + m_flipAfterRender = !!(m_init.resolution.reset & BGFX_RESET_FLIP_AFTER_RENDER); m_submit->create(_init.limits.minResourceCbSize); From c3e30539357c9c63976da1dfdadf89bdd2df0580 Mon Sep 17 00:00:00 2001 From: issam3105 <67145992+issam3105@users.noreply.github.com> Date: Tue, 4 Apr 2023 16:52:40 +0200 Subject: [PATCH 66/86] Fix call to non-existant glDrawBuffers on mobile WebGL 1 (#3068) Co-authored-by: Issam --- src/renderer_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 6b2e16e2d..2ed45614d 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -7073,7 +7073,7 @@ namespace bgfx { namespace gl // GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER. GL_CHECK(glDrawBuffer(GL_NONE) ); } - else if (g_caps.limits.maxFBAttachments > 0) + else if (g_caps.limits.maxFBAttachments > 1) { GL_CHECK(glDrawBuffers(colorIdx, buffers) ); } From fda8a3705f0573e3d95c398373ec57944df3ff79 Mon Sep 17 00:00:00 2001 From: rnbhatt <55766810+rnbhatt@users.noreply.github.com> Date: Wed, 12 Apr 2023 13:16:58 -0400 Subject: [PATCH 67/86] Fix for #2822 -- points rendering error on Apple silicon (#3079) * Add pointsize to SPIRV-Cross output before writing Adds float bgfx_metal_pointSize [[point_size]] = 1; to xlatMtlMain_out, ensuring that it always has a value. * Update shaderc_metal.cpp Only apply patch to vertex shaders --- tools/shaderc/shaderc_metal.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/shaderc/shaderc_metal.cpp b/tools/shaderc/shaderc_metal.cpp index 744e3e366..a4ed0337e 100644 --- a/tools/shaderc/shaderc_metal.cpp +++ b/tools/shaderc/shaderc_metal.cpp @@ -638,6 +638,17 @@ namespace bgfx { namespace metal } std::string source = msl.compile(); + + // fix https://github.com/bkaradzic/bgfx/issues/2822 + // insert struct member which declares point size, defaulted to 1 + if (_options.shaderType == 'v'){ + auto findName = "xlatMtlMain_out\n{"; + auto pos = source.find(findName); + if (pos != std::string::npos){ + pos += strlen(findName); + source.insert(pos, "\n\tfloat bgfx_metal_pointSize [[point_size]] = 1;"); + } + } if ('c' == _options.shaderType) { From d909d01734290d21a7f100e48734c403f9de1f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 12 Apr 2023 19:23:57 -0700 Subject: [PATCH 68/86] Metal: Rebuilt shaders. --- .../shaders/metal/fs_deferred_combine_ta.bin | Bin 1110 -> 1109 bytes .../shaders/metal/fs_deferred_debug_ta.bin | Bin 772 -> 771 bytes .../shaders/metal/fs_deferred_light_ta.bin | Bin 1585 -> 1584 bytes .../shaders/metal/vs_albedo_output.bin | Bin 1324 -> 1372 bytes .../shaders/metal/vs_bokeh_forward.bin | Bin 1395 -> 1443 bytes .../shaders/metal/vs_bokeh_screenquad.bin | Bin 701 -> 749 bytes examples/runtime/shaders/metal/vs_bump.bin | Bin 1816 -> 1864 bytes .../shaders/metal/vs_bump_instanced.bin | Bin 1990 -> 2038 bytes .../runtime/shaders/metal/vs_bunnylod.bin | Bin 886 -> 934 bytes .../runtime/shaders/metal/vs_callback.bin | Bin 873 -> 921 bytes examples/runtime/shaders/metal/vs_cubes.bin | Bin 685 -> 733 bytes .../shaders/metal/vs_deferred_combine.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_deferred_debug.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_deferred_debug_line.bin | Bin 685 -> 733 bytes .../shaders/metal/vs_deferred_geom.bin | Bin 1837 -> 1885 bytes .../shaders/metal/vs_deferred_light.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_denoise_gbuffer.bin | Bin 1734 -> 1782 bytes .../shaders/metal/vs_denoise_screenquad.bin | Bin 701 -> 749 bytes .../runtime/shaders/metal/vs_fsr_forward.bin | Bin 1368 -> 1416 bytes .../shaders/metal/vs_fsr_screenquad.bin | Bin 701 -> 749 bytes .../runtime/shaders/metal/vs_fullscreen.bin | Bin 697 -> 745 bytes .../runtime/shaders/metal/vs_hdr_blur.bin | Bin 1696 -> 1744 bytes .../runtime/shaders/metal/vs_hdr_bright.bin | Bin 697 -> 745 bytes examples/runtime/shaders/metal/vs_hdr_lum.bin | Bin 697 -> 745 bytes .../runtime/shaders/metal/vs_hdr_lumavg.bin | Bin 697 -> 745 bytes .../runtime/shaders/metal/vs_hdr_mesh.bin | Bin 1058 -> 1106 bytes .../runtime/shaders/metal/vs_hdr_skybox.bin | Bin 697 -> 745 bytes .../runtime/shaders/metal/vs_hdr_tonemap.bin | Bin 1721 -> 1769 bytes examples/runtime/shaders/metal/vs_hextile.bin | Bin 936 -> 984 bytes .../runtime/shaders/metal/vs_ibl_mesh.bin | Bin 1001 -> 1049 bytes .../runtime/shaders/metal/vs_ibl_skybox.bin | Bin 1025 -> 1073 bytes .../runtime/shaders/metal/vs_instancing.bin | Bin 950 -> 998 bytes examples/runtime/shaders/metal/vs_mesh.bin | Bin 1633 -> 1681 bytes examples/runtime/shaders/metal/vs_oit.bin | Bin 864 -> 912 bytes .../runtime/shaders/metal/vs_oit_blit.bin | Bin 697 -> 745 bytes .../runtime/shaders/metal/vs_particle.bin | Bin 1033 -> 1081 bytes .../shaders/metal/vs_picking_shaded.bin | Bin 1299 -> 1347 bytes examples/runtime/shaders/metal/vs_pom.bin | Bin 1678 -> 1726 bytes .../runtime/shaders/metal/vs_raymarching.bin | Bin 842 -> 890 bytes .../runtime/shaders/metal/vs_rsm_combine.bin | Bin 697 -> 745 bytes .../runtime/shaders/metal/vs_rsm_gbuffer.bin | Bin 830 -> 878 bytes .../runtime/shaders/metal/vs_rsm_lbuffer.bin | Bin 1800 -> 1848 bytes .../runtime/shaders/metal/vs_rsm_shadow.bin | Bin 813 -> 861 bytes .../shaders/metal/vs_shadowmaps_color.bin | Bin 540 -> 588 bytes .../metal/vs_shadowmaps_color_lighting.bin | Bin 1255 -> 1303 bytes .../vs_shadowmaps_color_lighting_csm.bin | Bin 2075 -> 2123 bytes .../vs_shadowmaps_color_lighting_linear.bin | Bin 1306 -> 1354 bytes ...s_shadowmaps_color_lighting_linear_csm.bin | Bin 2279 -> 2327 bytes ..._shadowmaps_color_lighting_linear_omni.bin | Bin 2217 -> 2265 bytes .../vs_shadowmaps_color_lighting_omni.bin | Bin 2013 -> 2061 bytes .../metal/vs_shadowmaps_color_texture.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_shadowmaps_depth.bin | Bin 540 -> 588 bytes .../shaders/metal/vs_shadowmaps_hblur.bin | Bin 1796 -> 1844 bytes .../shaders/metal/vs_shadowmaps_packdepth.bin | Bin 663 -> 711 bytes .../metal/vs_shadowmaps_packdepth_linear.bin | Bin 673 -> 721 bytes .../shaders/metal/vs_shadowmaps_texture.bin | Bin 697 -> 745 bytes .../metal/vs_shadowmaps_texture_lighting.bin | Bin 1101 -> 1149 bytes .../metal/vs_shadowmaps_unpackdepth.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_shadowmaps_vblur.bin | Bin 1796 -> 1844 bytes .../metal/vs_shadowvolume_color_lighting.bin | Bin 948 -> 996 bytes .../metal/vs_shadowvolume_color_texture.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_shadowvolume_svback.bin | Bin 749 -> 797 bytes .../shaders/metal/vs_shadowvolume_svfront.bin | Bin 540 -> 588 bytes .../shaders/metal/vs_shadowvolume_svside.bin | Bin 1025 -> 1073 bytes .../shaders/metal/vs_shadowvolume_texture.bin | Bin 697 -> 745 bytes .../vs_shadowvolume_texture_lighting.bin | Bin 1101 -> 1149 bytes examples/runtime/shaders/metal/vs_sky.bin | Bin 2809 -> 2857 bytes .../shaders/metal/vs_sky_landscape.bin | Bin 951 -> 999 bytes .../runtime/shaders/metal/vs_sms_mesh.bin | Bin 1230 -> 1278 bytes .../runtime/shaders/metal/vs_sms_shadow.bin | Bin 540 -> 588 bytes .../shaders/metal/vs_sms_shadow_pd.bin | Bin 663 -> 711 bytes .../runtime/shaders/metal/vs_sss_gbuffer.bin | Bin 1137 -> 1185 bytes .../shaders/metal/vs_sss_screenquad.bin | Bin 701 -> 749 bytes .../shaders/metal/vs_stencil_color.bin | Bin 540 -> 588 bytes .../metal/vs_stencil_color_lighting.bin | Bin 946 -> 994 bytes .../metal/vs_stencil_color_texture.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_stencil_texture.bin | Bin 697 -> 745 bytes .../metal/vs_stencil_texture_lighting.bin | Bin 1101 -> 1149 bytes examples/runtime/shaders/metal/vs_terrain.bin | Bin 808 -> 856 bytes .../metal/vs_terrain_height_texture.bin | Bin 1173 -> 1221 bytes .../shaders/metal/vs_terrain_render.bin | Bin 2431 -> 2479 bytes examples/runtime/shaders/metal/vs_tree.bin | Bin 1232 -> 1280 bytes examples/runtime/shaders/metal/vs_update.bin | Bin 697 -> 745 bytes .../shaders/metal/vs_vectordisplay_fb.bin | Bin 842 -> 890 bytes .../runtime/shaders/metal/vs_vt_generic.bin | Bin 765 -> 813 bytes examples/runtime/shaders/metal/vs_wf_mesh.bin | Bin 1137 -> 1185 bytes .../runtime/shaders/metal/vs_wf_wireframe.bin | Bin 931 -> 979 bytes 87 files changed, 0 insertions(+), 0 deletions(-) diff --git a/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin b/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin index 625f7a773a70a959b6a95b75ee5ab6ac58ca53b4..d84f87f54dead4390983b699fbd241fc5053f136 100644 GIT binary patch delta 21 dcmcb{ag}4jOvWu6X9Y1aXXce`{=k&R2moZK2$KK+ delta 22 ecmcc0agAfbOvbGnX9Y2_Yhjy^%hk diff --git a/examples/runtime/shaders/metal/fs_deferred_light_ta.bin b/examples/runtime/shaders/metal/fs_deferred_light_ta.bin index 0b84b89d6ff389a88a64e3f61933379de5ef38db..c2ae5106e11594ec020a888de02973d2e594183f 100644 GIT binary patch delta 20 ccmdnUvw>&A2S$sHA3a%^GxJI&+p&HI09R!QIRF3v delta 21 dcmdnMvyo@Q2S&?{A3a%E@=NnlCfl-p1^{3f2&Di3 diff --git a/examples/runtime/shaders/metal/vs_albedo_output.bin b/examples/runtime/shaders/metal/vs_albedo_output.bin index 83f7eaf7d96feaeca9868d8113fc459504de98fd..cbe5cf921006e42d193b7277ef5ea3e860a9c0be 100644 GIT binary patch delta 68 zcmZ3(b%$$$DU&$sMDx{poM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ T8>?WeU^qFDQE@XPqc#fwKkgR^ delta 17 Zcmcb^wT5egDbsV7iRP;}3o&}J0028?1=aun diff --git a/examples/runtime/shaders/metal/vs_bokeh_forward.bin b/examples/runtime/shaders/metal/vs_bokeh_forward.bin index e99b6d1c82bd774fc5fa3dc98b8deb09b8a4f095..c4ca95e2fcdf575483e408e41a5e94955e501d61 100644 GIT binary patch delta 64 zcmey&wU~Q?AEWz3|C9QhX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Pt6-~OXuVmSF@^;I7Ooc# delta 16 XcmZ3?{h4cmAEWq0|C5_N7^7JLG-m~- diff --git a/examples/runtime/shaders/metal/vs_bokeh_screenquad.bin b/examples/runtime/shaders/metal/vs_bokeh_screenquad.bin index 8cb8483ea2b8fd3ab8e88ff87dfc1b9a71f848fd..a6a6b3348f58daa4fea4c13c1498bae65b571d21 100644 GIT binary patch delta 63 zcmdnX`j&Nq2IJ0&n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$ke~bVE-xyB- delta 15 XcmaFMx|el=24m+$&FLFI{AC0HGmQr4 diff --git a/examples/runtime/shaders/metal/vs_bump.bin b/examples/runtime/shaders/metal/vs_bump.bin index f66bb152eea1d39ccb7bdef9d456656f40299394..640e9ef04b6e73891faba0465a4e372beacc57cc 100644 GIT binary patch delta 67 zcmbQicY<$%8{?;m?g#Za({l0?OB9mQ(<Vjw3r SR>4-maIyoV;%0TmkE{T7R~XR% delta 20 ccmX@XH-m428{?sg?gu9qG0JZaXZ*+t09679)c^nh diff --git a/examples/runtime/shaders/metal/vs_bump_instanced.bin b/examples/runtime/shaders/metal/vs_bump_instanced.bin index 8b7efc2481b5b60c67f100cc00bb3a65c05f11db..a9537b8e351462beb008f627053af1f8503507aa 100644 GIT binary patch delta 66 zcmX@c|BZiw3FE4Xrpxs>({l0?OB9mQ(<Vjw3r SR>4-maPnS8#f`sDvjG5HRvFR& delta 20 ccmeyye~f>E31ihn)8&)jGsy7%HX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXua`uHxmH*3m4-6 delta 16 XcmZ3+{*7&d6{EpK>y4Xb7`vDNGUf$- diff --git a/examples/runtime/shaders/metal/vs_callback.bin b/examples/runtime/shaders/metal/vs_callback.bin index 26d952d76b1ba56239b976a649b7cad61b067ec8..deca117e98f7df7ced35787f9e6c156ef64408fb 100644 GIT binary patch delta 63 zcmaFKHj{mV6=U#3>y7%HX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXua`u9TNcX%@?l# delta 16 XcmbQq{*rBi6{GS*>y4Xb7;BjTFwq4{ diff --git a/examples/runtime/shaders/metal/vs_cubes.bin b/examples/runtime/shaders/metal/vs_cubes.bin index 25ca9acd3bbf2cd26d6983bec12f644755fec259..a9d76b381ffc7fb09ceeb4fe813238fcf2dbf9f1 100644 GIT binary patch delta 63 zcmZ3>dY5&A2IIVjw3r OR>4-m(0b$kcZ>k{a2O8& delta 15 Xcmcc1x|Vf<24m$!&FLFIyk!IcF)aqC diff --git a/examples/runtime/shaders/metal/vs_deferred_combine.bin b/examples/runtime/shaders/metal/vs_deferred_combine.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_deferred_debug.bin b/examples/runtime/shaders/metal/vs_deferred_debug.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_deferred_debug_line.bin b/examples/runtime/shaders/metal/vs_deferred_debug_line.bin index 25ca9acd3bbf2cd26d6983bec12f644755fec259..a9d76b381ffc7fb09ceeb4fe813238fcf2dbf9f1 100644 GIT binary patch delta 63 zcmZ3>dY5&A2IIVjw3r OR>4-m(0b$kcZ>k{a2O8& delta 15 Xcmcc1x|Vf<24m$!&FLFIyk!IcF)aqC diff --git a/examples/runtime/shaders/metal/vs_deferred_geom.bin b/examples/runtime/shaders/metal/vs_deferred_geom.bin index 68bf21ec0fa62cb751a232920db32958c7028098..3be31d53fa53c4cad23d214bbdeb26e91dab42b2 100644 GIT binary patch delta 68 zcmZ3>cb9L18xuSGM2`b{oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ T8>?WeU^v-?g7ct6j4rgRz0{~kO2QdHu diff --git a/examples/runtime/shaders/metal/vs_deferred_light.bin b/examples/runtime/shaders/metal/vs_deferred_light.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_denoise_gbuffer.bin b/examples/runtime/shaders/metal/vs_denoise_gbuffer.bin index 83000ea2e9849dc455dd352e57e32c70393384b3..c5c22215137cdebbe091af095f44c0fff6d518d4 100644 GIT binary patch delta 79 zcmX@c`;B)(B4hi+q(@eqX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* at6-~OXw9Vn1Yj-3llL=Vjw3r OR>4-m(0b$ke~bVE-xyB- delta 15 XcmaFMx|el=24m+$&FLFI{AC0HGmQr4 diff --git a/examples/runtime/shaders/metal/vs_fsr_forward.bin b/examples/runtime/shaders/metal/vs_fsr_forward.bin index 9d5930e78bd09666b91cf799e9566b66554c6cc0..2cb8194b4a1fd0f255f6b97798fb9f2401dd44e0 100644 GIT binary patch delta 65 zcmcb?)xkZ%k4cYpV!#P~&a|BT#1e(1^t6ij+|-i9ocMzL%)FA|%&Js{=x8uIz8J`f Qja9H!Ftpw*&gjSj00(&%ssI20 delta 17 YcmeC+zQHxYkLe%F#DEiz>% diff --git a/examples/runtime/shaders/metal/vs_fsr_screenquad.bin b/examples/runtime/shaders/metal/vs_fsr_screenquad.bin index 8cb8483ea2b8fd3ab8e88ff87dfc1b9a71f848fd..a6a6b3348f58daa4fea4c13c1498bae65b571d21 100644 GIT binary patch delta 63 zcmdnX`j&Nq2IJ0&n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$ke~bVE-xyB- delta 15 XcmaFMx|el=24m+$&FLFI{AC0HGmQr4 diff --git a/examples/runtime/shaders/metal/vs_fullscreen.bin b/examples/runtime/shaders/metal/vs_fullscreen.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_hdr_blur.bin b/examples/runtime/shaders/metal/vs_hdr_blur.bin index baf06fa557718afa6679479ec1c7f8d22660a5c7..4115c0d06baf09ec7f8b710de552def47fda6180 100644 GIT binary patch delta 63 zcmZ3$dx3X?9b?->`}O*qX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXua|6W>x_E{1_bo delta 16 Ycmcb>yMT9s9b?!;`}LdU7&oy305fz2xBvhE diff --git a/examples/runtime/shaders/metal/vs_hdr_bright.bin b/examples/runtime/shaders/metal/vs_hdr_bright.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_hdr_lum.bin b/examples/runtime/shaders/metal/vs_hdr_lum.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_hdr_lumavg.bin b/examples/runtime/shaders/metal/vs_hdr_lumavg.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_hdr_mesh.bin b/examples/runtime/shaders/metal/vs_hdr_mesh.bin index f42ce4b416a2c20715b0c2e2fb19673d9e90142d..3ba7e15aeba198baec7042468e478f42e0e7892f 100644 GIT binary patch delta 64 zcmZ3)afxGs9TNx3M28LfoM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(MZy)iQY;pZ11 delta 17 Zcmcb_v4~@W9n%fwi4Ge!D=-={0{}W31-bwL diff --git a/examples/runtime/shaders/metal/vs_hdr_skybox.bin b/examples/runtime/shaders/metal/vs_hdr_skybox.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_hdr_tonemap.bin b/examples/runtime/shaders/metal/vs_hdr_tonemap.bin index b94d6dfa492c7bc9b2b69ef184d028cf3285b682..1cd57a0b07e8991d84b298af50e8e583021442e8 100644 GIT binary patch delta 63 zcmdnV`;vEp9pn6o_UrXI({l0?OB9mQ(<Vjw3r OR>4-m(0b$BGpqm&(HMaM delta 16 YcmaFKyOVc<9b^7P`}LdU7*DeT05^388~^|S diff --git a/examples/runtime/shaders/metal/vs_hextile.bin b/examples/runtime/shaders/metal/vs_hextile.bin index a1348181aeb2bced217bf210f01eb9283260451c..a615e2a0ceea97ff836d9ce13395851b1045d922 100644 GIT binary patch delta 63 zcmZ3%euI62DdY5sW^430({l0?OB9mQ(<Vjw3r OR>4-m(0b#;<4gejDi|UF delta 16 Ycmcb?zJh&%DP#IXvo)KA7>_Xl05g^ay#N3J diff --git a/examples/runtime/shaders/metal/vs_ibl_mesh.bin b/examples/runtime/shaders/metal/vs_ibl_mesh.bin index f7a54c3f0942b6d743f33f9a14e7327ccf7de907..3efe588ae166b2dc0c53a665664b1d2a33286fcc 100644 GIT binary patch delta 67 zcmaFKK9ggDFXMrUey8*}({l0?OB9mQ(<Vjw3r SR>4-maI!C>;%0NkO-ulF1sJ9P delta 20 ccmbQq@sfRlFXM!Xey1kaGsk delta 16 YcmdnU(a13&fN|->z~h@e7+*3005tRlSpWb4 diff --git a/examples/runtime/shaders/metal/vs_instancing.bin b/examples/runtime/shaders/metal/vs_instancing.bin index a419af98007464362bc13e263ac49b34f50d2efc..dfd6a32126cb87ae4836bb14242f77a0bb43c76f 100644 GIT binary patch delta 63 zcmdnS{)~NsGUM8bDwFg%({l0?OB9mQ(<Vjw3r OR>4-m(0b!mMrHu`aTg^3 delta 14 WcmaFHzKwl?GGpyTl}QVqF#`Z9GzF~y diff --git a/examples/runtime/shaders/metal/vs_mesh.bin b/examples/runtime/shaders/metal/vs_mesh.bin index 59a2df057e6d1920a00f21adece4b9bc9de2f653..688c3e0c588021ffc78f959ec6f8123a9b65adb2 100644 GIT binary patch delta 83 zcmaFJGm&?KKcm^ifFo9%X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* et6-~OXw9Vn1Yj*DlMgV8PWEGE-)zOG&I$nZ)f@f* delta 35 pcmbQp`;cdXKO@`3fFoQAK#-P`pIBlt`2(Zq diff --git a/examples/runtime/shaders/metal/vs_oit.bin b/examples/runtime/shaders/metal/vs_oit.bin index 3c21a1c4dd4164ccf139b74f960fb19fe0a643b3..45ee281ce73acc59b4c03da316a10e50f3bf0bce 100644 GIT binary patch delta 64 zcmaFBHi3PD8>7QS_k;SJX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Pt6-~OXuX-8F_H-Y1WgvK delta 16 XcmbQh{(x7HP_k)`)7$cYfFm?q* diff --git a/examples/runtime/shaders/metal/vs_oit_blit.bin b/examples/runtime/shaders/metal/vs_oit_blit.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_particle.bin b/examples/runtime/shaders/metal/vs_particle.bin index e6e9d33dd442729484de50f9577ee915c1e95668..1c3440c9b863c07ddc2d0d463c7b7b3667d8e8d7 100644 GIT binary patch delta 63 zcmeC=*vT=$neo*`m)-iDX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXua_tH!}bS@)yPc delta 16 XcmdnV(aABvnQ_-dm))E78M&ANGfo9z diff --git a/examples/runtime/shaders/metal/vs_picking_shaded.bin b/examples/runtime/shaders/metal/vs_picking_shaded.bin index af7e68ca5d7811e2de8f85de945409052956a94c..33942cec740cb77e240c441e2fc668a74ffa5323 100644 GIT binary patch delta 79 zcmbQtb(m{{KjVvu0Y|Jj({l0?OB9mQ(<Vjw3r aR>4-m(3(pD2*6rQCLdrF-E7SGfEfU-?Hp17 delta 31 lcmX@iHJNLIKjV&x0Y|tLfFLa=Ke5DQ@&`uI&B=@pm;tfR3l9JQ diff --git a/examples/runtime/shaders/metal/vs_pom.bin b/examples/runtime/shaders/metal/vs_pom.bin index aca34b930be2da8052b0d514d93959c428f12d89..550d1e39bfad7d2f22f48222346fcb53bf09d193 100644 GIT binary patch delta 64 zcmeC<-N!p2fzfYb;$3~tw4D6J5{0Dnw2JuL)RM%U_=5b*yprI|s#JyOXfQjz7|4l@ PRj^eswBBsX7|03$6MYvX delta 16 XcmdnT+s8X0fl+Q^;@!=8i~+0wGgJk< diff --git a/examples/runtime/shaders/metal/vs_raymarching.bin b/examples/runtime/shaders/metal/vs_raymarching.bin index 60037f46832429bd4e96e943c4b899feb31c6efe..0543efff8f0375111401af10f8c8245d62d5021a 100644 GIT binary patch delta 63 zcmX@b_KR(T2BXVF&FT7_X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXuWZNHxmHw85e{A delta 15 Xcmeyxc8YC+2BXMC&FLFIbTI({Fop&k diff --git a/examples/runtime/shaders/metal/vs_rsm_combine.bin b/examples/runtime/shaders/metal/vs_rsm_combine.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin b/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin index 724fefdfc1197b1dd57dd819153d742448dc42fd..cfaa2fd96726a114c818e287232eb3a2a3ef774a 100644 GIT binary patch delta 64 zcmdnT_Kt0W6_W<@M4JuzoM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(MZbubeE^bQw> delta 17 ZcmaFIwvTOs71IxVjw3r XR>4-maPoad#mT*F?3*tzTCf5D0UjF# delta 23 fcmdnN*TFa8A*1ZXM<*r=GRaTg%f`Nm$$}LCZ;%K& diff --git a/examples/runtime/shaders/metal/vs_rsm_shadow.bin b/examples/runtime/shaders/metal/vs_rsm_shadow.bin index 2141af3660e13cc3420a42442deb623f7f28b003..da7f7762846f70b2023b8897ddd1205dde6f8d1a 100644 GIT binary patch delta 64 zcmZ3>c9(5}9g{HgM28LfoM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(MZy&V$(=&2V* delta 17 Zcmcc1ww7&z9n)i`i4Ge!D=^wJ0RTI>1>gVx diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_color.bin b/examples/runtime/shaders/metal/vs_shadowmaps_color.bin index 2f8e28d717104c2a68b530132a995b9395b57572..9647f5507926fca309db0b1ca1e5839427db87cd 100644 GIT binary patch delta 64 zcmbQka)xDs29p%iM6GH1oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(K@e=H*a(LWZ> delta 16 YcmX@ZGKXb?2Gc9XiCWV(eu!ZN05rq~WdHyG diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting.bin b/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting.bin index d6c04f1715ced32e4633f71ba973f9996484a00a..a0b20dfc42ff9fac9a37c5aacffbd6919f6a9f24 100644 GIT binary patch delta 67 zcmaFPIh|`lI^&Xw84vV0({l0?OB9mQ(<Vjw3r SR>4-maPm$@#m(uA4a@+8L>WH- delta 20 ccmbQv^_+7;I%CPij0clnGstFk4{48Aj)gXCoOWuVa?qT*`Ef6#!w72xkBQ diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear.bin b/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear.bin index 8b8973cc963c3582b8fa8cd2c2794ff9880a867e..5132b75416d320d74fab1fe7fec6090a780c67fd 100644 GIT binary patch delta 67 zcmbQmb&6|3I^*?;84vV0({l0?OB9mQ(<Vjw3r SR>4-maPm$@#m(uAo0$QKtQm{| delta 20 ccmX@bHH&LPI^*(*84o7EW|ZGNopCcW09-i;kN^Mx diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_csm.bin b/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_csm.bin index 63714772395b583c90a22c4c9c77635ce3a71232..4d78f4c0048bb6d5c6eb79d9c9b246cf9cbc4293 100644 GIT binary patch delta 68 zcmaDZI9+JM8Akh!XCoQ)IMZ_S6H645($gy9b5lzabK(o~GxJJ1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ T8>?WeU^uysS#h&F(==89gIyTz delta 21 dcmeAbxXVA`JR{S_3lWTyH!#a@E@zs?3IJW92l4;_ diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin b/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin b/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin index 2f8e28d717104c2a68b530132a995b9395b57572..9647f5507926fca309db0b1ca1e5839427db87cd 100644 GIT binary patch delta 64 zcmbQka)xDs29p%iM6GH1oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(K@e=H*a(LWZ> delta 16 YcmX@ZGKXb?2Gc9XiCWV(eu!ZN05rq~WdHyG diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin b/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin index 51548a15c938db14ecdeed1d072c7ea39e6c6e3c..54e455a2189116a990646edc4bb7b39553976ffd 100644 GIT binary patch delta 64 zcmZqS+rl>?n(^$!m~;A^X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Pt6-~OXuVmJ@ir>}CbSps delta 16 YcmdnO*TOd;nsM&Lm~)$>7;mux05;18h5!Hn diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin b/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin index 012fce2f00840f7ab84282156fa806d9194cde5b..a08b03e08a90c22741f2baa5813659d52c0b9208 100644 GIT binary patch delta 63 zcmbQvdYpBF2IJI;n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$k8;k(xJQukD delta 15 XcmX@kI-PZb24m_(&FLFITxSFTE%^pf diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin index 01d0f5c98f1062ec0465ba16ee906381c16ce7cf..6291c7c5d5f71153dd87e71b3dba6928d48e971b 100644 GIT binary patch delta 63 zcmZ3;dXaU42IKsRn$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kM~ndPSQp^{ delta 15 Xcmcb}x{!5(24nt2&FLFIJY)m_FLefa diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin b/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_texture_lighting.bin b/examples/runtime/shaders/metal/vs_shadowmaps_texture_lighting.bin index 0faa79e4f75622113d9eec6b1f55480d4ca9f452..de1d9b60e5c382cd9ac6b882d6a0813a3ef2962f 100644 GIT binary patch delta 67 zcmX@h@t0$Q9i!ny`;B^>X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* St6-~OI60nCaWg-o9Www}Ll>X` delta 20 ccmey%ah79(9V6pJ`;C()GRkkZXS8Dm08je{qyPW_ diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin b/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin b/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin index 8124dc15999cb8e73fa3c8608a3053195e254124..5f06d6bdbc0883498ecdf73e92d3b54336cf247e 100644 GIT binary patch delta 64 zcmZqS+rl>?n(^$!m~;A^X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Pt6-~OXuVmJ@ir>}CbSps delta 16 YcmdnO*TOd;nsM&Lm~)$>7;mux05;18h5!Hn diff --git a/examples/runtime/shaders/metal/vs_shadowvolume_color_lighting.bin b/examples/runtime/shaders/metal/vs_shadowvolume_color_lighting.bin index 8c67f4be4f7b93e818811af80dc4edeaf575e257..0a12820f90d1690026e5d38baed46e0bd2c826a6 100644 GIT binary patch delta 63 zcmdnO{)Byk9pki#_8av%({l0?OB9mQ(<Vjw3r OR>4-m(0b$hqf7t>@EBYG delta 16 YcmaFDzJ+~)9b?)=`;D6w7>_Uk05$0a_W%F@ diff --git a/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin b/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin b/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin index 0a722b9570eac2e1ec626e36f399a20f8bdfbfda..f170ffe31b3392f9ea321f7f506e0688bc82333a 100644 GIT binary patch delta 64 zcmaFMI+txi5aYp#!H4xZ({l0?OB9mQ(<Vjw3r PR>4-m(0a2d;|)dtE$J8Q delta 16 YcmbQs_Lg-*5aYy&!G|}yFk diff --git a/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin b/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin index 2f8e28d717104c2a68b530132a995b9395b57572..9647f5507926fca309db0b1ca1e5839427db87cd 100644 GIT binary patch delta 64 zcmbQka)xDs29p%iM6GH1oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(K@e=H*a(LWZ> delta 16 YcmX@ZGKXb?2Gc9XiCWV(eu!ZN05rq~WdHyG diff --git a/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin b/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin index 4de8c6dcab06ce5d1521c87b3bd4084621fd0ab3..3ab172efae9b6188d52b70c6beef4b8e32a97955 100644 GIT binary patch delta 64 zcmZqV*vK&Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_shadowvolume_texture_lighting.bin b/examples/runtime/shaders/metal/vs_shadowvolume_texture_lighting.bin index 0faa79e4f75622113d9eec6b1f55480d4ca9f452..de1d9b60e5c382cd9ac6b882d6a0813a3ef2962f 100644 GIT binary patch delta 67 zcmX@h@t0$Q9i!ny`;B^>X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* St6-~OI60nCaWg-o9Www}Ll>X` delta 20 ccmey%ah79(9V6pJ`;C()GRkkZXS8Dm08je{qyPW_ diff --git a/examples/runtime/shaders/metal/vs_sky.bin b/examples/runtime/shaders/metal/vs_sky.bin index 8c0d0be1be4d66984fc46a2ad7689476e0e65c6c..92196f76bbcefd1a374145e77e69e028553613a2 100644 GIT binary patch delta 65 zcmew9UHC*!n@UCfO7oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ Q8>?WeU}(L$hcTBE051F&+W-In delta 17 YcmZ1}_EU61Cu7>iE@sBfdl_>$0YD`Na{vGU diff --git a/examples/runtime/shaders/metal/vs_sky_landscape.bin b/examples/runtime/shaders/metal/vs_sky_landscape.bin index 28a54011dc941e42934d61a36cb1e1593d36562a..bc00d287f35c85da2b017123aa1336ec2e785426 100644 GIT binary patch delta 63 zcmdna{+xY+732Jg)*JOX({l0?OB9mQ(<Vjw3r OR>4-m(0b$RGfV&oo)~5T delta 16 YcmaFPzMXx76=VKH>y4Xb7*8_+05(bn0RR91 diff --git a/examples/runtime/shaders/metal/vs_sms_mesh.bin b/examples/runtime/shaders/metal/vs_sms_mesh.bin index ba23b791da2c7d67f5d0676485cb0572cdf0d250..28d977c62da74b45131a4a05fd0e2fea9dc1de4a 100644 GIT binary patch delta 71 zcmX@d`Hyo#Fys7*A*b{>({l0?OB9mQ(<Vjw3r WR>4-maB@GR;^YQq_RTJgUCaRN)EXlI delta 24 gcmeyzd5&{JFk}A2kW-TnGRjZhz|6k6gt3bm0DvJ0R{#J2 diff --git a/examples/runtime/shaders/metal/vs_sms_shadow.bin b/examples/runtime/shaders/metal/vs_sms_shadow.bin index 2f8e28d717104c2a68b530132a995b9395b57572..9647f5507926fca309db0b1ca1e5839427db87cd 100644 GIT binary patch delta 64 zcmbQka)xDs29p%iM6GH1oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(K@e=H*a(LWZ> delta 16 YcmX@ZGKXb?2Gc9XiCWV(eu!ZN05rq~WdHyG diff --git a/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin b/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin index 012fce2f00840f7ab84282156fa806d9194cde5b..a08b03e08a90c22741f2baa5813659d52c0b9208 100644 GIT binary patch delta 63 zcmbQvdYpBF2IJI;n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$k8;k(xJQukD delta 15 XcmX@kI-PZb24m_(&FLFITxSFTE%^pf diff --git a/examples/runtime/shaders/metal/vs_sss_gbuffer.bin b/examples/runtime/shaders/metal/vs_sss_gbuffer.bin index 2a683784c16bad1dd0c48e6d26f9c4c66e54878c..4b8b28fcfacb16af5f03fd8401bca7ddb74c928d 100644 GIT binary patch delta 63 zcmey!v5<3u6=UQ?>y7%HX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXua`u8#4g+0vFN% delta 16 XcmZ3;`H^FS6{F@v>y4Xb7+aYEGC&1w diff --git a/examples/runtime/shaders/metal/vs_sss_screenquad.bin b/examples/runtime/shaders/metal/vs_sss_screenquad.bin index 8cb8483ea2b8fd3ab8e88ff87dfc1b9a71f848fd..a6a6b3348f58daa4fea4c13c1498bae65b571d21 100644 GIT binary patch delta 63 zcmdnX`j&Nq2IJ0&n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$ke~bVE-xyB- delta 15 XcmaFMx|el=24m+$&FLFI{AC0HGmQr4 diff --git a/examples/runtime/shaders/metal/vs_stencil_color.bin b/examples/runtime/shaders/metal/vs_stencil_color.bin index 2f8e28d717104c2a68b530132a995b9395b57572..9647f5507926fca309db0b1ca1e5839427db87cd 100644 GIT binary patch delta 64 zcmbQka)xDs29p%iM6GH1oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(K@e=H*a(LWZ> delta 16 YcmX@ZGKXb?2Gc9XiCWV(eu!ZN05rq~WdHyG diff --git a/examples/runtime/shaders/metal/vs_stencil_color_lighting.bin b/examples/runtime/shaders/metal/vs_stencil_color_lighting.bin index 27bd999fca75c09fb02d298b8b0637b5fb665bb4..1d49e9c7d7dbd795a6d743574ffac8d352bd1d58 100644 GIT binary patch delta 63 zcmdnQ{)l~o9pki#_8av%({l0?OB9mQ(<Vjw3r OR>4-m(0b$h!%P4L^cYqE delta 16 YcmaFFzKMN;9b?)=`;D6w7!NT405z!v@c;k- diff --git a/examples/runtime/shaders/metal/vs_stencil_color_texture.bin b/examples/runtime/shaders/metal/vs_stencil_color_texture.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_stencil_texture.bin b/examples/runtime/shaders/metal/vs_stencil_texture.bin index b1a3b15985583fb6bd9dba1666664f0d50d34ab4..4e599722f1ec55140a3652138b27505b80c3deaf 100644 GIT binary patch delta 63 zcmdnV`jT~m2IJO=n$z_;({l0?OB9mQ(<Vjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_stencil_texture_lighting.bin b/examples/runtime/shaders/metal/vs_stencil_texture_lighting.bin index 0faa79e4f75622113d9eec6b1f55480d4ca9f452..de1d9b60e5c382cd9ac6b882d6a0813a3ef2962f 100644 GIT binary patch delta 67 zcmX@h@t0$Q9i!ny`;B^>X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* St6-~OI60nCaWg-o9Www}Ll>X` delta 20 ccmey%ah79(9V6pJ`;C()GRkkZXS8Dm08je{qyPW_ diff --git a/examples/runtime/shaders/metal/vs_terrain.bin b/examples/runtime/shaders/metal/vs_terrain.bin index 33415306ca272cad537c43fa0ec7f8a675d1b7f3..2dde205b33907bdbae3a5dd49426b69047ec3715 100644 GIT binary patch delta 64 zcmZ3%c7tt#29pZ&M6GH1oM}1vi6sh2>1h@5xv3?IIq?PgnRz9_nN_I@(a~Ubd@+y{ P8>?WeU}(K@e1M~rjX0b^_#KL7v# delta 17 ZcmZ24{9kCodB!ChF9*}yfyj&aLG`;GdXX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXua|MLuLT|>KIf2 delta 16 XcmZqRy1+TXjVjw3r OR>4-m(0b$kUyJ|%2N*v9 delta 15 XcmaFKx|4N+24m|)&FLFI{A2_GGW7=6 diff --git a/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin b/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin index 60037f46832429bd4e96e943c4b899feb31c6efe..0543efff8f0375111401af10f8c8245d62d5021a 100644 GIT binary patch delta 63 zcmX@b_KR(T2BXVF&FT7_X*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* Ot6-~OXuWZNHxmHw85e{A delta 15 Xcmeyxc8YC+2BXMC&FLFIbTI({Fop&k diff --git a/examples/runtime/shaders/metal/vs_vt_generic.bin b/examples/runtime/shaders/metal/vs_vt_generic.bin index be9fa8b7ade725cb650441b58088fb1e8a30fbbd..a71d7f4bf79c2ff35f9b371f7bc1f17ead2d33b3 100644 GIT binary patch delta 63 zcmey%x|VH%DdU@oW^430({l0?OB9mQ(<Vjw3r OR>4-m(0b!T872T1Zx{0b delta 16 YcmZ3>_Lp^nDdV1rW@|PJF-kK505=K+jsO4v diff --git a/examples/runtime/shaders/metal/vs_wf_mesh.bin b/examples/runtime/shaders/metal/vs_wf_mesh.bin index e1284f209833df92d06f2e0f5a384c2d9ef7320e..218b009ed6c83dce637ceb473106bd5231b26c6f 100644 GIT binary patch delta 67 zcmey!v5<3uFQeN;zms~LX*v0cB??LDX%+FgsU?Xy@df#rc_qP_RjCTm(O`CbF_04* St6-~OIJurtakCktH8TKRbr<*m delta 20 ccmZ3;`H^FSFQeE*zmt)))r> delta 20 ccmcc2zL08j@93jhEB From 6dd8edc4b1223433b5f744354cde9a9fc3c3ac79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 12 Apr 2023 19:25:14 -0700 Subject: [PATCH 69/86] Cleanup. --- tools/shaderc/shaderc_metal.cpp | 101 ++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/tools/shaderc/shaderc_metal.cpp b/tools/shaderc/shaderc_metal.cpp index a4ed0337e..978c9f0c5 100644 --- a/tools/shaderc/shaderc_metal.cpp +++ b/tools/shaderc/shaderc_metal.cpp @@ -538,7 +538,7 @@ namespace bgfx { namespace metal spirv_cross::ShaderResources resourcesrefl = refl.get_shader_resources(); // Loop through the separate_images, and extract the uniform names: - for (auto &resource : resourcesrefl.separate_images) + for (auto& resource : resourcesrefl.separate_images) { std::string name = refl.get_name(resource.id); if (name.size() > 7 && 0 == bx::strCmp(name.c_str() + name.length() - 7, "Texture")) @@ -556,6 +556,7 @@ namespace bgfx { namespace metal uniforms.push_back(un); } + uint16_t size = writeUniformArray(_shaderWriter, uniforms, _options.shaderType == 'f'); bx::Error err; @@ -572,42 +573,48 @@ namespace bgfx { namespace metal spirv_cross::SmallVector entryPoints = msl.get_entry_points_and_stages(); if (!entryPoints.empty() ) - msl.rename_entry_point(entryPoints[0].name, "xlatMtlMain", entryPoints[0].execution_model); - - for (auto &resource : resources.uniform_buffers) { - unsigned set = msl.get_decoration( resource.id, spv::DecorationDescriptorSet ); - unsigned binding = msl.get_decoration( resource.id, spv::DecorationBinding ); - newBinding.desc_set = set; - newBinding.binding = binding; + msl.rename_entry_point( + entryPoints[0].name + , "xlatMtlMain" + , entryPoints[0].execution_model + ); + } + + for (auto& resource : resources.uniform_buffers) + { + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; newBinding.msl_buffer = 0; - msl.add_msl_resource_binding( newBinding ); + msl.add_msl_resource_binding(newBinding); msl.set_name(resource.id, "_mtl_u"); } - for (auto &resource : resources.storage_buffers) + for (auto& resource : resources.storage_buffers) { - unsigned set = msl.get_decoration( resource.id, spv::DecorationDescriptorSet ); - unsigned binding = msl.get_decoration( resource.id, spv::DecorationBinding ); - newBinding.desc_set = set; - newBinding.binding = binding; + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; newBinding.msl_buffer = binding + 1; - msl.add_msl_resource_binding( newBinding ); + msl.add_msl_resource_binding(newBinding); } - for (auto &resource : resources.separate_samplers) + for (auto& resource : resources.separate_samplers) { - unsigned set = msl.get_decoration( resource.id, spv::DecorationDescriptorSet ); - unsigned binding = msl.get_decoration( resource.id, spv::DecorationBinding ); - newBinding.desc_set = set; - newBinding.binding = binding; + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; newBinding.msl_texture = binding - textureBindingOffset; newBinding.msl_sampler = binding - textureBindingOffset; - msl.add_msl_resource_binding( newBinding ); + msl.add_msl_resource_binding(newBinding); } - for (auto &resource : resources.separate_images) + for (auto& resource : resources.separate_images) { std::string name = msl.get_name(resource.id); if (name.size() > 7 && 0 == bx::strCmp(name.c_str() + name.length() - 7, "Texture") ) @@ -615,46 +622,52 @@ namespace bgfx { namespace metal msl.set_name(resource.id, name.substr(0, name.length() - 7) ); } - unsigned set = msl.get_decoration( resource.id, spv::DecorationDescriptorSet ); - unsigned binding = msl.get_decoration( resource.id, spv::DecorationBinding ); - newBinding.desc_set = set; - newBinding.binding = binding; + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; newBinding.msl_texture = binding - textureBindingOffset; newBinding.msl_sampler = binding - textureBindingOffset; - msl.add_msl_resource_binding( newBinding ); + msl.add_msl_resource_binding(newBinding); } - for (auto &resource : resources.storage_images) + for (auto& resource : resources.storage_images) { std::string name = msl.get_name(resource.id); - unsigned set = msl.get_decoration( resource.id, spv::DecorationDescriptorSet ); - unsigned binding = msl.get_decoration( resource.id, spv::DecorationBinding ); - newBinding.desc_set = set; - newBinding.binding = binding; + unsigned set = msl.get_decoration(resource.id, spv::DecorationDescriptorSet); + unsigned binding = msl.get_decoration(resource.id, spv::DecorationBinding); + newBinding.desc_set = set; + newBinding.binding = binding; newBinding.msl_texture = binding - textureBindingOffset; newBinding.msl_sampler = binding - textureBindingOffset; - msl.add_msl_resource_binding( newBinding ); + msl.add_msl_resource_binding(newBinding); } std::string source = msl.compile(); - + // fix https://github.com/bkaradzic/bgfx/issues/2822 - // insert struct member which declares point size, defaulted to 1 - if (_options.shaderType == 'v'){ - auto findName = "xlatMtlMain_out\n{"; - auto pos = source.find(findName); - if (pos != std::string::npos){ - pos += strlen(findName); - source.insert(pos, "\n\tfloat bgfx_metal_pointSize [[point_size]] = 1;"); - } - } + // insert struct member which declares point size, defaulted to 1 + if ('v' == _options.shaderType) + { + const bx::StringView xlatMtlMainOut("xlatMtlMain_out\n{"); + size_t pos = source.find(xlatMtlMainOut.getPtr() ); + + if (pos != std::string::npos) + { + pos += xlatMtlMainOut.getLength(); + source.insert(pos, "\n\tfloat bgfx_metal_pointSize [[point_size]] = 1;"); + } + } if ('c' == _options.shaderType) { for (int i = 0; i < 3; ++i) { - uint16_t dim = (uint16_t)msl.get_execution_mode_argument(spv::ExecutionMode::ExecutionModeLocalSize, i); + uint16_t dim = (uint16_t)msl.get_execution_mode_argument( + spv::ExecutionMode::ExecutionModeLocalSize + , i + ); bx::write(_shaderWriter, dim, &err); } } From a3e68cd9b76a3a3fde2cba15b205c2600241c8c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Fri, 21 Apr 2023 19:04:16 -0700 Subject: [PATCH 70/86] Cleanup. --- examples/common/ps/particle_system.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/common/ps/particle_system.cpp b/examples/common/ps/particle_system.cpp index 6fafd7661..55bec8913 100644 --- a/examples/common/ps/particle_system.cpp +++ b/examples/common/ps/particle_system.cpp @@ -331,8 +331,8 @@ namespace ps bx::Aabb aabb = { - { bx::kInfinity, bx::kInfinity, bx::kInfinity }, - { -bx::kInfinity, -bx::kInfinity, -bx::kInfinity }, + { bx::kFloatInfinity, bx::kFloatInfinity, bx::kFloatInfinity }, + { -bx::kFloatInfinity, -bx::kFloatInfinity, -bx::kFloatInfinity }, }; for (uint32_t jj = 0, num = m_num, current = _first From e9d1e3d0fe9be3f3f5a3cab4c8668a43e1a5adb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 22 Apr 2023 22:22:45 -0700 Subject: [PATCH 71/86] Renamed bx::init::* tags. --- examples/18-ibl/ibl.cpp | 4 ++-- examples/28-wireframe/wireframe.cpp | 8 +++---- examples/29-debugdraw/debugdraw.cpp | 6 ++--- examples/36-sky/sky.cpp | 2 +- .../gpudrivenrendering.cpp | 4 ++-- examples/common/camera.cpp | 6 ++--- examples/common/debugdraw/debugdraw.cpp | 22 +++++++++---------- examples/common/ps/particle_system.cpp | 4 ++-- tools/geometryc/geometryc.cpp | 10 ++++----- tools/geometryv/geometryv.cpp | 6 ++--- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/examples/18-ibl/ibl.cpp b/examples/18-ibl/ibl.cpp index a2d15492e..54a785561 100644 --- a/examples/18-ibl/ibl.cpp +++ b/examples/18-ibl/ibl.cpp @@ -291,8 +291,8 @@ struct Camera struct Interp3f { - bx::Vec3 curr = bx::init::None; - bx::Vec3 dest = bx::init::None; + bx::Vec3 curr = bx::InitNone; + bx::Vec3 dest = bx::InitNone; }; Interp3f m_target; diff --git a/examples/28-wireframe/wireframe.cpp b/examples/28-wireframe/wireframe.cpp index 905ab2c6a..24347c8cb 100644 --- a/examples/28-wireframe/wireframe.cpp +++ b/examples/28-wireframe/wireframe.cpp @@ -29,8 +29,8 @@ struct Camera void reset() { - m_target.curr = bx::init::Zero; - m_target.dest = bx::init::Zero; + m_target.curr = bx::InitZero; + m_target.dest = bx::InitZero; m_pos.curr = { 0.0f, 0.0f, -2.0f }; m_pos.dest = { 0.0f, 0.0f, -2.0f }; @@ -135,8 +135,8 @@ struct Camera struct Interp3f { - bx::Vec3 curr = bx::init::None; - bx::Vec3 dest = bx::init::None; + bx::Vec3 curr = bx::InitNone; + bx::Vec3 dest = bx::InitNone; }; Interp3f m_target; diff --git a/examples/29-debugdraw/debugdraw.cpp b/examples/29-debugdraw/debugdraw.cpp index f274246da..5f2be270f 100644 --- a/examples/29-debugdraw/debugdraw.cpp +++ b/examples/29-debugdraw/debugdraw.cpp @@ -601,7 +601,7 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos) case Shape::Type::Plane: { - bx::Plane plane(bx::init::None); + bx::Plane plane(bx::InitNone); bx::calcPlane(plane, bx::normalize(bx::Vec3{0.0f, 1.0f, 1.0f}), _pos); _outShape = Shape(plane); } @@ -688,7 +688,7 @@ void initB(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos) case Shape::Type::Plane: { - bx::Plane plane(bx::init::None); + bx::Plane plane(bx::InitNone); bx::calcPlane(plane, bx::normalize(bx::Vec3{1.0f, 1.0f, 0.0f}), _pos); _outShape = Shape(plane); } @@ -1001,7 +1001,7 @@ public: const bx::Vec3 normal = { 0.0f, 1.0f, 0.0f }; const bx::Vec3 pos = { 0.0f, -2.0f, 0.0f }; - bx::Plane plane(bx::init::None); + bx::Plane plane(bx::InitNone); bx::calcPlane(plane, normal, pos); dde.setColor(false diff --git a/examples/36-sky/sky.cpp b/examples/36-sky/sky.cpp index 3648881c6..57f3a68b7 100644 --- a/examples/36-sky/sky.cpp +++ b/examples/36-sky/sky.cpp @@ -72,7 +72,7 @@ static constexpr float M_XYZ2RGB[] = // Converts color representation from CIE XYZ to RGB color-space. Color xyzToRgb(const Color& xyz) { - Color rgb(bx::init::None); + Color rgb(bx::InitNone); rgb.x = M_XYZ2RGB[0] * xyz.x + M_XYZ2RGB[3] * xyz.y + M_XYZ2RGB[6] * xyz.z; rgb.y = M_XYZ2RGB[1] * xyz.x + M_XYZ2RGB[4] * xyz.y + M_XYZ2RGB[7] * xyz.z; rgb.z = M_XYZ2RGB[2] * xyz.x + M_XYZ2RGB[5] * xyz.y + M_XYZ2RGB[8] * xyz.z; diff --git a/examples/37-gpudrivenrendering/gpudrivenrendering.cpp b/examples/37-gpudrivenrendering/gpudrivenrendering.cpp index 312ef4898..aa6f5bfb7 100644 --- a/examples/37-gpudrivenrendering/gpudrivenrendering.cpp +++ b/examples/37-gpudrivenrendering/gpudrivenrendering.cpp @@ -139,8 +139,8 @@ struct Camera struct Interp3f { - bx::Vec3 curr = bx::init::None; - bx::Vec3 dest = bx::init::None; + bx::Vec3 curr = bx::InitNone; + bx::Vec3 dest = bx::InitNone; }; Interp3f m_target; diff --git a/examples/common/camera.cpp b/examples/common/camera.cpp index 2578d3277..1770f4153 100644 --- a/examples/common/camera.cpp +++ b/examples/common/camera.cpp @@ -265,9 +265,9 @@ struct Camera MouseCoords m_mouseNow; MouseCoords m_mouseLast; - bx::Vec3 m_eye = bx::init::Zero; - bx::Vec3 m_at = bx::init::Zero; - bx::Vec3 m_up = bx::init::Zero; + bx::Vec3 m_eye = bx::InitZero; + bx::Vec3 m_at = bx::InitZero; + bx::Vec3 m_up = bx::InitZero; float m_horizontalAngle; float m_verticalAngle; diff --git a/examples/common/debugdraw/debugdraw.cpp b/examples/common/debugdraw/debugdraw.cpp index 9e6256d99..638d7733b 100644 --- a/examples/common/debugdraw/debugdraw.cpp +++ b/examples/common/debugdraw/debugdraw.cpp @@ -1650,7 +1650,7 @@ struct DebugDrawEncoderImpl void drawFrustum(const float* _viewProj) { - bx::Plane planes[6] = { bx::init::None, bx::init::None, bx::init::None, bx::init::None, bx::init::None, bx::init::None }; + bx::Plane planes[6] = { bx::InitNone, bx::InitNone, bx::InitNone, bx::InitNone, bx::InitNone, bx::InitNone }; buildFrustumPlanes(planes, _viewProj); const bx::Vec3 points[8] = @@ -1747,8 +1747,8 @@ struct DebugDrawEncoderImpl const float step = bx::kPi * 2.0f / num; _weight = bx::clamp(_weight, 0.0f, 2.0f); - bx::Vec3 udir(bx::init::None); - bx::Vec3 vdir(bx::init::None); + bx::Vec3 udir(bx::InitNone); + bx::Vec3 vdir(bx::InitNone); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); float xy0[2]; @@ -1819,8 +1819,8 @@ struct DebugDrawEncoderImpl const Attrib& attrib = m_attrib[m_stack]; if (attrib.m_wireframe) { - bx::Vec3 udir(bx::init::None); - bx::Vec3 vdir(bx::init::None); + bx::Vec3 udir(bx::InitNone); + bx::Vec3 vdir(bx::InitNone); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); const float halfExtent = _size*0.5f; @@ -1861,8 +1861,8 @@ struct DebugDrawEncoderImpl const Attrib& attrib = m_attrib[m_stack]; - bx::Vec3 udir(bx::init::None); - bx::Vec3 vdir(bx::init::None); + bx::Vec3 udir(bx::InitNone); + bx::Vec3 vdir(bx::InitNone); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); const Pack2D& pack = s_dds.m_sprite.get(_handle); @@ -1982,8 +1982,8 @@ struct DebugDrawEncoderImpl if (_thickness > 0.0f) { const bx::Vec3 from = { _x, _y, _z }; - bx::Vec3 mid(bx::init::None); - bx::Vec3 to(bx::init::None); + bx::Vec3 mid(bx::InitNone); + bx::Vec3 to(bx::InitNone); setColor(Axis::X == _highlight ? 0xff00ffff : 0xff0000ff); mid = { _x + _len - _thickness, _y, _z }; @@ -2025,8 +2025,8 @@ struct DebugDrawEncoderImpl { const Attrib& attrib = m_attrib[m_stack]; - bx::Vec3 udir(bx::init::None); - bx::Vec3 vdir(bx::init::None); + bx::Vec3 udir(bx::InitNone); + bx::Vec3 vdir(bx::InitNone); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); udir = bx::mul(udir, _step); diff --git a/examples/common/ps/particle_system.cpp b/examples/common/ps/particle_system.cpp index 55bec8913..ec57cd185 100644 --- a/examples/common/ps/particle_system.cpp +++ b/examples/common/ps/particle_system.cpp @@ -248,7 +248,7 @@ namespace ps Particle& particle = m_particles[m_num]; m_num++; - bx::Vec3 pos(bx::init::None); + bx::Vec3 pos(bx::InitNone); switch (m_shape) { default: @@ -281,7 +281,7 @@ namespace ps break; } - bx::Vec3 dir(bx::init::None); + bx::Vec3 dir(bx::InitNone); switch (m_direction) { default: diff --git a/tools/geometryc/geometryc.cpp b/tools/geometryc/geometryc.cpp index 971c8a7ed..e4964bd11 100644 --- a/tools/geometryc/geometryc.cpp +++ b/tools/geometryc/geometryc.cpp @@ -624,7 +624,7 @@ void parseObj(char* _data, uint32_t _size, Mesh* _mesh, bool _hasBc) if (0 == bx::strCmp(argv[0], "vn") ) { - bx::Vec3 normal(bx::init::None); + bx::Vec3 normal(bx::InitNone); bx::fromString(&normal.x, argv[1]); bx::fromString(&normal.y, argv[2]); bx::fromString(&normal.z, argv[3]); @@ -642,7 +642,7 @@ void parseObj(char* _data, uint32_t _size, Mesh* _mesh, bool _hasBc) } else if (0 == bx::strCmp(argv[0], "vt") ) { - bx::Vec3 texcoord(bx::init::None); + bx::Vec3 texcoord(bx::InitNone); texcoord.y = 0.0f; texcoord.z = 0.0f; @@ -783,7 +783,7 @@ void processGltfNode(cgltf_node* _node, Mesh* _mesh, Group* _group, bool _hasBc) { _mesh->m_positions.reserve(_mesh->m_positions.size() + accessorCount); - bx::Vec3 pos(bx::init::None); + bx::Vec3 pos(bx::InitNone); for (cgltf_size v = 0; v < accessorCount; ++v) { @@ -797,7 +797,7 @@ void processGltfNode(cgltf_node* _node, Mesh* _mesh, Group* _group, bool _hasBc) _mesh->m_normals.reserve(_mesh->m_normals.size() + accessorCount); hasNormal = true; - bx::Vec3 normal(bx::init::None); + bx::Vec3 normal(bx::InitNone); for (cgltf_size v = 0; v < accessorCount; ++v) { @@ -811,7 +811,7 @@ void processGltfNode(cgltf_node* _node, Mesh* _mesh, Group* _group, bool _hasBc) _mesh->m_texcoords.reserve(_mesh->m_texcoords.size() + accessorCount); hasTexcoord = true; - bx::Vec3 texcoord(bx::init::None); + bx::Vec3 texcoord(bx::InitNone); for (cgltf_size v = 0; v < accessorCount; ++v) { diff --git a/tools/geometryv/geometryv.cpp b/tools/geometryv/geometryv.cpp index ea3e075fa..70fe3ddb6 100644 --- a/tools/geometryv/geometryv.cpp +++ b/tools/geometryv/geometryv.cpp @@ -169,7 +169,7 @@ struct Camera { Camera() { - init(bx::init::Zero, 2.0f, 0.01f, 100.0f); + init(bx::InitZero, 2.0f, 0.01f, 100.0f); } void init(const bx::Vec3& _center, float _distance, float _near, float _far) @@ -265,8 +265,8 @@ struct Camera struct Interp3f { - bx::Vec3 curr = bx::init::None; - bx::Vec3 dest = bx::init::None; + bx::Vec3 curr = bx::InitNone; + bx::Vec3 dest = bx::InitNone; }; Interp3f m_target; From 277b5f4ada64266cbca760bf07697b07c3203e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 23 Apr 2023 09:06:41 -0700 Subject: [PATCH 72/86] Fixed MSVC warning. --- src/renderer_vk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index e7aa9de66..e70291160 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -5960,8 +5960,8 @@ VK_DESTROY uint32_t pitch; uint32_t slice; uint32_t size; - uint8_t mipLevel; - uint8_t layer; + uint32_t mipLevel; + uint32_t layer; }; ImageInfo* imageInfos = (ImageInfo*)BX_ALLOC(g_allocator, sizeof(ImageInfo) * numSrd); From 290295136b4a8220d96bd99d9691f0517e70d439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 23 Apr 2023 19:19:22 -0700 Subject: [PATCH 73/86] Added bx::Location, and removed allocator macros. --- examples/07-callback/callback.cpp | 10 ++-- examples/10-font/font.cpp | 2 +- examples/11-fontsdf/fontsdf.cpp | 2 +- examples/22-windows/windows.cpp | 4 +- examples/27-terrain/terrain.cpp | 12 ++--- examples/36-sky/sky.cpp | 8 +-- examples/40-svt/vt.cpp | 40 +++++++-------- examples/42-bunnylod/bunnylod.cpp | 40 +++++++-------- examples/common/bgfx_utils.cpp | 30 +++++------ examples/common/camera.cpp | 2 +- examples/common/debugdraw/debugdraw.cpp | 24 ++++----- examples/common/entry/cmd.cpp | 2 +- examples/common/entry/entry.cpp | 12 ++--- examples/common/entry/entry_p.h | 2 +- examples/common/entry/entry_sdl.cpp | 4 +- examples/common/entry/input.cpp | 2 +- examples/common/imgui/imgui.cpp | 4 +- examples/common/nanovg/nanovg_bgfx.cpp | 26 +++++----- examples/common/ps/particle_system.cpp | 12 ++--- src/bgfx.cpp | 36 +++++++------- src/bgfx_p.h | 32 ++++++------ src/glcontext_eagl.mm | 2 +- src/glcontext_egl.cpp | 2 +- src/glcontext_glx.cpp | 2 +- src/glcontext_html5.cpp | 8 +-- src/glcontext_nsgl.mm | 2 +- src/glcontext_wgl.cpp | 2 +- src/renderer_d3d11.cpp | 24 ++++----- src/renderer_d3d12.cpp | 42 ++++++++-------- src/renderer_d3d9.cpp | 22 ++++----- src/renderer_d3d9.h | 4 +- src/renderer_gl.cpp | 34 ++++++------- src/renderer_mtl.h | 4 +- src/renderer_mtl.mm | 32 ++++++------ src/renderer_noop.cpp | 2 +- src/renderer_vk.cpp | 66 ++++++++++++------------- src/renderer_webgpu.cpp | 46 ++++++++--------- src/renderer_webgpu.h | 8 +-- src/shader.cpp | 4 +- src/topology.cpp | 8 +-- src/vertexlayout.cpp | 4 +- tools/shaderc/shaderc_spirv.cpp | 4 +- 42 files changed, 314 insertions(+), 314 deletions(-) diff --git a/examples/07-callback/callback.cpp b/examples/07-callback/callback.cpp index 0f6097d9f..d660d7f4f 100644 --- a/examples/07-callback/callback.cpp +++ b/examples/07-callback/callback.cpp @@ -202,7 +202,7 @@ struct BgfxCallback : public bgfx::CallbackI m_writer = BX_NEW(entry::getAllocator(), AviWriter)(entry::getFileWriter() ); if (!m_writer->open("temp/capture.avi", _width, _height, 60, _yflip) ) { - BX_DELETE(entry::getAllocator(), m_writer); + bx::deleteObject(entry::getAllocator(), m_writer); m_writer = NULL; } } @@ -212,7 +212,7 @@ struct BgfxCallback : public bgfx::CallbackI if (NULL != m_writer) { m_writer->close(); - BX_DELETE(entry::getAllocator(), m_writer); + bx::deleteObject(entry::getAllocator(), m_writer); m_writer = NULL; } } @@ -257,7 +257,7 @@ public: } else { - bx::alignedFree(this, _ptr, _align, _file, _line); + bx::alignedFree(this, _ptr, _align, bx::Location(_file, _line) ); } } @@ -274,7 +274,7 @@ public: return ptr; } - return bx::alignedAlloc(this, _size, _align, _file, _line); + return bx::alignedAlloc(this, _size, _align, bx::Location(_file, _line) ); } if (kNaturalAlignment >= _align) @@ -292,7 +292,7 @@ public: return ptr; } - return bx::alignedRealloc(this, _ptr, _size, _align, _file, _line); + return bx::alignedRealloc(this, _ptr, _size, _align, bx::Location(_file, _line) ); } void dumpStats() const diff --git a/examples/10-font/font.cpp b/examples/10-font/font.cpp index 34daca64e..7e7be1b16 100644 --- a/examples/10-font/font.cpp +++ b/examples/10-font/font.cpp @@ -32,7 +32,7 @@ TrueTypeHandle loadTtf(FontManager* _fm, const char* _filePath) if (NULL != data) { TrueTypeHandle handle = _fm->createTtf( (uint8_t*)data, size); - BX_FREE(entry::getAllocator(), data); + bx::free(entry::getAllocator(), data); return handle; } diff --git a/examples/11-fontsdf/fontsdf.cpp b/examples/11-fontsdf/fontsdf.cpp index a7e7362a5..0b2de43a2 100644 --- a/examples/11-fontsdf/fontsdf.cpp +++ b/examples/11-fontsdf/fontsdf.cpp @@ -26,7 +26,7 @@ TrueTypeHandle loadTtf(FontManager* _fm, const char* _filePath) if (NULL != data) { TrueTypeHandle handle = _fm->createTtf( (uint8_t*)data, size); - BX_FREE(entry::getAllocator(), data); + bx::free(entry::getAllocator(), data); return handle; } diff --git a/examples/22-windows/windows.cpp b/examples/22-windows/windows.cpp index fa3577355..8f9150e43 100644 --- a/examples/22-windows/windows.cpp +++ b/examples/22-windows/windows.cpp @@ -98,7 +98,7 @@ public: if (swapChainSupported) { - m_bindings = (InputBinding*)BX_ALLOC(entry::getAllocator(), sizeof(InputBinding)*3); + m_bindings = (InputBinding*)bx::alloc(entry::getAllocator(), sizeof(InputBinding)*3); m_bindings[0].set(entry::Key::KeyC, entry::Modifier::None, 1, cmdCreateWindow, this); m_bindings[1].set(entry::Key::KeyD, entry::Modifier::None, 1, cmdDestroyWindow, this); m_bindings[2].end(); @@ -160,7 +160,7 @@ public: } inputRemoveBindings("22-windows"); - BX_FREE(entry::getAllocator(), m_bindings); + bx::free(entry::getAllocator(), m_bindings); // Cleanup. bgfx::destroy(m_ibh); diff --git a/examples/27-terrain/terrain.cpp b/examples/27-terrain/terrain.cpp index 3b493304a..64f1ba650 100644 --- a/examples/27-terrain/terrain.cpp +++ b/examples/27-terrain/terrain.cpp @@ -127,9 +127,9 @@ ExampleTerrain(const char* _name, const char* _description, const char* _url) m_terrain.m_mode = 0; m_terrain.m_dirty = true; - m_terrain.m_vertices = (PosTexCoord0Vertex*)BX_ALLOC(entry::getAllocator(), num * sizeof(PosTexCoord0Vertex) ); - m_terrain.m_indices = (uint16_t*)BX_ALLOC(entry::getAllocator(), num * sizeof(uint16_t) * 6); - m_terrain.m_heightMap = (uint8_t*)BX_ALLOC(entry::getAllocator(), num); + m_terrain.m_vertices = (PosTexCoord0Vertex*)bx::alloc(entry::getAllocator(), num * sizeof(PosTexCoord0Vertex) ); + m_terrain.m_indices = (uint16_t*)bx::alloc(entry::getAllocator(), num * sizeof(uint16_t) * 6); + m_terrain.m_heightMap = (uint8_t*)bx::alloc(entry::getAllocator(), num); bx::mtxSRT(m_terrain.m_transform, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); bx::memSet(m_terrain.m_heightMap, 0, sizeof(uint8_t) * s_terrainSize * s_terrainSize); @@ -181,9 +181,9 @@ ExampleTerrain(const char* _name, const char* _description, const char* _url) bgfx::frame(); bx::AllocatorI* allocator = entry::getAllocator(); - BX_FREE(allocator, m_terrain.m_vertices); - BX_FREE(allocator, m_terrain.m_indices); - BX_FREE(allocator, m_terrain.m_heightMap); + bx::free(allocator, m_terrain.m_vertices); + bx::free(allocator, m_terrain.m_indices); + bx::free(allocator, m_terrain.m_heightMap); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/36-sky/sky.cpp b/examples/36-sky/sky.cpp index 57f3a68b7..5c04dfa89 100644 --- a/examples/36-sky/sky.cpp +++ b/examples/36-sky/sky.cpp @@ -333,7 +333,7 @@ struct ProceduralSky bx::AllocatorI* allocator = entry::getAllocator(); - ScreenPosVertex* vertices = (ScreenPosVertex*)BX_ALLOC(allocator + ScreenPosVertex* vertices = (ScreenPosVertex*)bx::alloc(allocator , verticalCount * horizontalCount * sizeof(ScreenPosVertex) ); @@ -347,7 +347,7 @@ struct ProceduralSky } } - uint16_t* indices = (uint16_t*)BX_ALLOC(allocator + uint16_t* indices = (uint16_t*)bx::alloc(allocator , (verticalCount - 1) * (horizontalCount - 1) * 6 * sizeof(uint16_t) ); @@ -369,8 +369,8 @@ struct ProceduralSky m_vbh = bgfx::createVertexBuffer(bgfx::copy(vertices, sizeof(ScreenPosVertex) * verticalCount * horizontalCount), ScreenPosVertex::ms_layout); m_ibh = bgfx::createIndexBuffer(bgfx::copy(indices, sizeof(uint16_t) * k)); - BX_FREE(allocator, indices); - BX_FREE(allocator, vertices); + bx::free(allocator, indices); + bx::free(allocator, vertices); } void shutdown() diff --git a/examples/40-svt/vt.cpp b/examples/40-svt/vt.cpp index 64f479ea5..cabc06c40 100644 --- a/examples/40-svt/vt.cpp +++ b/examples/40-svt/vt.cpp @@ -296,7 +296,7 @@ Quadtree::~Quadtree() { if (m_children[i] != nullptr) { - BX_DELETE(VirtualTexture::getAllocator(), m_children[i]); + bx::deleteObject(VirtualTexture::getAllocator(), m_children[i]); } } } @@ -344,7 +344,7 @@ void Quadtree::remove(Page request) if (node != nullptr) { - BX_DELETE(VirtualTexture::getAllocator(), node->m_children[index]); + bx::deleteObject(VirtualTexture::getAllocator(), node->m_children[index]); node->m_children[index] = nullptr; } } @@ -459,12 +459,12 @@ PageTable::PageTable(PageCache* _cache, VirtualTextureInfo* _info, PageIndexer* PageTable::~PageTable() { - BX_DELETE(VirtualTexture::getAllocator(), m_quadtree); + bx::deleteObject(VirtualTexture::getAllocator(), m_quadtree); bgfx::destroy(m_texture); for (int i = 0; i < (int)m_images.size(); ++i) { - BX_DELETE(VirtualTexture::getAllocator(), m_images[i]); + bx::deleteObject(VirtualTexture::getAllocator(), m_images[i]); } for (int i = 0; i < (int)m_stagingTextures.size(); ++i) @@ -785,7 +785,7 @@ FeedbackBuffer::FeedbackBuffer(VirtualTextureInfo* _info, int _width, int _heigh FeedbackBuffer::~FeedbackBuffer() { - BX_DELETE(VirtualTexture::getAllocator(), m_indexer); + bx::deleteObject(VirtualTexture::getAllocator(), m_indexer); bgfx::destroy(m_feedbackFrameBuffer); } @@ -906,11 +906,11 @@ VirtualTexture::VirtualTexture(TileDataFile* _tileDataFile, VirtualTextureInfo* VirtualTexture::~VirtualTexture() { // Destroy - BX_DELETE(VirtualTexture::getAllocator(), m_indexer); - BX_DELETE(VirtualTexture::getAllocator(), m_atlas); - BX_DELETE(VirtualTexture::getAllocator(), m_loader); - BX_DELETE(VirtualTexture::getAllocator(), m_cache); - BX_DELETE(VirtualTexture::getAllocator(), m_pageTable); + bx::deleteObject(VirtualTexture::getAllocator(), m_indexer); + bx::deleteObject(VirtualTexture::getAllocator(), m_atlas); + bx::deleteObject(VirtualTexture::getAllocator(), m_loader); + bx::deleteObject(VirtualTexture::getAllocator(), m_cache); + bx::deleteObject(VirtualTexture::getAllocator(), m_pageTable); // Destroy all uniforms and textures bgfx::destroy(u_vt_settings_1); bgfx::destroy(u_vt_settings_2); @@ -1155,13 +1155,13 @@ TileGenerator::~TileGenerator() bimg::imageFree(m_sourceImage); } - BX_DELETE(VirtualTexture::getAllocator(), m_indexer); + bx::deleteObject(VirtualTexture::getAllocator(), m_indexer); - BX_DELETE(VirtualTexture::getAllocator(), m_page1Image); - BX_DELETE(VirtualTexture::getAllocator(), m_page2Image); - BX_DELETE(VirtualTexture::getAllocator(), m_2xtileImage); - BX_DELETE(VirtualTexture::getAllocator(), m_4xtileImage); - BX_DELETE(VirtualTexture::getAllocator(), m_tileImage); + bx::deleteObject(VirtualTexture::getAllocator(), m_page1Image); + bx::deleteObject(VirtualTexture::getAllocator(), m_page2Image); + bx::deleteObject(VirtualTexture::getAllocator(), m_2xtileImage); + bx::deleteObject(VirtualTexture::getAllocator(), m_4xtileImage); + bx::deleteObject(VirtualTexture::getAllocator(), m_tileImage); } bool TileGenerator::generate(const bx::FilePath& _filePath) @@ -1210,7 +1210,7 @@ bool TileGenerator::generate(const bx::FilePath& _filePath) return false; } - uint8_t* rawImage = (uint8_t*)BX_ALLOC(VirtualTexture::getAllocator(), size_t(size) ); + uint8_t* rawImage = (uint8_t*)bx::alloc(VirtualTexture::getAllocator(), size_t(size) ); bx::read(&fileReader, rawImage, int32_t(size), &err); bx::close(&fileReader); @@ -1218,12 +1218,12 @@ bool TileGenerator::generate(const bx::FilePath& _filePath) if (!err.isOk() ) { bx::debugPrintf("Image read failed'%s'.\n", _filePath.getCPtr() ); - BX_FREE(VirtualTexture::getAllocator(), rawImage); + bx::free(VirtualTexture::getAllocator(), rawImage); return false; } m_sourceImage = bimg::imageParse(VirtualTexture::getAllocator(), rawImage, uint32_t(size), bimg::TextureFormat::BGRA8, &err); - BX_FREE(VirtualTexture::getAllocator(), rawImage); + bx::free(VirtualTexture::getAllocator(), rawImage); if (!err.isOk() ) { @@ -1267,7 +1267,7 @@ bool TileGenerator::generate(const bx::FilePath& _filePath) // Write header m_tileDataFile->writeInfo(); // Close tile file - BX_DELETE(VirtualTexture::getAllocator(), m_tileDataFile); + bx::deleteObject(VirtualTexture::getAllocator(), m_tileDataFile); m_tileDataFile = nullptr; bx::debugPrintf("Done!\n"); return true; diff --git a/examples/42-bunnylod/bunnylod.cpp b/examples/42-bunnylod/bunnylod.cpp index 0af3ba0f1..800facb53 100644 --- a/examples/42-bunnylod/bunnylod.cpp +++ b/examples/42-bunnylod/bunnylod.cpp @@ -31,8 +31,8 @@ public: if (m_cachePermutation == NULL) { - m_cachePermutation = (uint32_t*)BX_ALLOC(entry::getAllocator(), numVertices * sizeof(uint32_t) ); - m_map = (uint32_t*)BX_ALLOC(entry::getAllocator(), numVertices * sizeof(uint32_t) ); + m_cachePermutation = (uint32_t*)bx::alloc(entry::getAllocator(), numVertices * sizeof(uint32_t) ); + m_map = (uint32_t*)bx::alloc(entry::getAllocator(), numVertices * sizeof(uint32_t) ); // It will takes long time if there are too many vertices. ProgressiveMesh( @@ -47,7 +47,7 @@ public: } // rearrange the vertex Array - char* temp = (char*)BX_ALLOC(entry::getAllocator(), numVertices * stride); + char* temp = (char*)bx::alloc(entry::getAllocator(), numVertices * stride); bx::memCopy(temp, _vb->data, _vb->size); for (uint32_t ii = 0; ii < numVertices; ++ii) @@ -55,7 +55,7 @@ public: bx::memCopy(_vb->data + m_cachePermutation[ii] * stride , temp + ii * stride, stride); } - BX_FREE(entry::getAllocator(), temp); + bx::free(entry::getAllocator(), temp); // update the changes in the entries in the triangle Array for (uint32_t ii = 0, num = numTriangles*3; ii < num; ++ii) @@ -107,7 +107,7 @@ public: } const bgfx::Memory* ib = bgfx::alloc(numIndices * sizeof(uint32_t) ); - uint8_t* vbData = (uint8_t*)BX_ALLOC(entry::getAllocator(), _mesh->m_layout.getSize(numVertices) ); + uint8_t* vbData = (uint8_t*)bx::alloc(entry::getAllocator(), _mesh->m_layout.getSize(numVertices) ); { uint32_t voffset = 0; @@ -144,11 +144,11 @@ public: cacheInvalid = true; m_originalVertices = numVertices; - BX_FREE(entry::getAllocator(), m_cachePermutation); + bx::free(entry::getAllocator(), m_cachePermutation); m_cachePermutation = NULL; - BX_FREE(entry::getAllocator(), m_cacheWeld); - m_cacheWeld = (uint32_t*)BX_ALLOC(entry::getAllocator(), numVertices * sizeof(uint32_t) ); + bx::free(entry::getAllocator(), m_cacheWeld); + m_cacheWeld = (uint32_t*)bx::alloc(entry::getAllocator(), numVertices * sizeof(uint32_t) ); m_totalVertices = bgfx::weldVertices(m_cacheWeld, _mesh->m_layout, vbData, numVertices, true, 0.00001f); remapIndices(m_cacheWeld, numVertices); @@ -161,7 +161,7 @@ public: , numVertices , m_totalVertices ); - BX_FREE(entry::getAllocator(), vbData); + bx::free(entry::getAllocator(), vbData); { uint32_t* ibData = (uint32_t*)ib->data; @@ -178,7 +178,7 @@ public: saveCache(); } - m_triangle = (uint32_t*)BX_ALLOC(entry::getAllocator(), ib->size); + m_triangle = (uint32_t*)bx::alloc(entry::getAllocator(), ib->size); bx::memCopy(m_triangle, ib->data, ib->size); m_vb = bgfx::createVertexBuffer(vb, _mesh->m_layout); @@ -205,26 +205,26 @@ public: { bx::read(&reader, m_originalVertices, &err); bx::read(&reader, m_totalVertices, &err); - m_cacheWeld = (uint32_t*)BX_ALLOC(entry::getAllocator(), m_originalVertices * sizeof(uint32_t) ); + m_cacheWeld = (uint32_t*)bx::alloc(entry::getAllocator(), m_originalVertices * sizeof(uint32_t) ); bx::read(&reader, m_cacheWeld, m_originalVertices * sizeof(uint32_t), &err); - m_cachePermutation = (uint32_t*)BX_ALLOC(entry::getAllocator(), m_totalVertices * sizeof(uint32_t) ); + m_cachePermutation = (uint32_t*)bx::alloc(entry::getAllocator(), m_totalVertices * sizeof(uint32_t) ); bx::read(&reader, m_cachePermutation, m_totalVertices * sizeof(uint32_t), &err); - m_map = (uint32_t*)BX_ALLOC(entry::getAllocator(), m_totalVertices * sizeof(uint32_t) ); + m_map = (uint32_t*)bx::alloc(entry::getAllocator(), m_totalVertices * sizeof(uint32_t) ); bx::read(&reader, m_map, m_totalVertices * sizeof(uint32_t), &err); if (!err.isOk() ) { // read fail - BX_FREE(entry::getAllocator(), m_cacheWeld); + bx::free(entry::getAllocator(), m_cacheWeld); m_cacheWeld = NULL; - BX_FREE(entry::getAllocator(), m_cachePermutation); + bx::free(entry::getAllocator(), m_cachePermutation); m_cachePermutation = NULL; - BX_FREE(entry::getAllocator(), m_map); + bx::free(entry::getAllocator(), m_map); m_map = NULL; } @@ -306,10 +306,10 @@ public: bgfx::destroy(m_ib); bgfx::destroy(u_tint); - BX_FREE(entry::getAllocator(), m_map); - BX_FREE(entry::getAllocator(), m_triangle); - BX_FREE(entry::getAllocator(), m_cacheWeld); - BX_FREE(entry::getAllocator(), m_cachePermutation); + bx::free(entry::getAllocator(), m_map); + bx::free(entry::getAllocator(), m_triangle); + bx::free(entry::getAllocator(), m_cacheWeld); + bx::free(entry::getAllocator(), m_cachePermutation); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/common/bgfx_utils.cpp b/examples/common/bgfx_utils.cpp index c48add461..fd9cfe9ab 100644 --- a/examples/common/bgfx_utils.cpp +++ b/examples/common/bgfx_utils.cpp @@ -28,7 +28,7 @@ void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _fi if (bx::open(_reader, _filePath) ) { uint32_t size = (uint32_t)bx::getSize(_reader); - void* data = BX_ALLOC(_allocator, size); + void* data = bx::alloc(_allocator, size); bx::read(_reader, data, size, bx::ErrorAssert{}); bx::close(_reader); if (NULL != _size) @@ -57,7 +57,7 @@ void* load(const char* _filePath, uint32_t* _size) void unload(void* _ptr) { - BX_FREE(entry::getAllocator(), _ptr); + bx::free(entry::getAllocator(), _ptr); } static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePath) @@ -81,7 +81,7 @@ static void* loadMem(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const if (bx::open(_reader, _filePath) ) { uint32_t size = (uint32_t)bx::getSize(_reader); - void* data = BX_ALLOC(_allocator, size); + void* data = bx::alloc(_allocator, size); bx::read(_reader, data, size, bx::ErrorAssert{}); bx::close(_reader); @@ -416,7 +416,7 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy) if (_ramcopy) { - group.m_vertices = (uint8_t*)BX_ALLOC(allocator, group.m_numVertices*stride); + group.m_vertices = (uint8_t*)bx::alloc(allocator, group.m_numVertices*stride); bx::memCopy(group.m_vertices, mem->data, mem->size); } @@ -441,16 +441,16 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy) uint32_t compressedSize; bx::read(_reader, compressedSize, &err); - void* compressedVertices = BX_ALLOC(allocator, compressedSize); + void* compressedVertices = bx::alloc(allocator, compressedSize); bx::read(_reader, compressedVertices, compressedSize, &err); meshopt_decodeVertexBuffer(mem->data, group.m_numVertices, stride, (uint8_t*)compressedVertices, compressedSize); - BX_FREE(allocator, compressedVertices); + bx::free(allocator, compressedVertices); if (_ramcopy) { - group.m_vertices = (uint8_t*)BX_ALLOC(allocator, group.m_numVertices*stride); + group.m_vertices = (uint8_t*)bx::alloc(allocator, group.m_numVertices*stride); bx::memCopy(group.m_vertices, mem->data, mem->size); } @@ -467,7 +467,7 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy) if (_ramcopy) { - group.m_indices = (uint16_t*)BX_ALLOC(allocator, group.m_numIndices*2); + group.m_indices = (uint16_t*)bx::alloc(allocator, group.m_numIndices*2); bx::memCopy(group.m_indices, mem->data, mem->size); } @@ -484,17 +484,17 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy) uint32_t compressedSize; bx::read(_reader, compressedSize, &err); - void* compressedIndices = BX_ALLOC(allocator, compressedSize); + void* compressedIndices = bx::alloc(allocator, compressedSize); bx::read(_reader, compressedIndices, compressedSize, &err); meshopt_decodeIndexBuffer(mem->data, group.m_numIndices, 2, (uint8_t*)compressedIndices, compressedSize); - BX_FREE(allocator, compressedIndices); + bx::free(allocator, compressedIndices); if (_ramcopy) { - group.m_indices = (uint16_t*)BX_ALLOC(allocator, group.m_numIndices*2); + group.m_indices = (uint16_t*)bx::alloc(allocator, group.m_numIndices*2); bx::memCopy(group.m_indices, mem->data, mem->size); } @@ -562,12 +562,12 @@ void Mesh::unload() if (NULL != group.m_vertices) { - BX_FREE(allocator, group.m_vertices); + bx::free(allocator, group.m_vertices); } if (NULL != group.m_indices) { - BX_FREE(allocator, group.m_indices); + bx::free(allocator, group.m_indices); } } m_groups.clear(); @@ -683,13 +683,13 @@ void meshUnload(Mesh* _mesh) MeshState* meshStateCreate() { - MeshState* state = (MeshState*)BX_ALLOC(entry::getAllocator(), sizeof(MeshState) ); + MeshState* state = (MeshState*)bx::alloc(entry::getAllocator(), sizeof(MeshState) ); return state; } void meshStateDestroy(MeshState* _meshState) { - BX_FREE(entry::getAllocator(), _meshState); + bx::free(entry::getAllocator(), _meshState); } void meshSubmit(const Mesh* _mesh, bgfx::ViewId _id, bgfx::ProgramHandle _program, const float* _mtx, uint64_t _state) diff --git a/examples/common/camera.cpp b/examples/common/camera.cpp index 1770f4153..c686b31dc 100644 --- a/examples/common/camera.cpp +++ b/examples/common/camera.cpp @@ -288,7 +288,7 @@ void cameraCreate() void cameraDestroy() { - BX_DELETE(entry::getAllocator(), s_camera); + bx::deleteObject(entry::getAllocator(), s_camera); s_camera = NULL; } diff --git a/examples/common/debugdraw/debugdraw.cpp b/examples/common/debugdraw/debugdraw.cpp index 638d7733b..201262c90 100644 --- a/examples/common/debugdraw/debugdraw.cpp +++ b/examples/common/debugdraw/debugdraw.cpp @@ -640,11 +640,11 @@ struct DebugDrawShared const uint32_t numVertices = genSphere(tess); const uint32_t numIndices = numVertices; - vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); + vertices[id] = bx::alloc(m_allocator, numVertices*stride); bx::memSet(vertices[id], 0, numVertices*stride); genSphere(tess, vertices[id], stride); - uint16_t* trilist = (uint16_t*)BX_ALLOC(m_allocator, numIndices*sizeof(uint16_t) ); + uint16_t* trilist = (uint16_t*)bx::alloc(m_allocator, numIndices*sizeof(uint16_t) ); for (uint32_t ii = 0; ii < numIndices; ++ii) { trilist[ii] = uint16_t(ii); @@ -658,7 +658,7 @@ struct DebugDrawShared , numIndices , false ); - indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); uint16_t* indicesOut = indices[id]; bx::memCopy(indicesOut, trilist, numIndices*sizeof(uint16_t) ); @@ -681,7 +681,7 @@ struct DebugDrawShared startVertex += numVertices; startIndex += numIndices + numLineListIndices; - BX_FREE(m_allocator, trilist); + bx::free(m_allocator, trilist); } for (uint32_t mesh = 0; mesh < 4; ++mesh) @@ -695,8 +695,8 @@ struct DebugDrawShared const uint32_t numIndices = num*6; const uint32_t numLineListIndices = num*4; - vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); - indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + vertices[id] = bx::alloc(m_allocator, numVertices*stride); + indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); bx::memSet(indices[id], 0, (numIndices + numLineListIndices)*sizeof(uint16_t) ); DebugShapeVertex* vertex = (DebugShapeVertex*)vertices[id]; @@ -756,8 +756,8 @@ struct DebugDrawShared const uint32_t numIndices = num*12; const uint32_t numLineListIndices = num*6; - vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); - indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + vertices[id] = bx::alloc(m_allocator, numVertices*stride); + indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); bx::memSet(indices[id], 0, (numIndices + numLineListIndices)*sizeof(uint16_t) ); DebugShapeVertex* vertex = (DebugShapeVertex*)vertices[id]; @@ -826,8 +826,8 @@ struct DebugDrawShared const uint32_t numIndices = num*6; const uint32_t numLineListIndices = num*6; - vertices[id] = BX_ALLOC(m_allocator, numVertices*stride); - indices[id] = (uint16_t*)BX_ALLOC(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); + vertices[id] = bx::alloc(m_allocator, numVertices*stride); + indices[id] = (uint16_t*)bx::alloc(m_allocator, (numIndices + numLineListIndices)*sizeof(uint16_t) ); bx::memSet(indices[id], 0, (numIndices + numLineListIndices)*sizeof(uint16_t) ); DebugShapeVertex* vertex = (DebugShapeVertex*)vertices[id]; @@ -919,8 +919,8 @@ struct DebugDrawShared , (m_mesh[id].m_numIndices[0]+m_mesh[id].m_numIndices[1])*sizeof(uint16_t) ); - BX_FREE(m_allocator, vertices[id]); - BX_FREE(m_allocator, indices[id]); + bx::free(m_allocator, vertices[id]); + bx::free(m_allocator, indices[id]); } bx::memCopy(&vb->data[m_mesh[DebugMesh::Quad].m_startVertex * stride] diff --git a/examples/common/entry/cmd.cpp b/examples/common/entry/cmd.cpp index 17ecea97d..c80b64d52 100644 --- a/examples/common/entry/cmd.cpp +++ b/examples/common/entry/cmd.cpp @@ -109,7 +109,7 @@ void cmdInit() void cmdShutdown() { - BX_DELETE(entry::getAllocator(), s_cmdContext); + bx::deleteObject(entry::getAllocator(), s_cmdContext); } void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData) diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index 2a13b7db2..04c702153 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -566,7 +566,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); return; } - AppI** apps = (AppI**)BX_ALLOC(g_allocator, s_numApps*sizeof(AppI*) ); + AppI** apps = (AppI**)bx::alloc(g_allocator, s_numApps*sizeof(AppI*) ); uint32_t ii = 0; for (AppI* app = getFirstApp(); NULL != app; app = app->getNext() ) @@ -589,7 +589,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); ai->m_next = NULL; } - BX_FREE(g_allocator, apps); + bx::free(g_allocator, apps); } int main(int _argc, const char* const* _argv) @@ -666,10 +666,10 @@ restart: cmdShutdown(); - BX_DELETE(g_allocator, s_fileReader); + bx::deleteObject(g_allocator, s_fileReader); s_fileReader = NULL; - BX_DELETE(g_allocator, s_fileWriter); + bx::deleteObject(g_allocator, s_fileWriter); s_fileWriter = NULL; return result; @@ -1010,14 +1010,14 @@ restart: void* TinyStlAllocator::static_allocate(size_t _bytes) { - return BX_ALLOC(getAllocator(), _bytes); + return bx::alloc(getAllocator(), _bytes); } void TinyStlAllocator::static_deallocate(void* _ptr, size_t /*_bytes*/) { if (NULL != _ptr) { - BX_FREE(getAllocator(), _ptr); + bx::free(getAllocator(), _ptr); } } diff --git a/examples/common/entry/entry_p.h b/examples/common/entry/entry_p.h index ef77cce47..b2f1f5790 100644 --- a/examples/common/entry/entry_p.h +++ b/examples/common/entry/entry_p.h @@ -318,7 +318,7 @@ namespace entry void release(const Event* _event) const { - BX_DELETE(getAllocator(), const_cast(_event) ); + bx::deleteObject(getAllocator(), const_cast(_event) ); } private: diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index afbf569c3..32a54da37 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/examples/common/entry/entry_sdl.cpp @@ -505,7 +505,7 @@ namespace entry { bx::AllocatorI* allocator = getAllocator(); uint32_t size = (uint32_t)bx::getSize(reader); - void* data = BX_ALLOC(allocator, size + 1); + void* data = bx::alloc(allocator, size + 1); bx::read(reader, data, size, bx::ErrorAssert{}); bx::close(reader); ((char*)data)[size] = '\0'; @@ -514,7 +514,7 @@ namespace entry DBG("SDL game controller add mapping failed: %s", SDL_GetError()); } - BX_FREE(allocator, data); + bx::free(allocator, data); } bool exit = false; diff --git a/examples/common/entry/input.cpp b/examples/common/entry/input.cpp index 01c941fbf..3fa13801e 100644 --- a/examples/common/entry/input.cpp +++ b/examples/common/entry/input.cpp @@ -292,7 +292,7 @@ void inputInit() void inputShutdown() { - BX_DELETE(entry::getAllocator(), s_input); + bx::deleteObject(entry::getAllocator(), s_input); } void inputAddBindings(const char* _name, const InputBinding* _bindings) diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index 951c118ed..760e6384a 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -507,13 +507,13 @@ static OcornutImguiContext s_ctx; static void* memAlloc(size_t _size, void* _userData) { BX_UNUSED(_userData); - return BX_ALLOC(s_ctx.m_allocator, _size); + return bx::alloc(s_ctx.m_allocator, _size); } static void memFree(void* _ptr, void* _userData) { BX_UNUSED(_userData); - BX_FREE(s_ctx.m_allocator, _ptr); + bx::free(s_ctx.m_allocator, _ptr); } void imguiCreate(float _fontSize, bx::AllocatorI* _allocator) diff --git a/examples/common/nanovg/nanovg_bgfx.cpp b/examples/common/nanovg/nanovg_bgfx.cpp index b87eea013..3446e4058 100644 --- a/examples/common/nanovg/nanovg_bgfx.cpp +++ b/examples/common/nanovg/nanovg_bgfx.cpp @@ -192,7 +192,7 @@ namespace { int old = gl->ctextures; gl->ctextures = (gl->ctextures == 0) ? 2 : gl->ctextures*2; - gl->textures = (struct GLNVGtexture*)BX_REALLOC(gl->allocator, gl->textures, sizeof(struct GLNVGtexture)*gl->ctextures); + gl->textures = (struct GLNVGtexture*)bx::realloc(gl->allocator, gl->textures, sizeof(struct GLNVGtexture)*gl->ctextures); bx::memSet(&gl->textures[old], 0xff, (gl->ctextures-old)*sizeof(struct GLNVGtexture) ); if (gl->textures == NULL) @@ -847,7 +847,7 @@ _cleanup: if (gl->ncalls+1 > gl->ccalls) { gl->ccalls = gl->ccalls == 0 ? 32 : gl->ccalls * 2; - gl->calls = (struct GLNVGcall*)BX_REALLOC(gl->allocator, gl->calls, sizeof(struct GLNVGcall) * gl->ccalls); + gl->calls = (struct GLNVGcall*)bx::realloc(gl->allocator, gl->calls, sizeof(struct GLNVGcall) * gl->ccalls); } ret = &gl->calls[gl->ncalls++]; bx::memSet(ret, 0, sizeof(struct GLNVGcall) ); @@ -860,7 +860,7 @@ _cleanup: if (gl->npaths + n > gl->cpaths) { GLNVGpath* paths; int cpaths = glnvg__maxi(gl->npaths + n, 128) + gl->cpaths / 2; // 1.5x Overallocate - paths = (GLNVGpath*)BX_REALLOC(gl->allocator, gl->paths, sizeof(GLNVGpath) * cpaths); + paths = (GLNVGpath*)bx::realloc(gl->allocator, gl->paths, sizeof(GLNVGpath) * cpaths); if (paths == NULL) return -1; gl->paths = paths; gl->cpaths = cpaths; @@ -877,7 +877,7 @@ _cleanup: { NVGvertex* verts; int cverts = glnvg__maxi(gl->nverts + n, 4096) + gl->cverts/2; // 1.5x Overallocate - verts = (NVGvertex*)BX_REALLOC(gl->allocator, gl->verts, sizeof(NVGvertex) * cverts); + verts = (NVGvertex*)bx::realloc(gl->allocator, gl->verts, sizeof(NVGvertex) * cverts); if (verts == NULL) return -1; gl->verts = verts; gl->cverts = cverts; @@ -893,7 +893,7 @@ _cleanup: if (gl->nuniforms+n > gl->cuniforms) { gl->cuniforms = gl->cuniforms == 0 ? glnvg__maxi(n, 32) : gl->cuniforms * 2; - gl->uniforms = (unsigned char*)BX_REALLOC(gl->allocator, gl->uniforms, gl->cuniforms * structSize); + gl->uniforms = (unsigned char*)bx::realloc(gl->allocator, gl->uniforms, gl->cuniforms * structSize); } ret = gl->nuniforms * structSize; gl->nuniforms += n; @@ -1098,12 +1098,12 @@ _cleanup: } } - BX_FREE(gl->allocator, gl->uniforms); - BX_FREE(gl->allocator, gl->verts); - BX_FREE(gl->allocator, gl->paths); - BX_FREE(gl->allocator, gl->calls); - BX_FREE(gl->allocator, gl->textures); - BX_FREE(gl->allocator, gl); + bx::free(gl->allocator, gl->uniforms); + bx::free(gl->allocator, gl->verts); + bx::free(gl->allocator, gl->paths); + bx::free(gl->allocator, gl->calls); + bx::free(gl->allocator, gl->textures); + bx::free(gl->allocator, gl); } } // namespace @@ -1118,7 +1118,7 @@ NVGcontext* nvgCreate(int32_t _edgeaa, bgfx::ViewId _viewId, bx::AllocatorI* _al struct NVGparams params; struct NVGcontext* ctx = NULL; - struct GLNVGcontext* gl = (struct GLNVGcontext*)BX_ALLOC(_allocator, sizeof(struct GLNVGcontext) ); + struct GLNVGcontext* gl = (struct GLNVGcontext*)bx::alloc(_allocator, sizeof(struct GLNVGcontext) ); if (gl == NULL) { goto error; @@ -1335,7 +1335,7 @@ void nvgluDeleteFramebuffer(NVGLUframebuffer* _framebuffer) struct NVGparams* params = nvgInternalParams(_framebuffer->ctx); struct GLNVGcontext* gl = (struct GLNVGcontext*)params->userPtr; glnvg__deleteTexture(gl, _framebuffer->image); - BX_DELETE(gl->allocator, _framebuffer); + bx::deleteObject(gl->allocator, _framebuffer); } void nvgluSetViewFramebuffer(bgfx::ViewId _viewId, NVGLUframebuffer* _framebuffer) diff --git a/examples/common/ps/particle_system.cpp b/examples/common/ps/particle_system.cpp index ec57cd185..1939bdfd8 100644 --- a/examples/common/ps/particle_system.cpp +++ b/examples/common/ps/particle_system.cpp @@ -452,7 +452,7 @@ namespace ps } m_emitterAlloc = bx::createHandleAlloc(m_allocator, _maxEmitters); - m_emitter = (Emitter*)BX_ALLOC(m_allocator, sizeof(Emitter)*_maxEmitters); + m_emitter = (Emitter*)bx::alloc(m_allocator, sizeof(Emitter)*_maxEmitters); PosColorTexCoord0Vertex::init(); @@ -482,7 +482,7 @@ namespace ps bgfx::destroy(s_texColor); bx::destroyHandleAlloc(m_allocator, m_emitterAlloc); - BX_FREE(m_allocator, m_emitter); + bx::free(m_allocator, m_emitter); m_allocator = NULL; } @@ -554,7 +554,7 @@ namespace ps ); PosColorTexCoord0Vertex* vertices = (PosColorTexCoord0Vertex*)tvb.data; - ParticleSort* particleSort = (ParticleSort*)BX_ALLOC(m_allocator, max*sizeof(ParticleSort) ); + ParticleSort* particleSort = (ParticleSort*)bx::alloc(m_allocator, max*sizeof(ParticleSort) ); uint32_t pos = 0; for (uint16_t ii = 0, numEmitters = m_emitterAlloc->getNumHandles(); ii < numEmitters; ++ii) @@ -595,7 +595,7 @@ namespace ps index[5] = idx*4+0; } - BX_FREE(m_allocator, particleSort); + bx::free(m_allocator, particleSort); bgfx::setState(0 | BGFX_STATE_WRITE_RGB @@ -687,12 +687,12 @@ namespace ps m_shape = _shape; m_direction = _direction; m_max = _maxParticles; - m_particles = (Particle*)BX_ALLOC(s_ctx.m_allocator, m_max*sizeof(Particle) ); + m_particles = (Particle*)bx::alloc(s_ctx.m_allocator, m_max*sizeof(Particle) ); } void Emitter::destroy() { - BX_FREE(s_ctx.m_allocator, m_particles); + bx::free(s_ctx.m_allocator, m_particles); m_particles = NULL; } diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 3c980282f..323b26238 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -54,14 +54,14 @@ namespace bgfx #if BGFX_CONFIG_USE_TINYSTL void* TinyStlAllocator::static_allocate(size_t _bytes) { - return BX_ALLOC(g_allocator, _bytes); + return bx::alloc(g_allocator, _bytes); } void TinyStlAllocator::static_deallocate(void* _ptr, size_t /*_bytes*/) { if (NULL != _ptr) { - BX_FREE(g_allocator, _ptr); + bx::free(g_allocator, _ptr); } } #endif // BGFX_CONFIG_USE_TINYSTL @@ -199,7 +199,7 @@ namespace bgfx } else { - bx::alignedFree(this, _ptr, _align, _file, _line); + bx::alignedFree(this, _ptr, _align, bx::Location(_file, _line) ); } } @@ -220,7 +220,7 @@ namespace bgfx return ::malloc(_size); } - return bx::alignedAlloc(this, _size, _align, _file, _line); + return bx::alignedAlloc(this, _size, _align, bx::Location(_file, _line) ); } if (kNaturalAlignment >= _align) @@ -237,7 +237,7 @@ namespace bgfx return ::realloc(_ptr, _size); } - return bx::alignedRealloc(this, _ptr, _size, _align, _file, _line); + return bx::alignedRealloc(this, _ptr, _size, _align, bx::Location(_file, _line) ); } void checkLeaks(); @@ -1970,8 +1970,8 @@ namespace bgfx frameNoRenderWait(); m_encoderHandle = bx::createHandleAlloc(g_allocator, _init.limits.maxEncoders); - m_encoder = (EncoderImpl*)BX_ALIGNED_ALLOC(g_allocator, sizeof(EncoderImpl)*_init.limits.maxEncoders, BX_ALIGNOF(EncoderImpl) ); - m_encoderStats = (EncoderStats*)BX_ALLOC(g_allocator, sizeof(EncoderStats)*_init.limits.maxEncoders); + m_encoder = (EncoderImpl*)bx::alignedAlloc(g_allocator, sizeof(EncoderImpl)*_init.limits.maxEncoders, BX_ALIGNOF(EncoderImpl) ); + m_encoderStats = (EncoderStats*)bx::alloc(g_allocator, sizeof(EncoderStats)*_init.limits.maxEncoders); for (uint32_t ii = 0, num = _init.limits.maxEncoders; ii < num; ++ii) { BX_PLACEMENT_NEW(&m_encoder[ii], EncoderImpl); @@ -2081,8 +2081,8 @@ namespace bgfx m_encoder[ii].~EncoderImpl(); } - BX_ALIGNED_FREE(g_allocator, m_encoder, BX_ALIGNOF(EncoderImpl) ); - BX_FREE(g_allocator, m_encoderStats); + bx::alignedFree(g_allocator, m_encoder, BX_ALIGNOF(EncoderImpl) ); + bx::free(g_allocator, m_encoderStats); m_dynVertexBufferAllocator.compact(); m_dynIndexBufferAllocator.compact(); @@ -3563,21 +3563,21 @@ namespace bgfx switch (errorState) { case ErrorState::ContextAllocated: - BX_ALIGNED_DELETE(g_allocator, s_ctx, Context::kAlignment); + bx::deleteObject(g_allocator, s_ctx, Context::kAlignment); s_ctx = NULL; BX_FALLTHROUGH; case ErrorState::Default: if (NULL != s_callbackStub) { - BX_DELETE(g_allocator, s_callbackStub); + bx::deleteObject(g_allocator, s_callbackStub); s_callbackStub = NULL; } if (NULL != s_allocatorStub) { bx::DefaultAllocator allocator; - BX_DELETE(&allocator, s_allocatorStub); + bx::deleteObject(&allocator, s_allocatorStub); s_allocatorStub = NULL; } @@ -3599,7 +3599,7 @@ namespace bgfx ctx->shutdown(); BX_ASSERT(NULL == s_ctx, "bgfx is should be uninitialized here."); - BX_ALIGNED_DELETE(g_allocator, ctx, Context::kAlignment); + bx::deleteObject(g_allocator, ctx, Context::kAlignment); BX_TRACE("Shutdown complete."); @@ -3610,14 +3610,14 @@ namespace bgfx if (NULL != s_callbackStub) { - BX_DELETE(g_allocator, s_callbackStub); + bx::deleteObject(g_allocator, s_callbackStub); s_callbackStub = NULL; } if (NULL != s_allocatorStub) { bx::DefaultAllocator allocator; - BX_DELETE(&allocator, s_allocatorStub); + bx::deleteObject(&allocator, s_allocatorStub); s_allocatorStub = NULL; } @@ -4066,7 +4066,7 @@ namespace bgfx const Memory* alloc(uint32_t _size) { BX_ASSERT(0 < _size, "Invalid memory operation. _size is 0."); - Memory* mem = (Memory*)BX_ALLOC(g_allocator, sizeof(Memory) + _size); + Memory* mem = (Memory*)bx::alloc(g_allocator, sizeof(Memory) + _size); mem->size = _size; mem->data = (uint8_t*)mem + sizeof(Memory); return mem; @@ -4089,7 +4089,7 @@ namespace bgfx const Memory* makeRef(const void* _data, uint32_t _size, ReleaseFn _releaseFn, void* _userData) { - MemoryRef* memRef = (MemoryRef*)BX_ALLOC(g_allocator, sizeof(MemoryRef) ); + MemoryRef* memRef = (MemoryRef*)bx::alloc(g_allocator, sizeof(MemoryRef) ); memRef->mem.size = _size; memRef->mem.data = (uint8_t*)_data; memRef->releaseFn = _releaseFn; @@ -4114,7 +4114,7 @@ namespace bgfx memRef->releaseFn(mem->data, memRef->userData); } } - BX_FREE(g_allocator, mem); + bx::free(g_allocator, mem); } void setDebug(uint32_t _debug) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 3db3b6116..c7661faac 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -666,7 +666,7 @@ namespace bgfx ~TextVideoMem() { - BX_FREE(g_allocator, m_mem); + bx::free(g_allocator, m_mem); } void resize(bool _small, uint32_t _width, uint32_t _height) @@ -686,7 +686,7 @@ namespace bgfx uint32_t size = m_size; m_size = m_width * m_height; - m_mem = (MemSlot*)BX_REALLOC(g_allocator, m_mem, m_size * sizeof(MemSlot) ); + m_mem = (MemSlot*)bx::realloc(g_allocator, m_mem, m_size * sizeof(MemSlot) ); if (size < m_size) { @@ -885,7 +885,7 @@ namespace bgfx ~CommandBuffer() { - BX_FREE(g_allocator, m_buffer); + bx::free(g_allocator, m_buffer); } void init(uint32_t _minCapacity) @@ -933,7 +933,7 @@ namespace bgfx void resize(uint32_t _capacity = 0) { m_capacity = bx::alignUp(bx::max(_capacity, m_minCapacity), 1024); - m_buffer = (uint8_t*)BX_REALLOC(g_allocator, m_buffer, m_capacity); + m_buffer = (uint8_t*)bx::realloc(g_allocator, m_buffer, m_capacity); } void write(const void* _data, uint32_t _size) @@ -1483,14 +1483,14 @@ namespace bgfx const uint32_t structSize = sizeof(UniformBuffer)-sizeof(UniformBuffer::m_buffer); uint32_t size = bx::alignUp(_size, 16); - void* data = BX_ALLOC(g_allocator, size+structSize); + void* data = bx::alloc(g_allocator, size+structSize); return BX_PLACEMENT_NEW(data, UniformBuffer)(size); } static void destroy(UniformBuffer* _uniformBuffer) { _uniformBuffer->~UniformBuffer(); - BX_FREE(g_allocator, _uniformBuffer); + bx::free(g_allocator, _uniformBuffer); } static void update(UniformBuffer** _uniformBuffer, uint32_t _threshold = 64<<10, uint32_t _grow = 1<<20) @@ -1500,7 +1500,7 @@ namespace bgfx { const uint32_t structSize = sizeof(UniformBuffer)-sizeof(UniformBuffer::m_buffer); uint32_t size = bx::alignUp(uniformBuffer->m_size + _grow, 16); - void* data = BX_REALLOC(g_allocator, uniformBuffer, size+structSize); + void* data = bx::realloc(g_allocator, uniformBuffer, size+structSize); uniformBuffer = reinterpret_cast(data); uniformBuffer->m_size = size; @@ -2182,7 +2182,7 @@ namespace bgfx { const uint32_t num = g_caps.limits.maxEncoders; - m_uniformBuffer = (UniformBuffer**)BX_ALLOC(g_allocator, sizeof(UniformBuffer*)*num); + m_uniformBuffer = (UniformBuffer**)bx::alloc(g_allocator, sizeof(UniformBuffer*)*num); for (uint32_t ii = 0; ii < num; ++ii) { @@ -2202,8 +2202,8 @@ namespace bgfx UniformBuffer::destroy(m_uniformBuffer[ii]); } - BX_FREE(g_allocator, m_uniformBuffer); - BX_DELETE(g_allocator, m_textVideoMem); + bx::free(g_allocator, m_uniformBuffer); + bx::deleteObject(g_allocator, m_textVideoMem); } void reset() @@ -3909,7 +3909,7 @@ namespace bgfx + bx::alignUp(sizeof(TransientIndexBuffer), 16) + bx::alignUp(_size, 16) ; - tib = (TransientIndexBuffer*)BX_ALIGNED_ALLOC(g_allocator, size, 16); + tib = (TransientIndexBuffer*)bx::alignedAlloc(g_allocator, size, 16); tib->data = (uint8_t *)tib + bx::alignUp(sizeof(TransientIndexBuffer), 16); tib->size = _size; tib->handle = handle; @@ -3926,7 +3926,7 @@ namespace bgfx cmdbuf.write(_tib->handle); m_submit->free(_tib->handle); - BX_ALIGNED_FREE(g_allocator, _tib, 16); + bx::alignedFree(g_allocator, _tib, 16); } BGFX_API_FUNC(void allocTransientIndexBuffer(TransientIndexBuffer* _tib, uint32_t _num, bool _index32) ) @@ -3976,7 +3976,7 @@ namespace bgfx + bx::alignUp(sizeof(TransientVertexBuffer), 16) + bx::alignUp(_size, 16) ; - tvb = (TransientVertexBuffer*)BX_ALIGNED_ALLOC(g_allocator, size, 16); + tvb = (TransientVertexBuffer*)bx::alignedAlloc(g_allocator, size, 16); tvb->data = (uint8_t *)tvb + bx::alignUp(sizeof(TransientVertexBuffer), 16); tvb->size = _size; tvb->startVertex = 0; @@ -3996,7 +3996,7 @@ namespace bgfx cmdbuf.write(_tvb->handle); m_submit->free(_tvb->handle); - BX_ALIGNED_FREE(g_allocator, _tvb, 16); + bx::alignedFree(g_allocator, _tvb, 16); } BGFX_API_FUNC(void allocTransientVertexBuffer(TransientVertexBuffer* _tvb, uint32_t _num, VertexLayoutHandle _layoutHandle, uint16_t _stride) ) @@ -4207,7 +4207,7 @@ namespace bgfx if (0 != sr.m_num) { uint32_t size = sr.m_num*sizeof(UniformHandle); - sr.m_uniforms = (UniformHandle*)BX_ALLOC(g_allocator, size); + sr.m_uniforms = (UniformHandle*)bx::alloc(g_allocator, size); bx::memCopy(sr.m_uniforms, uniforms, size); } @@ -4320,7 +4320,7 @@ namespace bgfx destroyUniform(sr.m_uniforms[ii]); } - BX_FREE(g_allocator, sr.m_uniforms); + bx::free(g_allocator, sr.m_uniforms); sr.m_uniforms = NULL; sr.m_num = 0; } diff --git a/src/glcontext_eagl.mm b/src/glcontext_eagl.mm index 7926e0720..070f7f566 100644 --- a/src/glcontext_eagl.mm +++ b/src/glcontext_eagl.mm @@ -316,7 +316,7 @@ namespace bgfx { namespace gl void GlContext::destroySwapChain(SwapChainGL* _swapChain) { - BX_DELETE(g_allocator, _swapChain); + bx::deleteObject(g_allocator, _swapChain); } void GlContext::swap(SwapChainGL* _swapChain) diff --git a/src/glcontext_egl.cpp b/src/glcontext_egl.cpp index d543880cf..82d19911d 100644 --- a/src/glcontext_egl.cpp +++ b/src/glcontext_egl.cpp @@ -413,7 +413,7 @@ EGL_IMPORT void GlContext::destroySwapChain(SwapChainGL* _swapChain) { - BX_DELETE(g_allocator, _swapChain); + bx::deleteObject(g_allocator, _swapChain); } void GlContext::swap(SwapChainGL* _swapChain) diff --git a/src/glcontext_glx.cpp b/src/glcontext_glx.cpp index 2d815ecbf..d76872b2c 100644 --- a/src/glcontext_glx.cpp +++ b/src/glcontext_glx.cpp @@ -330,7 +330,7 @@ namespace bgfx { namespace gl void GlContext::destroySwapChain(SwapChainGL* _swapChain) { - BX_DELETE(g_allocator, _swapChain); + bx::deleteObject(g_allocator, _swapChain); glXMakeCurrent(m_display, (::Window)g_platformData.nwh, m_context); } diff --git a/src/glcontext_html5.cpp b/src/glcontext_html5.cpp index e1a76d987..db1dbf1d2 100644 --- a/src/glcontext_html5.cpp +++ b/src/glcontext_html5.cpp @@ -31,7 +31,7 @@ namespace bgfx { namespace gl SwapChainGL(int _context, const char* _canvas) : m_context(_context) { - m_canvas = (char*)BX_ALLOC(g_allocator, strlen(_canvas) + 1); + m_canvas = (char*)bx::alloc(g_allocator, strlen(_canvas) + 1); strcpy(m_canvas, _canvas); makeCurrent(); @@ -45,7 +45,7 @@ namespace bgfx { namespace gl ~SwapChainGL() { EMSCRIPTEN_CHECK(emscripten_webgl_destroy_context(m_context) ); - BX_FREE(g_allocator, m_canvas); + bx::free(g_allocator, m_canvas); } void makeCurrent() @@ -107,7 +107,7 @@ namespace bgfx { namespace gl m_current = NULL; } - BX_DELETE(g_allocator, m_primary); + bx::deleteObject(g_allocator, m_primary); m_primary = NULL; } } @@ -171,7 +171,7 @@ namespace bgfx { namespace gl void GlContext::destroySwapChain(SwapChainGL* _swapChain) { - BX_DELETE(g_allocator, _swapChain); + bx::deleteObject(g_allocator, _swapChain); } void GlContext::swap(SwapChainGL* /* _swapChain */) diff --git a/src/glcontext_nsgl.mm b/src/glcontext_nsgl.mm index eb8e8d092..0bed6f52b 100644 --- a/src/glcontext_nsgl.mm +++ b/src/glcontext_nsgl.mm @@ -333,7 +333,7 @@ namespace bgfx { namespace gl void GlContext::destroySwapChain(SwapChainGL* _swapChain) { - BX_DELETE(g_allocator, _swapChain); + bx::deleteObject(g_allocator, _swapChain); } void GlContext::swap(SwapChainGL* _swapChain) diff --git a/src/glcontext_wgl.cpp b/src/glcontext_wgl.cpp index 9018b00d3..ce8f353f4 100644 --- a/src/glcontext_wgl.cpp +++ b/src/glcontext_wgl.cpp @@ -349,7 +349,7 @@ namespace bgfx { namespace gl void GlContext::destroySwapChain(SwapChainGL* _swapChain) { - BX_DELETE(g_allocator, _swapChain); + bx::deleteObject(g_allocator, _swapChain); wglMakeCurrent(m_hdc, m_context); } diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 758db2f25..460ea7d0a 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1963,11 +1963,11 @@ namespace bgfx { namespace d3d11 { if (NULL != m_uniforms[_handle.idx]) { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); } const uint32_t size = bx::alignUp(g_uniformTypeSize[_type]*_num, 16); - void* data = BX_ALLOC(g_allocator, size); + void* data = bx::alloc(g_allocator, size); bx::memSet(data, 0, size); m_uniforms[_handle.idx] = data; m_uniformReg.add(_handle, _name); @@ -1975,7 +1975,7 @@ namespace bgfx { namespace d3d11 void destroyUniform(UniformHandle _handle) override { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); m_uniforms[_handle.idx] = NULL; m_uniformReg.remove(_handle); } @@ -3643,7 +3643,7 @@ namespace bgfx { namespace d3d11 s_renderD3D11 = BX_NEW(g_allocator, RendererContextD3D11); if (!s_renderD3D11->init(_init) ) { - BX_DELETE(g_allocator, s_renderD3D11); + bx::deleteObject(g_allocator, s_renderD3D11); s_renderD3D11 = NULL; } return s_renderD3D11; @@ -3652,7 +3652,7 @@ namespace bgfx { namespace d3d11 void rendererDestroy() { s_renderD3D11->shutdown(); - BX_DELETE(g_allocator, s_renderD3D11); + bx::deleteObject(g_allocator, s_renderD3D11); s_renderD3D11 = NULL; } @@ -4449,7 +4449,7 @@ namespace bgfx { namespace d3d11 if (convert) { uint32_t srcpitch = mip.m_width*bpp/8; - temp = (uint8_t*)BX_ALLOC(g_allocator, srcpitch*mip.m_height); + temp = (uint8_t*)bx::alloc(g_allocator, srcpitch*mip.m_height); bimg::imageDecodeToBgra8(g_allocator, temp, mip.m_data, mip.m_width, mip.m_height, srcpitch, mip.m_format); srd[kk].pSysMem = temp; @@ -4467,17 +4467,17 @@ namespace bgfx { namespace d3d11 switch (m_textureFormat) { case TextureFormat::R5G6B5: - temp = (uint8_t*)BX_ALLOC(g_allocator, srd[kk].SysMemPitch*mip.m_height); + temp = (uint8_t*)bx::alloc(g_allocator, srd[kk].SysMemPitch*mip.m_height); bimg::imageConvert(temp, 16, bx::packB5G6R5, mip.m_data, bx::unpackR5G6B5, srd[kk].SysMemPitch*mip.m_height); srd[kk].pSysMem = temp; break; case TextureFormat::RGBA4: - temp = (uint8_t*)BX_ALLOC(g_allocator, srd[kk].SysMemPitch*mip.m_height); + temp = (uint8_t*)bx::alloc(g_allocator, srd[kk].SysMemPitch*mip.m_height); bimg::imageConvert(temp, 16, bx::packBgra4, mip.m_data, bx::unpackRgba4, srd[kk].SysMemPitch*mip.m_height); srd[kk].pSysMem = temp; break; case TextureFormat::RGB5A1: - temp = (uint8_t*)BX_ALLOC(g_allocator, srd[kk].SysMemPitch*mip.m_height); + temp = (uint8_t*)bx::alloc(g_allocator, srd[kk].SysMemPitch*mip.m_height); bimg::imageConvert(temp, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, srd[kk].SysMemPitch*mip.m_height); srd[kk].pSysMem = temp; break; @@ -4713,7 +4713,7 @@ namespace bgfx { namespace d3d11 { for (uint32_t lod = 0, num = ti.numMips; lod < num; ++lod) { - BX_FREE(g_allocator, const_cast(srd[kk].pSysMem) ); + bx::free(g_allocator, const_cast(srd[kk].pSysMem) ); ++kk; } } @@ -4801,7 +4801,7 @@ namespace bgfx { namespace d3d11 if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, slicepitch); + temp = (uint8_t*)bx::alloc(g_allocator, slicepitch); bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); data = temp; @@ -4820,7 +4820,7 @@ namespace bgfx { namespace d3d11 if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } } diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index d27136791..c302bc0ed 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -2010,11 +2010,11 @@ namespace bgfx { namespace d3d12 { if (NULL != m_uniforms[_handle.idx]) { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); } const uint32_t size = bx::alignUp(g_uniformTypeSize[_type] * _num, 16); - void* data = BX_ALLOC(g_allocator, size); + void* data = bx::alloc(g_allocator, size); bx::memSet(data, 0, size); m_uniforms[_handle.idx] = data; m_uniformReg.add(_handle, _name); @@ -2022,7 +2022,7 @@ namespace bgfx { namespace d3d12 void destroyUniform(UniformHandle _handle) override { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); m_uniforms[_handle.idx] = NULL; m_uniformReg.remove(_handle); } @@ -2994,7 +2994,7 @@ namespace bgfx { namespace d3d12 if (cached) { - cachedData = BX_ALLOC(g_allocator, length); + cachedData = bx::alloc(g_allocator, length); if (g_callback->cacheRead(hash, cachedData, length) ) { BX_TRACE("Loading cached compute PSO (size %d).", length); @@ -3039,7 +3039,7 @@ namespace bgfx { namespace d3d12 if (NULL != cachedData) { - BX_FREE(g_allocator, cachedData); + bx::free(g_allocator, cachedData); } return pso; @@ -3275,7 +3275,7 @@ namespace bgfx { namespace d3d12 if (cached) { - cachedData = BX_ALLOC(g_allocator, length); + cachedData = bx::alloc(g_allocator, length); if (g_callback->cacheRead(hash, cachedData, length) ) { BX_TRACE("Loading cached graphics PSO (size %d).", length); @@ -3327,7 +3327,7 @@ namespace bgfx { namespace d3d12 if (NULL != cachedData) { - BX_FREE(g_allocator, cachedData); + bx::free(g_allocator, cachedData); } return pso; @@ -3642,7 +3642,7 @@ namespace bgfx { namespace d3d12 s_renderD3D12 = BX_NEW(g_allocator, RendererContextD3D12); if (!s_renderD3D12->init(_init) ) { - BX_DELETE(g_allocator, s_renderD3D12); + bx::deleteObject(g_allocator, s_renderD3D12); s_renderD3D12 = NULL; } return s_renderD3D12; @@ -3651,7 +3651,7 @@ namespace bgfx { namespace d3d12 void rendererDestroy() { s_renderD3D12->shutdown(); - BX_DELETE(g_allocator, s_renderD3D12); + bx::deleteObject(g_allocator, s_renderD3D12); s_renderD3D12 = NULL; } @@ -4174,8 +4174,8 @@ namespace bgfx { namespace d3d12 , (void**)&m_commandSignature[DrawIndexed] ) ); - m_cmds[Draw ] = BX_ALLOC(g_allocator, m_maxDrawPerBatch*sizeof(DrawIndirectCommand) ); - m_cmds[DrawIndexed] = BX_ALLOC(g_allocator, m_maxDrawPerBatch*sizeof(DrawIndexedIndirectCommand) ); + m_cmds[Draw ] = bx::alloc(g_allocator, m_maxDrawPerBatch*sizeof(DrawIndirectCommand) ); + m_cmds[DrawIndexed] = bx::alloc(g_allocator, m_maxDrawPerBatch*sizeof(DrawIndexedIndirectCommand) ); uint32_t cmdSize = bx::max(sizeof(DrawIndirectCommand), sizeof(DrawIndexedIndirectCommand) ); for (uint32_t ii = 0; ii < BX_COUNTOF(m_indirect); ++ii) @@ -4191,8 +4191,8 @@ namespace bgfx { namespace d3d12 void BatchD3D12::destroy() { - BX_FREE(g_allocator, m_cmds[0]); - BX_FREE(g_allocator, m_cmds[1]); + bx::free(g_allocator, m_cmds[0]); + bx::free(g_allocator, m_cmds[1]); DX_RELEASE(m_commandSignature[0], 0); DX_RELEASE(m_commandSignature[1], 0); @@ -4983,7 +4983,7 @@ namespace bgfx { namespace d3d12 uint64_t requiredSize = 0; const size_t sizeInBytes = size_t(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(uint32_t) + sizeof(uint64_t) ) * _numSubresources; - D3D12_PLACED_SUBRESOURCE_FOOTPRINT* layouts = (D3D12_PLACED_SUBRESOURCE_FOOTPRINT*)BX_ALLOC(g_allocator, sizeInBytes); + D3D12_PLACED_SUBRESOURCE_FOOTPRINT* layouts = (D3D12_PLACED_SUBRESOURCE_FOOTPRINT*)bx::alloc(g_allocator, sizeInBytes); uint64_t* rowSizesInBytes = (uint64_t*)(layouts + _numSubresources); uint32_t* numRows = (uint32_t*)(rowSizesInBytes + _numSubresources); @@ -5012,7 +5012,7 @@ namespace bgfx { namespace d3d12 , _srcData ); - BX_FREE(g_allocator, layouts); + bx::free(g_allocator, layouts); return result; } @@ -5112,7 +5112,7 @@ namespace bgfx { namespace d3d12 const uint32_t slice = bx::strideAlign(bx::max(mip.m_height, 4)*pitch, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); const uint32_t size = slice*mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageDecodeToBgra8( g_allocator , temp @@ -5133,7 +5133,7 @@ namespace bgfx { namespace d3d12 const uint32_t slice = bx::strideAlign( (mip.m_height/blockInfo.blockHeight)*pitch, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); const uint32_t size = slice*mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageCopy(temp , mip.m_height/blockInfo.blockHeight , (mip.m_width /blockInfo.blockWidth )*mip.m_blockSize @@ -5151,7 +5151,7 @@ namespace bgfx { namespace d3d12 const uint32_t pitch = bx::strideAlign(mip.m_width*mip.m_bpp / 8, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); const uint32_t slice = bx::strideAlign(mip.m_height*pitch, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, slice*mip.m_depth); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, slice*mip.m_depth); bimg::imageCopy(temp , mip.m_height , mip.m_width*mip.m_bpp/8 @@ -5388,7 +5388,7 @@ namespace bgfx { namespace d3d12 { for (uint32_t lod = 0, num = ti.numMips; lod < num; ++lod) { - BX_FREE(g_allocator, const_cast(srd[kk].pData) ); + bx::free(g_allocator, const_cast(srd[kk].pData) ); ++kk; } } @@ -5488,7 +5488,7 @@ namespace bgfx { namespace d3d12 if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, slicepitch); + temp = (uint8_t*)bx::alloc(g_allocator, slicepitch); bimg::imageDecodeToBgra8(g_allocator, temp, srcData, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat)); srcData = temp; @@ -5529,7 +5529,7 @@ namespace bgfx { namespace d3d12 if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } D3D12_RANGE writeRange = { 0, numRows*rowPitch }; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 4ee0c9b8c..915406b62 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -1226,11 +1226,11 @@ namespace bgfx { namespace d3d9 { if (NULL != m_uniforms[_handle.idx]) { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); } const uint32_t size = bx::alignUp(g_uniformTypeSize[_type]*_num, 16); - void* data = BX_ALLOC(g_allocator, size); + void* data = bx::alloc(g_allocator, size); bx::memSet(data, 0, size); m_uniforms[_handle.idx] = data; m_uniformReg.add(_handle, _name); @@ -1238,7 +1238,7 @@ namespace bgfx { namespace d3d9 void destroyUniform(UniformHandle _handle) override { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); m_uniforms[_handle.idx] = NULL; m_uniformReg.remove(_handle); } @@ -2281,7 +2281,7 @@ namespace bgfx { namespace d3d9 s_renderD3D9 = BX_NEW(g_allocator, RendererContextD3D9); if (!s_renderD3D9->init(_init) ) { - BX_DELETE(g_allocator, s_renderD3D9); + bx::deleteObject(g_allocator, s_renderD3D9); s_renderD3D9 = NULL; } return s_renderD3D9; @@ -2290,7 +2290,7 @@ namespace bgfx { namespace d3d9 void rendererDestroy() { s_renderD3D9->shutdown(); - BX_DELETE(g_allocator, s_renderD3D9); + bx::deleteObject(g_allocator, s_renderD3D9); s_renderD3D9 = NULL; } @@ -2306,7 +2306,7 @@ namespace bgfx { namespace d3d9 { usage |= D3DUSAGE_DYNAMIC; pool = D3DPOOL_DEFAULT; - m_dynamic = (uint8_t*)BX_ALLOC(g_allocator, _size); + m_dynamic = (uint8_t*)bx::alloc(g_allocator, _size); } const D3DFORMAT format = 0 == (_flags & BGFX_BUFFER_INDEX32) @@ -2369,7 +2369,7 @@ namespace bgfx { namespace d3d9 { usage |= D3DUSAGE_DYNAMIC; pool = D3DPOOL_DEFAULT; - m_dynamic = (uint8_t*)BX_ALLOC(g_allocator, _size); + m_dynamic = (uint8_t*)bx::alloc(g_allocator, _size); } DX_CHECK(s_renderD3D9->m_device->CreateVertexBuffer(m_size @@ -3029,7 +3029,7 @@ namespace bgfx { namespace d3d9 { uint32_t srcpitch = mipWidth*bpp/8; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, srcpitch*mipHeight); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, srcpitch*mipHeight); bimg::imageDecodeToBgra8( g_allocator , temp @@ -3042,7 +3042,7 @@ namespace bgfx { namespace d3d9 bx::memCopy(bits, pitch, temp, srcpitch, pitch, height); - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } else { @@ -3111,7 +3111,7 @@ namespace bgfx { namespace d3d9 if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); + temp = (uint8_t*)bx::alloc(g_allocator, rectpitch*_rect.m_height); bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); data = temp; } @@ -3146,7 +3146,7 @@ namespace bgfx { namespace d3d9 if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } if (0 == _mip) diff --git a/src/renderer_d3d9.h b/src/renderer_d3d9.h index 9eefdc8b2..52c803f00 100644 --- a/src/renderer_d3d9.h +++ b/src/renderer_d3d9.h @@ -166,7 +166,7 @@ namespace bgfx { namespace d3d9 if (NULL != m_dynamic) { - BX_FREE(g_allocator, m_dynamic); + bx::free(g_allocator, m_dynamic); m_dynamic = NULL; } } @@ -219,7 +219,7 @@ namespace bgfx { namespace d3d9 if (NULL != m_dynamic) { - BX_FREE(g_allocator, m_dynamic); + bx::free(g_allocator, m_dynamic); m_dynamic = NULL; } } diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 2ed45614d..020dceba6 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3530,11 +3530,11 @@ namespace bgfx { namespace gl { if (NULL != m_uniforms[_handle.idx]) { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); } uint32_t size = g_uniformTypeSize[_type]*_num; - void* data = BX_ALLOC(g_allocator, size); + void* data = bx::alloc(g_allocator, size); bx::memSet(data, 0, size); m_uniforms[_handle.idx] = data; m_uniformReg.add(_handle, _name); @@ -3542,7 +3542,7 @@ namespace bgfx { namespace gl void destroyUniform(UniformHandle _handle) override { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); m_uniforms[_handle.idx] = NULL; m_uniformReg.remove(_handle); } @@ -3564,7 +3564,7 @@ namespace bgfx { namespace gl m_glctx.makeCurrent(swapChain); uint32_t length = width*height*4; - uint8_t* data = (uint8_t*)BX_ALLOC(g_allocator, length); + uint8_t* data = (uint8_t*)bx::alloc(g_allocator, length); GL_CHECK(glReadPixels(0 , 0 @@ -3588,7 +3588,7 @@ namespace bgfx { namespace gl , length , true ); - BX_FREE(g_allocator, data); + bx::free(g_allocator, data); } void updateViewName(ViewId _id, const char* _name) override @@ -4292,7 +4292,7 @@ namespace bgfx { namespace gl if (m_resolution.reset&BGFX_RESET_CAPTURE) { m_captureSize = m_resolution.width*m_resolution.height*4; - m_capture = BX_REALLOC(g_allocator, m_capture, m_captureSize); + m_capture = bx::realloc(g_allocator, m_capture, m_captureSize); g_callback->captureBegin(m_resolution.width, m_resolution.height, m_resolution.width*4, TextureFormat::BGRA8, true); } else @@ -4335,7 +4335,7 @@ namespace bgfx { namespace gl if (NULL != m_capture) { g_callback->captureEnd(); - BX_FREE(g_allocator, m_capture); + bx::free(g_allocator, m_capture); m_capture = NULL; m_captureSize = 0; } @@ -4354,7 +4354,7 @@ namespace bgfx { namespace gl if (cached) { - void* data = BX_ALLOC(g_allocator, length); + void* data = bx::alloc(g_allocator, length); if (g_callback->cacheRead(_id, data, length) ) { bx::Error err; @@ -4366,7 +4366,7 @@ namespace bgfx { namespace gl GL_CHECK(glProgramBinary(programId, format, reader.getDataPtr(), (GLsizei)reader.remaining() ) ); } - BX_FREE(g_allocator, data); + bx::free(g_allocator, data); } #if BGFX_CONFIG_RENDERER_OPENGL @@ -4390,13 +4390,13 @@ namespace bgfx { namespace gl if (0 < programLength) { uint32_t length = programLength + 4; - uint8_t* data = (uint8_t*)BX_ALLOC(g_allocator, length); + uint8_t* data = (uint8_t*)bx::alloc(g_allocator, length); GL_CHECK(glGetProgramBinary(programId, programLength, NULL, &format, &data[4]) ); *(uint32_t*)data = format; g_callback->cacheWrite(_id, data, length); - BX_FREE(g_allocator, data); + bx::free(g_allocator, data); } } } @@ -4830,7 +4830,7 @@ namespace bgfx { namespace gl s_renderGL = BX_NEW(g_allocator, RendererContextGL); if (!s_renderGL->init(_init) ) { - BX_DELETE(g_allocator, s_renderGL); + bx::deleteObject(g_allocator, s_renderGL); s_renderGL = NULL; } return s_renderGL; @@ -4839,7 +4839,7 @@ namespace bgfx { namespace gl void rendererDestroy() { s_renderGL->shutdown(); - BX_DELETE(g_allocator, s_renderGL); + bx::deleteObject(g_allocator, s_renderGL); s_renderGL = NULL; } @@ -5786,7 +5786,7 @@ namespace bgfx { namespace gl uint8_t* temp = NULL; if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, ti.width*ti.height*4); + temp = (uint8_t*)bx::alloc(g_allocator, ti.width*ti.height*4); } const uint16_t numSides = ti.numLayers * (imageContainer.m_cubeMap ? 6 : 1); @@ -5922,7 +5922,7 @@ namespace bgfx { namespace gl if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } } @@ -5994,7 +5994,7 @@ namespace bgfx { namespace gl if (convert || !unpackRowLength) { - temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*height); + temp = (uint8_t*)bx::alloc(g_allocator, rectpitch*height); } else if (unpackRowLength) { @@ -6069,7 +6069,7 @@ namespace bgfx { namespace gl if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } } diff --git a/src/renderer_mtl.h b/src/renderer_mtl.h index b7f848080..4c5608b38 100644 --- a/src/renderer_mtl.h +++ b/src/renderer_mtl.h @@ -805,7 +805,7 @@ namespace bgfx { namespace mtl if (NULL != m_dynamic) { - BX_DELETE(g_allocator, m_dynamic); + bx::deleteObject(g_allocator, m_dynamic); m_dynamic = NULL; } } @@ -940,7 +940,7 @@ namespace bgfx { namespace mtl void release(PipelineStateMtl* _ptr) { - BX_DELETE(g_allocator, _ptr); + bx::deleteObject(g_allocator, _ptr); } struct TextureMtl diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index bfc0a4286..1eff4cad2 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -1095,11 +1095,11 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa { if (NULL != m_uniforms[_handle.idx]) { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); } const uint32_t size = bx::alignUp(g_uniformTypeSize[_type]*_num, 16); - void* data = BX_ALLOC(g_allocator, size); + void* data = bx::alloc(g_allocator, size); bx::memSet(data, 0, size); m_uniforms[_handle.idx] = data; m_uniformReg.add(_handle, _name); @@ -1107,7 +1107,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa void destroyUniform(UniformHandle _handle) override { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); m_uniforms[_handle.idx] = NULL; m_uniformReg.remove(_handle); } @@ -1134,7 +1134,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa uint32_t width = m_screenshotTarget.width(); uint32_t height = m_screenshotTarget.height(); uint32_t length = width*height*4; - uint8_t* data = (uint8_t*)BX_ALLOC(g_allocator, length); + uint8_t* data = (uint8_t*)bx::alloc(g_allocator, length); MTLRegion region = { { 0, 0, 0 }, { width, height, 1 } }; @@ -1150,7 +1150,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa , false ); - BX_FREE(g_allocator, data); + bx::free(g_allocator, data); m_commandBuffer = m_cmd.alloc(); } @@ -1433,7 +1433,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (m_resolution.reset&BGFX_RESET_CAPTURE) { m_captureSize = m_resolution.width*m_resolution.height*4; - m_capture = BX_REALLOC(g_allocator, m_capture, m_captureSize); + m_capture = bx::realloc(g_allocator, m_capture, m_captureSize); g_callback->captureBegin(m_resolution.width, m_resolution.height, m_resolution.width*4, TextureFormat::BGRA8, false); } else @@ -1525,7 +1525,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (NULL != m_capture) { g_callback->captureEnd(); - BX_FREE(g_allocator, m_capture); + bx::free(g_allocator, m_capture); m_capture = NULL; m_captureSize = 0; } @@ -2558,7 +2558,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa s_renderMtl = BX_NEW(g_allocator, RendererContextMtl); if (!s_renderMtl->init(_init) ) { - BX_DELETE(g_allocator, s_renderMtl); + bx::deleteObject(g_allocator, s_renderMtl); s_renderMtl = NULL; } return s_renderMtl; @@ -2567,7 +2567,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa void rendererDestroy() { s_renderMtl->shutdown(); - BX_DELETE(g_allocator, s_renderMtl); + bx::deleteObject(g_allocator, s_renderMtl); s_renderMtl = NULL; } @@ -2731,7 +2731,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa m_fsh = NULL; if (NULL != m_computePS) { - BX_DELETE(g_allocator, m_computePS); + bx::deleteObject(g_allocator, m_computePS); m_computePS = NULL; } } @@ -2763,7 +2763,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa { if (NULL == m_dynamic) { - m_dynamic = (uint8_t*)BX_ALLOC(g_allocator, m_size); + m_dynamic = (uint8_t*)bx::alloc(g_allocator, m_size); } bx::memCopy(m_dynamic + _offset, _data, _size); @@ -2961,7 +2961,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa uint8_t* temp = NULL; if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, ti.width*ti.height*4); + temp = (uint8_t*)bx::alloc(g_allocator, ti.width*ti.height*4); } for (uint16_t side = 0; side < numSides; ++side) @@ -3037,7 +3037,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } } } @@ -3070,7 +3070,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); + temp = (uint8_t*)bx::alloc(g_allocator, rectpitch*_rect.m_height); bimg::imageDecodeToBgra8( g_allocator , temp @@ -3134,7 +3134,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } } @@ -3551,7 +3551,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa { if (NULL != m_swapChain) { - BX_DELETE(g_allocator, m_swapChain); + bx::deleteObject(g_allocator, m_swapChain); m_swapChain = NULL; } diff --git a/src/renderer_noop.cpp b/src/renderer_noop.cpp index 408da38c4..2c3dc0b2f 100644 --- a/src/renderer_noop.cpp +++ b/src/renderer_noop.cpp @@ -280,7 +280,7 @@ namespace bgfx { namespace noop void rendererDestroy() { - BX_DELETE(g_allocator, s_renderNOOP); + bx::deleteObject(g_allocator, s_renderNOOP); s_renderNOOP = NULL; } } /* namespace noop */ } // namespace bgfx diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index e70291160..8d4530edd 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -530,13 +530,13 @@ VK_IMPORT_DEVICE static void* VKAPI_PTR allocationFunction(void* _userData, size_t _size, size_t _alignment, VkSystemAllocationScope _allocationScope) { BX_UNUSED(_userData, _allocationScope); - return bx::alignedAlloc(g_allocator, _size, _alignment, s_allocScopeName[_allocationScope]); + return bx::alignedAlloc(g_allocator, _size, _alignment, bx::Location(s_allocScopeName[_allocationScope], 0) ); } static void* VKAPI_PTR reallocationFunction(void* _userData, void* _original, size_t _size, size_t _alignment, VkSystemAllocationScope _allocationScope) { BX_UNUSED(_userData, _allocationScope); - return bx::alignedRealloc(g_allocator, _original, _size, _alignment, s_allocScopeName[_allocationScope]); + return bx::alignedRealloc(g_allocator, _original, _size, _alignment, bx::Location(s_allocScopeName[_allocationScope], 0) ); } static void VKAPI_PTR freeFunction(void* _userData, void* _memory) @@ -699,7 +699,7 @@ VK_IMPORT_DEVICE if (VK_SUCCESS == result && 0 < numExtensionProperties) { - VkExtensionProperties* extensionProperties = (VkExtensionProperties*)BX_ALLOC(g_allocator, numExtensionProperties * sizeof(VkExtensionProperties) ); + VkExtensionProperties* extensionProperties = (VkExtensionProperties*)bx::alloc(g_allocator, numExtensionProperties * sizeof(VkExtensionProperties) ); result = enumerateExtensionProperties(_physicalDevice , NULL , &numExtensionProperties @@ -728,7 +728,7 @@ VK_IMPORT_DEVICE BX_UNUSED(supported); } - BX_FREE(g_allocator, extensionProperties); + bx::free(g_allocator, extensionProperties); } } @@ -739,7 +739,7 @@ VK_IMPORT_DEVICE if (VK_SUCCESS == result && 0 < numLayerProperties) { - VkLayerProperties* layerProperties = (VkLayerProperties*)BX_ALLOC(g_allocator, numLayerProperties * sizeof(VkLayerProperties) ); + VkLayerProperties* layerProperties = (VkLayerProperties*)bx::alloc(g_allocator, numLayerProperties * sizeof(VkLayerProperties) ); result = enumerateLayerProperties(_physicalDevice, &numLayerProperties, layerProperties); char indent = VK_NULL_HANDLE == _physicalDevice ? '\0' : '\t'; @@ -774,7 +774,7 @@ VK_IMPORT_DEVICE if (VK_SUCCESS == result && 0 < numExtensionProperties) { - VkExtensionProperties* extensionProperties = (VkExtensionProperties*)BX_ALLOC(g_allocator, numExtensionProperties * sizeof(VkExtensionProperties) ); + VkExtensionProperties* extensionProperties = (VkExtensionProperties*)bx::alloc(g_allocator, numExtensionProperties * sizeof(VkExtensionProperties) ); result = enumerateExtensionProperties(_physicalDevice , layerProperties[layer].layerName , &numExtensionProperties @@ -800,11 +800,11 @@ VK_IMPORT_DEVICE BX_UNUSED(supported); } - BX_FREE(g_allocator, extensionProperties); + bx::free(g_allocator, extensionProperties); } } - BX_FREE(g_allocator, layerProperties); + bx::free(g_allocator, layerProperties); } } @@ -1722,7 +1722,7 @@ VK_IMPORT_INSTANCE , NULL ); - VkQueueFamilyProperties* queueFamilyPropertices = (VkQueueFamilyProperties*)BX_ALLOC(g_allocator, queueFamilyPropertyCount * sizeof(VkQueueFamilyProperties) ); + VkQueueFamilyProperties* queueFamilyPropertices = (VkQueueFamilyProperties*)bx::alloc(g_allocator, queueFamilyPropertyCount * sizeof(VkQueueFamilyProperties) ); vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice , &queueFamilyPropertyCount @@ -1752,7 +1752,7 @@ VK_IMPORT_INSTANCE } } - BX_FREE(g_allocator, queueFamilyPropertices); + bx::free(g_allocator, queueFamilyPropertices); if (UINT32_MAX == m_globalQueueFamily) { @@ -2419,11 +2419,11 @@ VK_IMPORT_DEVICE { if (NULL != m_uniforms[_handle.idx]) { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); } const uint32_t size = bx::alignUp(g_uniformTypeSize[_type] * _num, 16); - void* data = BX_ALLOC(g_allocator, size); + void* data = bx::alloc(g_allocator, size); bx::memSet(data, 0, size); m_uniforms[_handle.idx] = data; m_uniformReg.add(_handle, _name); @@ -2431,7 +2431,7 @@ VK_IMPORT_DEVICE void destroyUniform(UniformHandle _handle) override { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); m_uniforms[_handle.idx] = NULL; } @@ -3728,7 +3728,7 @@ VK_IMPORT_DEVICE if (cached) { - cachedData = BX_ALLOC(g_allocator, length); + cachedData = bx::alloc(g_allocator, length); if (g_callback->cacheRead(hash, cachedData, length) ) { BX_TRACE("Loading cached pipeline state (size %d).", length); @@ -3759,7 +3759,7 @@ VK_IMPORT_DEVICE { if (length < dataSize) { - cachedData = BX_REALLOC(g_allocator, cachedData, dataSize); + cachedData = bx::realloc(g_allocator, cachedData, dataSize); } VK_CHECK(vkGetPipelineCacheData(m_device, cache, &dataSize, cachedData) ); @@ -3771,7 +3771,7 @@ VK_IMPORT_DEVICE if (NULL != cachedData) { - BX_FREE(g_allocator, cachedData); + bx::free(g_allocator, cachedData); } return pipeline; @@ -4052,13 +4052,13 @@ VK_IMPORT_DEVICE const uint32_t dstPitch = width * dstBpp / 8; const uint32_t dstSize = height * dstPitch; - void* dst = BX_ALLOC(g_allocator, dstSize); + void* dst = bx::alloc(g_allocator, dstSize); bimg::imageConvert(g_allocator, dst, bimg::TextureFormat::BGRA8, src, bimg::TextureFormat::Enum(_swapChain.m_colorFormat), width, height, 1); _func(dst, width, height, dstPitch, _userData); - BX_FREE(g_allocator, dst); + bx::free(g_allocator, dst); } vkUnmapMemory(m_device, _memory); @@ -4494,7 +4494,7 @@ VK_IMPORT_DEVICE s_renderVK = BX_NEW(g_allocator, RendererContextVK); if (!s_renderVK->init(_init) ) { - BX_DELETE(g_allocator, s_renderVK); + bx::deleteObject(g_allocator, s_renderVK); s_renderVK = NULL; } return s_renderVK; @@ -4503,7 +4503,7 @@ VK_IMPORT_DEVICE void rendererDestroy() { s_renderVK->shutdown(); - BX_DELETE(g_allocator, s_renderVK); + bx::deleteObject(g_allocator, s_renderVK); s_renderVK = NULL; } @@ -5964,7 +5964,7 @@ VK_DESTROY uint32_t layer; }; - ImageInfo* imageInfos = (ImageInfo*)BX_ALLOC(g_allocator, sizeof(ImageInfo) * numSrd); + ImageInfo* imageInfos = (ImageInfo*)bx::alloc(g_allocator, sizeof(ImageInfo) * numSrd); bx::memSet(imageInfos, 0, sizeof(ImageInfo) * numSrd); uint32_t alignment = 1; // tightly aligned buffer @@ -5982,7 +5982,7 @@ VK_DESTROY const uint32_t slice = bx::strideAlign(bx::max(mip.m_height, 4) * pitch, alignment); const uint32_t size = slice * mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageDecodeToBgra8( g_allocator , temp @@ -6009,7 +6009,7 @@ VK_DESTROY const uint32_t slice = bx::strideAlign( (mip.m_height / blockInfo.blockHeight) * pitch, alignment); const uint32_t size = slice * mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageCopy( temp , mip.m_height / blockInfo.blockHeight @@ -6035,7 +6035,7 @@ VK_DESTROY const uint32_t slice = bx::strideAlign(mip.m_height * pitch, alignment); const uint32_t size = slice * mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageCopy( temp , mip.m_height @@ -6061,7 +6061,7 @@ VK_DESTROY } uint32_t totalMemSize = 0; - VkBufferImageCopy* bufferCopyInfo = (VkBufferImageCopy*)BX_ALLOC(g_allocator, sizeof(VkBufferImageCopy) * numSrd); + VkBufferImageCopy* bufferCopyInfo = (VkBufferImageCopy*)bx::alloc(g_allocator, sizeof(VkBufferImageCopy) * numSrd); for (uint32_t ii = 0; ii < numSrd; ++ii) { @@ -6116,14 +6116,14 @@ VK_DESTROY setImageMemoryBarrier(_commandBuffer, m_sampledLayout); } - BX_FREE(g_allocator, bufferCopyInfo); + bx::free(g_allocator, bufferCopyInfo); for (uint32_t ii = 0; ii < numSrd; ++ii) { - BX_FREE(g_allocator, imageInfos[ii].data); + bx::free(g_allocator, imageInfos[ii].data); } - BX_FREE(g_allocator, imageInfos); + bx::free(g_allocator, imageInfos); m_readback.create(m_textureImage, m_width, m_height, TextureFormat::Enum(m_textureFormat) ); } @@ -6182,7 +6182,7 @@ VK_DESTROY if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, slicepitch); + temp = (uint8_t*)bx::alloc(g_allocator, slicepitch); bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat)); data = temp; @@ -6219,7 +6219,7 @@ VK_DESTROY if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } } @@ -7294,13 +7294,13 @@ VK_DESTROY return selectedFormat; } - VkSurfaceFormatKHR* surfaceFormats = (VkSurfaceFormatKHR*)BX_ALLOC(g_allocator, numSurfaceFormats * sizeof(VkSurfaceFormatKHR) ); + VkSurfaceFormatKHR* surfaceFormats = (VkSurfaceFormatKHR*)bx::alloc(g_allocator, numSurfaceFormats * sizeof(VkSurfaceFormatKHR) ); result = vkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, m_surface, &numSurfaceFormats, surfaceFormats); if (VK_SUCCESS != result) { BX_TRACE("findSurfaceFormat error: vkGetPhysicalDeviceSurfaceFormatsKHR failed %d: %s.", result, getName(result) ); - BX_FREE(g_allocator, surfaceFormats); + bx::free(g_allocator, surfaceFormats); return selectedFormat; } @@ -7340,7 +7340,7 @@ VK_DESTROY } } - BX_FREE(g_allocator, surfaceFormats); + bx::free(g_allocator, surfaceFormats); if (TextureFormat::Count == selectedFormat) { diff --git a/src/renderer_webgpu.cpp b/src/renderer_webgpu.cpp index 8f747167e..ba18f7b61 100644 --- a/src/renderer_webgpu.cpp +++ b/src/renderer_webgpu.cpp @@ -1023,11 +1023,11 @@ namespace bgfx { namespace webgpu { if (NULL != m_uniforms[_handle.idx]) { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); } uint32_t size = bx::alignUp(g_uniformTypeSize[_type]*_num, 16); - void* data = BX_ALLOC(g_allocator, size); + void* data = bx::alloc(g_allocator, size); bx::memSet(data, 0, size); m_uniforms[_handle.idx] = data; m_uniformReg.add(_handle, _name); @@ -1035,7 +1035,7 @@ namespace bgfx { namespace webgpu void destroyUniform(UniformHandle _handle) override { - BX_FREE(g_allocator, m_uniforms[_handle.idx]); + bx::free(g_allocator, m_uniforms[_handle.idx]); m_uniforms[_handle.idx] = NULL; m_uniformReg.remove(_handle); } @@ -2459,7 +2459,7 @@ namespace bgfx { namespace webgpu s_renderWgpu = BX_NEW(g_allocator, RendererContextWgpu); if (!s_renderWgpu->init(_init) ) { - BX_DELETE(g_allocator, s_renderWgpu); + bx::deleteObject(g_allocator, s_renderWgpu); s_renderWgpu = NULL; } return s_renderWgpu; @@ -2468,7 +2468,7 @@ namespace bgfx { namespace webgpu void rendererDestroy() { s_renderWgpu->shutdown(); - BX_DELETE(g_allocator, s_renderWgpu); + bx::deleteObject(g_allocator, s_renderWgpu); s_renderWgpu = NULL; } @@ -2717,7 +2717,7 @@ namespace bgfx { namespace webgpu const uint32_t* code = (const uint32_t*)reader.getDataPtr(); bx::skip(&reader, shaderSize+1); - m_code = (uint32_t*)BX_ALLOC(g_allocator, shaderSize); + m_code = (uint32_t*)bx::alloc(g_allocator, shaderSize); m_codeSize = shaderSize; bx::memCopy(m_code, code, shaderSize); @@ -2938,7 +2938,7 @@ namespace bgfx { namespace webgpu m_fsh = NULL; if ( NULL != m_computePS ) { - BX_DELETE(g_allocator, m_computePS); + bx::deleteObject(g_allocator, m_computePS); m_computePS = NULL; } } @@ -2981,7 +2981,7 @@ namespace bgfx { namespace webgpu { if ( m_dynamic == NULL ) { - m_dynamic = (uint8_t*)BX_ALLOC(g_allocator, m_size); + m_dynamic = (uint8_t*)bx::alloc(g_allocator, m_size); } bx::memCopy(m_dynamic + _offset, _data, _size); @@ -3202,7 +3202,7 @@ namespace bgfx { namespace webgpu uint8_t layer; }; - ImageInfo* imageInfos = (ImageInfo*)BX_ALLOC(g_allocator, sizeof(ImageInfo) * numSrd); + ImageInfo* imageInfos = (ImageInfo*)bx::alloc(g_allocator, sizeof(ImageInfo) * numSrd); bx::memSet(imageInfos, 0, sizeof(ImageInfo) * numSrd); uint32_t alignment = 1; // tightly aligned buffer @@ -3221,7 +3221,7 @@ namespace bgfx { namespace webgpu const uint32_t slice = bx::strideAlign(bx::max(mip.m_height, 4) * pitch, alignment); const uint32_t size = slice * mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageDecodeToBgra8( g_allocator , temp @@ -3248,7 +3248,7 @@ namespace bgfx { namespace webgpu const uint32_t slice = bx::strideAlign((mip.m_height / blockInfo.blockHeight) * pitch, alignment); const uint32_t size = slice * mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageCopy( temp , mip.m_height / blockInfo.blockHeight @@ -3274,7 +3274,7 @@ namespace bgfx { namespace webgpu const uint32_t slice = bx::strideAlign(mip.m_height * pitch, alignment); const uint32_t size = slice * mip.m_depth; - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); + uint8_t* temp = (uint8_t*)bx::alloc(g_allocator, size); bimg::imageCopy(temp , mip.m_height , mip.m_width * mip.m_bpp / 8 @@ -3338,9 +3338,9 @@ namespace bgfx { namespace webgpu stagingBuffer.Unmap(); } - wgpu::ImageCopyBuffer* imageCopyBuffer = (wgpu::ImageCopyBuffer*)BX_ALLOC(g_allocator, sizeof(wgpu::ImageCopyBuffer) * numSrd); - wgpu::ImageCopyTexture* imageCopyTexture = (wgpu::ImageCopyTexture*)BX_ALLOC(g_allocator, sizeof(wgpu::ImageCopyTexture) * numSrd); - wgpu::Extent3D* textureCopySize = (wgpu::Extent3D*)BX_ALLOC(g_allocator, sizeof(wgpu::Extent3D) * numSrd); + wgpu::ImageCopyBuffer* imageCopyBuffer = (wgpu::ImageCopyBuffer*)bx::alloc(g_allocator, sizeof(wgpu::ImageCopyBuffer) * numSrd); + wgpu::ImageCopyTexture* imageCopyTexture = (wgpu::ImageCopyTexture*)bx::alloc(g_allocator, sizeof(wgpu::ImageCopyTexture) * numSrd); + wgpu::Extent3D* textureCopySize = (wgpu::Extent3D*)bx::alloc(g_allocator, sizeof(wgpu::Extent3D) * numSrd); uint64_t offset = 0; @@ -3392,14 +3392,14 @@ namespace bgfx { namespace webgpu //vkFreeMemory(device, stagingDeviceMem, allocatorCb); //vkDestroy(stagingBuffer); - BX_FREE(g_allocator, imageCopyBuffer); - BX_FREE(g_allocator, imageCopyTexture); - BX_FREE(g_allocator, textureCopySize); + bx::free(g_allocator, imageCopyBuffer); + bx::free(g_allocator, imageCopyTexture); + bx::free(g_allocator, textureCopySize); for (uint32_t ii = 0; ii < numSrd; ++ii) { - BX_FREE(g_allocator, imageInfos[ii].data); + bx::free(g_allocator, imageInfos[ii].data); } - BX_FREE(g_allocator, imageInfos); + bx::free(g_allocator, imageInfos); } } @@ -3418,7 +3418,7 @@ namespace bgfx { namespace webgpu if (convert) { - temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); + temp = (uint8_t*)bx::alloc(g_allocator, rectpitch*_rect.m_height); bimg::imageDecodeToBgra8( g_allocator , temp @@ -3478,7 +3478,7 @@ namespace bgfx { namespace webgpu if (NULL != temp) { - BX_FREE(g_allocator, temp); + bx::free(g_allocator, temp); } } @@ -3860,7 +3860,7 @@ namespace bgfx { namespace webgpu { if (NULL != m_swapChain) { - BX_DELETE(g_allocator, m_swapChain); + bx::deleteObject(g_allocator, m_swapChain); m_swapChain = NULL; } diff --git a/src/renderer_webgpu.h b/src/renderer_webgpu.h index 54c8aff23..5d728fa6e 100644 --- a/src/renderer_webgpu.h +++ b/src/renderer_webgpu.h @@ -98,7 +98,7 @@ namespace bgfx { namespace webgpu if(NULL != m_dynamic) { - BX_DELETE(g_allocator, m_dynamic); + bx::deleteObject(g_allocator, m_dynamic); m_dynamic = NULL; } } @@ -278,12 +278,12 @@ namespace bgfx { namespace webgpu void release(RenderPassStateWgpu* _ptr) { - BX_DELETE(g_allocator, _ptr); + bx::deleteObject(g_allocator, _ptr); } void release(PipelineStateWgpu* _ptr) { - BX_DELETE(g_allocator, _ptr); + bx::deleteObject(g_allocator, _ptr); } class StagingBufferWgpu @@ -413,7 +413,7 @@ namespace bgfx { namespace webgpu void release(SamplerStateWgpu* _ptr) { - BX_DELETE(g_allocator, _ptr); + bx::deleteObject(g_allocator, _ptr); } struct FrameBufferWgpu; diff --git a/src/shader.cpp b/src/shader.cpp index 98b6626ab..9e0ba24c2 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -250,7 +250,7 @@ namespace bgfx if (!_err->isOk() ) { return; } - uint8_t* shaderCode = (uint8_t*)BX_ALLOC(g_allocator, shaderSize); + uint8_t* shaderCode = (uint8_t*)bx::alloc(g_allocator, shaderSize); bx::read(_reader, shaderCode, shaderSize, _err); bx::MemoryReader reader(shaderCode, shaderSize); @@ -258,7 +258,7 @@ namespace bgfx bx::write(_writer, '\0', _err); - BX_FREE(g_allocator, shaderCode); + bx::free(g_allocator, shaderCode); } else { diff --git a/src/topology.cpp b/src/topology.cpp index 5d48092df..69378f4c2 100644 --- a/src/topology.cpp +++ b/src/topology.cpp @@ -143,10 +143,10 @@ namespace bgfx template static uint32_t topologyConvertTriListToLineList(void* _dst, uint32_t _dstSize, const IndexT* _indices, uint32_t _numIndices, bx::AllocatorI* _allocator) { - IndexT* temp = (IndexT*)BX_ALLOC(_allocator, _numIndices*2*sizeof(IndexT)*2); + IndexT* temp = (IndexT*)bx::alloc(_allocator, _numIndices*2*sizeof(IndexT)*2); SortT* tempSort = (SortT*)&temp[_numIndices*2]; uint32_t num = topologyConvertTriListToLineList(_dst, _dstSize, _indices, _numIndices, temp, tempSort); - BX_FREE(_allocator, temp); + bx::free(_allocator, temp); return num; } @@ -397,7 +397,7 @@ namespace bgfx : sizeof(uint16_t) ; uint32_t num = bx::uint32_min(_numIndices*indexSize, _dstSize)/(indexSize*3); - uint32_t* temp = (uint32_t*)BX_ALLOC(_allocator, sizeof(uint32_t)*num*4); + uint32_t* temp = (uint32_t*)bx::alloc(_allocator, sizeof(uint32_t)*num*4); uint32_t* keys = &temp[num*0]; uint32_t* values = &temp[num*1]; @@ -439,7 +439,7 @@ namespace bgfx ); } - BX_FREE(_allocator, temp); + bx::free(_allocator, temp); } } //namespace bgfx diff --git a/src/vertexlayout.cpp b/src/vertexlayout.cpp index c75f6be79..e43221fa8 100644 --- a/src/vertexlayout.cpp +++ b/src/vertexlayout.cpp @@ -777,7 +777,7 @@ namespace bgfx uint32_t numVertices = 0; const uint32_t size = sizeof(IndexT)*(hashSize + _num); - IndexT* hashTable = (IndexT*)BX_ALLOC(_allocator, size); + IndexT* hashTable = (IndexT*)bx::alloc(_allocator, size); bx::memSet(hashTable, 0xff, size); IndexT* next = hashTable + hashSize; @@ -810,7 +810,7 @@ namespace bgfx } } - BX_FREE(_allocator, hashTable); + bx::free(_allocator, hashTable); return IndexT(numVertices); } diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp index f27ef832d..a8d3d4e15 100644 --- a/tools/shaderc/shaderc_spirv.cpp +++ b/tools/shaderc/shaderc_spirv.cpp @@ -37,14 +37,14 @@ namespace bgfx void* TinyStlAllocator::static_allocate(size_t _bytes) { - return BX_ALLOC(g_allocator, _bytes); + return bx::alloc(g_allocator, _bytes); } void TinyStlAllocator::static_deallocate(void* _ptr, size_t /*_bytes*/) { if (NULL != _ptr) { - BX_FREE(g_allocator, _ptr); + bx::free(g_allocator, _ptr); } } } // namespace bgfx From 09ac630f0ad4817582c68b909b69fefc765cae4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:22:29 -0700 Subject: [PATCH 74/86] Updated ImGui. --- 3rdparty/dear-imgui/imgui.cpp | 312 +++++++++++++++----------- 3rdparty/dear-imgui/imgui.h | 35 ++- 3rdparty/dear-imgui/imgui_demo.cpp | 20 +- 3rdparty/dear-imgui/imgui_draw.cpp | 5 +- 3rdparty/dear-imgui/imgui_internal.h | 51 +++-- 3rdparty/dear-imgui/imgui_tables.cpp | 14 +- 3rdparty/dear-imgui/imgui_widgets.cpp | 27 ++- 7 files changed, 284 insertions(+), 180 deletions(-) diff --git a/3rdparty/dear-imgui/imgui.cpp b/3rdparty/dear-imgui/imgui.cpp index 8f5913df0..4b420bb4c 100644 --- a/3rdparty/dear-imgui/imgui.cpp +++ b/3rdparty/dear-imgui/imgui.cpp @@ -1,14 +1,14 @@ -// dear imgui, v1.89.5 WIP +// dear imgui, v1.89.6 WIP // (main code and documentation) // Help: -// - Read FAQ at http://dearimgui.org/faq +// - Read FAQ at http://dearimgui.com/faq // - Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase. // - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that. // Read imgui.cpp for details, links and comments. // Resources: -// - FAQ http://dearimgui.org/faq +// - FAQ http://dearimgui.com/faq // - Homepage & latest https://github.com/ocornut/imgui // - Releases & changelog https://github.com/ocornut/imgui/releases // - Gallery https://github.com/ocornut/imgui/issues/5886 (please post your screenshots/video there!) @@ -48,7 +48,7 @@ DOCUMENTATION - HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE - API BREAKING CHANGES (read me when you update!) - FREQUENTLY ASKED QUESTIONS (FAQ) - - Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer) + - Read all answers online: https://www.dearimgui.com/faq, or in docs/FAQ.md (with a Markdown viewer) CODE (search for "[SECTION]" in the code to find them) @@ -159,7 +159,7 @@ CODE - GAMEPAD CONTROLS - Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. - Particularly useful to use Dear ImGui on a console system (e.g. PlayStation, Switch, Xbox) without a mouse! - - Download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets + - Download controller mapping PNG/PSD at http://dearimgui.com/controls_sheets - Backend support: backend needs to: - Set 'io.BackendFlags |= ImGuiBackendFlags_HasGamepad' + call io.AddKeyEvent/AddKeyAnalogEvent() with ImGuiKey_Gamepad_XXX keys. - For analog values (0.0f to 1.0f), backend is responsible to handling a dead-zone and rescaling inputs accordingly. @@ -286,7 +286,7 @@ CODE // Build and load the texture atlas into a texture // (In the examples/ app this is usually done within the ImGui_ImplXXX_Init() function from one of the demo Renderer) int width, height; - unsigned char* pixels = NULL; + unsigned char* pixels = nullptr; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // At this point you've got the texture data and you need to upload that to your graphic system: @@ -783,7 +783,7 @@ CODE ================================ Read all answers online: - https://www.dearimgui.org/faq or https://github.com/ocornut/imgui/blob/master/docs/FAQ.md (same url) + https://www.dearimgui.com/faq or https://github.com/ocornut/imgui/blob/master/docs/FAQ.md (same url) Read all answers locally (with a text editor or ideally a Markdown viewer): docs/FAQ.md Some answers are copied down here to facilitate searching in code. @@ -807,7 +807,7 @@ CODE Q: What is this library called? Q: Which version should I get? >> This library is called "Dear ImGui", please don't call it "ImGui" :) - >> See https://www.dearimgui.org/faq for details. + >> See https://www.dearimgui.com/faq for details. Q&A: Integration ================ @@ -817,14 +817,14 @@ CODE Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application? A: You should read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags! - >> See https://www.dearimgui.org/faq for a fully detailed answer. You really want to read this. + >> See https://www.dearimgui.com/faq for a fully detailed answer. You really want to read this. Q. How can I enable keyboard controls? Q: How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display) Q: I integrated Dear ImGui in my engine and little squares are showing instead of text... Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around... Q: I integrated Dear ImGui in my engine and some elements are displaying outside their expected windows boundaries... - >> See https://www.dearimgui.org/faq + >> See https://www.dearimgui.com/faq Q&A: Usage ---------- @@ -838,7 +838,7 @@ CODE Q: How can I use my own math types instead of ImVec2/ImVec4? Q: How can I interact with standard C++ types (such as std::string and std::vector)? Q: How can I display custom shapes? (using low-level ImDrawList API) - >> See https://www.dearimgui.org/faq + >> See https://www.dearimgui.com/faq Q&A: Fonts, Text ================ @@ -848,7 +848,7 @@ CODE Q: How can I easily use icons in my application? Q: How can I load multiple fonts? Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic? - >> See https://www.dearimgui.org/faq and https://github.com/ocornut/imgui/edit/master/docs/FONTS.md + >> See https://www.dearimgui.com/faq and https://github.com/ocornut/imgui/edit/master/docs/FONTS.md Q&A: Concerns ============= @@ -857,7 +857,7 @@ CODE Q: Can you create elaborate/serious tools with Dear ImGui? Q: Can you reskin the look of Dear ImGui? Q: Why using C++ (as opposed to C)? - >> See https://www.dearimgui.org/faq + >> See https://www.dearimgui.com/faq Q&A: Community ============== @@ -1058,7 +1058,6 @@ static void RenderWindowDecorations(ImGuiWindow* window, const ImRec static void RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open); static void RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col); static void RenderDimmedBackgrounds(); -static ImGuiWindow* FindBlockingModal(ImGuiWindow* window); // Viewports static void UpdateViewportsNewFrame(); @@ -1248,6 +1247,7 @@ ImGuiIO::ImGuiIO() // Input (NB: we already have memset zero the entire structure!) MousePos = ImVec2(-FLT_MAX, -FLT_MAX); MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX); + MouseSource = ImGuiMouseSource_Mouse; MouseDragThreshold = 6.0f; for (int i = 0; i < IM_ARRAYSIZE(MouseDownDuration); i++) MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0f; for (int i = 0; i < IM_ARRAYSIZE(KeysData); i++) { KeysData[i].DownDuration = KeysData[i].DownDurationPrev = -1.0f; } @@ -1270,6 +1270,7 @@ void ImGuiIO::AddInputCharacter(unsigned int c) ImGuiInputEvent e; e.Type = ImGuiInputEventType_Text; e.Source = ImGuiInputSource_Keyboard; + e.EventId = g.InputEventsNextEventId++; e.Text.Char = c; g.InputEventsQueue.push_back(e); } @@ -1408,6 +1409,7 @@ void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) ImGuiInputEvent e; e.Type = ImGuiInputEventType_Key; e.Source = ImGui::IsGamepadKey(key) ? ImGuiInputSource_Gamepad : ImGuiInputSource_Keyboard; + e.EventId = g.InputEventsNextEventId++; e.Key.Key = key; e.Key.Down = down; e.Key.AnalogValue = analog_value; @@ -1472,8 +1474,10 @@ void ImGuiIO::AddMousePosEvent(float x, float y) ImGuiInputEvent e; e.Type = ImGuiInputEventType_MousePos; e.Source = ImGuiInputSource_Mouse; + e.EventId = g.InputEventsNextEventId++; e.MousePos.PosX = pos.x; e.MousePos.PosY = pos.y; + e.MouseWheel.MouseSource = g.InputEventsNextMouseSource; g.InputEventsQueue.push_back(e); } @@ -1494,8 +1498,10 @@ void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down) ImGuiInputEvent e; e.Type = ImGuiInputEventType_MouseButton; e.Source = ImGuiInputSource_Mouse; + e.EventId = g.InputEventsNextEventId++; e.MouseButton.Button = mouse_button; e.MouseButton.Down = down; + e.MouseWheel.MouseSource = g.InputEventsNextMouseSource; g.InputEventsQueue.push_back(e); } @@ -1512,11 +1518,22 @@ void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y) ImGuiInputEvent e; e.Type = ImGuiInputEventType_MouseWheel; e.Source = ImGuiInputSource_Mouse; + e.EventId = g.InputEventsNextEventId++; e.MouseWheel.WheelX = wheel_x; e.MouseWheel.WheelY = wheel_y; + e.MouseWheel.MouseSource = g.InputEventsNextMouseSource; g.InputEventsQueue.push_back(e); } +// This is not a real event, the data is latched in order to be stored in actual Mouse events. +// This is so that duplicate events (e.g. Windows sending extraneous WM_MOUSEMOVE) gets filtered and are not leading to actual source changes. +void ImGuiIO::AddMouseSourceEvent(ImGuiMouseSource source) +{ + IM_ASSERT(Ctx != NULL); + ImGuiContext& g = *Ctx; + g.InputEventsNextMouseSource = source; +} + void ImGuiIO::AddFocusEvent(bool focused) { IM_ASSERT(Ctx != NULL); @@ -1530,6 +1547,7 @@ void ImGuiIO::AddFocusEvent(bool focused) ImGuiInputEvent e; e.Type = ImGuiInputEventType_Focus; + e.EventId = g.InputEventsNextEventId++; e.AppFocused.Focused = focused; g.InputEventsQueue.push_back(e); } @@ -3238,6 +3256,9 @@ void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end // Default clip_rect uses (pos_min,pos_max) // Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges) +// FIXME-OPT: Since we have or calculate text_size we could coarse clip whole block immediately, especally for text above draw_list->DrawList. +// Effectively as this is called from widget doing their own coarse clipping it's not very valuable presently. Next time function will take +// better advantage of the render function taking size into account for coarse clipping. void ImGui::RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_display_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect) { // Perform CPU side clipping for single clipped element to avoid using scissor state @@ -3723,7 +3744,10 @@ static void SetCurrentWindow(ImGuiWindow* window) g.CurrentWindow = window; g.CurrentTable = window && window->DC.CurrentTableIdx != -1 ? g.Tables.GetByIndex(window->DC.CurrentTableIdx) : NULL; if (window) + { g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); + ImGui::NavUpdateCurrentWindowIsScrollPushableX(); + } } void ImGui::GcCompactTransientMiscBuffers() @@ -3888,7 +3912,7 @@ bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flag // Inhibit hover unless the window is within the stack of our modal/popup if (want_inhibit) - if (!ImGui::IsWindowWithinBeginStackOf(window->RootWindow, focused_root_window)) + if (!IsWindowWithinBeginStackOf(window->RootWindow, focused_root_window)) return false; } return true; @@ -4273,10 +4297,10 @@ void ImGui::UpdateMouseMovingWindowEndFrame() if (g.HoveredIdDisabled) g.MovingWindow = NULL; } - else if (root_window == NULL && g.NavWindow != NULL && GetTopMostPopupModal() == NULL) + else if (root_window == NULL && g.NavWindow != NULL) { // Clicking on void disable focus - FocusWindow(NULL); + FocusWindow(NULL, ImGuiFocusRequestFlags_UnlessBelowModal); } } @@ -4601,7 +4625,7 @@ void ImGui::NewFrame() // Closing the focused window restore focus to the first active root window in descending z-order if (g.NavWindow && !g.NavWindow->WasActive) - FocusTopMostWindowUnderOne(NULL, NULL); + FocusTopMostWindowUnderOne(NULL, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // No window should be open at the beginning of the frame. // But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear. @@ -5292,7 +5316,8 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b parent_window->DC.CursorPos = child_window->Pos; // Process navigation-in immediately so NavInit can run on first frame - if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavHasScroll)) + // Can enter a child if (A) it has navigatable items or (B) it can be scrolled. + if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY)) { FocusWindow(child_window); NavInitWindow(child_window, false); @@ -5339,7 +5364,7 @@ void ImGui::EndChild() ImGuiWindow* parent_window = g.CurrentWindow; ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz); ItemSize(sz); - if ((window->DC.NavLayersActiveMask != 0 || window->DC.NavHasScroll) && !(window->Flags & ImGuiWindowFlags_NavFlattened)) + if ((window->DC.NavLayersActiveMask != 0 || window->DC.NavWindowHasScrollY) && !(window->Flags & ImGuiWindowFlags_NavFlattened)) { ItemAdd(bb, window->ChildId); RenderNavHighlight(bb, window->ChildId); @@ -5352,6 +5377,10 @@ void ImGui::EndChild() { // Not navigable into ItemAdd(bb, 0); + + // But when flattened we directly reach items, adjust active layer mask accordingly + if (window->Flags & ImGuiWindowFlags_NavFlattened) + parent_window->DC.NavLayersActiveMaskNext |= window->DC.NavLayersActiveMaskNext; } if (g.HoveredWindow == window) g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow; @@ -6053,7 +6082,10 @@ void ImGui::UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags // - Window // .. returns Modal2 // - Window // .. returns Modal2 // - Modal2 // .. returns Modal2 -static ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window) +// Notes: +// - FindBlockingModal(NULL) == NULL is generally equivalent to GetTopMostPopupModal() == NULL. +// Only difference is here we check for ->Active/WasActive but it may be unecessary. +ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window) { ImGuiContext& g = *GImGui; if (g.OpenPopupStack.Size <= 0) @@ -6067,6 +6099,8 @@ static ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window) continue; if (!popup_window->Active && !popup_window->WasActive) // Check WasActive, because this code may run before popup renders on current frame, also check Active to handle newly created windows. continue; + if (window == NULL) // FindBlockingModal(NULL) test for if FocusWindow(NULL) is naturally possible via a mouse click. + return popup_window; if (IsWindowWithinBeginStackOf(window, popup_window)) // Window is rendered over last modal, no render order change needed. break; for (ImGuiWindow* parent = popup_window->ParentWindowInBeginStack->RootWindow; parent != NULL; parent = parent->ParentWindowInBeginStack->RootWindow) @@ -6441,22 +6475,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) want_focus = true; else if ((flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip)) == 0) want_focus = true; - - ImGuiWindow* modal = GetTopMostPopupModal(); - if (modal != NULL && !IsWindowWithinBeginStackOf(window, modal)) - { - // Avoid focusing a window that is created outside of active modal. This will prevent active modal from being closed. - // Since window is not focused it would reappear at the same display position like the last time it was visible. - // In case of completely new windows it would go to the top (over current modal), but input to such window would still be blocked by modal. - // Position window behind a modal that is not a begin-parent of this window. - want_focus = false; - if (window == window->RootWindow) - { - ImGuiWindow* blocking_modal = FindBlockingModal(window); - IM_ASSERT(blocking_modal != NULL); - BringWindowToDisplayBehind(window, blocking_modal); - } - } } // [Test Engine] Register whole window in the item system (before submitting further decorations) @@ -6583,8 +6601,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // - We disable this when the parent window has zero vertices, which is a common pattern leading to laying out multiple overlapping childs ImGuiWindow* previous_child = parent_window->DC.ChildWindows.Size >= 2 ? parent_window->DC.ChildWindows[parent_window->DC.ChildWindows.Size - 2] : NULL; bool previous_child_overlapping = previous_child ? previous_child->Rect().Overlaps(window->Rect()) : false; - bool parent_is_empty = parent_window->DrawList->VtxBuffer.Size > 0; - if (window->DrawList->CmdBuffer.back().ElemCount == 0 && parent_is_empty && !previous_child_overlapping) + bool parent_is_empty = (parent_window->DrawList->VtxBuffer.Size == 0); + if (window->DrawList->CmdBuffer.back().ElemCount == 0 && !parent_is_empty && !previous_child_overlapping) render_decorations_in_parent = true; } if (render_decorations_in_parent) @@ -6649,8 +6667,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DC.NavLayerCurrent = ImGuiNavLayer_Main; window->DC.NavLayersActiveMask = window->DC.NavLayersActiveMaskNext; window->DC.NavLayersActiveMaskNext = 0x00; + window->DC.NavIsScrollPushableX = true; window->DC.NavHideHighlightOneFrame = false; - window->DC.NavHasScroll = (window->ScrollMax.y > 0.0f); + window->DC.NavWindowHasScrollY = (window->ScrollMax.y > 0.0f); window->DC.MenuBarAppending = false; window->DC.MenuColumns.Update(style.ItemSpacing.x, window_just_activated_by_user); @@ -6673,11 +6692,13 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->AutoFitFramesY--; // Apply focus (we need to call FocusWindow() AFTER setting DC.CursorStartPos so our initial navigation reference rectangle can start around there) + // We ImGuiFocusRequestFlags_UnlessBelowModal to: + // - Avoid focusing a window that is created outside of a modal. This will prevent active modal from being closed. + // - Position window behind the modal that is not a begin-parent of this window. if (want_focus) - { - FocusWindow(window); + FocusWindow(window, ImGuiFocusRequestFlags_UnlessBelowModal); + if (want_focus && window == g.NavWindow) NavInitWindow(window, false); // <-- this is in the way for us to be able to defer and sort reappearing FocusWindow() calls - } // Title bar if (!(flags & ImGuiWindowFlags_NoTitleBar)) @@ -6903,10 +6924,25 @@ int ImGui::FindWindowDisplayIndex(ImGuiWindow* window) } // Moving window to front of display and set focus (which happens to be back of our sorted list) -void ImGui::FocusWindow(ImGuiWindow* window) +void ImGui::FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags) { ImGuiContext& g = *GImGui; + // Modal check? + if ((flags & ImGuiFocusRequestFlags_UnlessBelowModal) && (g.NavWindow != window)) // Early out in common case. + if (ImGuiWindow* blocking_modal = FindBlockingModal(window)) + { + IMGUI_DEBUG_LOG_FOCUS("[focus] FocusWindow(\"%s\", UnlessBelowModal): prevented by \"%s\".\n", window ? window->Name : "", blocking_modal->Name); + if (window && window == window->RootWindow && (window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0) + BringWindowToDisplayBehind(window, blocking_modal); // Still bring to right below modal. + return; + } + + // Find last focused child (if any) and focus it instead. + if ((flags & ImGuiFocusRequestFlags_RestoreFocusedChild) && window != NULL) + window = NavRestoreLastChildNavWindow(window); + + // Apply focus if (g.NavWindow != window) { SetNavWindow(window); @@ -6943,9 +6979,10 @@ void ImGui::FocusWindow(ImGuiWindow* window) BringWindowToDisplayFront(display_front_window); } -void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window) +void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags) { ImGuiContext& g = *GImGui; + IM_UNUSED(filter_viewport); // Unused in master branch. int start_idx = g.WindowsFocusOrder.Size - 1; if (under_this_window != NULL) { @@ -6963,15 +7000,15 @@ void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWind // We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user. ImGuiWindow* window = g.WindowsFocusOrder[i]; IM_ASSERT(window == window->RootWindow); - if (window != ignore_window && window->WasActive) - if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) - { - ImGuiWindow* focus_window = NavRestoreLastChildNavWindow(window); - FocusWindow(focus_window); - return; - } + if (window == ignore_window || !window->WasActive) + continue; + if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) + { + FocusWindow(window, flags); + return; + } } - FocusWindow(NULL); + FocusWindow(NULL, flags); } // Important: this alone doesn't alter current ImDrawList state. This is called by PushFont/PopFont only. @@ -8665,12 +8702,18 @@ static const char* GetInputSourceName(ImGuiInputSource source) IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT && source >= 0 && source < ImGuiInputSource_COUNT); return input_source_names[source]; } +static const char* GetMouseSourceName(ImGuiMouseSource source) +{ + const char* mouse_source_names[] = { "Mouse", "TouchScreen", "Pen" }; + IM_ASSERT(IM_ARRAYSIZE(mouse_source_names) == ImGuiMouseSource_COUNT && source >= 0 && source < ImGuiMouseSource_COUNT); + return mouse_source_names[source]; +} static void DebugPrintInputEvent(const char* prefix, const ImGuiInputEvent* e) { ImGuiContext& g = *GImGui; - if (e->Type == ImGuiInputEventType_MousePos) { if (e->MousePos.PosX == -FLT_MAX && e->MousePos.PosY == -FLT_MAX) IMGUI_DEBUG_LOG_IO("%s: MousePos (-FLT_MAX, -FLT_MAX)\n", prefix); else IMGUI_DEBUG_LOG_IO("%s: MousePos (%.1f, %.1f)\n", prefix, e->MousePos.PosX, e->MousePos.PosY); return; } - if (e->Type == ImGuiInputEventType_MouseButton) { IMGUI_DEBUG_LOG_IO("%s: MouseButton %d %s\n", prefix, e->MouseButton.Button, e->MouseButton.Down ? "Down" : "Up"); return; } - if (e->Type == ImGuiInputEventType_MouseWheel) { IMGUI_DEBUG_LOG_IO("%s: MouseWheel (%.3f, %.3f)\n", prefix, e->MouseWheel.WheelX, e->MouseWheel.WheelY); return; } + if (e->Type == ImGuiInputEventType_MousePos) { if (e->MousePos.PosX == -FLT_MAX && e->MousePos.PosY == -FLT_MAX) IMGUI_DEBUG_LOG_IO("%s: MousePos (-FLT_MAX, -FLT_MAX)\n", prefix); else IMGUI_DEBUG_LOG_IO("%s: MousePos (%.1f, %.1f) (%s)\n", prefix, e->MousePos.PosX, e->MousePos.PosY, GetMouseSourceName(e->MouseWheel.MouseSource)); return; } + if (e->Type == ImGuiInputEventType_MouseButton) { IMGUI_DEBUG_LOG_IO("%s: MouseButton %d %s (%s)\n", prefix, e->MouseButton.Button, e->MouseButton.Down ? "Down" : "Up", GetMouseSourceName(e->MouseWheel.MouseSource)); return; } + if (e->Type == ImGuiInputEventType_MouseWheel) { IMGUI_DEBUG_LOG_IO("%s: MouseWheel (%.3f, %.3f) (%s)\n", prefix, e->MouseWheel.WheelX, e->MouseWheel.WheelY, GetMouseSourceName(e->MouseWheel.MouseSource)); return; } if (e->Type == ImGuiInputEventType_Key) { IMGUI_DEBUG_LOG_IO("%s: Key \"%s\" %s\n", prefix, ImGui::GetKeyName(e->Key.Key), e->Key.Down ? "Down" : "Up"); return; } if (e->Type == ImGuiInputEventType_Text) { IMGUI_DEBUG_LOG_IO("%s: Text: %c (U+%08X)\n", prefix, e->Text.Char, e->Text.Char); return; } if (e->Type == ImGuiInputEventType_Focus) { IMGUI_DEBUG_LOG_IO("%s: AppFocused %d\n", prefix, e->AppFocused.Focused); return; } @@ -8706,6 +8749,7 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_wheeled || key_changed || text_inputted)) break; io.MousePos = event_pos; + io.MouseSource = e->MousePos.MouseSource; mouse_moved = true; } else if (e->Type == ImGuiInputEventType_MouseButton) @@ -8715,7 +8759,10 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); if (trickle_fast_inputs && ((mouse_button_changed & (1 << button)) || mouse_wheeled)) break; + if (trickle_fast_inputs && e->MouseButton.MouseSource == ImGuiMouseSource_TouchScreen && mouse_moved) // #2702: TouchScreen have no initial hover. + break; io.MouseDown[button] = e->MouseButton.Down; + io.MouseSource = e->MouseButton.MouseSource; mouse_button_changed |= (1 << button); } else if (e->Type == ImGuiInputEventType_MouseWheel) @@ -8725,6 +8772,7 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs) break; io.MouseWheelH += e->MouseWheel.WheelX; io.MouseWheel += e->MouseWheel.WheelY; + io.MouseSource = e->MouseWheel.MouseSource; mouse_wheeled = true; } else if (e->Type == ImGuiInputEventType_Key) @@ -9310,7 +9358,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu // [DEBUG] People keep stumbling on this problem and using "" as identifier in the root of a window instead of "##something". // Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something". - // READ THE FAQ: https://dearimgui.org/faq + // READ THE FAQ: https://dearimgui.com/faq IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!"); } g.NextItemData.Flags = ImGuiNextItemDataFlags_None; @@ -9337,6 +9385,8 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu DebugLocateItemResolveWithLastItem(); #endif //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG] + //if ((g.LastItemData.InFlags & ImGuiItemFlags_NoNav) == 0) + // window->DrawList->AddRect(g.LastItemData.NavRect.Min, g.LastItemData.NavRect.Max, IM_COL32(255,255,0,255)); // [DEBUG] // We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them) if (is_rect_visible) @@ -10061,6 +10111,7 @@ bool ImGui::IsPopupOpen(const char* str_id, ImGuiPopupFlags popup_flags) return IsPopupOpen(id, popup_flags); } +// Also see FindBlockingModal(NULL) ImGuiWindow* ImGui::GetTopMostPopupModal() { ImGuiContext& g = *GImGui; @@ -10071,6 +10122,7 @@ ImGuiWindow* ImGui::GetTopMostPopupModal() return NULL; } +// See Demo->Stacked Modal to confirm what this is for. ImGuiWindow* ImGui::GetTopMostAndVisiblePopupModal() { ImGuiContext& g = *GImGui; @@ -10199,7 +10251,7 @@ void ImGui::ClosePopupsExceptModals() for (popup_count_to_keep = g.OpenPopupStack.Size; popup_count_to_keep > 0; popup_count_to_keep--) { ImGuiWindow* window = g.OpenPopupStack[popup_count_to_keep - 1].Window; - if (!window || window->Flags & ImGuiWindowFlags_Modal) + if (!window || (window->Flags & ImGuiWindowFlags_Modal)) break; } if (popup_count_to_keep < g.OpenPopupStack.Size) // This test is not required but it allows to set a convenient breakpoint on the statement below @@ -10221,16 +10273,9 @@ void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_ { ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : popup_backup_nav_window; if (focus_window && !focus_window->WasActive && popup_window) - { - // Fallback - FocusTopMostWindowUnderOne(popup_window, NULL); - } + FocusTopMostWindowUnderOne(popup_window, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // Fallback else - { - if (g.NavLayer == ImGuiNavLayer_Main && focus_window) - focus_window = NavRestoreLastChildNavWindow(focus_window); - FocusWindow(focus_window); - } + FocusWindow(focus_window, (g.NavLayer == ImGuiNavLayer_Main) ? ImGuiFocusRequestFlags_RestoreFocusedChild : ImGuiFocusRequestFlags_None); } } @@ -10620,29 +10665,15 @@ ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy) return (dy > 0.0f) ? ImGuiDir_Down : ImGuiDir_Up; } -static float inline NavScoreItemDistInterval(float a0, float a1, float b0, float b1) +static float inline NavScoreItemDistInterval(float cand_min, float cand_max, float curr_min, float curr_max) { - if (a1 < b0) - return a1 - b0; - if (b1 < a0) - return a0 - b1; + if (cand_max < curr_min) + return cand_max - curr_min; + if (curr_max < cand_min) + return cand_min - curr_max; return 0.0f; } -static void inline NavClampRectToVisibleAreaForMoveDir(ImGuiDir move_dir, ImRect& r, const ImRect& clip_rect) -{ - if (move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right) - { - r.Min.y = ImClamp(r.Min.y, clip_rect.Min.y, clip_rect.Max.y); - r.Max.y = ImClamp(r.Max.y, clip_rect.Min.y, clip_rect.Max.y); - } - else // FIXME: PageUp/PageDown are leaving move_dir == None - { - r.Min.x = ImClamp(r.Min.x, clip_rect.Min.x, clip_rect.Max.x); - r.Max.x = ImClamp(r.Max.x, clip_rect.Min.x, clip_rect.Max.x); - } -} - // Scoring function for gamepad/keyboard directional navigation. Based on https://gist.github.com/rygorous/6981057 static bool ImGui::NavScoreItem(ImGuiNavItemData* result) { @@ -10665,10 +10696,6 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result) cand.ClipWithFull(window->ClipRect); // This allows the scored item to not overlap other candidates in the parent window } - // We perform scoring on items bounding box clipped by the current clipping rectangle on the other axis (clipping on our movement axis would give us equal scores for all clipped items) - // For example, this ensures that items in one column are not reached when moving vertically from items in another column. - NavClampRectToVisibleAreaForMoveDir(g.NavMoveClipDir, cand, window->ClipRect); - // Compute distance between boxes // FIXME-NAV: Introducing biases for vertical navigation, needs to be removed. float dbx = NavScoreItemDistInterval(cand.Min.x, cand.Max.x, curr.Min.x, curr.Max.x); @@ -10707,32 +10734,35 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result) quadrant = (g.LastItemData.ID < g.NavId) ? ImGuiDir_Left : ImGuiDir_Right; } + const ImGuiDir move_dir = g.NavMoveDir; #if IMGUI_DEBUG_NAV_SCORING - char buf[128]; - if (IsMouseHoveringRect(cand.Min, cand.Max)) + char buf[200]; + if (g.IO.KeyCtrl) // Hold CTRL to preview score in matching quadrant. CTRL+Arrow to rotate. { - ImFormatString(buf, IM_ARRAYSIZE(buf), "dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "WENS"[g.NavMoveDir], "WENS"[quadrant]); - ImDrawList* draw_list = GetForegroundDrawList(window); - draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255,200,0,100)); - draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200)); - draw_list->AddRectFilled(cand.Max - ImVec2(4, 4), cand.Max + CalcTextSize(buf) + ImVec2(4, 4), IM_COL32(40,0,0,150)); - draw_list->AddText(cand.Max, ~0U, buf); - } - else if (g.IO.KeyCtrl) // Hold to preview score in matching quadrant. Press C to rotate. - { - if (quadrant == g.NavMoveDir) + if (quadrant == move_dir) { ImFormatString(buf, IM_ARRAYSIZE(buf), "%.0f/%.0f", dist_box, dist_center); ImDrawList* draw_list = GetForegroundDrawList(window); - draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 200)); + draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 80)); + draw_list->AddRectFilled(cand.Min, cand.Min + CalcTextSize(buf), IM_COL32(255, 0, 0, 200)); draw_list->AddText(cand.Min, IM_COL32(255, 255, 255, 255), buf); } } + if (IsMouseHoveringRect(cand.Min, cand.Max)) + { + ImFormatString(buf, IM_ARRAYSIZE(buf), + "d-box (%7.3f,%7.3f) -> %7.3f\nd-center (%7.3f,%7.3f) -> %7.3f\nd-axial (%7.3f,%7.3f) -> %7.3f\nnav %c, quadrant %c", + dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "WENS"[g.NavMoveDir], "WENS"[quadrant]); + ImDrawList* draw_list = GetForegroundDrawList(window); + draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255,200,0,100)); + draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200)); + draw_list->AddRectFilled(cand.Max - ImVec2(4, 4), cand.Max + CalcTextSize(buf) + ImVec2(4, 4), IM_COL32(40,0,0,200)); + draw_list->AddText(cand.Max, ~0U, buf); + } #endif // Is it in the quadrant we're interested in moving to? bool new_best = false; - const ImGuiDir move_dir = g.NavMoveDir; if (quadrant == move_dir) { // Does it beat the current best candidate? @@ -10788,6 +10818,15 @@ static void ImGui::NavApplyItemToResult(ImGuiNavItemData* result) result->RectRel = WindowRectAbsToRel(window, g.LastItemData.NavRect); } +// True when current work location may be scrolled horizontally when moving left / right. +// This is generally always true UNLESS within a column. We don't have a vertical equivalent. +void ImGui::NavUpdateCurrentWindowIsScrollPushableX() +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + window->DC.NavIsScrollPushableX = (g.CurrentTable == NULL && window->DC.CurrentColumns == NULL); +} + // We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above) // This is called after LastItemData is set. static void ImGui::NavProcessItem() @@ -10795,9 +10834,16 @@ static void ImGui::NavProcessItem() ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; const ImGuiID id = g.LastItemData.ID; - const ImRect nav_bb = g.LastItemData.NavRect; const ImGuiItemFlags item_flags = g.LastItemData.InFlags; + // When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221) + if (window->DC.NavIsScrollPushableX == false) + { + g.LastItemData.NavRect.Min.x = ImClamp(g.LastItemData.NavRect.Min.x, window->ClipRect.Min.x, window->ClipRect.Max.x); + g.LastItemData.NavRect.Max.x = ImClamp(g.LastItemData.NavRect.Max.x, window->ClipRect.Min.x, window->ClipRect.Max.x); + } + const ImRect nav_bb = g.LastItemData.NavRect; + // Process Init Request if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent && (item_flags & ImGuiItemFlags_Disabled) == 0) { @@ -10839,7 +10885,7 @@ static void ImGui::NavProcessItem() } } - // Update window-relative bounding box of navigated item + // Update information for currently focused/navigated item if (g.NavId == id) { if (g.NavWindow != window) @@ -10847,7 +10893,7 @@ static void ImGui::NavProcessItem() g.NavLayer = window->DC.NavLayerCurrent; g.NavFocusScopeId = g.CurrentFocusScopeId; g.NavIdIsAlive = true; - window->NavRectRel[window->DC.NavLayerCurrent] = WindowRectAbsToRel(window, nav_bb); // Store item bounding box (relative to window position) + window->NavRectRel[window->DC.NavLayerCurrent] = WindowRectAbsToRel(window, nav_bb); // Store item bounding box (relative to window position) } } @@ -10977,10 +11023,11 @@ void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNav void ImGui::NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags wrap_flags) { ImGuiContext& g = *GImGui; - IM_ASSERT(wrap_flags != 0); // Call with _WrapX, _WrapY, _LoopX, _LoopY + IM_ASSERT((wrap_flags & ImGuiNavMoveFlags_WrapMask_ ) != 0 && (wrap_flags & ~ImGuiNavMoveFlags_WrapMask_) == 0); // Call with _WrapX, _WrapY, _LoopX, _LoopY + // In theory we should test for NavMoveRequestButNoResultYet() but there's no point doing it, NavEndFrame() will do the same test if (g.NavWindow == window && g.NavMoveScoringItems && g.NavLayer == ImGuiNavLayer_Main) - g.NavMoveFlags |= wrap_flags; + g.NavMoveFlags = (g.NavMoveFlags & ~ImGuiNavMoveFlags_WrapMask_) | wrap_flags; } // FIXME: This could be replaced by updating a frame number in each window when (window == NavWindow) and (NavLayer == 0). @@ -11237,7 +11284,7 @@ static void ImGui::NavUpdate() ImGuiWindow* window = g.NavWindow; const float scroll_speed = IM_ROUND(window->CalcFontSize() * 100 * io.DeltaTime); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported. const ImGuiDir move_dir = g.NavMoveDir; - if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavHasScroll && move_dir != ImGuiDir_None) + if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavWindowHasScrollY && move_dir != ImGuiDir_None) { if (move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right) SetScrollX(window, ImFloor(window->Scroll.x + ((move_dir == ImGuiDir_Left) ? -1.0f : +1.0f) * scroll_speed)); @@ -11347,13 +11394,15 @@ void ImGui::NavUpdateCreateMoveRequest() g.NavScoringNoClipRect.TranslateY(scoring_rect_offset_y); } - // [DEBUG] Always send a request + // [DEBUG] Always send a request when holding CTRL. Hold CTRL + Arrow change the direction. #if IMGUI_DEBUG_NAV_SCORING - if (io.KeyCtrl && IsKeyPressed(ImGuiKey_C)) - g.NavMoveDirForDebug = (ImGuiDir)((g.NavMoveDirForDebug + 1) & 3); - if (io.KeyCtrl && g.NavMoveDir == ImGuiDir_None) + //if (io.KeyCtrl && IsKeyPressed(ImGuiKey_C)) + // g.NavMoveDirForDebug = (ImGuiDir)((g.NavMoveDirForDebug + 1) & 3); + if (io.KeyCtrl) { - g.NavMoveDir = g.NavMoveDirForDebug; + if (g.NavMoveDir == ImGuiDir_None) + g.NavMoveDir = g.NavMoveDirForDebug; + g.NavMoveClipDir = g.NavMoveDir; g.NavMoveFlags |= ImGuiNavMoveFlags_DebugNoResult; } #endif @@ -11467,6 +11516,7 @@ void ImGui::NavMoveRequestApplyResult() g.NavMoveFlags |= ImGuiNavMoveFlags_DontSetNavHighlight; if (g.NavId != 0 && (g.NavMoveFlags & ImGuiNavMoveFlags_DontSetNavHighlight) == 0) NavRestoreHighlightAfterMove(); + IMGUI_DEBUG_LOG_NAV("[nav] NavMoveSubmitted but not led to a result!\n"); return; } @@ -11484,17 +11534,15 @@ void ImGui::NavMoveRequestApplyResult() // Scroll to keep newly navigated item fully into view. if (g.NavLayer == ImGuiNavLayer_Main) { + ImRect rect_abs = WindowRectRelToAbs(result->Window, result->RectRel); + ScrollToRectEx(result->Window, rect_abs, g.NavMoveScrollFlags); + if (g.NavMoveFlags & ImGuiNavMoveFlags_ScrollToEdgeY) { - // FIXME: Should remove this + // FIXME: Should remove this? Or make more precise: use ScrollToRectEx() with edge? float scroll_target = (g.NavMoveDir == ImGuiDir_Up) ? result->Window->ScrollMax.y : 0.0f; SetScrollY(result->Window, scroll_target); } - else - { - ImRect rect_abs = WindowRectRelToAbs(result->Window, result->RectRel); - ScrollToRectEx(result->Window, rect_abs, g.NavMoveScrollFlags); - } } if (g.NavWindow != result->Window) @@ -11605,7 +11653,7 @@ static float ImGui::NavUpdatePageUpPageDown() if (g.NavLayer != ImGuiNavLayer_Main) NavRestoreLayer(ImGuiNavLayer_Main); - if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavHasScroll) + if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavWindowHasScrollY) { // Fallback manual-scroll when window has no navigable item if (IsKeyPressed(ImGuiKey_PageUp, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat)) @@ -11673,8 +11721,7 @@ static void ImGui::NavEndFrame() // Perform wrap-around in menus // FIXME-NAV: Wrap may need to apply a weight bias on the other axis. e.g. 4x4 grid with 2 last items missing on last item won't handle LoopY/WrapY correctly. // FIXME-NAV: Wrap (not Loop) support could be handled by the scoring function and then WrapX would function without an extra frame. - const ImGuiNavMoveFlags wanted_flags = ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY; - if (g.NavWindow && NavMoveRequestButNoResultYet() && (g.NavMoveFlags & wanted_flags) && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded) == 0) + if (g.NavWindow && NavMoveRequestButNoResultYet() && (g.NavMoveFlags & ImGuiNavMoveFlags_WrapMask_) && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded) == 0) NavUpdateCreateWrappingRequest(); } @@ -11783,7 +11830,7 @@ static void ImGui::NavUpdateWindowing() bool apply_toggle_layer = false; ImGuiWindow* modal_window = GetTopMostPopupModal(); - bool allow_windowing = (modal_window == NULL); + bool allow_windowing = (modal_window == NULL); // FIXME: This prevent CTRL+TAB from being usable with windows that are inside the Begin-stack of that modal. if (!allow_windowing) g.NavWindowingTarget = NULL; @@ -11912,9 +11959,9 @@ static void ImGui::NavUpdateWindowing() { ClearActiveID(); NavRestoreHighlightAfterMove(); - apply_focus_window = NavRestoreLastChildNavWindow(apply_focus_window); ClosePopupsOverWindow(apply_focus_window, false); - FocusWindow(apply_focus_window); + FocusWindow(apply_focus_window, ImGuiFocusRequestFlags_RestoreFocusedChild); + apply_focus_window = g.NavWindow; if (apply_focus_window->NavLastIds[0] == 0) NavInitWindow(apply_focus_window, false); @@ -12687,6 +12734,7 @@ void ImGui::LoadIniSettingsFromDisk(const char* ini_filename) } // Zero-tolerance, no error reporting, cheap .ini parsing +// Set ini_size==0 to let us use strlen(ini_data). Do not call this function with a 0 if your buffer is actually empty! void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size) { ImGuiContext& g = *GImGui; @@ -12818,7 +12866,7 @@ ImGuiWindowSettings* ImGui::FindWindowSettingsByID(ImGuiID id) { ImGuiContext& g = *GImGui; for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings)) - if (settings->ID == id) + if (settings->ID == id && !settings->WantDelete) return settings; return NULL; } @@ -13727,6 +13775,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) Text("Mouse clicked:"); for (int i = 0; i < count; i++) if (IsMouseClicked(i)) { SameLine(); Text("b%d (%d)", i, io.MouseClickedCount[i]); } Text("Mouse released:"); for (int i = 0; i < count; i++) if (IsMouseReleased(i)) { SameLine(); Text("b%d", i); } Text("Mouse wheel: %.1f", io.MouseWheel); + Text("Mouse source: %s", GetMouseSourceName(io.MouseSource)); Text("Pen Pressure: %.1f", io.PenPressure); // Note: currently unused Unindent(); } @@ -14327,14 +14376,13 @@ void ImGui::ShowDebugLogWindow(bool* p_open) return; } - AlignTextToFramePadding(); - Text("Log events:"); - SameLine(); CheckboxFlags("All", &g.DebugLogFlags, ImGuiDebugLogFlags_EventMask_); + CheckboxFlags("All", &g.DebugLogFlags, ImGuiDebugLogFlags_EventMask_); SameLine(); CheckboxFlags("ActiveId", &g.DebugLogFlags, ImGuiDebugLogFlags_EventActiveId); SameLine(); CheckboxFlags("Focus", &g.DebugLogFlags, ImGuiDebugLogFlags_EventFocus); SameLine(); CheckboxFlags("Popup", &g.DebugLogFlags, ImGuiDebugLogFlags_EventPopup); SameLine(); CheckboxFlags("Nav", &g.DebugLogFlags, ImGuiDebugLogFlags_EventNav); SameLine(); if (CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper)) { g.DebugLogClipperAutoDisableFrames = 2; } if (IsItemHovered()) SetTooltip("Clipper log auto-disabled after 2 frames"); + //SameLine(); CheckboxFlags("Selection", &g.DebugLogFlags, ImGuiDebugLogFlags_EventSelection); SameLine(); CheckboxFlags("IO", &g.DebugLogFlags, ImGuiDebugLogFlags_EventIO); if (SmallButton("Clear")) @@ -14357,7 +14405,7 @@ void ImGui::ShowDebugLogWindow(bool* p_open) TextUnformatted(line_begin, line_end); ImRect text_rect = g.LastItemData.Rect; if (IsItemHovered()) - for (const char* p = line_begin; p < line_end - 10; p++) + for (const char* p = line_begin; p <= line_end - 10; p++) { ImGuiID id = 0; if (p[0] != '0' || (p[1] != 'x' && p[1] != 'X') || sscanf(p + 2, "%X", &id) != 1) diff --git a/3rdparty/dear-imgui/imgui.h b/3rdparty/dear-imgui/imgui.h index a90a4dc95..a450ffe2a 100644 --- a/3rdparty/dear-imgui/imgui.h +++ b/3rdparty/dear-imgui/imgui.h @@ -1,14 +1,14 @@ -// dear imgui, v1.89.5 WIP +// dear imgui, v1.89.6 WIP // (headers) // Help: -// - Read FAQ at http://dearimgui.org/faq +// - Read FAQ at http://dearimgui.com/faq // - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. // - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that. // Read imgui.cpp for details, links and comments. // Resources: -// - FAQ http://dearimgui.org/faq +// - FAQ http://dearimgui.com/faq // - Homepage & latest https://github.com/ocornut/imgui // - Releases & changelog https://github.com/ocornut/imgui/releases // - Gallery https://github.com/ocornut/imgui/issues/5886 (please post your screenshots/video there!) @@ -22,8 +22,8 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') -#define IMGUI_VERSION "1.89.5 WIP" -#define IMGUI_VERSION_NUM 18946 +#define IMGUI_VERSION "1.89.6 WIP" +#define IMGUI_VERSION_NUM 18954 #define IMGUI_HAS_TABLE /* @@ -167,6 +167,7 @@ struct ImGuiViewport; // A Platform Window (always only one in 'ma // In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. // With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. enum ImGuiKey : int; // -> enum ImGuiKey // Enum: A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value) +enum ImGuiMouseSource : int; // -> enum ImGuiMouseSource // Enum; A mouse input source identifier (Mouse, TouchScreen, Pen) typedef int ImGuiCol; // -> enum ImGuiCol_ // Enum: A color identifier for styling typedef int ImGuiCond; // -> enum ImGuiCond_ // Enum: A condition for many Set*() functions typedef int ImGuiDataType; // -> enum ImGuiDataType_ // Enum: A primary data type @@ -255,8 +256,8 @@ struct ImVec2 float x, y; constexpr ImVec2() : x(0.0f), y(0.0f) { } constexpr ImVec2(float _x, float _y) : x(_x), y(_y) { } - float& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return ((float*)(char*)this)[idx]; } // We very rarely use this [] operator, so the assert overhead is fine. - float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return ((const float*)(const char*)this)[idx]; } + float& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return ((float*)(void*)(char*)this)[idx]; } // We very rarely use this [] operator, so the assert overhead is fine. + float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return ((const float*)(const void*)(const char*)this)[idx]; } #ifdef IM_VEC2_CLASS_EXTRA IM_VEC2_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2. #endif @@ -460,7 +461,7 @@ namespace ImGui IMGUI_API float GetFrameHeightWithSpacing(); // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets) // ID stack/scopes - // Read the FAQ (docs/FAQ.md or http://dearimgui.org/faq) for more details about how ID are handled in dear imgui. + // Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui. // - Those questions are answered and impacted by understanding of the ID stack system: // - "Q: Why is my widget not reacting when I click on it?" // - "Q: How can I have widgets with an empty label?" @@ -1407,7 +1408,7 @@ enum ImGuiKey : int ImGuiKey_KeypadEqual, // Gamepad (some of those are analog values, 0.0f to 1.0f) // NAVIGATION ACTION - // (download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets) + // (download controller mapping PNG/PSD at http://dearimgui.com/controls_sheets) ImGuiKey_GamepadStart, // Menu (Xbox) + (Switch) Start/Options (PS) ImGuiKey_GamepadBack, // View (Xbox) - (Switch) Share (PS) ImGuiKey_GamepadFaceLeft, // X (Xbox) Y (Switch) Square (PS) // Tap: Toggle Menu. Hold: Windowing mode (Focus/Move/Resize windows) @@ -1715,6 +1716,18 @@ enum ImGuiMouseCursor_ ImGuiMouseCursor_COUNT }; +// Enumeration for AddMouseSourceEvent() actual source of Mouse Input data. +// Historically we use "Mouse" terminology everywhere to indicate pointer data, e.g. MousePos, IsMousePressed(), io.AddMousePosEvent() +// But that "Mouse" data can come from different source which occasionally may be useful for application to know about. +// You can submit a change of pointer type using io.AddMouseSourceEvent(). +enum ImGuiMouseSource : int +{ + ImGuiMouseSource_Mouse = 0, // Input is coming from an actual mouse. + ImGuiMouseSource_TouchScreen, // Input is coming from a touch screen (no hovering prior to initial press, less precise initial press aiming, dual-axis wheeling possible). + ImGuiMouseSource_Pen, // Input is coming from a pressure/magnetic pen (often used in conjunction with high-sampling rates). + ImGuiMouseSource_COUNT +}; + // Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions // Represent a condition. // Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always. @@ -1982,6 +1995,7 @@ struct ImGuiIO IMGUI_API void AddMousePosEvent(float x, float y); // Queue a mouse position update. Use -FLT_MAX,-FLT_MAX to signify no mouse (e.g. app not focused and not hovered) IMGUI_API void AddMouseButtonEvent(int button, bool down); // Queue a mouse button change IMGUI_API void AddMouseWheelEvent(float wheel_x, float wheel_y); // Queue a mouse wheel update. wheel_y<0: scroll down, wheel_y>0: scroll up, wheel_x<0: scroll right, wheel_x>0: scroll left. + IMGUI_API void AddMouseSourceEvent(ImGuiMouseSource source); // Queue a mouse source change (Mouse/TouchScreen/Pen) IMGUI_API void AddFocusEvent(bool focused); // Queue a gain/loss of focus for the application (generally based on OS/platform focus of your window) IMGUI_API void AddInputCharacter(unsigned int c); // Queue a new character input IMGUI_API void AddInputCharacterUTF16(ImWchar16 c); // Queue a new character input from a UTF-16 character, it can be a surrogate @@ -2035,6 +2049,7 @@ struct ImGuiIO bool MouseDown[5]; // Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Other buttons allow us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API. float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down. Hold SHIFT to turn vertical scroll into horizontal scroll. float MouseWheelH; // Mouse wheel Horizontal. >0 scrolls Left, <0 scrolls Right. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends. + ImGuiMouseSource MouseSource; // Mouse actual input peripheral (Mouse/TouchScreen/Pen). bool KeyCtrl; // Keyboard modifier down: Control bool KeyShift; // Keyboard modifier down: Shift bool KeyAlt; // Keyboard modifier down: Alt @@ -2337,7 +2352,6 @@ struct ImGuiListClipper // - It is important that we are keeping those disabled by default so they don't leak in user space. // - This is in order to allow user enabling implicit cast operators between ImVec2/ImVec4 and their own types (using IM_VEC2_CLASS_EXTRA in imconfig.h) // - You can use '#define IMGUI_DEFINE_MATH_OPERATORS' to import our operators, provided as a courtesy. -// - We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself. #ifdef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED IM_MSVC_RUNTIME_CHECKS_OFF @@ -2347,6 +2361,7 @@ static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); } static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); } static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); } +static inline ImVec2 operator-(const ImVec2& lhs) { return ImVec2(-lhs.x, -lhs.y); } static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; } static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; } static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; } diff --git a/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/dear-imgui/imgui_demo.cpp index 5f29b626a..af3000e4d 100644 --- a/3rdparty/dear-imgui/imgui_demo.cpp +++ b/3rdparty/dear-imgui/imgui_demo.cpp @@ -1,8 +1,8 @@ -// dear imgui, v1.89.5 WIP +// dear imgui, v1.89.6 WIP // (demo code) // Help: -// - Read FAQ at http://dearimgui.org/faq +// - Read FAQ at http://dearimgui.com/faq // - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. // - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that. // Read imgui.cpp for more details, documentation and comments. @@ -409,7 +409,7 @@ void ImGui::ShowDemoWindow(bool* p_open) ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!"); ImGui::BulletText("See comments in imgui.cpp."); ImGui::BulletText("See example applications in the examples/ folder."); - ImGui::BulletText("Read the FAQ at http://www.dearimgui.org/faq/"); + ImGui::BulletText("Read the FAQ at http://www.dearimgui.com/faq/"); ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls."); ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls."); ImGui::Separator(); @@ -483,13 +483,13 @@ void ImGui::ShowDemoWindow(bool* p_open) "Those flags are set by the backends (imgui_impl_xxx files) to specify their capabilities.\n" "Here we expose them as read-only fields to avoid breaking interactions with your backend."); - // Make a local copy to avoid modifying actual backend flags. - // FIXME: We don't use BeginDisabled() to keep label bright, maybe we need a BeginReadonly() equivalent.. - ImGuiBackendFlags backend_flags = io.BackendFlags; - ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", &backend_flags, ImGuiBackendFlags_HasGamepad); - ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &backend_flags, ImGuiBackendFlags_HasMouseCursors); - ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &backend_flags, ImGuiBackendFlags_HasSetMousePos); - ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &backend_flags, ImGuiBackendFlags_RendererHasVtxOffset); + // FIXME: Maybe we need a BeginReadonly() equivalent to keep label bright? + ImGui::BeginDisabled(); + ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", &io.BackendFlags, ImGuiBackendFlags_HasGamepad); + ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &io.BackendFlags, ImGuiBackendFlags_HasMouseCursors); + ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &io.BackendFlags, ImGuiBackendFlags_HasSetMousePos); + ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &io.BackendFlags, ImGuiBackendFlags_RendererHasVtxOffset); + ImGui::EndDisabled(); ImGui::TreePop(); ImGui::Spacing(); } diff --git a/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/dear-imgui/imgui_draw.cpp index 5bf034604..b76f876d2 100644 --- a/3rdparty/dear-imgui/imgui_draw.cpp +++ b/3rdparty/dear-imgui/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.5 WIP +// dear imgui, v1.89.6 WIP // (drawing and font code) /* @@ -2623,6 +2623,9 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa ImVector& user_rects = atlas->CustomRects; IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong. +#ifdef __GNUC__ + if (user_rects.Size < 1) { __builtin_unreachable(); } // Workaround for GCC bug if IM_ASSERT() is defined to conditionally throw (see #5343) +#endif ImVector pack_rects; pack_rects.resize(user_rects.Size); diff --git a/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/dear-imgui/imgui_internal.h index bc9dd2337..c6b9ee6fa 100644 --- a/3rdparty/dear-imgui/imgui_internal.h +++ b/3rdparty/dear-imgui/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.89.5 WIP +// dear imgui, v1.89.6 WIP // (internal structures/api) // You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility. @@ -164,6 +164,7 @@ typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // E // Flags typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later) typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags +typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow(); typedef int ImGuiInputFlags; // -> enum ImGuiInputFlags_ // Flags: for IsKeyPressed(), IsMouseClicked(), SetKeyOwner(), SetItemKeyOwner() etc. typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), g.LastItemData.InFlags typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for g.LastItemData.StatusFlags @@ -230,6 +231,7 @@ namespace ImStb #define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) #define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) #define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) +#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) #define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) #define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) @@ -905,6 +907,16 @@ enum ImGuiSeparatorFlags_ ImGuiSeparatorFlags_SpanAllColumns = 1 << 2, }; +// Flags for FocusWindow(). This is not called ImGuiFocusFlags to avoid confusion with public-facing ImGuiFocusedFlags. +// FIXME: Once we finishing replacing more uses of GetTopMostPopupModal()+IsWindowWithinBeginStackOf() +// and FindBlockingModal() with this, we may want to change the flag to be opt-out instead of opt-in. +enum ImGuiFocusRequestFlags_ +{ + ImGuiFocusRequestFlags_None = 0, + ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0, // Find last focused child (if any) and focus it instead. + ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1, // Do not set focus if the window is below a modal. +}; + enum ImGuiTextFlags_ { ImGuiTextFlags_None = 0, @@ -1264,7 +1276,7 @@ enum ImGuiInputEventType enum ImGuiInputSource { ImGuiInputSource_None = 0, - ImGuiInputSource_Mouse, + ImGuiInputSource_Mouse, // Note: may be Mouse or TouchScreen or Pen. See io.MouseSource to distinguish them. ImGuiInputSource_Keyboard, ImGuiInputSource_Gamepad, ImGuiInputSource_Clipboard, // Currently only used by InputText() @@ -1273,9 +1285,9 @@ enum ImGuiInputSource // FIXME: Structures in the union below need to be declared as anonymous unions appears to be an extension? // Using ImVec2() would fail on Clang 'union member 'MousePos' has a non-trivial default constructor' -struct ImGuiInputEventMousePos { float PosX, PosY; }; -struct ImGuiInputEventMouseWheel { float WheelX, WheelY; }; -struct ImGuiInputEventMouseButton { int Button; bool Down; }; +struct ImGuiInputEventMousePos { float PosX, PosY; ImGuiMouseSource MouseSource; }; +struct ImGuiInputEventMouseWheel { float WheelX, WheelY; ImGuiMouseSource MouseSource; }; +struct ImGuiInputEventMouseButton { int Button; bool Down; ImGuiMouseSource MouseSource; }; struct ImGuiInputEventKey { ImGuiKey Key; bool Down; float AnalogValue; }; struct ImGuiInputEventText { unsigned int Char; }; struct ImGuiInputEventAppFocused { bool Focused; }; @@ -1284,6 +1296,7 @@ struct ImGuiInputEvent { ImGuiInputEventType Type; ImGuiInputSource Source; + ImU32 EventId; // Unique, sequential increasing integer to identify an event (if you need to correlate them to other data). union { ImGuiInputEventMousePos MousePos; // if Type == ImGuiInputEventType_MousePos @@ -1460,6 +1473,7 @@ enum ImGuiNavMoveFlags_ ImGuiNavMoveFlags_LoopY = 1 << 1, ImGuiNavMoveFlags_WrapX = 1 << 2, // On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left) ImGuiNavMoveFlags_WrapY = 1 << 3, // This is not super useful but provided for completeness + ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY, ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4, // Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place) ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5, // Store alternate result in NavMoveResultLocalVisible that only comprise elements that are already fully visible (used by PageUp/PageDown) ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6, // Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword, probably unnecessary @@ -1669,8 +1683,9 @@ enum ImGuiDebugLogFlags_ ImGuiDebugLogFlags_EventPopup = 1 << 2, ImGuiDebugLogFlags_EventNav = 1 << 3, ImGuiDebugLogFlags_EventClipper = 1 << 4, - ImGuiDebugLogFlags_EventIO = 1 << 5, - ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventIO, + ImGuiDebugLogFlags_EventSelection = 1 << 5, + ImGuiDebugLogFlags_EventIO = 1 << 6, + ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO, ImGuiDebugLogFlags_OutputToTTY = 1 << 10, // Also send output to TTY }; @@ -1739,8 +1754,6 @@ struct ImGuiContext bool Initialized; bool FontAtlasOwnedByContext; // IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it. ImGuiIO IO; - ImVector InputEventsQueue; // Input events which will be tricked/written into IO structure. - ImVector InputEventsTrail; // Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail. ImGuiStyle Style; ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back() float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window. @@ -1757,6 +1770,12 @@ struct ImGuiContext bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log() void* TestEngine; // Test engine user data + // Inputs + ImVector InputEventsQueue; // Input events which will be trickled/written into IO structure. + ImVector InputEventsTrail; // Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail. + ImGuiMouseSource InputEventsNextMouseSource; + ImU32 InputEventsNextEventId; + // Windows state ImVector Windows; // Windows, sorted in display order, back to front ImVector WindowsFocusOrder; // Root windows, sorted in focus order, back to front. @@ -2041,6 +2060,9 @@ struct ImGuiContext TestEngineHookItems = false; TestEngine = NULL; + InputEventsNextMouseSource = ImGuiMouseSource_Mouse; + InputEventsNextEventId = 1; + WindowsActiveCount = 0; CurrentWindow = NULL; HoveredWindow = NULL; @@ -2216,14 +2238,15 @@ struct IMGUI_API ImGuiWindowTempData ImVec1 Indent; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.) ImVec1 ColumnsOffset; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API. ImVec1 GroupOffset; - ImVec2 CursorStartPosLossyness;// Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensentate and fix the most common use case of large scroll area. + ImVec2 CursorStartPosLossyness;// Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensate and fix the most common use case of large scroll area. // Keyboard/Gamepad navigation ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1) short NavLayersActiveMask; // Which layers have been written to (result from previous frame) short NavLayersActiveMaskNext;// Which layers have been written to (accumulator for current frame) + bool NavIsScrollPushableX; // Set when current work location may be scrolled horizontally when moving left / right. This is generally always true UNLESS within a column. bool NavHideHighlightOneFrame; - bool NavHasScroll; // Set when scrolling can be used (ScrollMax > 0.0f) + bool NavWindowHasScrollY; // Set per window when scrolling can be used (== ScrollMax.y > 0.0f) // Miscellaneous bool MenuBarAppending; // FIXME: Remove this @@ -2740,8 +2763,8 @@ namespace ImGui inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); } // Windows: Display Order and Focus Order - IMGUI_API void FocusWindow(ImGuiWindow* window); - IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window); + IMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0); + IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags); IMGUI_API void BringWindowToFocusFront(ImGuiWindow* window); IMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window); IMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window); @@ -2861,6 +2884,7 @@ namespace ImGui IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window); IMGUI_API ImGuiWindow* GetTopMostPopupModal(); IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal(); + IMGUI_API ImGuiWindow* FindBlockingModal(ImGuiWindow* window); IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window); IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy); @@ -2884,6 +2908,7 @@ namespace ImGui IMGUI_API void NavMoveRequestCancel(); IMGUI_API void NavMoveRequestApplyResult(); IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags); + IMGUI_API void NavUpdateCurrentWindowIsScrollPushableX(); IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again. IMGUI_API void SetNavWindow(ImGuiWindow* window); IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel); diff --git a/3rdparty/dear-imgui/imgui_tables.cpp b/3rdparty/dear-imgui/imgui_tables.cpp index 8e92ff2a7..7ff5d643c 100644 --- a/3rdparty/dear-imgui/imgui_tables.cpp +++ b/3rdparty/dear-imgui/imgui_tables.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.5 WIP +// dear imgui, v1.89.6 WIP // (tables and columns code) /* @@ -483,6 +483,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG // Make table current g.CurrentTable = table; + outer_window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX(); outer_window->DC.CurrentTableIdx = table_idx; if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly. inner_window->DC.CurrentTableIdx = table_idx; @@ -1436,6 +1437,7 @@ void ImGui::EndTable() g.CurrentTable->DrawSplitter = &temp_data->DrawSplitter; } outer_window->DC.CurrentTableIdx = g.CurrentTable ? g.Tables.GetIndex(g.CurrentTable) : -1; + NavUpdateCurrentWindowIsScrollPushableX(); } // See "COLUMN SIZING POLICIES" comments at the top of this file @@ -2381,11 +2383,11 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) struct MergeGroup { ImRect ClipRect; - int ChannelsCount; - ImBitArrayPtr ChannelsMask; + int ChannelsCount = 0; + ImBitArrayPtr ChannelsMask = NULL; }; int merge_group_mask = 0x00; - MergeGroup merge_groups[4] = {}; + MergeGroup merge_groups[4]; // Use a reusable temp buffer for the merge masks as they are dynamically sized. const int max_draw_channels = (4 + table->ColumnsCount * 2); @@ -3007,7 +3009,7 @@ void ImGui::TableHeader(const char* label) } // Sort order arrow - const float ellipsis_max = cell_r.Max.x - w_arrow - w_sort_text; + const float ellipsis_max = ImMax(cell_r.Max.x - w_arrow - w_sort_text, label_pos.x); if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort)) { if (column->SortOrder != -1) @@ -3902,6 +3904,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl columns->Count = columns_count; columns->Flags = flags; window->DC.CurrentColumns = columns; + window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX(); columns->HostCursorPosY = window->DC.CursorPos.y; columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x; @@ -4092,6 +4095,7 @@ void ImGui::EndColumns() window->DC.CurrentColumns = NULL; window->DC.ColumnsOffset.x = 0.0f; window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); + NavUpdateCurrentWindowIsScrollPushableX(); } void ImGui::Columns(int columns_count, const char* id, bool border) diff --git a/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/dear-imgui/imgui_widgets.cpp index d22fbbda6..b63351968 100644 --- a/3rdparty/dear-imgui/imgui_widgets.cpp +++ b/3rdparty/dear-imgui/imgui_widgets.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.89.5 WIP +// dear imgui, v1.89.6 WIP // (widgets code) /* @@ -638,7 +638,12 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool g.ActiveIdClickOffset = g.IO.MousePos - bb.Min; const int mouse_button = g.ActiveIdMouseButton; - if (IsMouseDown(mouse_button, test_owner_id)) + if (mouse_button == -1) + { + // Fallback for the rare situation were g.ActiveId was set programmatically or from another widget (e.g. #6304). + ClearActiveID(); + } + else if (IsMouseDown(mouse_button, test_owner_id)) { held = true; } @@ -4051,7 +4056,7 @@ void ImGui::InputTextDeactivateHook(ImGuiID id) return; g.InputTextDeactivatedState.ID = state->ID; g.InputTextDeactivatedState.TextA.resize(state->CurLenA + 1); - memcpy(g.InputTextDeactivatedState.TextA.Data, state->TextA.Data, state->CurLenA + 1); + memcpy(g.InputTextDeactivatedState.TextA.Data, state->TextA.Data ? state->TextA.Data : "", state->CurLenA + 1); } // Edit a string of text @@ -4306,7 +4311,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Although we are active we don't prevent mouse from hovering other elements unless we are interacting right now with the widget. // Down the line we should have a cleaner library-wide concept of Selected vs Active. g.ActiveIdAllowOverlap = !io.MouseDown[0]; - g.WantTextInputNextFrame = 1; // Edit in progress const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + state->ScrollX; @@ -4745,8 +4749,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } // Release active ID at the end of the function (so e.g. pressing Return still does a final application of the value) - if (clear_active_id && g.ActiveId == id) + // Otherwise request text input ahead for next frame. + if (g.ActiveId == id && clear_active_id) ClearActiveID(); + else if (g.ActiveId == id) + g.WantTextInputNextFrame = 1; // Render frame if (!is_multiline) @@ -7092,7 +7099,7 @@ void ImGui::EndMainMenuBar() // FIXME: With this strategy we won't be able to restore a NULL focus. ImGuiContext& g = *GImGui; if (g.CurrentWindow == g.NavWindow && g.NavLayer == ImGuiNavLayer_Main && !g.NavAnyRequest) - FocusTopMostWindowUnderOne(g.NavWindow, NULL); + FocusTopMostWindowUnderOne(g.NavWindow, NULL, NULL, ImGuiFocusRequestFlags_UnlessBelowModal | ImGuiFocusRequestFlags_RestoreFocusedChild); End(); } @@ -7106,9 +7113,9 @@ static bool IsRootOfOpenMenuSet() // Initially we used 'upper_popup->OpenParentId == window->IDStack.back()' to differentiate multiple menu sets from each others // (e.g. inside menu bar vs loose menu items) based on parent ID. - // This would however prevent the use of e.g. PuhsID() user code submitting menus. + // This would however prevent the use of e.g. PushID() user code submitting menus. // Previously this worked between popup and a first child menu because the first child menu always had the _ChildWindow flag, - // making hovering on parent popup possible while first child menu was focused - but this was generally a bug with other side effects. + // making hovering on parent popup possible while first child menu was focused - but this was generally a bug with other side effects. // Instead we don't treat Popup specifically (in order to consistently support menu features in them), maybe the first child menu of a Popup // doesn't have the _ChildWindow flag, and we rely on this IsRootOfOpenMenuSet() check to allow hovering between root window/popup and first child menu. // In the end, lack of ID check made it so we could no longer differentiate between separate menu sets. To compensate for that, we at least check parent window nav layer. @@ -7116,7 +7123,9 @@ static bool IsRootOfOpenMenuSet() // open on hover, but that should be a lesser problem, because if such menus are close in proximity in window content then it won't feel weird and if they are far apart // it likely won't be a problem anyone runs into. const ImGuiPopupData* upper_popup = &g.OpenPopupStack[g.BeginPopupStack.Size]; - return (window->DC.NavLayerCurrent == upper_popup->ParentNavLayer && upper_popup->Window && (upper_popup->Window->Flags & ImGuiWindowFlags_ChildMenu)); + if (window->DC.NavLayerCurrent != upper_popup->ParentNavLayer) + return false; + return upper_popup->Window && (upper_popup->Window->Flags & ImGuiWindowFlags_ChildMenu) && ImGui::IsWindowChildOf(upper_popup->Window, window, true); } bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled) From ddfae2f9157435231749ac433116139bad2ec3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:22:44 -0700 Subject: [PATCH 75/86] Updated meshoptimizer. --- 3rdparty/meshoptimizer/src/meshoptimizer.h | 4 +-- 3rdparty/meshoptimizer/src/vertexcodec.cpp | 31 +++++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/3rdparty/meshoptimizer/src/meshoptimizer.h b/3rdparty/meshoptimizer/src/meshoptimizer.h index 71088c462..26c4e99a5 100644 --- a/3rdparty/meshoptimizer/src/meshoptimizer.h +++ b/3rdparty/meshoptimizer/src/meshoptimizer.h @@ -1,5 +1,5 @@ /** - * meshoptimizer - version 0.18 + * meshoptimizer - version 0.19 * * Copyright (C) 2016-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Report bugs and download new versions at https://github.com/zeux/meshoptimizer @@ -12,7 +12,7 @@ #include /* Version macro; major * 1000 + minor * 10 + patch */ -#define MESHOPTIMIZER_VERSION 180 /* 0.18 */ +#define MESHOPTIMIZER_VERSION 190 /* 0.19 */ /* If no API is defined, assume default */ #ifndef MESHOPTIMIZER_API diff --git a/3rdparty/meshoptimizer/src/vertexcodec.cpp b/3rdparty/meshoptimizer/src/vertexcodec.cpp index 4bd11121d..167034bae 100644 --- a/3rdparty/meshoptimizer/src/vertexcodec.cpp +++ b/3rdparty/meshoptimizer/src/vertexcodec.cpp @@ -44,6 +44,10 @@ // When targeting Wasm SIMD we can't use runtime cpuid checks so we unconditionally enable SIMD #if defined(__wasm_simd128__) #define SIMD_WASM +// Prevent compiling other variant when wasm simd compilation is active +#undef SIMD_NEON +#undef SIMD_SSE +#undef SIMD_AVX #endif #ifndef SIMD_TARGET @@ -83,19 +87,17 @@ #endif #ifdef SIMD_WASM -#undef __DEPRECATED -#pragma clang diagnostic ignored "-Wdeprecated-declarations" #include #endif #ifdef SIMD_WASM -#define wasmx_splat_v32x4(v, i) wasm_v32x4_shuffle(v, v, i, i, i, i) -#define wasmx_unpacklo_v8x16(a, b) wasm_v8x16_shuffle(a, b, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23) -#define wasmx_unpackhi_v8x16(a, b) wasm_v8x16_shuffle(a, b, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31) -#define wasmx_unpacklo_v16x8(a, b) wasm_v16x8_shuffle(a, b, 0, 8, 1, 9, 2, 10, 3, 11) -#define wasmx_unpackhi_v16x8(a, b) wasm_v16x8_shuffle(a, b, 4, 12, 5, 13, 6, 14, 7, 15) -#define wasmx_unpacklo_v64x2(a, b) wasm_v64x2_shuffle(a, b, 0, 2) -#define wasmx_unpackhi_v64x2(a, b) wasm_v64x2_shuffle(a, b, 1, 3) +#define wasmx_splat_v32x4(v, i) wasm_i32x4_shuffle(v, v, i, i, i, i) +#define wasmx_unpacklo_v8x16(a, b) wasm_i8x16_shuffle(a, b, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23) +#define wasmx_unpackhi_v8x16(a, b) wasm_i8x16_shuffle(a, b, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31) +#define wasmx_unpacklo_v16x8(a, b) wasm_i16x8_shuffle(a, b, 0, 8, 1, 9, 2, 10, 3, 11) +#define wasmx_unpackhi_v16x8(a, b) wasm_i16x8_shuffle(a, b, 4, 12, 5, 13, 6, 14, 7, 15) +#define wasmx_unpacklo_v64x2(a, b) wasm_i64x2_shuffle(a, b, 0, 2) +#define wasmx_unpackhi_v64x2(a, b) wasm_i64x2_shuffle(a, b, 1, 3) #endif namespace meshopt @@ -294,7 +296,7 @@ static unsigned char* encodeVertexBlock(unsigned char* data, unsigned char* data return data; } -#if defined(SIMD_FALLBACK) || (!defined(SIMD_SSE) && !defined(SIMD_NEON) && !defined(SIMD_AVX)) +#if defined(SIMD_FALLBACK) || (!defined(SIMD_SSE) && !defined(SIMD_NEON) && !defined(SIMD_AVX) && !defined(SIMD_WASM)) static const unsigned char* decodeBytesGroup(const unsigned char* data, unsigned char* buffer, int bitslog2) { #define READ() byte = *data++ @@ -757,7 +759,7 @@ static v128_t decodeShuffleMask(unsigned char mask0, unsigned char mask1) v128_t sm1 = wasm_v128_load(&kDecodeBytesGroupShuffle[mask1]); v128_t sm1off = wasm_v128_load(&kDecodeBytesGroupCount[mask0]); - sm1off = wasm_v8x16_shuffle(sm1off, sm1off, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + sm1off = wasm_i8x16_shuffle(sm1off, sm1off, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); v128_t sm1r = wasm_i8x16_add(sm1, sm1off); @@ -777,9 +779,6 @@ static void wasmMoveMask(v128_t mask, unsigned char& mask0, unsigned char& mask1 SIMD_TARGET static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int bitslog2) { - unsigned char byte, enc, encv; - const unsigned char* data_var; - switch (bitslog2) { case 0: @@ -807,7 +806,7 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi v128_t shuf = decodeShuffleMask(mask0, mask1); - v128_t result = wasm_v128_bitselect(wasm_v8x16_swizzle(rest, shuf), sel, mask); + v128_t result = wasm_v128_bitselect(wasm_i8x16_swizzle(rest, shuf), sel, mask); wasm_v128_store(buffer, result); @@ -829,7 +828,7 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi v128_t shuf = decodeShuffleMask(mask0, mask1); - v128_t result = wasm_v128_bitselect(wasm_v8x16_swizzle(rest, shuf), sel, mask); + v128_t result = wasm_v128_bitselect(wasm_i8x16_swizzle(rest, shuf), sel, mask); wasm_v128_store(buffer, result); From bf5fda9ae7b93f2b8ed761d2d5b9d9b51ed22561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:23:10 -0700 Subject: [PATCH 76/86] Updated glslang. --- 3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 63 +- 3rdparty/glslang/SPIRV/SpvBuilder.cpp | 61 +- 3rdparty/glslang/StandAlone/StandAlone.cpp | 26 +- .../glslang/glslang/HLSL/hlslParseHelper.cpp | 7 +- .../MachineIndependent/ParseHelper.cpp | 7 +- .../MachineIndependent/SpirvIntrinsics.cpp | 47 +- .../glslang/MachineIndependent/glslang.m4 | 36 +- .../glslang/MachineIndependent/glslang.y | 36 +- .../MachineIndependent/glslang_tab.cpp | 4205 +++++++++-------- 9 files changed, 2306 insertions(+), 2182 deletions(-) diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index 713db67df..47c0a38b9 100644 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -2004,6 +2004,10 @@ void TGlslangToSpvTraverser::dumpSpv(std::vector& out) // void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) { + // We update the line information even though no code might be generated here + // This is helpful to yield correct lines for control flow instructions + builder.setLine(symbol->getLoc().line, symbol->getLoc().getFilename()); + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); if (symbol->getType().isStruct()) glslangTypeToIdMap[symbol->getType().getStruct()] = symbol->getId(); @@ -2155,6 +2159,9 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T node->getRight()->traverse(this); spv::Id rValue = accessChainLoad(node->getRight()->getType()); + // reset line number for assignment + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + if (node->getOp() != glslang::EOpAssign) { // the left is also an r-value builder.setAccessChain(lValue); @@ -3782,10 +3789,11 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang // Find a way of executing both sides and selecting the right result. const auto executeBothSides = [&]() -> void { // execute both sides + spv::Id resultType = convertGlslangToSpvType(node->getType()); node->getTrueBlock()->traverse(this); spv::Id trueValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); node->getFalseBlock()->traverse(this); - spv::Id falseValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); + spv::Id falseValue = accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()); builder.setLine(node->getLoc().line, node->getLoc().getFilename()); @@ -3794,8 +3802,8 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang return; // emit code to select between trueValue and falseValue - - // see if OpSelect can handle it + // see if OpSelect can handle the result type, and that the SPIR-V types + // of the inputs match the result type. if (isOpSelectable()) { // Emit OpSelect for this selection. @@ -3807,10 +3815,18 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang builder.getNumComponents(trueValue))); } + // If the types do not match, it is because of mismatched decorations on aggregates. + // Since isOpSelectable only lets us get here for SPIR-V >= 1.4, we can use OpCopyObject + // to get matching types. + if (builder.getTypeId(trueValue) != resultType) { + trueValue = builder.createUnaryOp(spv::OpCopyLogical, resultType, trueValue); + } + if (builder.getTypeId(falseValue) != resultType) { + falseValue = builder.createUnaryOp(spv::OpCopyLogical, resultType, falseValue); + } + // OpSelect - result = builder.createTriOp(spv::OpSelect, - convertGlslangToSpvType(node->getType()), condition, - trueValue, falseValue); + result = builder.createTriOp(spv::OpSelect, resultType, condition, trueValue, falseValue); builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -3818,7 +3834,7 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang // We need control flow to select the result. // TODO: Once SPIR-V OpSelect allows arbitrary types, eliminate this path. result = builder.createVariable(TranslatePrecisionDecoration(node->getType()), - spv::StorageClassFunction, convertGlslangToSpvType(node->getType())); + spv::StorageClassFunction, resultType); // Selection control: const spv::SelectionControlMask control = TranslateSelectionControl(*node); @@ -3827,10 +3843,15 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang spv::Builder::If ifBuilder(condition, control, builder); // emit the "then" statement - builder.createStore(trueValue, result); + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), trueValue); + ifBuilder.makeBeginElse(); // emit the "else" statement - builder.createStore(falseValue, result); + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), falseValue); // finish off the control flow ifBuilder.makeEndIf(); @@ -3857,16 +3878,26 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang // emit the "then" statement if (node->getTrueBlock() != nullptr) { node->getTrueBlock()->traverse(this); - if (result != spv::NoResult) - builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result); + if (result != spv::NoResult) { + spv::Id load = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); + + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), load); + } } if (node->getFalseBlock() != nullptr) { ifBuilder.makeBeginElse(); // emit the "else" statement node->getFalseBlock()->traverse(this); - if (result != spv::NoResult) - builder.createStore(accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()), result); + if (result != spv::NoResult) { + spv::Id load = accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()); + + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + multiTypeStore(node->getType(), load); + } } // finish off the control flow @@ -9418,10 +9449,10 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol std::vector operandIds; assert(!decorateId.second.empty()); for (auto extraOperand : decorateId.second) { - if (extraOperand->getQualifier().isSpecConstant()) - operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); - else + if (extraOperand->getQualifier().isFrontEndConstant()) operandIds.push_back(createSpvConstant(*extraOperand)); + else + operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); } builder.addDecorationId(id, static_cast(decorateId.first), operandIds); } diff --git a/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/3rdparty/glslang/SPIRV/SpvBuilder.cpp index 764a88602..9d0733425 100644 --- a/3rdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -144,6 +144,7 @@ void Builder::addLine(Id fileName, int lineNum, int column) void Builder::addDebugScopeAndLine(Id fileName, int lineNum, int column) { + assert(!currentDebugScopeId.empty()); if (currentDebugScopeId.top() != lastDebugScopeId) { spv::Id resultId = getUniqueId(); Instruction* scopeInst = new Instruction(resultId, makeVoidType(), OpExtInst); @@ -1071,6 +1072,12 @@ Id Builder::makeDebugCompilationUnit() { constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); module.mapInstruction(sourceInst); nonSemanticShaderCompilationUnitId = resultId; + + // We can reasonably assume that makeDebugCompilationUnit will be called before any of + // debug-scope stack. Function scopes and lexical scopes will occur afterward. + assert(currentDebugScopeId.empty()); + currentDebugScopeId.push(nonSemanticShaderCompilationUnitId); + return resultId; } @@ -1100,6 +1107,8 @@ Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id c Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t const argNumber) { assert(name != nullptr); + assert(!currentDebugScopeId.empty()); + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); inst->addIdOperand(nonSemanticShaderDebugInfo); inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLocalVariable); @@ -2119,6 +2128,8 @@ Id Builder::makeDebugFunction(Function* function, Id nameId, Id funcTypeId) { } Id Builder::makeDebugLexicalBlock(uint32_t line) { + assert(!currentDebugScopeId.empty()); + Id lexId = getUniqueId(); auto lex = new Instruction(lexId, makeVoidType(), OpExtInst); lex->addIdOperand(nonSemanticShaderDebugInfo); @@ -2758,52 +2769,49 @@ Id Builder::createBuiltinCall(Id resultType, Id builtins, int entryPoint, const Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, bool noImplicitLod, const TextureParameters& parameters, ImageOperandsMask signExtensionMask) { - static const int maxTextureArgs = 10; - Id texArgs[maxTextureArgs] = {}; + std::vector texArgs; // // Set up the fixed arguments // - int numArgs = 0; bool explicitLod = false; - texArgs[numArgs++] = parameters.sampler; - texArgs[numArgs++] = parameters.coords; + texArgs.push_back(parameters.sampler); + texArgs.push_back(parameters.coords); if (parameters.Dref != NoResult) - texArgs[numArgs++] = parameters.Dref; + texArgs.push_back(parameters.Dref); if (parameters.component != NoResult) - texArgs[numArgs++] = parameters.component; + texArgs.push_back(parameters.component); #ifndef GLSLANG_WEB if (parameters.granularity != NoResult) - texArgs[numArgs++] = parameters.granularity; + texArgs.push_back(parameters.granularity); if (parameters.coarse != NoResult) - texArgs[numArgs++] = parameters.coarse; + texArgs.push_back(parameters.coarse); #endif // // Set up the optional arguments // - int optArgNum = numArgs; // track which operand, if it exists, is the mask of optional arguments - ++numArgs; // speculatively make room for the mask operand + size_t optArgNum = texArgs.size(); // the position of the mask for the optional arguments, if any. ImageOperandsMask mask = ImageOperandsMaskNone; // the mask operand if (parameters.bias) { mask = (ImageOperandsMask)(mask | ImageOperandsBiasMask); - texArgs[numArgs++] = parameters.bias; + texArgs.push_back(parameters.bias); } if (parameters.lod) { mask = (ImageOperandsMask)(mask | ImageOperandsLodMask); - texArgs[numArgs++] = parameters.lod; + texArgs.push_back(parameters.lod); explicitLod = true; } else if (parameters.gradX) { mask = (ImageOperandsMask)(mask | ImageOperandsGradMask); - texArgs[numArgs++] = parameters.gradX; - texArgs[numArgs++] = parameters.gradY; + texArgs.push_back(parameters.gradX); + texArgs.push_back(parameters.gradY); explicitLod = true; } else if (noImplicitLod && ! fetch && ! gather) { // have to explicitly use lod of 0 if not allowed to have them be implicit, and // we would otherwise be about to issue an implicit instruction mask = (ImageOperandsMask)(mask | ImageOperandsLodMask); - texArgs[numArgs++] = makeFloatConstant(0.0); + texArgs.push_back(makeFloatConstant(0.0)); explicitLod = true; } if (parameters.offset) { @@ -2813,24 +2821,24 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, addCapability(CapabilityImageGatherExtended); mask = (ImageOperandsMask)(mask | ImageOperandsOffsetMask); } - texArgs[numArgs++] = parameters.offset; + texArgs.push_back(parameters.offset); } if (parameters.offsets) { addCapability(CapabilityImageGatherExtended); mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask); - texArgs[numArgs++] = parameters.offsets; + texArgs.push_back(parameters.offsets); } #ifndef GLSLANG_WEB if (parameters.sample) { mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask); - texArgs[numArgs++] = parameters.sample; + texArgs.push_back(parameters.sample); } if (parameters.lodClamp) { // capability if this bit is used addCapability(CapabilityMinLod); mask = (ImageOperandsMask)(mask | ImageOperandsMinLodMask); - texArgs[numArgs++] = parameters.lodClamp; + texArgs.push_back(parameters.lodClamp); } if (parameters.nonprivate) { mask = mask | ImageOperandsNonPrivateTexelKHRMask; @@ -2840,10 +2848,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, } #endif mask = mask | signExtensionMask; - if (mask == ImageOperandsMaskNone) - --numArgs; // undo speculative reservation for the mask argument - else - texArgs[optArgNum] = mask; + // insert the operand for the mask, if any bits were set. + if (mask != ImageOperandsMaskNone) + texArgs.insert(texArgs.begin() + optArgNum, mask); // // Set up the instruction @@ -2947,11 +2954,11 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, // Build the SPIR-V instruction Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode); - for (int op = 0; op < optArgNum; ++op) + for (size_t op = 0; op < optArgNum; ++op) textureInst->addIdOperand(texArgs[op]); - if (optArgNum < numArgs) + if (optArgNum < texArgs.size()) textureInst->addImmediateOperand(texArgs[optArgNum]); - for (int op = optArgNum + 1; op < numArgs; ++op) + for (size_t op = optArgNum + 1; op < texArgs.size(); ++op) textureInst->addIdOperand(texArgs[op]); setPrecision(textureInst->getResultId(), precision); buildPoint->addInstruction(std::unique_ptr(textureInst)); diff --git a/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/glslang/StandAlone/StandAlone.cpp index e02628562..e038ed167 100644 --- a/3rdparty/glslang/StandAlone/StandAlone.cpp +++ b/3rdparty/glslang/StandAlone/StandAlone.cpp @@ -258,6 +258,17 @@ public: text.append("\n"); } + void addText(std::string preambleText) + { + fixLine(preambleText); + + Processes.push_back("preamble-text"); + Processes.back().append(preambleText); + + text.append(preambleText); + text.append("\n"); + } + protected: void fixLine(std::string& line) { @@ -727,6 +738,13 @@ void ProcessArguments(std::vector>& workItem } else if (lowerword == "no-storage-format" || // synonyms lowerword == "nsf") { Options |= EOptionNoStorageFormat; + } else if (lowerword == "preamble-text" || + lowerword == "p") { + if (argc > 1) + UserPreamble.addText(argv[1]); + else + Error("expects ", argv[0]); + bumpArg(); } else if (lowerword == "relaxed-errors") { Options |= EOptionRelaxedErrors; } else if (lowerword == "reflect-strict-array-suffix") { @@ -926,6 +944,9 @@ void ProcessArguments(std::vector>& workItem else Error("unknown -O option"); break; + case 'P': + UserPreamble.addText(getStringOperand("-P")); + break; case 'R': VulkanRulesRelaxed = true; break; @@ -1832,7 +1853,7 @@ void CompileFile(const char* fileName, ShHandle compiler) SetMessageOptions(messages); if (UserPreamble.isSet()) - Error("-D and -U options require -l (linking)\n"); + Error("-D, -U and -P options require -l (linking)\n"); for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) { for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) { @@ -1902,6 +1923,9 @@ void usage() " is searched first, followed by left-to-right order of -I\n" " -Od disables optimization; may cause illegal SPIR-V for HLSL\n" " -Os optimizes SPIR-V to minimize size\n" + " -P | --preamble-text | --P \n" + " inject custom preamble text, which is treated as if it\n" + " appeared immediately after the version declaration (if any).\n" " -R use relaxed verification rules for generating Vulkan SPIR-V,\n" " allowing the use of default uniforms, atomic_uints, and\n" " gl_VertexID and gl_InstanceID keywords.\n" diff --git a/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp b/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp index 6e0d314ae..ac0dee50c 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp +++ b/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp @@ -1177,10 +1177,13 @@ void HlslParseContext::flatten(const TVariable& variable, bool linkage, bool arr if (type.isBuiltIn() && !type.isStruct()) return; + auto entry = flattenMap.insert(std::make_pair(variable.getUniqueId(), TFlattenData(type.getQualifier().layoutBinding, type.getQualifier().layoutLocation))); + if (type.isStruct() && type.getStruct()->size()==0) + return; // if flattening arrayed io struct, array each member of dereferenced type if (arrayed) { const TType dereferencedType(type, 0); @@ -7565,7 +7568,6 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction candidateList[0]->getBuiltInOp() == EOpMethodRestartStrip || candidateList[0]->getBuiltInOp() == EOpMethodIncrementCounter || candidateList[0]->getBuiltInOp() == EOpMethodDecrementCounter || - candidateList[0]->getBuiltInOp() == EOpMethodAppend || candidateList[0]->getBuiltInOp() == EOpMethodConsume)) { return candidateList[0]; } @@ -9046,7 +9048,8 @@ void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TType // "The specified offset must be a multiple // of the base alignment of the type of the block member it qualifies, or a compile-time error results." if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment)) - error(memberLoc, "must be a multiple of the member's alignment", "offset", ""); + error(memberLoc, "must be a multiple of the member's alignment", "offset", + "(layout offset = %d | member alignment = %d)", memberQualifier.layoutOffset, memberAlignment); // "The offset qualifier forces the qualified member to start at or after the specified // integral-constant expression, which will be its byte offset from the beginning of the buffer. diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 4b22c6cd4..6e79f0c2e 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -4013,7 +4013,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali switch (language) { case EShLangVertex: if (publicType.basicType == EbtStruct) { - error(loc, "cannot be a structure or array", GetStorageQualifierString(qualifier.storage), ""); + error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), ""); return; } if (publicType.arraySizes) { @@ -4228,7 +4228,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons if (dstSpirvDecorate.decorates.find(decorateString.first) != dstSpirvDecorate.decorates.end()) error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate_string", "(decoration=%u)", decorateString.first); else - dstSpirvDecorate.decorates.insert(decorateString); + dstSpirvDecorate.decorateStrings.insert(decorateString); } } else { dst.spirvDecorate = src.spirvDecorate; @@ -9029,7 +9029,8 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ // "The specified offset must be a multiple // of the base alignment of the type of the block member it qualifies, or a compile-time error results." if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment)) - error(memberLoc, "must be a multiple of the member's alignment", "offset", ""); + error(memberLoc, "must be a multiple of the member's alignment", "offset", + "(layout offset = %d | member alignment = %d)", memberQualifier.layoutOffset, memberAlignment); // GLSL: "It is a compile-time error to specify an offset that is smaller than the offset of the previous // member in the block or that lies within the previous member of the block" diff --git a/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp b/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp index 6650f7d9e..49d8b8c77 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp @@ -168,7 +168,7 @@ void TQualifier::setSpirvDecorateId(int decoration, const TIntermAggregate* args TVector extraOperands; for (auto arg : args->getSequence()) { auto extraOperand = arg->getAsTyped(); - assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant()); + assert(extraOperand != nullptr); extraOperands.push_back(extraOperand); } spirvDecorate->decorateIds[decoration] = extraOperands; @@ -202,30 +202,29 @@ TString TQualifier::getSpirvDecorateQualifierString() const const auto appendStr = [&](const char* s) { qualifierString.append(s); }; const auto appendDecorate = [&](const TIntermTyped* constant) { - auto& constArray = constant->getAsConstantUnion() != nullptr ? constant->getAsConstantUnion()->getConstArray() - : constant->getAsSymbolNode()->getConstArray(); - if (constant->getBasicType() == EbtFloat) { - float value = static_cast(constArray[0].getDConst()); - appendFloat(value); + if (constant->getAsConstantUnion()) { + auto& constArray = constant->getAsConstantUnion()->getConstArray(); + if (constant->getBasicType() == EbtFloat) { + float value = static_cast(constArray[0].getDConst()); + appendFloat(value); + } else if (constant->getBasicType() == EbtInt) { + int value = constArray[0].getIConst(); + appendInt(value); + } else if (constant->getBasicType() == EbtUint) { + unsigned value = constArray[0].getUConst(); + appendUint(value); + } else if (constant->getBasicType() == EbtBool) { + bool value = constArray[0].getBConst(); + appendBool(value); + } else if (constant->getBasicType() == EbtString) { + const TString* value = constArray[0].getSConst(); + appendStr(value->c_str()); + } else + assert(0); + } else { + assert(constant->getAsSymbolNode()); + appendStr(constant->getAsSymbolNode()->getName().c_str()); } - else if (constant->getBasicType() == EbtInt) { - int value = constArray[0].getIConst(); - appendInt(value); - } - else if (constant->getBasicType() == EbtUint) { - unsigned value = constArray[0].getUConst(); - appendUint(value); - } - else if (constant->getBasicType() == EbtBool) { - bool value = constArray[0].getBConst(); - appendBool(value); - } - else if (constant->getBasicType() == EbtString) { - const TString* value = constArray[0].getSConst(); - appendStr(value->c_str()); - } - else - assert(0); }; for (auto& decorate : spirvDecorate->decorates) { diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 b/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 index 442529be5..914919f92 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 @@ -378,7 +378,7 @@ GLSLANG_WEB_EXCLUDE_ON %type spirv_storage_class_qualifier %type spirv_decorate_qualifier %type spirv_decorate_parameter_list spirv_decorate_parameter -%type spirv_decorate_id_parameter_list +%type spirv_decorate_id_parameter_list spirv_decorate_id_parameter %type spirv_decorate_string_parameter_list %type spirv_type_specifier %type spirv_type_parameter_list spirv_type_parameter @@ -4347,23 +4347,33 @@ spirv_decorate_parameter } spirv_decorate_id_parameter_list - : constant_expression { - if ($1->getBasicType() != EbtFloat && - $1->getBasicType() != EbtInt && - $1->getBasicType() != EbtUint && - $1->getBasicType() != EbtBool) - parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), ""); + : spirv_decorate_id_parameter { $$ = parseContext.intermediate.makeAggregate($1); } - | spirv_decorate_id_parameter_list COMMA constant_expression { - if ($3->getBasicType() != EbtFloat && - $3->getBasicType() != EbtInt && - $3->getBasicType() != EbtUint && - $3->getBasicType() != EbtBool) - parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), ""); + | spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter { $$ = parseContext.intermediate.growAggregate($1, $3); } +spirv_decorate_id_parameter + : variable_identifier { + if ($1->getAsConstantUnion() || $1->getAsSymbolNode()) + $$ = $1; + else + parseContext.error($1->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); + } + | FLOATCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); + } + | INTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } + | BOOLCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); + } + spirv_decorate_string_parameter_list : STRING_LITERAL { $$ = parseContext.intermediate.makeAggregate( diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/3rdparty/glslang/glslang/MachineIndependent/glslang.y index e0a5bcf15..1eec08ee6 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.y +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang.y @@ -378,7 +378,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %type spirv_storage_class_qualifier %type spirv_decorate_qualifier %type spirv_decorate_parameter_list spirv_decorate_parameter -%type spirv_decorate_id_parameter_list +%type spirv_decorate_id_parameter_list spirv_decorate_id_parameter %type spirv_decorate_string_parameter_list %type spirv_type_specifier %type spirv_type_parameter_list spirv_type_parameter @@ -4347,23 +4347,33 @@ spirv_decorate_parameter } spirv_decorate_id_parameter_list - : constant_expression { - if ($1->getBasicType() != EbtFloat && - $1->getBasicType() != EbtInt && - $1->getBasicType() != EbtUint && - $1->getBasicType() != EbtBool) - parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), ""); + : spirv_decorate_id_parameter { $$ = parseContext.intermediate.makeAggregate($1); } - | spirv_decorate_id_parameter_list COMMA constant_expression { - if ($3->getBasicType() != EbtFloat && - $3->getBasicType() != EbtInt && - $3->getBasicType() != EbtUint && - $3->getBasicType() != EbtBool) - parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), ""); + | spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter { $$ = parseContext.intermediate.growAggregate($1, $3); } +spirv_decorate_id_parameter + : variable_identifier { + if ($1->getAsConstantUnion() || $1->getAsSymbolNode()) + $$ = $1; + else + parseContext.error($1->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); + } + | FLOATCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); + } + | INTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINTCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } + | BOOLCONSTANT { + $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); + } + spirv_decorate_string_parameter_list : STRING_LITERAL { $$ = parseContext.intermediate.makeAggregate( diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp index 5c17c8cea..b79f699df 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -705,13 +705,14 @@ enum yysymbol_kind_t YYSYMBOL_spirv_decorate_parameter_list = 581, /* spirv_decorate_parameter_list */ YYSYMBOL_spirv_decorate_parameter = 582, /* spirv_decorate_parameter */ YYSYMBOL_spirv_decorate_id_parameter_list = 583, /* spirv_decorate_id_parameter_list */ - YYSYMBOL_spirv_decorate_string_parameter_list = 584, /* spirv_decorate_string_parameter_list */ - YYSYMBOL_spirv_type_specifier = 585, /* spirv_type_specifier */ - YYSYMBOL_spirv_type_parameter_list = 586, /* spirv_type_parameter_list */ - YYSYMBOL_spirv_type_parameter = 587, /* spirv_type_parameter */ - YYSYMBOL_spirv_instruction_qualifier = 588, /* spirv_instruction_qualifier */ - YYSYMBOL_spirv_instruction_qualifier_list = 589, /* spirv_instruction_qualifier_list */ - YYSYMBOL_spirv_instruction_qualifier_id = 590 /* spirv_instruction_qualifier_id */ + YYSYMBOL_spirv_decorate_id_parameter = 584, /* spirv_decorate_id_parameter */ + YYSYMBOL_spirv_decorate_string_parameter_list = 585, /* spirv_decorate_string_parameter_list */ + YYSYMBOL_spirv_type_specifier = 586, /* spirv_type_specifier */ + YYSYMBOL_spirv_type_parameter_list = 587, /* spirv_type_parameter_list */ + YYSYMBOL_spirv_type_parameter = 588, /* spirv_type_parameter */ + YYSYMBOL_spirv_instruction_qualifier = 589, /* spirv_instruction_qualifier */ + YYSYMBOL_spirv_instruction_qualifier_list = 590, /* spirv_instruction_qualifier_list */ + YYSYMBOL_spirv_instruction_qualifier_id = 591 /* spirv_instruction_qualifier_id */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -733,7 +734,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; extern int yylex(YYSTYPE*, TParseContext&); -#line 737 "MachineIndependent/glslang_tab.cpp" +#line 738 "MachineIndependent/glslang_tab.cpp" #ifdef short @@ -1039,16 +1040,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 447 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 12557 +#define YYLAST 12562 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 460 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 131 +#define YYNNTS 132 /* YYNRULES -- Number of rules. */ -#define YYNRULES 688 +#define YYNRULES 693 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 934 +#define YYNSTATES 939 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 714 @@ -1210,8 +1211,9 @@ static const yytype_int16 yyrline[] = 4198, 4203, 4207, 4212, 4216, 4221, 4225, 4232, 4235, 4240, 4243, 4246, 4249, 4252, 4257, 4266, 4277, 4282, 4290, 4294, 4299, 4303, 4308, 4312, 4317, 4321, 4328, 4331, 4336, 4339, - 4342, 4345, 4350, 4358, 4368, 4372, 4377, 4381, 4386, 4390, - 4397, 4400, 4405, 4410, 4413, 4419, 4422, 4427, 4430 + 4342, 4345, 4350, 4353, 4358, 4364, 4367, 4370, 4373, 4378, + 4382, 4387, 4391, 4396, 4400, 4407, 4410, 4415, 4420, 4423, + 4429, 4432, 4437, 4440 }; #endif @@ -1372,7 +1374,7 @@ static const char *const yytname[] = "spirv_execution_mode_id_parameter_list", "spirv_storage_class_qualifier", "spirv_decorate_qualifier", "spirv_decorate_parameter_list", "spirv_decorate_parameter", - "spirv_decorate_id_parameter_list", + "spirv_decorate_id_parameter_list", "spirv_decorate_id_parameter", "spirv_decorate_string_parameter_list", "spirv_type_specifier", "spirv_type_parameter_list", "spirv_type_parameter", "spirv_instruction_qualifier", "spirv_instruction_qualifier_list", @@ -1440,7 +1442,7 @@ static const yytype_int16 yytoknum[] = }; #endif -#define YYPACT_NINF (-868) +#define YYPACT_NINF (-867) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) @@ -1454,100 +1456,100 @@ static const yytype_int16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 4593, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -296, -250, -233, - -225, -220, -203, -180, -178, -868, -868, -125, -868, -868, - -868, -868, -868, -60, -868, -868, -868, -868, -868, -329, - -868, -868, -868, -868, -868, -868, -156, -116, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -331, -313, -109, -94, 7792, -309, -868, - -106, -868, -868, -868, -868, 5507, -868, -868, -868, -868, - -98, -868, -868, 937, -868, -868, 7792, -124, -868, -868, - -868, 5964, -74, -288, -234, -154, -138, -137, -74, -127, - -68, 12163, -868, -32, -345, -61, -868, -307, -868, -17, - -13, 7792, -868, -868, -868, 7792, -57, -38, -868, -262, - -868, -223, -868, -868, 10858, -3, -868, -868, -868, 1, - -36, 7792, -868, -9, -6, -2, -868, -268, -868, -239, - -5, 3, 4, 5, -231, 6, 10, 12, 13, 14, - 17, -219, 8, 18, 16, -291, -868, -4, 7792, -868, - 19, -868, -216, -868, -868, -184, 9118, -868, -302, 1394, - -868, -868, -868, -868, -868, -3, -260, -868, 9553, -258, - -868, -29, -868, -218, 10858, 10858, -868, 10858, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -245, -868, -868, - -868, 25, -169, 11293, 27, -868, 10858, -868, -868, -308, - 29, -13, 32, -868, -316, -74, -868, -28, -868, -303, - 36, -126, 10858, -122, -868, -144, -121, 10858, -115, 15, - -114, -74, -868, 11728, -868, -108, 10858, 31, -68, -868, - 7792, -18, 6421, -868, 7792, 10858, -868, -345, -868, 20, - -868, -868, -46, -196, -1, -305, -264, 21, 26, 22, - 53, 52, -314, 38, 9988, -868, 43, -868, -868, 49, - 41, 48, -868, 66, 68, 62, 10423, 73, 10858, 67, - 64, 69, 72, 75, -185, -868, -868, -78, -868, -313, - 76, 77, -868, -868, -868, -868, -868, 1851, -868, -868, - -868, -868, -868, -868, -868, -868, -868, 5050, 29, 9553, - -249, 8248, -868, -868, 9553, 7792, -868, 42, -868, -868, - -868, -168, -868, -868, 10858, 47, -868, -868, 10858, 85, - -868, -868, -868, 10858, -868, -868, -868, -311, -868, -868, - -167, 78, -868, -868, -868, -868, -868, -868, -165, -868, - -160, -868, -868, -158, 81, -868, -868, -868, -868, -155, - -868, -153, -868, -150, 83, -868, -148, 84, -146, 78, - -868, -145, -868, 91, 93, -868, -868, -18, -3, -51, - -868, -868, -868, 6878, -868, -868, -868, 10858, 10858, 10858, - 10858, 10858, 10858, 10858, 10858, 10858, 10858, 10858, 10858, 10858, - 10858, 10858, 10858, 10858, 10858, 10858, -868, -868, -868, 94, - -868, 2308, -868, -868, -868, 2308, -868, 10858, -868, -868, - -49, 10858, -25, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, 10858, - 10858, -868, -868, -868, -868, -868, -868, -868, 9553, -868, - -868, -71, -868, 7335, -868, -868, 95, 89, -868, -868, - -868, -868, -868, -244, -213, -868, -306, -868, -303, -868, - -303, -868, 10858, 10858, -868, -144, -868, -144, -868, 10858, - 10858, -868, 100, 15, -868, 11728, -868, 10858, -868, -868, - -47, 29, -18, -868, -868, -868, -868, -868, -46, -46, - -196, -196, -1, -1, -1, -1, -305, -305, -264, 21, - 26, 22, 53, 52, 10858, -868, 2308, 4136, 57, 3679, - -143, -868, -141, -868, -868, -868, -868, -868, 8683, -868, - -868, -868, 103, -868, 70, -868, -136, -868, -134, -868, - -133, -868, -132, -868, -131, -129, -868, -868, -868, -23, - 99, 89, 71, 104, 106, -868, -868, 4136, 107, -868, - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - 10858, -868, 105, 2765, 10858, -868, 98, 111, 65, 112, - 3222, -868, 113, -868, 9553, -868, -868, -868, -120, 10858, - 2765, 107, -868, -868, 2308, -868, 108, 89, -868, -868, - 2308, 110, -868, -868 + 4598, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -289, -262, -241, + -203, -191, -181, -98, -73, -867, -867, -178, -867, -867, + -867, -867, -867, -60, -867, -867, -867, -867, -867, -312, + -867, -867, -867, -867, -867, -867, -62, -28, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -330, -314, -225, -109, 7797, -260, -867, + -207, -867, -867, -867, -867, 5512, -867, -867, -867, -867, + -173, -867, -867, 942, -867, -867, 7797, -30, -867, -867, + -867, 5969, -52, -222, -162, -148, -124, -123, -52, -122, + -48, 12168, -867, -14, -332, -45, -867, -313, -867, -12, + -7, 7797, -867, -867, -867, 7797, -39, -38, -867, -299, + -867, -259, -867, -867, 10863, -2, -867, -867, -867, 1, + -35, 7797, -867, -6, -4, -1, -867, -302, -867, -261, + 3, 4, 6, 7, -249, 8, 11, 12, 15, 16, + 17, -229, 19, 18, 10, -171, -867, -3, 7797, -867, + 21, -867, -226, -867, -867, -221, 9123, -867, -271, 1399, + -867, -867, -867, -867, -867, -2, -300, -867, 9558, -266, + -867, -33, -867, -233, 10863, 10863, -867, 10863, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -246, -867, -867, + -867, 20, -218, 11298, 26, -867, 10863, -867, -867, -319, + 25, -7, 31, -867, -316, -52, -867, -27, -867, -320, + 30, -118, 10863, -117, -867, -138, -116, -143, -112, 34, + -102, -52, -867, 11733, -867, -101, 10863, 5, -48, -867, + 7797, -20, 6426, -867, 7797, 10863, -867, -332, -867, 22, + -867, -867, -47, -41, -37, -298, -22, 24, 27, 29, + 48, 47, -305, 35, 9993, -867, 32, -867, -867, 40, + 37, 53, -867, 42, 50, 57, 10428, 68, 10863, 49, + 62, 65, 66, 67, -227, -867, -867, -176, -867, -314, + 78, 79, -867, -867, -867, -867, -867, 1856, -867, -867, + -867, -867, -867, -867, -867, -867, -867, 5055, 25, 9558, + -265, 8253, -867, -867, 9558, 7797, -867, 46, -867, -867, + -867, -216, -867, -867, 10863, 51, -867, -867, 10863, 82, + -867, -867, -867, 10863, -867, -867, -867, -306, -867, -867, + -213, 76, -867, -867, -867, -867, -867, -867, -202, -867, + -201, -867, -867, -199, 81, -867, -867, -867, -867, -194, + -867, -179, -867, -867, -867, -867, -867, -174, -867, 83, + -867, -155, 84, -154, 76, -867, -153, -867, 85, 91, + -867, -867, -20, -2, -129, -867, -867, -867, 6883, -867, + -867, -867, 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, + 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, + 10863, -867, -867, -867, 92, -867, 2313, -867, -867, -867, + 2313, -867, 10863, -867, -867, -128, 10863, -31, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, 10863, 10863, -867, -867, -867, -867, + -867, -867, -867, 9558, -867, -867, -215, -867, 7340, -867, + -867, 93, 87, -867, -867, -867, -867, -867, -131, -130, + -867, -304, -867, -320, -867, -320, -867, 10863, 10863, -867, + -138, -867, -138, -867, -143, -143, -867, 98, 34, -867, + 11733, -867, 10863, -867, -867, -74, 25, -20, -867, -867, + -867, -867, -867, -47, -47, -41, -41, -37, -37, -37, + -37, -298, -298, -22, 24, 27, 29, 48, 47, 10863, + -867, 2313, 4141, 54, 3684, -152, -867, -151, -867, -867, + -867, -867, -867, 8688, -867, -867, -867, 100, -867, 69, + -867, -144, -867, -142, -867, -141, -867, -140, -867, -139, + -137, -867, -867, -867, -29, 99, 87, 70, 102, 105, + -867, -867, 4141, 103, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, 10863, -867, 101, 2770, 10863, + -867, 104, 107, 63, 108, 3227, -867, 109, -867, 9558, + -867, -867, -867, -132, 10863, 2770, 103, -867, -867, 2313, + -867, 106, 87, -867, -867, 2313, 112, -867, -867 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1600,7 +1602,7 @@ static const yytype_int16 yydefact[] = 0, 0, 540, 0, 0, 0, 99, 0, 94, 0, 109, 0, 121, 115, 123, 0, 124, 0, 97, 131, 102, 0, 156, 136, 0, 208, 214, 1, 622, 0, - 0, 0, 96, 0, 0, 0, 633, 0, 685, 0, + 0, 0, 96, 0, 0, 0, 633, 0, 690, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 631, 0, 629, 0, 0, 538, 151, 153, 0, 149, 206, 0, 0, 100, 0, 0, @@ -1609,9 +1611,9 @@ static const yytype_int16 yydefact[] = 44, 41, 5, 6, 7, 8, 2, 16, 14, 15, 17, 10, 11, 12, 13, 3, 18, 37, 20, 25, 26, 0, 0, 30, 0, 217, 0, 36, 34, 0, - 209, 111, 0, 95, 0, 0, 683, 0, 641, 0, + 209, 111, 0, 95, 0, 0, 688, 0, 641, 0, 0, 0, 0, 0, 658, 0, 0, 0, 0, 0, - 0, 0, 678, 0, 656, 0, 0, 0, 0, 98, + 0, 0, 683, 0, 656, 0, 0, 0, 0, 98, 0, 0, 0, 542, 0, 0, 148, 0, 203, 0, 210, 45, 49, 52, 55, 60, 63, 65, 67, 69, 71, 73, 75, 0, 0, 101, 569, 578, 582, 0, @@ -1621,72 +1623,72 @@ static const yytype_int16 yydefact[] = 584, 562, 591, 563, 564, 599, 565, 0, 119, 0, 127, 0, 550, 134, 0, 0, 107, 0, 104, 38, 39, 0, 22, 23, 0, 0, 28, 27, 0, 219, - 31, 33, 40, 0, 216, 112, 687, 0, 688, 634, - 0, 0, 686, 653, 649, 650, 651, 652, 0, 647, + 31, 33, 40, 0, 216, 112, 692, 0, 693, 634, + 0, 0, 691, 653, 649, 650, 651, 652, 0, 647, 0, 93, 654, 0, 0, 668, 669, 670, 671, 0, - 666, 0, 672, 0, 0, 674, 0, 0, 0, 2, - 682, 0, 680, 0, 0, 628, 630, 0, 548, 0, - 546, 541, 543, 0, 152, 150, 207, 0, 0, 0, + 666, 0, 675, 676, 677, 678, 674, 0, 672, 0, + 679, 0, 0, 0, 2, 687, 0, 685, 0, 0, + 628, 630, 0, 548, 0, 546, 541, 543, 0, 152, + 150, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 76, 211, 212, 0, - 568, 0, 601, 614, 613, 0, 605, 0, 617, 615, - 0, 0, 0, 598, 618, 619, 620, 567, 81, 82, - 84, 83, 86, 87, 88, 89, 90, 85, 80, 0, - 0, 583, 579, 581, 585, 592, 600, 129, 0, 553, - 554, 0, 133, 0, 108, 4, 0, 24, 21, 32, - 218, 637, 639, 0, 0, 684, 0, 643, 0, 642, - 0, 645, 0, 0, 660, 0, 659, 0, 662, 0, - 0, 664, 0, 0, 679, 0, 676, 0, 657, 632, - 0, 549, 0, 544, 539, 46, 47, 48, 51, 50, - 53, 54, 58, 59, 56, 57, 61, 62, 64, 66, - 68, 70, 72, 74, 0, 213, 570, 0, 0, 0, - 0, 616, 0, 597, 79, 92, 128, 551, 0, 106, - 19, 635, 0, 636, 0, 648, 0, 655, 0, 667, - 0, 673, 0, 675, 0, 0, 681, 545, 547, 0, - 0, 589, 0, 0, 0, 608, 607, 610, 576, 593, - 552, 555, 638, 640, 644, 646, 661, 663, 665, 677, - 0, 571, 0, 0, 0, 609, 0, 0, 588, 0, - 0, 586, 0, 77, 0, 573, 602, 572, 0, 611, - 0, 576, 575, 577, 595, 590, 0, 612, 606, 587, - 596, 0, 604, 594 + 0, 76, 211, 212, 0, 568, 0, 601, 614, 613, + 0, 605, 0, 617, 615, 0, 0, 0, 598, 618, + 619, 620, 567, 81, 82, 84, 83, 86, 87, 88, + 89, 90, 85, 80, 0, 0, 583, 579, 581, 585, + 592, 600, 129, 0, 553, 554, 0, 133, 0, 108, + 4, 0, 24, 21, 32, 218, 637, 639, 0, 0, + 689, 0, 643, 0, 642, 0, 645, 0, 0, 660, + 0, 659, 0, 662, 0, 0, 664, 0, 0, 684, + 0, 681, 0, 657, 632, 0, 549, 0, 544, 539, + 46, 47, 48, 51, 50, 53, 54, 58, 59, 56, + 57, 61, 62, 64, 66, 68, 70, 72, 74, 0, + 213, 570, 0, 0, 0, 0, 616, 0, 597, 79, + 92, 128, 551, 0, 106, 19, 635, 0, 636, 0, + 648, 0, 655, 0, 667, 0, 673, 0, 680, 0, + 0, 686, 545, 547, 0, 0, 589, 0, 0, 0, + 608, 607, 610, 576, 593, 552, 555, 638, 640, 644, + 646, 661, 663, 665, 682, 0, 571, 0, 0, 0, + 609, 0, 0, 588, 0, 0, 586, 0, 77, 0, + 573, 602, 572, 0, 611, 0, 576, 575, 577, 595, + 590, 0, 612, 606, 587, 596, 0, 604, 594 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, - -868, -868, -429, -868, -378, -377, -471, -381, -259, -261, - -257, -256, -255, -263, -868, -478, -868, -492, -868, -503, - -535, 11, -868, -868, -868, 7, -392, -868, -868, 39, - 45, 46, -868, -868, -401, -868, -868, -868, -868, -104, - -868, -386, -374, -868, 9, -868, 0, -426, -868, -868, - -868, -868, 147, -868, -868, -868, -551, -569, -224, -340, - -606, -868, -365, -615, -867, -868, -424, -868, -868, -432, - -431, -868, -868, 63, -723, -358, -868, -142, -868, -394, - -868, -140, -868, -868, -868, -868, -135, -868, -868, -868, - -868, -868, -868, -868, -868, 96, -868, -868, 2, -868, - -72, -237, -436, -868, -868, -868, -300, -304, -299, -868, - -868, -301, -298, -297, -310, -868, -295, -312, -868, -391, - -531 + -867, -538, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -428, -867, -392, -391, -474, -389, -264, -267, + -263, -268, -258, -257, -867, -482, -867, -495, -867, -502, + -534, 13, -867, -867, -867, 14, -385, -867, -867, 38, + 41, 44, -867, -867, -400, -867, -867, -867, -867, -100, + -867, -386, -368, -867, 9, -867, 0, -422, -867, -867, + -867, -867, 142, -867, -867, -867, -545, -550, -236, -347, + -629, -867, -372, -620, -866, -867, -430, -867, -867, -440, + -438, -867, -867, 61, -720, -363, -867, -136, -867, -406, + -867, -135, -867, -867, -867, -867, -134, -867, -867, -867, + -867, -867, -867, -867, -867, 90, -867, -867, 2, -867, + -72, -224, -384, -867, -867, -867, -311, -308, -309, -867, + -867, -315, -310, -307, -303, -301, -867, -297, -318, -867, + -390, -539 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 525, 526, 527, 786, 528, 529, 530, 531, 532, + -1, 525, 526, 527, 791, 528, 529, 530, 531, 532, 533, 534, 614, 536, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 615, 844, 616, 769, 617, - 700, 618, 383, 645, 503, 619, 385, 386, 387, 432, + 588, 589, 590, 591, 592, 615, 849, 616, 774, 617, + 705, 618, 383, 645, 503, 619, 385, 386, 387, 432, 433, 434, 388, 389, 390, 391, 392, 393, 482, 483, 394, 395, 396, 397, 537, 485, 538, 488, 445, 446, - 539, 400, 401, 402, 574, 478, 572, 573, 709, 710, - 643, 781, 622, 623, 624, 625, 626, 741, 880, 916, - 908, 909, 910, 917, 627, 628, 629, 630, 911, 883, - 631, 632, 912, 931, 633, 634, 635, 847, 745, 849, - 887, 906, 907, 636, 403, 404, 405, 429, 637, 475, - 476, 455, 456, 793, 794, 407, 678, 679, 683, 408, - 409, 689, 690, 693, 696, 410, 701, 702, 411, 457, - 458 + 539, 400, 401, 402, 574, 478, 572, 573, 714, 715, + 643, 786, 622, 623, 624, 625, 626, 746, 885, 921, + 913, 914, 915, 922, 627, 628, 629, 630, 916, 888, + 631, 632, 917, 936, 633, 634, 635, 852, 750, 854, + 892, 911, 912, 636, 403, 404, 405, 429, 637, 475, + 476, 455, 456, 798, 799, 407, 678, 679, 683, 408, + 409, 689, 690, 697, 698, 701, 410, 706, 707, 411, + 457, 458 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1694,64 +1696,64 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 399, 435, 406, 712, 651, 450, 642, 384, 593, 398, - 450, 382, 773, 499, 449, 535, 672, 682, 846, 540, - 451, 442, 692, 713, 735, 451, 422, 471, 724, 725, - 426, 704, 672, 777, 666, 780, 915, 667, 782, 791, - 714, 660, 480, 923, 666, 435, 486, 673, 428, 437, - 663, 594, 438, 915, 487, 412, 427, 581, 423, 595, - 736, 442, 664, 567, 726, 727, 481, 568, 668, 638, - 640, 728, 729, 792, 681, 649, 650, 442, 668, 681, - 674, 675, 676, 677, 546, 681, 652, 653, 681, 497, - 547, 486, 570, 486, 783, 594, 459, 681, 498, 460, - 639, 413, 644, 750, 594, 752, -35, 662, 654, 669, - 861, 778, 655, 548, 862, 669, 739, 669, 414, 549, - 669, 554, 669, 581, 669, 669, 415, 555, 581, 669, - 848, 416, 500, 562, 581, 501, 576, 581, 502, 563, - 647, 863, 577, 648, 712, 864, 581, 642, 417, 642, - 462, 787, 642, 460, 670, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 581, 789, 720, 578, 721, - 698, 418, 856, 419, 579, 768, 461, 463, 465, 467, - 469, 470, 473, 657, 785, 795, 570, 797, 570, 658, - 770, 547, 799, 798, 801, 424, 442, 804, 800, 806, - 802, 930, 808, 805, 811, 807, 814, 816, 809, 888, - 812, 889, 815, 817, 712, 770, 894, 770, 895, 896, - 897, 898, 798, 899, 802, 805, 809, 812, 420, 817, - 464, 773, 926, 460, 790, 425, 450, 452, 770, 685, - 686, 687, 688, 430, 850, 449, 466, 468, 852, 460, - 460, 451, 891, 832, 833, 834, 835, 472, 680, 570, - 460, 460, 684, 691, 431, 460, 460, 867, 682, 694, - 697, 444, 460, 460, 871, 692, 703, 854, 855, 460, - 770, 439, 821, 771, 672, 857, 642, 858, 825, 826, - 827, 581, 581, 581, 581, 581, 581, 581, 581, 581, - 581, 581, 581, 581, 581, 581, 581, 822, 925, 770, - 823, 822, 851, 454, 877, 773, 330, 331, 332, 474, - 717, 718, 719, 479, 681, 681, 484, 570, 722, 723, - 495, 681, 681, 770, 853, 770, 900, 681, 489, 681, - 327, 879, 828, 829, 881, 830, 831, 836, 837, 496, - 486, 542, 543, 541, 544, 550, 545, 569, 646, 671, - 564, 551, 552, 553, 556, 695, 642, 566, 557, 708, - 558, 559, 560, 581, 581, 561, 565, 656, 661, 575, - 581, 581, 594, 497, 881, 705, 581, 436, 581, 667, - 733, 734, 737, 732, 730, 443, 398, 570, 731, 740, - 742, 918, 743, 399, 398, 406, 399, 716, 913, 744, - 384, 399, 398, 406, 382, 398, 927, 746, 453, 747, - 398, 477, 642, 748, 751, 754, 753, -36, -34, 784, - 755, 436, 491, 756, 788, 436, 757, -29, 796, 803, - 398, 810, 813, 818, 398, 819, 882, 770, 845, 860, - 873, 443, 884, 892, 893, 901, 903, 904, 902, 919, - 398, 451, -574, 920, 921, 914, 933, 596, 924, 932, - 839, 838, 843, 715, 493, 840, 492, 841, 571, 842, - 421, 494, 878, 820, 885, 922, 882, 398, 928, 621, - 929, 886, 490, 905, 865, 774, 706, 775, 620, 448, - 866, 451, 776, 874, 868, 876, 870, 869, 0, 0, - 0, 0, 0, 872, 0, 0, 0, 0, 0, 0, - 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 399, 435, 406, 642, 593, 651, 450, 778, 672, 398, + 782, 450, 785, 382, 384, 787, 535, 499, 682, 696, + 451, 449, 717, 540, 672, 451, 851, 442, 471, 718, + 673, 426, 709, 740, 666, 729, 730, 667, 660, 663, + 486, 719, 920, 422, 796, 435, 666, 428, 487, 928, + 546, 664, 497, 486, 486, 480, 547, 427, 581, 920, + 639, 498, 412, 674, 675, 676, 677, 442, 668, 741, + 681, 731, 732, 638, 640, 423, 649, 650, 797, 481, + 668, 681, 594, 442, 681, 652, 653, 594, 594, 413, + 595, 548, 570, 681, 644, 783, 500, 549, 437, 501, + 788, 438, 502, 554, 755, -35, 757, 654, 662, 555, + 414, 655, 744, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 562, 581, 647, 576, 430, 648, 563, + 853, 578, 577, 773, 657, 581, 790, 579, 581, 800, + 658, 862, 775, 863, 642, 547, 642, 581, 415, 642, + 802, 804, 792, 806, 861, 670, 803, 805, 809, 807, + 416, 669, 459, 794, 810, 460, 581, 669, 717, 669, + 417, 703, 669, 811, 669, 420, 669, 669, 813, 812, + 439, 669, 775, 567, 814, 776, 570, 568, 570, 461, + 463, 465, 467, 469, 470, 473, 444, 816, 819, 821, + 893, 894, 442, 817, 820, 822, 775, 775, 899, 935, + 900, 901, 902, 903, 803, 904, 807, 810, 814, 817, + 931, 822, 462, 866, 868, 460, 775, 867, 869, 827, + 775, 778, 828, 856, 896, 795, 464, 450, 717, 460, + 692, 693, 694, 695, 516, 685, 686, 687, 688, 431, + 855, 451, 449, 418, 857, 837, 838, 839, 840, 570, + 466, 468, 472, 460, 460, 460, 680, 684, 691, 460, + 460, 460, 699, 872, 682, 460, 696, 696, 419, 859, + 860, 672, 702, 708, 827, 460, 460, 882, 642, 424, + 930, 826, 727, 728, 830, 831, 832, 581, 581, 581, + 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, + 581, 581, 581, 733, 734, 778, 330, 331, 332, 722, + 723, 724, 725, 425, 726, 681, 681, 775, 858, 775, + 905, 452, 570, 833, 834, 454, 835, 836, 681, 474, + 681, 479, 484, 489, 841, 842, 327, 884, 495, 496, + 886, 486, 542, 541, 646, 543, 544, 545, 569, 710, + 671, 566, 551, 550, 552, 553, 556, 713, 642, 557, + 558, 564, 656, 559, 560, 561, 565, 661, 594, 581, + 581, 575, 497, 667, 700, 738, 739, 436, 745, 742, + 886, 747, 581, 751, 581, 443, 398, 735, 748, 736, + 737, 752, 570, 399, 398, 406, 399, 923, 758, 721, + 918, 399, 398, 406, 749, 398, 382, 384, 753, 756, + 398, 477, 932, 759, 642, 453, 760, 761, 762, -36, + -34, 436, 491, 789, -29, 436, 801, 823, 793, 808, + 398, 815, 818, 824, 398, 775, 850, 865, 878, 889, + 897, 443, 887, 898, 908, 906, 909, 907, -574, 925, + 398, 919, 926, 596, 929, 924, 451, 937, 938, 844, + 846, 843, 492, 493, 845, 421, 825, 720, 571, 494, + 883, 847, 890, 848, 927, 933, 910, 398, 934, 621, + 490, 891, 887, 448, 871, 870, 711, 875, 620, 873, + 874, 779, 780, 781, 881, 0, 451, 0, 877, 0, + 0, 876, 0, 0, 0, 0, 0, 879, 0, 0, + 0, 0, 0, 880, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 707, 0, 571, 0, 571, 0, 0, 0, 0, 398, + 712, 0, 571, 0, 571, 0, 0, 0, 0, 398, 0, 398, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1765,258 +1767,30 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, - 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, + 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 621, 0, 0, 0, 621, 0, 0, 0, 0, - 620, 0, 0, 0, 620, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 621, 0, 0, 0, + 621, 0, 0, 0, 0, 620, 0, 0, 0, 620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, - 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, + 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 621, 621, 0, 621, - 0, 406, 0, 0, 0, 620, 620, 0, 620, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 621, 621, 0, 621, 0, 406, 0, 0, 0, + 620, 620, 0, 620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 621, 0, 0, - 0, 0, 0, 0, 0, 0, 620, 0, 0, 0, - 0, 0, 0, 621, 0, 0, 0, 0, 0, 0, - 621, 0, 620, 0, 0, 0, 0, 0, 0, 620, - 621, 0, 0, 0, 621, 0, 0, 0, 0, 620, - 621, 0, 0, 620, 0, 0, 0, 447, 0, 620, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 327, 0, 0, 0, 0, 0, 0, 0, 328, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 329, 330, 331, 332, 333, 0, 0, 0, - 0, 0, 0, 0, 0, 334, 335, 336, 337, 338, - 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, - 344, 345, 346, 0, 0, 0, 0, 0, 0, 0, - 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 0, 0, 504, 505, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 506, 507, 0, 327, 0, 596, - 597, 0, 0, 0, 0, 598, 508, 509, 510, 511, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, - 330, 331, 332, 333, 0, 0, 0, 512, 513, 514, - 515, 516, 334, 335, 336, 337, 338, 339, 340, 599, - 600, 601, 602, 0, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 341, 342, 343, 344, 345, 346, - 517, 518, 519, 520, 521, 522, 523, 524, 347, 613, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 506, 507, 0, 327, 0, 596, 772, 0, 0, - 0, 0, 598, 508, 509, 510, 511, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 329, 330, 331, 332, - 333, 0, 0, 0, 512, 513, 514, 515, 516, 334, - 335, 336, 337, 338, 339, 340, 599, 600, 601, 602, - 0, 603, 604, 605, 606, 607, 608, 609, 610, 611, - 612, 341, 342, 343, 344, 345, 346, 517, 518, 519, - 520, 521, 522, 523, 524, 347, 613, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 327, 0, 596, 0, 0, 0, 0, 0, 598, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 329, 330, 331, 332, 333, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 335, 336, 337, - 338, 339, 340, 599, 600, 601, 602, 0, 603, 604, - 605, 606, 607, 608, 609, 610, 611, 612, 341, 342, - 343, 344, 345, 346, 517, 518, 519, 520, 521, 522, - 523, 524, 347, 613, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 0, 0, 504, 505, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 506, 507, 0, 327, 0, - 489, 0, 0, 0, 0, 0, 598, 508, 509, 510, - 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 329, 330, 331, 332, 333, 0, 0, 0, 512, 513, - 514, 515, 516, 334, 335, 336, 337, 338, 339, 340, - 599, 600, 601, 602, 0, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 341, 342, 343, 344, 345, - 346, 517, 518, 519, 520, 521, 522, 523, 524, 347, - 613, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 380, 381, 1, 2, 3, 4, 5, + 0, 0, 621, 0, 0, 0, 0, 0, 0, 0, + 0, 620, 0, 0, 0, 0, 0, 0, 621, 0, + 0, 0, 0, 0, 0, 621, 0, 620, 0, 0, + 0, 0, 0, 0, 620, 621, 0, 0, 0, 621, + 0, 0, 0, 0, 620, 621, 0, 0, 620, 0, + 0, 0, 447, 0, 620, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, @@ -2049,16 +1823,16 @@ static const yytype_int16 yytable[] = 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 0, 0, 504, 505, 0, 0, 0, 0, 0, + 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 506, 507, 0, 327, 0, 0, 0, 0, - 0, 0, 0, 598, 508, 509, 510, 511, 0, 0, + 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, + 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, - 332, 333, 0, 0, 0, 512, 513, 514, 515, 516, - 334, 335, 336, 337, 338, 339, 340, 599, 600, 601, - 602, 0, 603, 604, 605, 606, 607, 608, 609, 610, - 611, 612, 341, 342, 343, 344, 345, 346, 517, 518, - 519, 520, 521, 522, 523, 524, 347, 613, 348, 349, + 332, 333, 0, 0, 0, 0, 0, 0, 0, 0, + 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 341, 342, 343, 344, 345, 346, 0, 0, + 0, 0, 0, 0, 0, 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, @@ -2097,14 +1871,14 @@ static const yytype_int16 yytable[] = 319, 320, 321, 322, 323, 324, 325, 326, 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 506, - 507, 0, 327, 0, 0, 0, 0, 0, 0, 0, + 507, 0, 327, 0, 596, 597, 0, 0, 0, 0, 598, 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, 332, 333, 0, 0, 0, 512, 513, 514, 515, 516, 334, 335, 336, - 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, + 337, 338, 339, 340, 599, 600, 601, 602, 0, 603, + 604, 605, 606, 607, 608, 609, 610, 611, 612, 341, 342, 343, 344, 345, 346, 517, 518, 519, 520, 521, - 522, 523, 524, 347, 0, 348, 349, 350, 351, 352, + 522, 523, 524, 347, 613, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 1, @@ -2139,18 +1913,18 @@ static const yytype_int16 yytable[] = 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 0, 0, 0, 320, 321, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 506, 507, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 508, 509, + 0, 0, 0, 0, 0, 0, 506, 507, 0, 327, + 0, 596, 777, 0, 0, 0, 0, 598, 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 329, 330, 331, 332, 0, 0, 0, 0, 512, + 0, 329, 330, 331, 332, 333, 0, 0, 0, 512, 513, 514, 515, 516, 334, 335, 336, 337, 338, 339, - 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 341, 342, 343, 344, + 340, 599, 600, 601, 602, 0, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 341, 342, 343, 344, 345, 346, 517, 518, 519, 520, 521, 522, 523, 524, - 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, + 347, 613, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 1, 2, 3, 4, @@ -2186,16 +1960,16 @@ static const yytype_int16 yytable[] = 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, + 325, 326, 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, - 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 327, 0, 596, 0, + 0, 0, 0, 0, 598, 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, - 331, 332, 333, 0, 0, 0, 0, 0, 0, 0, - 0, 334, 335, 336, 337, 338, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 341, 342, 343, 344, 345, 346, 0, - 0, 0, 0, 0, 0, 0, 0, 347, 0, 348, + 331, 332, 333, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 335, 336, 337, 338, 339, 340, 599, 600, + 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, + 610, 611, 612, 341, 342, 343, 344, 345, 346, 517, + 518, 519, 520, 521, 522, 523, 524, 347, 613, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, @@ -2230,18 +2004,18 @@ static const yytype_int16 yytable[] = 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 0, - 0, 0, 320, 321, 322, 323, 324, 325, 326, 0, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 0, + 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 329, 330, 331, 332, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 334, 335, - 336, 337, 338, 339, 340, 599, 0, 0, 602, 0, - 603, 604, 0, 0, 607, 0, 0, 0, 0, 0, - 341, 342, 343, 344, 345, 346, 0, 0, 0, 0, - 0, 0, 0, 0, 347, 0, 348, 349, 350, 351, + 506, 507, 0, 327, 0, 489, 0, 0, 0, 0, + 0, 598, 508, 509, 510, 511, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 329, 330, 331, 332, 333, + 0, 0, 0, 512, 513, 514, 515, 516, 334, 335, + 336, 337, 338, 339, 340, 599, 600, 601, 602, 0, + 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 341, 342, 343, 344, 345, 346, 517, 518, 519, 520, + 521, 522, 523, 524, 347, 613, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, @@ -2276,18 +2050,18 @@ static const yytype_int16 yytable[] = 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 0, 0, 0, 320, - 321, 322, 323, 324, 325, 326, 0, 0, 0, 0, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 440, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 329, 330, 331, 332, 0, 0, 0, 0, - 0, 0, 0, 0, 441, 334, 335, 336, 337, 338, - 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, - 344, 345, 346, 0, 0, 0, 0, 0, 0, 0, - 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, + 0, 0, 0, 0, 0, 0, 0, 506, 507, 0, + 327, 0, 0, 0, 0, 0, 0, 0, 598, 508, + 509, 510, 511, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 329, 330, 331, 332, 333, 0, 0, 0, + 512, 513, 514, 515, 516, 334, 335, 336, 337, 338, + 339, 340, 599, 600, 601, 602, 0, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 341, 342, 343, + 344, 345, 346, 517, 518, 519, 520, 521, 522, 523, + 524, 347, 613, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 1, 2, 3, @@ -2322,17 +2096,17 @@ static const yytype_int16 yytable[] = 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 0, 0, 0, 320, 321, 322, 323, - 324, 325, 326, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 506, 507, 0, 327, 0, 0, + 0, 0, 0, 0, 0, 598, 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, - 330, 331, 332, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 334, 335, 336, 337, 338, 339, 340, 0, + 330, 331, 332, 333, 0, 0, 0, 512, 513, 514, + 515, 516, 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, 344, 345, 346, - 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, + 517, 518, 519, 520, 521, 522, 523, 524, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, @@ -2369,16 +2143,16 @@ static const yytype_int16 yytable[] = 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, 320, 321, 322, 323, 324, 325, 326, + 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 711, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 506, 507, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, 332, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 334, + 0, 0, 0, 0, 512, 513, 514, 515, 516, 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 341, 342, 343, 344, 345, 346, 0, 0, 0, - 0, 0, 0, 0, 0, 347, 0, 348, 349, 350, + 0, 341, 342, 343, 344, 345, 346, 517, 518, 519, + 520, 521, 522, 523, 524, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, @@ -2413,13 +2187,13 @@ static const yytype_int16 yytable[] = 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 824, 0, 0, 0, 0, 0, + 0, 327, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 329, 330, 331, 332, 0, 0, 0, + 0, 0, 0, 329, 330, 331, 332, 333, 0, 0, 0, 0, 0, 0, 0, 0, 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, 342, @@ -2463,11 +2237,11 @@ static const yytype_int16 yytable[] = 323, 324, 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 859, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 334, 335, 336, 337, 338, 339, 340, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 599, 0, 0, 602, 0, 603, 604, 0, 0, 607, 0, 0, 0, 0, 0, 341, 342, 343, 344, 345, 346, 0, 0, 0, 0, 0, 0, 0, 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, @@ -2509,9 +2283,9 @@ static const yytype_int16 yytable[] = 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, - 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 332, 0, 0, 0, 0, 0, 0, 0, 0, 441, 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, 344, 345, 346, 0, 0, @@ -2519,627 +2293,7 @@ static const yytype_int16 yytable[] = 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 0, 641, 779, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 0, 641, 890, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 580, 0, 0, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 0, 641, 0, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 749, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 659, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 699, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 334, 0, 0, 0, 0, 339, 340 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 387, 0, 572, 507, 406, 498, 0, 486, 0, - 411, 0, 627, 439, 406, 444, 547, 552, 741, 445, - 406, 395, 557, 574, 338, 411, 355, 418, 333, 334, - 361, 566, 563, 639, 350, 641, 903, 353, 644, 350, - 575, 533, 387, 910, 350, 431, 353, 350, 361, 358, - 358, 353, 361, 920, 361, 351, 387, 486, 387, 361, - 374, 435, 370, 354, 369, 370, 411, 358, 384, 495, - 496, 335, 336, 384, 552, 504, 505, 451, 384, 557, - 383, 384, 385, 386, 352, 563, 331, 332, 566, 351, - 358, 353, 478, 353, 645, 353, 384, 575, 360, 387, - 360, 351, 360, 606, 353, 608, 351, 536, 353, 545, - 354, 360, 357, 352, 358, 551, 594, 553, 351, 358, - 556, 352, 558, 552, 560, 561, 351, 358, 557, 565, - 745, 351, 355, 352, 563, 358, 352, 566, 361, 358, - 358, 354, 358, 361, 713, 358, 575, 639, 351, 641, - 384, 654, 644, 387, 545, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 594, 658, 363, 352, 365, - 561, 351, 778, 351, 358, 360, 413, 414, 415, 416, - 417, 418, 419, 352, 352, 352, 572, 352, 574, 358, - 358, 358, 352, 358, 352, 351, 570, 352, 358, 352, - 358, 924, 352, 358, 352, 358, 352, 352, 358, 352, - 358, 352, 358, 358, 783, 358, 352, 358, 352, 352, - 352, 352, 358, 352, 358, 358, 358, 358, 353, 358, - 384, 846, 352, 387, 663, 351, 637, 361, 358, 383, - 384, 385, 386, 352, 747, 637, 384, 384, 751, 387, - 387, 637, 858, 724, 725, 726, 727, 384, 384, 645, - 387, 387, 384, 384, 358, 387, 387, 802, 803, 384, - 384, 369, 387, 387, 809, 810, 384, 769, 770, 387, - 358, 387, 708, 361, 815, 356, 778, 358, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 358, 914, 358, - 361, 358, 361, 387, 361, 930, 376, 377, 378, 387, - 366, 367, 368, 355, 802, 803, 387, 713, 329, 330, - 387, 809, 810, 358, 359, 358, 359, 815, 355, 817, - 353, 844, 720, 721, 847, 722, 723, 728, 729, 387, - 353, 387, 361, 352, 360, 360, 358, 361, 387, 387, - 352, 358, 358, 358, 358, 350, 858, 351, 358, 387, - 358, 358, 358, 802, 803, 358, 358, 352, 351, 360, - 809, 810, 353, 351, 887, 354, 815, 387, 817, 353, - 337, 339, 354, 371, 373, 395, 387, 783, 372, 356, - 351, 904, 361, 403, 395, 403, 406, 387, 900, 361, - 403, 411, 403, 411, 403, 406, 919, 351, 411, 351, - 411, 421, 914, 361, 351, 361, 359, 351, 351, 387, - 361, 431, 430, 361, 387, 435, 361, 352, 360, 358, - 431, 358, 358, 352, 435, 352, 847, 358, 354, 354, - 350, 451, 395, 350, 384, 356, 352, 351, 387, 361, - 451, 847, 355, 352, 399, 360, 356, 355, 355, 361, - 731, 730, 735, 577, 435, 732, 431, 733, 478, 734, - 333, 435, 822, 707, 849, 909, 887, 478, 920, 489, - 921, 849, 429, 887, 798, 637, 568, 637, 489, 403, - 800, 887, 637, 813, 803, 817, 807, 805, -1, -1, - -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, - 815, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 541, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 570, -1, 572, -1, 574, -1, -1, -1, -1, 570, - -1, 572, -1, 574, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 627, -1, -1, - -1, -1, -1, -1, -1, -1, 627, 637, -1, -1, - -1, -1, -1, -1, -1, 645, 637, -1, -1, -1, - -1, -1, -1, -1, 645, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 713, -1, -1, -1, -1, -1, -1, - -1, -1, 713, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 741, -1, -1, -1, 745, -1, -1, -1, -1, - 741, -1, -1, -1, 745, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 783, -1, -1, -1, -1, -1, -1, - -1, -1, 783, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 846, 847, -1, 849, - -1, 849, -1, -1, -1, 846, 847, -1, 849, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 887, -1, -1, - -1, -1, -1, -1, -1, -1, 887, -1, -1, -1, - -1, -1, -1, 903, -1, -1, -1, -1, -1, -1, - 910, -1, 903, -1, -1, -1, -1, -1, -1, 910, - 920, -1, -1, -1, 924, -1, -1, -1, -1, 920, - 930, -1, -1, 924, -1, -1, -1, 0, -1, 930, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 353, -1, -1, -1, -1, -1, -1, -1, 361, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 375, 376, 377, 378, 379, -1, -1, -1, - -1, -1, -1, -1, -1, 388, 389, 390, 391, 392, - 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, - 413, 414, 415, -1, -1, -1, -1, -1, -1, -1, - -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, -1, -1, 331, 332, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 350, 351, -1, 353, -1, 355, - 356, -1, -1, -1, -1, 361, 362, 363, 364, 365, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, - 376, 377, 378, 379, -1, -1, -1, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, - 456, 457, 458, 459, 3, 4, 5, 6, 7, 8, + 380, 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, @@ -3170,22 +2324,22 @@ static const yytype_int16 yycheck[] = 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 350, 351, -1, 353, -1, 355, 356, -1, -1, - -1, -1, 361, 362, 363, 364, 365, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 375, 376, 377, 378, - 379, -1, -1, -1, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 309, 310, 311, 312, 313, 314, 315, 316, 0, 0, + 0, 320, 321, 322, 323, 324, 325, 326, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 329, 330, 331, 332, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 334, 335, 336, + 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, + 342, 343, 344, 345, 346, 0, 0, 0, 0, 0, + 0, 0, 0, 347, 0, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, @@ -3216,21 +2370,21 @@ static const yytype_int16 yycheck[] = 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, -1, -1, 331, - 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, 353, -1, 355, -1, -1, -1, -1, -1, 361, - 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 375, 376, 377, 378, 379, -1, -1, - -1, 383, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, -1, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 3, 4, + 312, 313, 314, 315, 316, 0, 0, 0, 320, 321, + 322, 323, 324, 325, 326, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 716, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 329, 330, 331, 332, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 334, 335, 336, 337, 338, 339, + 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 341, 342, 343, 344, + 345, 346, 0, 0, 0, 0, 0, 0, 0, 0, + 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, @@ -3262,21 +2416,642 @@ static const yytype_int16 yycheck[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, -1, -1, 331, 332, -1, -1, + 315, 316, 0, 0, 0, 320, 321, 322, 323, 324, + 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 829, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, + 331, 332, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 334, 335, 336, 337, 338, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 341, 342, 343, 344, 345, 346, 0, + 0, 0, 0, 0, 0, 0, 0, 347, 0, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 0, + 0, 0, 320, 321, 322, 323, 324, 325, 326, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 864, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 329, 330, 331, 332, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 334, 335, + 336, 337, 338, 339, 340, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 341, 342, 343, 344, 345, 346, 0, 0, 0, 0, + 0, 0, 0, 0, 347, 0, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 0, 0, 0, 320, + 321, 322, 323, 324, 325, 326, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 329, 330, 331, 332, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 334, 335, 336, 337, 338, + 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, + 344, 345, 346, 0, 0, 0, 0, 0, 0, 0, + 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 0, 641, 784, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 0, 641, 895, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 580, 0, 0, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 0, 641, 0, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 743, 0, 0, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 754, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, + 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, + 0, 339, 659, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, + 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 704, 334, 0, 0, 0, 0, 339, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 334, 0, 0, 0, + 0, 339, 340 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 387, 0, 498, 486, 507, 406, 627, 547, 0, + 639, 411, 641, 0, 0, 644, 444, 439, 552, 557, + 406, 406, 572, 445, 563, 411, 746, 395, 418, 574, + 350, 361, 566, 338, 350, 333, 334, 353, 533, 358, + 353, 575, 908, 355, 350, 431, 350, 361, 361, 915, + 352, 370, 351, 353, 353, 387, 358, 387, 486, 925, + 360, 360, 351, 383, 384, 385, 386, 435, 384, 374, + 552, 369, 370, 495, 496, 387, 504, 505, 384, 411, + 384, 563, 353, 451, 566, 331, 332, 353, 353, 351, + 361, 352, 478, 575, 360, 360, 355, 358, 358, 358, + 645, 361, 361, 352, 606, 351, 608, 353, 536, 358, + 351, 357, 594, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 352, 552, 358, 352, 352, 361, 358, + 750, 352, 358, 360, 352, 563, 352, 358, 566, 352, + 358, 356, 358, 358, 639, 358, 641, 575, 351, 644, + 352, 352, 654, 352, 783, 545, 358, 358, 352, 358, + 351, 545, 384, 658, 358, 387, 594, 551, 718, 553, + 351, 561, 556, 352, 558, 353, 560, 561, 352, 358, + 387, 565, 358, 354, 358, 361, 572, 358, 574, 413, + 414, 415, 416, 417, 418, 419, 369, 352, 352, 352, + 352, 352, 570, 358, 358, 358, 358, 358, 352, 929, + 352, 352, 352, 352, 358, 352, 358, 358, 358, 358, + 352, 358, 384, 354, 354, 387, 358, 358, 358, 358, + 358, 851, 361, 361, 863, 663, 384, 637, 788, 387, + 383, 384, 385, 386, 387, 383, 384, 385, 386, 358, + 752, 637, 637, 351, 756, 729, 730, 731, 732, 645, + 384, 384, 384, 387, 387, 387, 384, 384, 384, 387, + 387, 387, 384, 807, 808, 387, 814, 815, 351, 774, + 775, 820, 384, 384, 358, 387, 387, 361, 783, 351, + 919, 713, 329, 330, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, + 738, 739, 740, 335, 336, 935, 376, 377, 378, 366, + 367, 368, 363, 351, 365, 807, 808, 358, 359, 358, + 359, 361, 718, 725, 726, 387, 727, 728, 820, 387, + 822, 355, 387, 355, 733, 734, 353, 849, 387, 387, + 852, 353, 387, 352, 387, 361, 360, 358, 361, 354, + 387, 351, 358, 360, 358, 358, 358, 387, 863, 358, + 358, 352, 352, 358, 358, 358, 358, 351, 353, 807, + 808, 360, 351, 353, 350, 337, 339, 387, 356, 354, + 892, 351, 820, 351, 822, 395, 387, 373, 361, 372, + 371, 351, 788, 403, 395, 403, 406, 909, 359, 387, + 905, 411, 403, 411, 361, 406, 403, 403, 361, 351, + 411, 421, 924, 361, 919, 411, 361, 361, 361, 351, + 351, 431, 430, 387, 352, 435, 360, 352, 387, 358, + 431, 358, 358, 352, 435, 358, 354, 354, 350, 395, + 350, 451, 852, 384, 352, 356, 351, 387, 355, 352, + 451, 360, 399, 355, 355, 361, 852, 361, 356, 736, + 738, 735, 431, 435, 737, 333, 712, 577, 478, 435, + 827, 739, 854, 740, 914, 925, 892, 478, 926, 489, + 429, 854, 892, 403, 805, 803, 568, 812, 489, 808, + 810, 637, 637, 637, 822, -1, 892, -1, 815, -1, + -1, 814, -1, -1, -1, -1, -1, 818, -1, -1, + -1, -1, -1, 820, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 350, 351, -1, 353, -1, - 355, -1, -1, -1, -1, -1, 361, 362, 363, 364, - 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 375, 376, 377, 378, 379, -1, -1, -1, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459, 3, 4, 5, 6, 7, + -1, -1, -1, 541, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 570, -1, 572, -1, 574, -1, -1, -1, -1, 570, + -1, 572, -1, 574, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 627, -1, -1, + -1, -1, -1, -1, -1, -1, 627, 637, -1, -1, + -1, -1, -1, -1, -1, 645, 637, -1, -1, -1, + -1, -1, -1, -1, 645, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 718, -1, + -1, -1, -1, -1, -1, -1, -1, 718, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 746, -1, -1, -1, + 750, -1, -1, -1, -1, 746, -1, -1, -1, 750, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 788, -1, + -1, -1, -1, -1, -1, -1, -1, 788, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 851, 852, -1, 854, -1, 854, -1, -1, -1, + 851, 852, -1, 854, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 892, -1, -1, -1, -1, -1, -1, -1, + -1, 892, -1, -1, -1, -1, -1, -1, 908, -1, + -1, -1, -1, -1, -1, 915, -1, 908, -1, -1, + -1, -1, -1, -1, 915, 925, -1, -1, -1, 929, + -1, -1, -1, -1, 925, 935, -1, -1, 929, -1, + -1, -1, 0, -1, 935, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, @@ -3309,16 +3084,16 @@ static const yytype_int16 yycheck[] = 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, -1, -1, 331, 332, -1, -1, -1, -1, -1, + 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 350, 351, -1, 353, -1, -1, -1, -1, - -1, -1, -1, 361, 362, 363, 364, 365, -1, -1, + -1, -1, -1, -1, -1, 353, -1, -1, -1, -1, + -1, -1, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, - 378, 379, -1, -1, -1, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 378, 379, -1, -1, -1, -1, -1, -1, -1, -1, + 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 410, 411, 412, 413, 414, 415, -1, -1, + -1, -1, -1, -1, -1, -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, @@ -3357,14 +3132,14 @@ static const yytype_int16 yycheck[] = 321, 322, 323, 324, 325, 326, 327, 328, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, - 351, -1, 353, -1, -1, -1, -1, -1, -1, -1, + 351, -1, 353, -1, 355, 356, -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, 378, 379, -1, -1, -1, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, + 391, 392, 393, 394, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, - 421, 422, 423, 424, -1, 426, 427, 428, 429, 430, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 3, @@ -3399,18 +3174,18 @@ static const yytype_int16 yycheck[] = 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, -1, -1, -1, 322, 323, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 350, 351, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 362, 363, + -1, -1, -1, -1, -1, -1, 350, 351, -1, 353, + -1, 355, 356, -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 375, 376, 377, 378, -1, -1, -1, -1, 383, + -1, 375, 376, 377, 378, 379, -1, -1, -1, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 410, 411, 412, 413, + 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, - 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, + 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 3, 4, 5, 6, @@ -3446,16 +3221,16 @@ static const yytype_int16 yycheck[] = 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, + 327, 328, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 353, -1, -1, -1, - -1, -1, -1, -1, 361, -1, -1, -1, -1, -1, + -1, -1, -1, 350, 351, -1, 353, -1, 355, -1, + -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, - 377, 378, 379, -1, -1, -1, -1, -1, -1, -1, - -1, 388, 389, 390, 391, 392, 393, 394, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 410, 411, 412, 413, 414, 415, -1, - -1, -1, -1, -1, -1, -1, -1, 424, -1, 426, + 377, 378, 379, -1, -1, -1, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, @@ -3490,18 +3265,18 @@ static const yytype_int16 yycheck[] = 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, - -1, -1, 322, 323, 324, 325, 326, 327, 328, -1, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, -1, + -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 375, 376, 377, 378, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 388, 389, - 390, 391, 392, 393, 394, 395, -1, -1, 398, -1, - 400, 401, -1, -1, 404, -1, -1, -1, -1, -1, - 410, 411, 412, 413, 414, 415, -1, -1, -1, -1, - -1, -1, -1, -1, 424, -1, 426, 427, 428, 429, + 350, 351, -1, 353, -1, 355, -1, -1, -1, -1, + -1, 361, 362, 363, 364, 365, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 375, 376, 377, 378, 379, + -1, -1, -1, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, @@ -3536,18 +3311,18 @@ static const yytype_int16 yycheck[] = 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, -1, -1, -1, 322, - 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 361, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 375, 376, 377, 378, -1, -1, -1, -1, - -1, -1, -1, -1, 387, 388, 389, 390, 391, 392, - 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, - 413, 414, 415, -1, -1, -1, -1, -1, -1, -1, - -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, + -1, -1, -1, -1, -1, -1, -1, 350, 351, -1, + 353, -1, -1, -1, -1, -1, -1, -1, 361, 362, + 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 375, 376, 377, 378, 379, -1, -1, -1, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 3, 4, 5, @@ -3582,17 +3357,17 @@ static const yytype_int16 yycheck[] = 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, -1, -1, -1, 322, 323, 324, 325, - 326, 327, 328, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 353, -1, -1, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 350, 351, -1, 353, -1, -1, + -1, -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, - 376, 377, 378, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 388, 389, 390, 391, 392, 393, 394, -1, + 376, 377, 378, 379, -1, -1, -1, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, 413, 414, 415, - -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, + 416, 417, 418, 419, 420, 421, 422, 423, 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, @@ -3629,16 +3404,16 @@ static const yytype_int16 yycheck[] = 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, 322, 323, 324, 325, 326, 327, 328, + -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 356, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 350, 351, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, 378, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 388, + -1, -1, -1, -1, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 410, 411, 412, 413, 414, 415, -1, -1, -1, - -1, -1, -1, -1, -1, 424, -1, 426, 427, 428, + -1, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, @@ -3673,13 +3448,13 @@ static const yytype_int16 yycheck[] = 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 356, -1, -1, -1, -1, -1, + -1, 353, -1, -1, -1, -1, -1, -1, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 375, 376, 377, 378, -1, -1, -1, + -1, -1, -1, 375, 376, 377, 378, 379, -1, -1, -1, -1, -1, -1, -1, -1, 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, 411, @@ -3723,11 +3498,11 @@ static const yytype_int16 yycheck[] = 325, 326, 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 356, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, 388, 389, 390, 391, 392, 393, 394, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 395, -1, -1, 398, -1, 400, 401, -1, -1, 404, -1, -1, -1, -1, -1, 410, 411, 412, 413, 414, 415, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, 434, @@ -3769,9 +3544,9 @@ static const yytype_int16 yycheck[] = 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, - 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 378, -1, -1, -1, -1, -1, -1, -1, -1, 387, 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, 413, 414, 415, -1, -1, @@ -3779,50 +3554,235 @@ static const yytype_int16 yycheck[] = 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, - -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, - -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, - 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, -1, 355, 356, -1, -1, -1, -1, -1, - 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, + 458, 459, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, + -1, 322, 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, - -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, - 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, + -1, -1, 353, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 375, 376, 377, 378, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 388, 389, 390, + 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, + 411, 412, 413, 414, 415, -1, -1, -1, -1, -1, + -1, -1, -1, 424, -1, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, -1, -1, -1, 322, 323, + 324, 325, 326, 327, 328, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 356, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 375, 376, 377, 378, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 388, 389, 390, 391, 392, 393, + 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 410, 411, 412, 413, + 414, 415, -1, -1, -1, -1, -1, -1, -1, -1, + 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, + 454, 455, 456, 457, 458, 459, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, -1, -1, -1, 322, 323, 324, 325, 326, + 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 356, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, + 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 388, 389, 390, 391, 392, 393, 394, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 410, 411, 412, 413, 414, 415, -1, + -1, -1, -1, -1, -1, -1, -1, 424, -1, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, + -1, -1, 322, 323, 324, 325, 326, 327, 328, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 356, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 375, 376, 377, 378, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 388, 389, + 390, 391, 392, 393, 394, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 410, 411, 412, 413, 414, 415, -1, -1, -1, -1, + -1, -1, -1, -1, 424, -1, 426, 427, 428, 429, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, -1, -1, -1, 322, + 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 375, 376, 377, 378, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 388, 389, 390, 391, 392, + 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, + 413, 414, 415, -1, -1, -1, -1, -1, -1, -1, + -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, @@ -3901,7 +3861,7 @@ static const yytype_int16 yycheck[] = -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 355, 356, -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, @@ -3944,7 +3904,7 @@ static const yytype_int16 yycheck[] = 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, -1, -1, 355, -1, + -1, -1, -1, 350, 351, -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, @@ -3988,7 +3948,7 @@ static const yytype_int16 yycheck[] = -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 355, -1, -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, @@ -4031,8 +3991,8 @@ static const yytype_int16 yycheck[] = 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, + -1, -1, -1, 350, 351, -1, -1, 354, -1, -1, + -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, @@ -4075,7 +4035,7 @@ static const yytype_int16 yycheck[] = -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, @@ -4203,13 +4163,57 @@ static const yytype_int16 yycheck[] = 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, + -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 350, 351, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, + 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, + 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + -1, -1, -1, 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 388, -1, -1, -1, -1, 393, 394 + -1, -1, -1, -1, -1, -1, 388, -1, -1, -1, + -1, 393, 394 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -4257,13 +4261,13 @@ static const yytype_int16 yystos[] = 458, 459, 491, 492, 495, 496, 497, 498, 502, 503, 504, 505, 506, 507, 510, 511, 512, 513, 514, 516, 521, 522, 523, 564, 565, 566, 568, 575, 579, 580, - 585, 588, 351, 351, 351, 351, 351, 351, 351, 351, + 586, 589, 351, 351, 351, 351, 351, 351, 351, 351, 353, 522, 355, 387, 351, 351, 361, 387, 361, 567, 352, 358, 499, 500, 501, 511, 516, 358, 361, 387, 361, 387, 512, 516, 369, 518, 519, 0, 565, 496, - 504, 511, 361, 495, 387, 571, 572, 589, 590, 384, + 504, 511, 361, 495, 387, 571, 572, 590, 591, 384, 387, 571, 384, 571, 384, 571, 384, 571, 384, 571, - 571, 589, 384, 571, 387, 569, 570, 516, 525, 355, + 571, 590, 384, 571, 387, 569, 570, 516, 525, 355, 387, 411, 508, 509, 387, 515, 353, 361, 517, 355, 543, 568, 500, 499, 501, 387, 387, 351, 360, 517, 355, 358, 361, 494, 331, 332, 350, 351, 362, 363, @@ -4283,33 +4287,33 @@ static const yytype_int16 yystos[] = 517, 355, 487, 530, 360, 493, 387, 358, 361, 472, 472, 489, 331, 332, 353, 357, 352, 352, 358, 394, 487, 351, 472, 358, 370, 568, 350, 353, 384, 572, - 589, 387, 590, 350, 383, 384, 385, 386, 576, 577, + 590, 387, 591, 350, 383, 384, 385, 386, 576, 577, 384, 485, 490, 578, 384, 383, 384, 385, 386, 581, - 582, 384, 490, 583, 384, 350, 584, 384, 589, 387, - 490, 586, 587, 384, 490, 354, 570, 516, 387, 528, - 529, 356, 527, 526, 490, 509, 387, 366, 367, 368, - 363, 365, 329, 330, 333, 334, 369, 370, 335, 336, - 373, 372, 371, 337, 339, 338, 374, 354, 354, 485, - 356, 537, 351, 361, 361, 558, 351, 351, 361, 361, - 489, 351, 489, 359, 361, 361, 361, 361, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 360, 488, - 358, 361, 356, 533, 547, 551, 556, 530, 360, 356, - 530, 531, 530, 526, 387, 352, 464, 489, 387, 487, - 472, 350, 384, 573, 574, 352, 360, 352, 358, 352, - 358, 352, 358, 358, 352, 358, 352, 358, 352, 358, - 358, 352, 358, 358, 352, 358, 352, 358, 352, 352, - 528, 517, 358, 361, 356, 472, 472, 472, 474, 474, - 475, 475, 476, 476, 476, 476, 477, 477, 478, 479, - 480, 481, 482, 483, 486, 354, 544, 557, 533, 559, - 489, 361, 489, 359, 487, 487, 530, 356, 358, 356, - 354, 354, 358, 354, 358, 577, 576, 490, 578, 582, - 581, 490, 583, 350, 584, 586, 587, 361, 529, 489, - 538, 489, 504, 549, 395, 532, 545, 560, 352, 352, - 356, 530, 350, 384, 352, 352, 352, 352, 352, 352, - 359, 356, 387, 352, 351, 549, 561, 562, 540, 541, - 542, 548, 552, 487, 360, 534, 539, 543, 489, 361, - 352, 399, 536, 534, 355, 530, 352, 489, 539, 540, - 544, 553, 361, 356 + 582, 384, 383, 384, 385, 386, 461, 583, 584, 384, + 350, 585, 384, 590, 387, 490, 587, 588, 384, 490, + 354, 570, 516, 387, 528, 529, 356, 527, 526, 490, + 509, 387, 366, 367, 368, 363, 365, 329, 330, 333, + 334, 369, 370, 335, 336, 373, 372, 371, 337, 339, + 338, 374, 354, 354, 485, 356, 537, 351, 361, 361, + 558, 351, 351, 361, 361, 489, 351, 489, 359, 361, + 361, 361, 361, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 360, 488, 358, 361, 356, 533, 547, + 551, 556, 530, 360, 356, 530, 531, 530, 526, 387, + 352, 464, 489, 387, 487, 472, 350, 384, 573, 574, + 352, 360, 352, 358, 352, 358, 352, 358, 358, 352, + 358, 352, 358, 352, 358, 358, 352, 358, 358, 352, + 358, 352, 358, 352, 352, 528, 517, 358, 361, 356, + 472, 472, 472, 474, 474, 475, 475, 476, 476, 476, + 476, 477, 477, 478, 479, 480, 481, 482, 483, 486, + 354, 544, 557, 533, 559, 489, 361, 489, 359, 487, + 487, 530, 356, 358, 356, 354, 354, 358, 354, 358, + 577, 576, 490, 578, 582, 581, 584, 583, 350, 585, + 587, 588, 361, 529, 489, 538, 489, 504, 549, 395, + 532, 545, 560, 352, 352, 356, 530, 350, 384, 352, + 352, 352, 352, 352, 352, 359, 356, 387, 352, 351, + 549, 561, 562, 540, 541, 542, 548, 552, 487, 360, + 534, 539, 543, 489, 361, 352, 399, 536, 534, 355, + 530, 352, 489, 539, 540, 544, 553, 361, 356 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -4382,8 +4386,9 @@ static const yytype_int16 yyr1[] = 574, 575, 575, 575, 575, 575, 575, 576, 576, 577, 577, 577, 577, 577, 578, 578, 579, 579, 580, 580, 580, 580, 580, 580, 580, 580, 581, 581, 582, 582, - 582, 582, 583, 583, 584, 584, 585, 585, 585, 585, - 586, 586, 587, 588, 588, 589, 589, 590, 590 + 582, 582, 583, 583, 584, 584, 584, 584, 584, 585, + 585, 586, 586, 586, 586, 587, 587, 588, 589, 589, + 590, 590, 591, 591 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -4456,8 +4461,9 @@ static const yytype_int8 yyr2[] = 3, 4, 6, 6, 8, 6, 8, 1, 3, 1, 1, 1, 1, 1, 1, 3, 4, 6, 4, 6, 6, 8, 6, 8, 6, 8, 1, 3, 1, 1, - 1, 1, 1, 3, 1, 3, 6, 8, 4, 6, - 1, 3, 1, 4, 6, 1, 3, 3, 3 + 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, + 3, 6, 8, 4, 6, 1, 3, 1, 4, 6, + 1, 3, 3, 3 }; @@ -5207,7 +5213,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 5211 "MachineIndependent/glslang_tab.cpp" +#line 5217 "MachineIndependent/glslang_tab.cpp" break; case 3: /* primary_expression: variable_identifier */ @@ -5215,7 +5221,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5219 "MachineIndependent/glslang_tab.cpp" +#line 5225 "MachineIndependent/glslang_tab.cpp" break; case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */ @@ -5225,7 +5231,7 @@ yyreduce: if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 5229 "MachineIndependent/glslang_tab.cpp" +#line 5235 "MachineIndependent/glslang_tab.cpp" break; case 5: /* primary_expression: FLOATCONSTANT */ @@ -5233,7 +5239,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 5237 "MachineIndependent/glslang_tab.cpp" +#line 5243 "MachineIndependent/glslang_tab.cpp" break; case 6: /* primary_expression: INTCONSTANT */ @@ -5241,7 +5247,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5245 "MachineIndependent/glslang_tab.cpp" +#line 5251 "MachineIndependent/glslang_tab.cpp" break; case 7: /* primary_expression: UINTCONSTANT */ @@ -5250,7 +5256,7 @@ yyreduce: parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5254 "MachineIndependent/glslang_tab.cpp" +#line 5260 "MachineIndependent/glslang_tab.cpp" break; case 8: /* primary_expression: BOOLCONSTANT */ @@ -5258,7 +5264,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 5262 "MachineIndependent/glslang_tab.cpp" +#line 5268 "MachineIndependent/glslang_tab.cpp" break; case 9: /* primary_expression: STRING_LITERAL */ @@ -5266,7 +5272,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 5270 "MachineIndependent/glslang_tab.cpp" +#line 5276 "MachineIndependent/glslang_tab.cpp" break; case 10: /* primary_expression: INT32CONSTANT */ @@ -5275,7 +5281,7 @@ yyreduce: parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5279 "MachineIndependent/glslang_tab.cpp" +#line 5285 "MachineIndependent/glslang_tab.cpp" break; case 11: /* primary_expression: UINT32CONSTANT */ @@ -5284,7 +5290,7 @@ yyreduce: parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5288 "MachineIndependent/glslang_tab.cpp" +#line 5294 "MachineIndependent/glslang_tab.cpp" break; case 12: /* primary_expression: INT64CONSTANT */ @@ -5293,7 +5299,7 @@ yyreduce: parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 5297 "MachineIndependent/glslang_tab.cpp" +#line 5303 "MachineIndependent/glslang_tab.cpp" break; case 13: /* primary_expression: UINT64CONSTANT */ @@ -5302,7 +5308,7 @@ yyreduce: parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 5306 "MachineIndependent/glslang_tab.cpp" +#line 5312 "MachineIndependent/glslang_tab.cpp" break; case 14: /* primary_expression: INT16CONSTANT */ @@ -5311,7 +5317,7 @@ yyreduce: parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5315 "MachineIndependent/glslang_tab.cpp" +#line 5321 "MachineIndependent/glslang_tab.cpp" break; case 15: /* primary_expression: UINT16CONSTANT */ @@ -5320,7 +5326,7 @@ yyreduce: parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5324 "MachineIndependent/glslang_tab.cpp" +#line 5330 "MachineIndependent/glslang_tab.cpp" break; case 16: /* primary_expression: DOUBLECONSTANT */ @@ -5331,7 +5337,7 @@ yyreduce: parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } -#line 5335 "MachineIndependent/glslang_tab.cpp" +#line 5341 "MachineIndependent/glslang_tab.cpp" break; case 17: /* primary_expression: FLOAT16CONSTANT */ @@ -5340,7 +5346,7 @@ yyreduce: parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 5344 "MachineIndependent/glslang_tab.cpp" +#line 5350 "MachineIndependent/glslang_tab.cpp" break; case 18: /* postfix_expression: primary_expression */ @@ -5348,7 +5354,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5352 "MachineIndependent/glslang_tab.cpp" +#line 5358 "MachineIndependent/glslang_tab.cpp" break; case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */ @@ -5356,7 +5362,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } -#line 5360 "MachineIndependent/glslang_tab.cpp" +#line 5366 "MachineIndependent/glslang_tab.cpp" break; case 20: /* postfix_expression: function_call */ @@ -5364,7 +5370,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5368 "MachineIndependent/glslang_tab.cpp" +#line 5374 "MachineIndependent/glslang_tab.cpp" break; case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */ @@ -5372,7 +5378,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } -#line 5376 "MachineIndependent/glslang_tab.cpp" +#line 5382 "MachineIndependent/glslang_tab.cpp" break; case 22: /* postfix_expression: postfix_expression INC_OP */ @@ -5382,7 +5388,7 @@ yyreduce: parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5386 "MachineIndependent/glslang_tab.cpp" +#line 5392 "MachineIndependent/glslang_tab.cpp" break; case 23: /* postfix_expression: postfix_expression DEC_OP */ @@ -5392,7 +5398,7 @@ yyreduce: parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5396 "MachineIndependent/glslang_tab.cpp" +#line 5402 "MachineIndependent/glslang_tab.cpp" break; case 24: /* integer_expression: expression */ @@ -5401,7 +5407,7 @@ yyreduce: parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5405 "MachineIndependent/glslang_tab.cpp" +#line 5411 "MachineIndependent/glslang_tab.cpp" break; case 25: /* function_call: function_call_or_method */ @@ -5410,7 +5416,7 @@ yyreduce: (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 5414 "MachineIndependent/glslang_tab.cpp" +#line 5420 "MachineIndependent/glslang_tab.cpp" break; case 26: /* function_call_or_method: function_call_generic */ @@ -5418,7 +5424,7 @@ yyreduce: { (yyval.interm) = (yyvsp[0].interm); } -#line 5422 "MachineIndependent/glslang_tab.cpp" +#line 5428 "MachineIndependent/glslang_tab.cpp" break; case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */ @@ -5427,7 +5433,7 @@ yyreduce: (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5431 "MachineIndependent/glslang_tab.cpp" +#line 5437 "MachineIndependent/glslang_tab.cpp" break; case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */ @@ -5436,7 +5442,7 @@ yyreduce: (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5440 "MachineIndependent/glslang_tab.cpp" +#line 5446 "MachineIndependent/glslang_tab.cpp" break; case 29: /* function_call_header_no_parameters: function_call_header VOID */ @@ -5444,7 +5450,7 @@ yyreduce: { (yyval.interm) = (yyvsp[-1].interm); } -#line 5448 "MachineIndependent/glslang_tab.cpp" +#line 5454 "MachineIndependent/glslang_tab.cpp" break; case 30: /* function_call_header_no_parameters: function_call_header */ @@ -5452,7 +5458,7 @@ yyreduce: { (yyval.interm) = (yyvsp[0].interm); } -#line 5456 "MachineIndependent/glslang_tab.cpp" +#line 5462 "MachineIndependent/glslang_tab.cpp" break; case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */ @@ -5464,7 +5470,7 @@ yyreduce: (yyval.interm).function = (yyvsp[-1].interm).function; (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } -#line 5468 "MachineIndependent/glslang_tab.cpp" +#line 5474 "MachineIndependent/glslang_tab.cpp" break; case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */ @@ -5476,7 +5482,7 @@ yyreduce: (yyval.interm).function = (yyvsp[-2].interm).function; (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } -#line 5480 "MachineIndependent/glslang_tab.cpp" +#line 5486 "MachineIndependent/glslang_tab.cpp" break; case 33: /* function_call_header: function_identifier LEFT_PAREN */ @@ -5484,7 +5490,7 @@ yyreduce: { (yyval.interm) = (yyvsp[-1].interm); } -#line 5488 "MachineIndependent/glslang_tab.cpp" +#line 5494 "MachineIndependent/glslang_tab.cpp" break; case 34: /* function_identifier: type_specifier */ @@ -5494,7 +5500,7 @@ yyreduce: (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5498 "MachineIndependent/glslang_tab.cpp" +#line 5504 "MachineIndependent/glslang_tab.cpp" break; case 35: /* function_identifier: postfix_expression */ @@ -5526,7 +5532,7 @@ yyreduce: (yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull); } } -#line 5530 "MachineIndependent/glslang_tab.cpp" +#line 5536 "MachineIndependent/glslang_tab.cpp" break; case 36: /* function_identifier: non_uniform_qualifier */ @@ -5536,7 +5542,7 @@ yyreduce: (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5540 "MachineIndependent/glslang_tab.cpp" +#line 5546 "MachineIndependent/glslang_tab.cpp" break; case 37: /* unary_expression: postfix_expression */ @@ -5547,7 +5553,7 @@ yyreduce: if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 5551 "MachineIndependent/glslang_tab.cpp" +#line 5557 "MachineIndependent/glslang_tab.cpp" break; case 38: /* unary_expression: INC_OP unary_expression */ @@ -5556,7 +5562,7 @@ yyreduce: parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5560 "MachineIndependent/glslang_tab.cpp" +#line 5566 "MachineIndependent/glslang_tab.cpp" break; case 39: /* unary_expression: DEC_OP unary_expression */ @@ -5565,7 +5571,7 @@ yyreduce: parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5569 "MachineIndependent/glslang_tab.cpp" +#line 5575 "MachineIndependent/glslang_tab.cpp" break; case 40: /* unary_expression: unary_operator unary_expression */ @@ -5586,38 +5592,38 @@ yyreduce: (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 5590 "MachineIndependent/glslang_tab.cpp" +#line 5596 "MachineIndependent/glslang_tab.cpp" break; case 41: /* unary_operator: PLUS */ #line 628 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 5596 "MachineIndependent/glslang_tab.cpp" +#line 5602 "MachineIndependent/glslang_tab.cpp" break; case 42: /* unary_operator: DASH */ #line 629 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 5602 "MachineIndependent/glslang_tab.cpp" +#line 5608 "MachineIndependent/glslang_tab.cpp" break; case 43: /* unary_operator: BANG */ #line 630 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 5608 "MachineIndependent/glslang_tab.cpp" +#line 5614 "MachineIndependent/glslang_tab.cpp" break; case 44: /* unary_operator: TILDE */ #line 631 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 5615 "MachineIndependent/glslang_tab.cpp" +#line 5621 "MachineIndependent/glslang_tab.cpp" break; case 45: /* multiplicative_expression: unary_expression */ #line 637 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5621 "MachineIndependent/glslang_tab.cpp" +#line 5627 "MachineIndependent/glslang_tab.cpp" break; case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ @@ -5627,7 +5633,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5631 "MachineIndependent/glslang_tab.cpp" +#line 5637 "MachineIndependent/glslang_tab.cpp" break; case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ @@ -5637,7 +5643,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5641 "MachineIndependent/glslang_tab.cpp" +#line 5647 "MachineIndependent/glslang_tab.cpp" break; case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ @@ -5648,13 +5654,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5652 "MachineIndependent/glslang_tab.cpp" +#line 5658 "MachineIndependent/glslang_tab.cpp" break; case 49: /* additive_expression: multiplicative_expression */ #line 657 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5658 "MachineIndependent/glslang_tab.cpp" +#line 5664 "MachineIndependent/glslang_tab.cpp" break; case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */ @@ -5664,7 +5670,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5668 "MachineIndependent/glslang_tab.cpp" +#line 5674 "MachineIndependent/glslang_tab.cpp" break; case 51: /* additive_expression: additive_expression DASH multiplicative_expression */ @@ -5674,13 +5680,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5678 "MachineIndependent/glslang_tab.cpp" +#line 5684 "MachineIndependent/glslang_tab.cpp" break; case 52: /* shift_expression: additive_expression */ #line 671 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5684 "MachineIndependent/glslang_tab.cpp" +#line 5690 "MachineIndependent/glslang_tab.cpp" break; case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */ @@ -5691,7 +5697,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5695 "MachineIndependent/glslang_tab.cpp" +#line 5701 "MachineIndependent/glslang_tab.cpp" break; case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */ @@ -5702,13 +5708,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5706 "MachineIndependent/glslang_tab.cpp" +#line 5712 "MachineIndependent/glslang_tab.cpp" break; case 55: /* relational_expression: shift_expression */ #line 687 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5712 "MachineIndependent/glslang_tab.cpp" +#line 5718 "MachineIndependent/glslang_tab.cpp" break; case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ @@ -5718,7 +5724,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5722 "MachineIndependent/glslang_tab.cpp" +#line 5728 "MachineIndependent/glslang_tab.cpp" break; case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ @@ -5728,7 +5734,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5732 "MachineIndependent/glslang_tab.cpp" +#line 5738 "MachineIndependent/glslang_tab.cpp" break; case 58: /* relational_expression: relational_expression LE_OP shift_expression */ @@ -5738,7 +5744,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5742 "MachineIndependent/glslang_tab.cpp" +#line 5748 "MachineIndependent/glslang_tab.cpp" break; case 59: /* relational_expression: relational_expression GE_OP shift_expression */ @@ -5748,13 +5754,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5752 "MachineIndependent/glslang_tab.cpp" +#line 5758 "MachineIndependent/glslang_tab.cpp" break; case 60: /* equality_expression: relational_expression */ #line 711 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5758 "MachineIndependent/glslang_tab.cpp" +#line 5764 "MachineIndependent/glslang_tab.cpp" break; case 61: /* equality_expression: equality_expression EQ_OP relational_expression */ @@ -5768,7 +5774,7 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5772 "MachineIndependent/glslang_tab.cpp" +#line 5778 "MachineIndependent/glslang_tab.cpp" break; case 62: /* equality_expression: equality_expression NE_OP relational_expression */ @@ -5782,13 +5788,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5786 "MachineIndependent/glslang_tab.cpp" +#line 5792 "MachineIndependent/glslang_tab.cpp" break; case 63: /* and_expression: equality_expression */ #line 733 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5792 "MachineIndependent/glslang_tab.cpp" +#line 5798 "MachineIndependent/glslang_tab.cpp" break; case 64: /* and_expression: and_expression AMPERSAND equality_expression */ @@ -5799,13 +5805,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5803 "MachineIndependent/glslang_tab.cpp" +#line 5809 "MachineIndependent/glslang_tab.cpp" break; case 65: /* exclusive_or_expression: and_expression */ #line 743 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5809 "MachineIndependent/glslang_tab.cpp" +#line 5815 "MachineIndependent/glslang_tab.cpp" break; case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ @@ -5816,13 +5822,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5820 "MachineIndependent/glslang_tab.cpp" +#line 5826 "MachineIndependent/glslang_tab.cpp" break; case 67: /* inclusive_or_expression: exclusive_or_expression */ #line 753 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5826 "MachineIndependent/glslang_tab.cpp" +#line 5832 "MachineIndependent/glslang_tab.cpp" break; case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ @@ -5833,13 +5839,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5837 "MachineIndependent/glslang_tab.cpp" +#line 5843 "MachineIndependent/glslang_tab.cpp" break; case 69: /* logical_and_expression: inclusive_or_expression */ #line 763 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5843 "MachineIndependent/glslang_tab.cpp" +#line 5849 "MachineIndependent/glslang_tab.cpp" break; case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ @@ -5849,13 +5855,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5853 "MachineIndependent/glslang_tab.cpp" +#line 5859 "MachineIndependent/glslang_tab.cpp" break; case 71: /* logical_xor_expression: logical_and_expression */ #line 772 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5859 "MachineIndependent/glslang_tab.cpp" +#line 5865 "MachineIndependent/glslang_tab.cpp" break; case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ @@ -5865,13 +5871,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5869 "MachineIndependent/glslang_tab.cpp" +#line 5875 "MachineIndependent/glslang_tab.cpp" break; case 73: /* logical_or_expression: logical_xor_expression */ #line 781 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5875 "MachineIndependent/glslang_tab.cpp" +#line 5881 "MachineIndependent/glslang_tab.cpp" break; case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ @@ -5881,13 +5887,13 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5885 "MachineIndependent/glslang_tab.cpp" +#line 5891 "MachineIndependent/glslang_tab.cpp" break; case 75: /* conditional_expression: logical_or_expression */ #line 790 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5891 "MachineIndependent/glslang_tab.cpp" +#line 5897 "MachineIndependent/glslang_tab.cpp" break; case 76: /* $@1: %empty */ @@ -5895,7 +5901,7 @@ yyreduce: { ++parseContext.controlFlowNestingLevel; } -#line 5899 "MachineIndependent/glslang_tab.cpp" +#line 5905 "MachineIndependent/glslang_tab.cpp" break; case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ @@ -5912,13 +5918,13 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 5916 "MachineIndependent/glslang_tab.cpp" +#line 5922 "MachineIndependent/glslang_tab.cpp" break; case 78: /* assignment_expression: conditional_expression */ #line 809 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5922 "MachineIndependent/glslang_tab.cpp" +#line 5928 "MachineIndependent/glslang_tab.cpp" break; case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */ @@ -5936,7 +5942,7 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 5940 "MachineIndependent/glslang_tab.cpp" +#line 5946 "MachineIndependent/glslang_tab.cpp" break; case 80: /* assignment_operator: EQUAL */ @@ -5945,7 +5951,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 5949 "MachineIndependent/glslang_tab.cpp" +#line 5955 "MachineIndependent/glslang_tab.cpp" break; case 81: /* assignment_operator: MUL_ASSIGN */ @@ -5954,7 +5960,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 5958 "MachineIndependent/glslang_tab.cpp" +#line 5964 "MachineIndependent/glslang_tab.cpp" break; case 82: /* assignment_operator: DIV_ASSIGN */ @@ -5963,7 +5969,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 5967 "MachineIndependent/glslang_tab.cpp" +#line 5973 "MachineIndependent/glslang_tab.cpp" break; case 83: /* assignment_operator: MOD_ASSIGN */ @@ -5973,7 +5979,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 5977 "MachineIndependent/glslang_tab.cpp" +#line 5983 "MachineIndependent/glslang_tab.cpp" break; case 84: /* assignment_operator: ADD_ASSIGN */ @@ -5982,7 +5988,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 5986 "MachineIndependent/glslang_tab.cpp" +#line 5992 "MachineIndependent/glslang_tab.cpp" break; case 85: /* assignment_operator: SUB_ASSIGN */ @@ -5991,7 +5997,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 5995 "MachineIndependent/glslang_tab.cpp" +#line 6001 "MachineIndependent/glslang_tab.cpp" break; case 86: /* assignment_operator: LEFT_ASSIGN */ @@ -6000,7 +6006,7 @@ yyreduce: parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 6004 "MachineIndependent/glslang_tab.cpp" +#line 6010 "MachineIndependent/glslang_tab.cpp" break; case 87: /* assignment_operator: RIGHT_ASSIGN */ @@ -6009,7 +6015,7 @@ yyreduce: parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 6013 "MachineIndependent/glslang_tab.cpp" +#line 6019 "MachineIndependent/glslang_tab.cpp" break; case 88: /* assignment_operator: AND_ASSIGN */ @@ -6018,7 +6024,7 @@ yyreduce: parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 6022 "MachineIndependent/glslang_tab.cpp" +#line 6028 "MachineIndependent/glslang_tab.cpp" break; case 89: /* assignment_operator: XOR_ASSIGN */ @@ -6027,7 +6033,7 @@ yyreduce: parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 6031 "MachineIndependent/glslang_tab.cpp" +#line 6037 "MachineIndependent/glslang_tab.cpp" break; case 90: /* assignment_operator: OR_ASSIGN */ @@ -6036,7 +6042,7 @@ yyreduce: parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 6040 "MachineIndependent/glslang_tab.cpp" +#line 6046 "MachineIndependent/glslang_tab.cpp" break; case 91: /* expression: assignment_expression */ @@ -6044,7 +6050,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6048 "MachineIndependent/glslang_tab.cpp" +#line 6054 "MachineIndependent/glslang_tab.cpp" break; case 92: /* expression: expression COMMA assignment_expression */ @@ -6057,7 +6063,7 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 6061 "MachineIndependent/glslang_tab.cpp" +#line 6067 "MachineIndependent/glslang_tab.cpp" break; case 93: /* constant_expression: conditional_expression */ @@ -6066,7 +6072,7 @@ yyreduce: parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6070 "MachineIndependent/glslang_tab.cpp" +#line 6076 "MachineIndependent/glslang_tab.cpp" break; case 94: /* declaration: function_prototype SEMICOLON */ @@ -6076,7 +6082,7 @@ yyreduce: (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6080 "MachineIndependent/glslang_tab.cpp" +#line 6086 "MachineIndependent/glslang_tab.cpp" break; case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ @@ -6088,7 +6094,7 @@ yyreduce: (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6092 "MachineIndependent/glslang_tab.cpp" +#line 6098 "MachineIndependent/glslang_tab.cpp" break; case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ @@ -6098,7 +6104,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); (yyval.interm.intermNode) = 0; } -#line 6102 "MachineIndependent/glslang_tab.cpp" +#line 6108 "MachineIndependent/glslang_tab.cpp" break; case 97: /* declaration: init_declarator_list SEMICOLON */ @@ -6108,7 +6114,7 @@ yyreduce: (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 6112 "MachineIndependent/glslang_tab.cpp" +#line 6118 "MachineIndependent/glslang_tab.cpp" break; case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ @@ -6120,7 +6126,7 @@ yyreduce: parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 6124 "MachineIndependent/glslang_tab.cpp" +#line 6130 "MachineIndependent/glslang_tab.cpp" break; case 99: /* declaration: block_structure SEMICOLON */ @@ -6129,7 +6135,7 @@ yyreduce: parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } -#line 6133 "MachineIndependent/glslang_tab.cpp" +#line 6139 "MachineIndependent/glslang_tab.cpp" break; case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */ @@ -6138,7 +6144,7 @@ yyreduce: parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 6142 "MachineIndependent/glslang_tab.cpp" +#line 6148 "MachineIndependent/glslang_tab.cpp" break; case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ @@ -6147,7 +6153,7 @@ yyreduce: parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } -#line 6151 "MachineIndependent/glslang_tab.cpp" +#line 6157 "MachineIndependent/glslang_tab.cpp" break; case 102: /* declaration: type_qualifier SEMICOLON */ @@ -6157,7 +6163,7 @@ yyreduce: parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } -#line 6161 "MachineIndependent/glslang_tab.cpp" +#line 6167 "MachineIndependent/glslang_tab.cpp" break; case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */ @@ -6167,7 +6173,7 @@ yyreduce: parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 6171 "MachineIndependent/glslang_tab.cpp" +#line 6177 "MachineIndependent/glslang_tab.cpp" break; case 104: /* declaration: type_qualifier IDENTIFIER identifier_list SEMICOLON */ @@ -6178,13 +6184,13 @@ yyreduce: parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 6182 "MachineIndependent/glslang_tab.cpp" +#line 6188 "MachineIndependent/glslang_tab.cpp" break; case 105: /* $@2: %empty */ #line 957 "MachineIndependent/glslang.y" { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 6188 "MachineIndependent/glslang_tab.cpp" +#line 6194 "MachineIndependent/glslang_tab.cpp" break; case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */ @@ -6198,7 +6204,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 6202 "MachineIndependent/glslang_tab.cpp" +#line 6208 "MachineIndependent/glslang_tab.cpp" break; case 107: /* identifier_list: COMMA IDENTIFIER */ @@ -6207,7 +6213,7 @@ yyreduce: (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6211 "MachineIndependent/glslang_tab.cpp" +#line 6217 "MachineIndependent/glslang_tab.cpp" break; case 108: /* identifier_list: identifier_list COMMA IDENTIFIER */ @@ -6216,7 +6222,7 @@ yyreduce: (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6220 "MachineIndependent/glslang_tab.cpp" +#line 6226 "MachineIndependent/glslang_tab.cpp" break; case 109: /* function_prototype: function_declarator RIGHT_PAREN */ @@ -6225,7 +6231,7 @@ yyreduce: (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 6229 "MachineIndependent/glslang_tab.cpp" +#line 6235 "MachineIndependent/glslang_tab.cpp" break; case 110: /* function_prototype: function_declarator RIGHT_PAREN attribute */ @@ -6236,7 +6242,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6240 "MachineIndependent/glslang_tab.cpp" +#line 6246 "MachineIndependent/glslang_tab.cpp" break; case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN */ @@ -6247,7 +6253,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); } -#line 6251 "MachineIndependent/glslang_tab.cpp" +#line 6257 "MachineIndependent/glslang_tab.cpp" break; case 112: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */ @@ -6259,7 +6265,7 @@ yyreduce: parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6263 "MachineIndependent/glslang_tab.cpp" +#line 6269 "MachineIndependent/glslang_tab.cpp" break; case 113: /* function_declarator: function_header */ @@ -6267,7 +6273,7 @@ yyreduce: { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6271 "MachineIndependent/glslang_tab.cpp" +#line 6277 "MachineIndependent/glslang_tab.cpp" break; case 114: /* function_declarator: function_header_with_parameters */ @@ -6275,7 +6281,7 @@ yyreduce: { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6279 "MachineIndependent/glslang_tab.cpp" +#line 6285 "MachineIndependent/glslang_tab.cpp" break; case 115: /* function_header_with_parameters: function_header parameter_declaration */ @@ -6288,7 +6294,7 @@ yyreduce: else delete (yyvsp[0].interm).param.type; } -#line 6292 "MachineIndependent/glslang_tab.cpp" +#line 6298 "MachineIndependent/glslang_tab.cpp" break; case 116: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */ @@ -6310,7 +6316,7 @@ yyreduce: (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 6314 "MachineIndependent/glslang_tab.cpp" +#line 6320 "MachineIndependent/glslang_tab.cpp" break; case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ @@ -6334,7 +6340,7 @@ yyreduce: function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 6338 "MachineIndependent/glslang_tab.cpp" +#line 6344 "MachineIndependent/glslang_tab.cpp" break; case 118: /* parameter_declarator: type_specifier IDENTIFIER */ @@ -6354,7 +6360,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 6358 "MachineIndependent/glslang_tab.cpp" +#line 6364 "MachineIndependent/glslang_tab.cpp" break; case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ @@ -6378,7 +6384,7 @@ yyreduce: (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 6382 "MachineIndependent/glslang_tab.cpp" +#line 6388 "MachineIndependent/glslang_tab.cpp" break; case 120: /* parameter_declaration: type_qualifier parameter_declarator */ @@ -6394,7 +6400,7 @@ yyreduce: parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6398 "MachineIndependent/glslang_tab.cpp" +#line 6404 "MachineIndependent/glslang_tab.cpp" break; case 121: /* parameter_declaration: parameter_declarator */ @@ -6406,7 +6412,7 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 6410 "MachineIndependent/glslang_tab.cpp" +#line 6416 "MachineIndependent/glslang_tab.cpp" break; case 122: /* parameter_declaration: type_qualifier parameter_type_specifier */ @@ -6421,7 +6427,7 @@ yyreduce: parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6425 "MachineIndependent/glslang_tab.cpp" +#line 6431 "MachineIndependent/glslang_tab.cpp" break; case 123: /* parameter_declaration: parameter_type_specifier */ @@ -6433,7 +6439,7 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 6437 "MachineIndependent/glslang_tab.cpp" +#line 6443 "MachineIndependent/glslang_tab.cpp" break; case 124: /* parameter_type_specifier: type_specifier */ @@ -6444,7 +6450,7 @@ yyreduce: if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 6448 "MachineIndependent/glslang_tab.cpp" +#line 6454 "MachineIndependent/glslang_tab.cpp" break; case 125: /* init_declarator_list: single_declaration */ @@ -6452,7 +6458,7 @@ yyreduce: { (yyval.interm) = (yyvsp[0].interm); } -#line 6456 "MachineIndependent/glslang_tab.cpp" +#line 6462 "MachineIndependent/glslang_tab.cpp" break; case 126: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ @@ -6461,7 +6467,7 @@ yyreduce: (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 6465 "MachineIndependent/glslang_tab.cpp" +#line 6471 "MachineIndependent/glslang_tab.cpp" break; case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ @@ -6470,7 +6476,7 @@ yyreduce: (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 6474 "MachineIndependent/glslang_tab.cpp" +#line 6480 "MachineIndependent/glslang_tab.cpp" break; case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ @@ -6480,7 +6486,7 @@ yyreduce: TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6484 "MachineIndependent/glslang_tab.cpp" +#line 6490 "MachineIndependent/glslang_tab.cpp" break; case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ @@ -6490,7 +6496,7 @@ yyreduce: TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6494 "MachineIndependent/glslang_tab.cpp" +#line 6500 "MachineIndependent/glslang_tab.cpp" break; case 130: /* single_declaration: fully_specified_type */ @@ -6502,7 +6508,7 @@ yyreduce: parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 6506 "MachineIndependent/glslang_tab.cpp" +#line 6512 "MachineIndependent/glslang_tab.cpp" break; case 131: /* single_declaration: fully_specified_type IDENTIFIER */ @@ -6512,7 +6518,7 @@ yyreduce: (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 6516 "MachineIndependent/glslang_tab.cpp" +#line 6522 "MachineIndependent/glslang_tab.cpp" break; case 132: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ @@ -6522,7 +6528,7 @@ yyreduce: (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 6526 "MachineIndependent/glslang_tab.cpp" +#line 6532 "MachineIndependent/glslang_tab.cpp" break; case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ @@ -6532,7 +6538,7 @@ yyreduce: TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6536 "MachineIndependent/glslang_tab.cpp" +#line 6542 "MachineIndependent/glslang_tab.cpp" break; case 134: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ @@ -6542,7 +6548,7 @@ yyreduce: TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6546 "MachineIndependent/glslang_tab.cpp" +#line 6552 "MachineIndependent/glslang_tab.cpp" break; case 135: /* fully_specified_type: type_specifier */ @@ -6557,7 +6563,7 @@ yyreduce: } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } -#line 6561 "MachineIndependent/glslang_tab.cpp" +#line 6567 "MachineIndependent/glslang_tab.cpp" break; case 136: /* fully_specified_type: type_qualifier type_specifier */ @@ -6586,7 +6592,7 @@ yyreduce: (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 6590 "MachineIndependent/glslang_tab.cpp" +#line 6596 "MachineIndependent/glslang_tab.cpp" break; case 137: /* invariant_qualifier: INVARIANT */ @@ -6597,7 +6603,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 6601 "MachineIndependent/glslang_tab.cpp" +#line 6607 "MachineIndependent/glslang_tab.cpp" break; case 138: /* interpolation_qualifier: SMOOTH */ @@ -6609,7 +6615,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 6613 "MachineIndependent/glslang_tab.cpp" +#line 6619 "MachineIndependent/glslang_tab.cpp" break; case 139: /* interpolation_qualifier: FLAT */ @@ -6621,7 +6627,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 6625 "MachineIndependent/glslang_tab.cpp" +#line 6631 "MachineIndependent/glslang_tab.cpp" break; case 140: /* interpolation_qualifier: NOPERSPECTIVE */ @@ -6633,7 +6639,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 6637 "MachineIndependent/glslang_tab.cpp" +#line 6643 "MachineIndependent/glslang_tab.cpp" break; case 141: /* interpolation_qualifier: EXPLICITINTERPAMD */ @@ -6645,7 +6651,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.explicitInterp = true; } -#line 6649 "MachineIndependent/glslang_tab.cpp" +#line 6655 "MachineIndependent/glslang_tab.cpp" break; case 142: /* interpolation_qualifier: PERVERTEXNV */ @@ -6658,7 +6664,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexNV = true; } -#line 6662 "MachineIndependent/glslang_tab.cpp" +#line 6668 "MachineIndependent/glslang_tab.cpp" break; case 143: /* interpolation_qualifier: PERVERTEXEXT */ @@ -6671,7 +6677,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexEXT = true; } -#line 6675 "MachineIndependent/glslang_tab.cpp" +#line 6681 "MachineIndependent/glslang_tab.cpp" break; case 144: /* interpolation_qualifier: PERPRIMITIVENV */ @@ -6686,7 +6692,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6690 "MachineIndependent/glslang_tab.cpp" +#line 6696 "MachineIndependent/glslang_tab.cpp" break; case 145: /* interpolation_qualifier: PERPRIMITIVEEXT */ @@ -6701,7 +6707,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6705 "MachineIndependent/glslang_tab.cpp" +#line 6711 "MachineIndependent/glslang_tab.cpp" break; case 146: /* interpolation_qualifier: PERVIEWNV */ @@ -6713,7 +6719,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perViewNV = true; } -#line 6717 "MachineIndependent/glslang_tab.cpp" +#line 6723 "MachineIndependent/glslang_tab.cpp" break; case 147: /* interpolation_qualifier: PERTASKNV */ @@ -6725,7 +6731,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perTaskNV = true; } -#line 6729 "MachineIndependent/glslang_tab.cpp" +#line 6735 "MachineIndependent/glslang_tab.cpp" break; case 148: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ @@ -6733,7 +6739,7 @@ yyreduce: { (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 6737 "MachineIndependent/glslang_tab.cpp" +#line 6743 "MachineIndependent/glslang_tab.cpp" break; case 149: /* layout_qualifier_id_list: layout_qualifier_id */ @@ -6741,7 +6747,7 @@ yyreduce: { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6745 "MachineIndependent/glslang_tab.cpp" +#line 6751 "MachineIndependent/glslang_tab.cpp" break; case 150: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ @@ -6751,7 +6757,7 @@ yyreduce: (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6755 "MachineIndependent/glslang_tab.cpp" +#line 6761 "MachineIndependent/glslang_tab.cpp" break; case 151: /* layout_qualifier_id: IDENTIFIER */ @@ -6760,7 +6766,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 6764 "MachineIndependent/glslang_tab.cpp" +#line 6770 "MachineIndependent/glslang_tab.cpp" break; case 152: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ @@ -6769,7 +6775,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 6773 "MachineIndependent/glslang_tab.cpp" +#line 6779 "MachineIndependent/glslang_tab.cpp" break; case 153: /* layout_qualifier_id: SHARED */ @@ -6779,7 +6785,7 @@ yyreduce: TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 6783 "MachineIndependent/glslang_tab.cpp" +#line 6789 "MachineIndependent/glslang_tab.cpp" break; case 154: /* precise_qualifier: PRECISE */ @@ -6790,7 +6796,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 6794 "MachineIndependent/glslang_tab.cpp" +#line 6800 "MachineIndependent/glslang_tab.cpp" break; case 155: /* type_qualifier: single_type_qualifier */ @@ -6798,7 +6804,7 @@ yyreduce: { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6802 "MachineIndependent/glslang_tab.cpp" +#line 6808 "MachineIndependent/glslang_tab.cpp" break; case 156: /* type_qualifier: type_qualifier single_type_qualifier */ @@ -6811,7 +6817,7 @@ yyreduce: (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6815 "MachineIndependent/glslang_tab.cpp" +#line 6821 "MachineIndependent/glslang_tab.cpp" break; case 157: /* single_type_qualifier: storage_qualifier */ @@ -6819,7 +6825,7 @@ yyreduce: { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6823 "MachineIndependent/glslang_tab.cpp" +#line 6829 "MachineIndependent/glslang_tab.cpp" break; case 158: /* single_type_qualifier: layout_qualifier */ @@ -6827,7 +6833,7 @@ yyreduce: { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6831 "MachineIndependent/glslang_tab.cpp" +#line 6837 "MachineIndependent/glslang_tab.cpp" break; case 159: /* single_type_qualifier: precision_qualifier */ @@ -6836,7 +6842,7 @@ yyreduce: parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6840 "MachineIndependent/glslang_tab.cpp" +#line 6846 "MachineIndependent/glslang_tab.cpp" break; case 160: /* single_type_qualifier: interpolation_qualifier */ @@ -6845,7 +6851,7 @@ yyreduce: // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6849 "MachineIndependent/glslang_tab.cpp" +#line 6855 "MachineIndependent/glslang_tab.cpp" break; case 161: /* single_type_qualifier: invariant_qualifier */ @@ -6854,7 +6860,7 @@ yyreduce: // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6858 "MachineIndependent/glslang_tab.cpp" +#line 6864 "MachineIndependent/glslang_tab.cpp" break; case 162: /* single_type_qualifier: precise_qualifier */ @@ -6863,7 +6869,7 @@ yyreduce: // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6867 "MachineIndependent/glslang_tab.cpp" +#line 6873 "MachineIndependent/glslang_tab.cpp" break; case 163: /* single_type_qualifier: non_uniform_qualifier */ @@ -6871,7 +6877,7 @@ yyreduce: { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6875 "MachineIndependent/glslang_tab.cpp" +#line 6881 "MachineIndependent/glslang_tab.cpp" break; case 164: /* single_type_qualifier: spirv_storage_class_qualifier */ @@ -6881,7 +6887,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6885 "MachineIndependent/glslang_tab.cpp" +#line 6891 "MachineIndependent/glslang_tab.cpp" break; case 165: /* single_type_qualifier: spirv_decorate_qualifier */ @@ -6890,7 +6896,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6894 "MachineIndependent/glslang_tab.cpp" +#line 6900 "MachineIndependent/glslang_tab.cpp" break; case 166: /* single_type_qualifier: SPIRV_BY_REFERENCE */ @@ -6900,7 +6906,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvByReference(); } -#line 6904 "MachineIndependent/glslang_tab.cpp" +#line 6910 "MachineIndependent/glslang_tab.cpp" break; case 167: /* single_type_qualifier: SPIRV_LITERAL */ @@ -6910,7 +6916,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvLiteral(); } -#line 6914 "MachineIndependent/glslang_tab.cpp" +#line 6920 "MachineIndependent/glslang_tab.cpp" break; case 168: /* storage_qualifier: CONST */ @@ -6919,7 +6925,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 6923 "MachineIndependent/glslang_tab.cpp" +#line 6929 "MachineIndependent/glslang_tab.cpp" break; case 169: /* storage_qualifier: INOUT */ @@ -6929,7 +6935,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 6933 "MachineIndependent/glslang_tab.cpp" +#line 6939 "MachineIndependent/glslang_tab.cpp" break; case 170: /* storage_qualifier: IN */ @@ -6940,7 +6946,7 @@ yyreduce: // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 6944 "MachineIndependent/glslang_tab.cpp" +#line 6950 "MachineIndependent/glslang_tab.cpp" break; case 171: /* storage_qualifier: OUT */ @@ -6951,7 +6957,7 @@ yyreduce: // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 6955 "MachineIndependent/glslang_tab.cpp" +#line 6961 "MachineIndependent/glslang_tab.cpp" break; case 172: /* storage_qualifier: CENTROID */ @@ -6963,7 +6969,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 6967 "MachineIndependent/glslang_tab.cpp" +#line 6973 "MachineIndependent/glslang_tab.cpp" break; case 173: /* storage_qualifier: UNIFORM */ @@ -6973,7 +6979,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 6977 "MachineIndependent/glslang_tab.cpp" +#line 6983 "MachineIndependent/glslang_tab.cpp" break; case 174: /* storage_qualifier: SHARED */ @@ -6986,7 +6992,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 6990 "MachineIndependent/glslang_tab.cpp" +#line 6996 "MachineIndependent/glslang_tab.cpp" break; case 175: /* storage_qualifier: BUFFER */ @@ -6996,7 +7002,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 7000 "MachineIndependent/glslang_tab.cpp" +#line 7006 "MachineIndependent/glslang_tab.cpp" break; case 176: /* storage_qualifier: ATTRIBUTE */ @@ -7013,7 +7019,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7017 "MachineIndependent/glslang_tab.cpp" +#line 7023 "MachineIndependent/glslang_tab.cpp" break; case 177: /* storage_qualifier: VARYING */ @@ -7032,7 +7038,7 @@ yyreduce: else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7036 "MachineIndependent/glslang_tab.cpp" +#line 7042 "MachineIndependent/glslang_tab.cpp" break; case 178: /* storage_qualifier: PATCH */ @@ -7043,7 +7049,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 7047 "MachineIndependent/glslang_tab.cpp" +#line 7053 "MachineIndependent/glslang_tab.cpp" break; case 179: /* storage_qualifier: SAMPLE */ @@ -7053,7 +7059,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 7057 "MachineIndependent/glslang_tab.cpp" +#line 7063 "MachineIndependent/glslang_tab.cpp" break; case 180: /* storage_qualifier: HITATTRNV */ @@ -7066,7 +7072,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7070 "MachineIndependent/glslang_tab.cpp" +#line 7076 "MachineIndependent/glslang_tab.cpp" break; case 181: /* storage_qualifier: HITOBJECTATTRNV */ @@ -7079,7 +7085,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitObjectAttrNV; } -#line 7083 "MachineIndependent/glslang_tab.cpp" +#line 7089 "MachineIndependent/glslang_tab.cpp" break; case 182: /* storage_qualifier: HITATTREXT */ @@ -7092,7 +7098,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7096 "MachineIndependent/glslang_tab.cpp" +#line 7102 "MachineIndependent/glslang_tab.cpp" break; case 183: /* storage_qualifier: PAYLOADNV */ @@ -7105,7 +7111,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7109 "MachineIndependent/glslang_tab.cpp" +#line 7115 "MachineIndependent/glslang_tab.cpp" break; case 184: /* storage_qualifier: PAYLOADEXT */ @@ -7118,7 +7124,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7122 "MachineIndependent/glslang_tab.cpp" +#line 7128 "MachineIndependent/glslang_tab.cpp" break; case 185: /* storage_qualifier: PAYLOADINNV */ @@ -7131,7 +7137,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7135 "MachineIndependent/glslang_tab.cpp" +#line 7141 "MachineIndependent/glslang_tab.cpp" break; case 186: /* storage_qualifier: PAYLOADINEXT */ @@ -7144,7 +7150,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7148 "MachineIndependent/glslang_tab.cpp" +#line 7154 "MachineIndependent/glslang_tab.cpp" break; case 187: /* storage_qualifier: CALLDATANV */ @@ -7157,7 +7163,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7161 "MachineIndependent/glslang_tab.cpp" +#line 7167 "MachineIndependent/glslang_tab.cpp" break; case 188: /* storage_qualifier: CALLDATAEXT */ @@ -7170,7 +7176,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7174 "MachineIndependent/glslang_tab.cpp" +#line 7180 "MachineIndependent/glslang_tab.cpp" break; case 189: /* storage_qualifier: CALLDATAINNV */ @@ -7182,7 +7188,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7186 "MachineIndependent/glslang_tab.cpp" +#line 7192 "MachineIndependent/glslang_tab.cpp" break; case 190: /* storage_qualifier: CALLDATAINEXT */ @@ -7194,7 +7200,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7198 "MachineIndependent/glslang_tab.cpp" +#line 7204 "MachineIndependent/glslang_tab.cpp" break; case 191: /* storage_qualifier: COHERENT */ @@ -7203,7 +7209,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 7207 "MachineIndependent/glslang_tab.cpp" +#line 7213 "MachineIndependent/glslang_tab.cpp" break; case 192: /* storage_qualifier: DEVICECOHERENT */ @@ -7213,7 +7219,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 7217 "MachineIndependent/glslang_tab.cpp" +#line 7223 "MachineIndependent/glslang_tab.cpp" break; case 193: /* storage_qualifier: QUEUEFAMILYCOHERENT */ @@ -7223,7 +7229,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 7227 "MachineIndependent/glslang_tab.cpp" +#line 7233 "MachineIndependent/glslang_tab.cpp" break; case 194: /* storage_qualifier: WORKGROUPCOHERENT */ @@ -7233,7 +7239,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 7237 "MachineIndependent/glslang_tab.cpp" +#line 7243 "MachineIndependent/glslang_tab.cpp" break; case 195: /* storage_qualifier: SUBGROUPCOHERENT */ @@ -7243,7 +7249,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 7247 "MachineIndependent/glslang_tab.cpp" +#line 7253 "MachineIndependent/glslang_tab.cpp" break; case 196: /* storage_qualifier: NONPRIVATE */ @@ -7253,7 +7259,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 7257 "MachineIndependent/glslang_tab.cpp" +#line 7263 "MachineIndependent/glslang_tab.cpp" break; case 197: /* storage_qualifier: SHADERCALLCOHERENT */ @@ -7263,7 +7269,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); (yyval.interm.type).qualifier.shadercallcoherent = true; } -#line 7267 "MachineIndependent/glslang_tab.cpp" +#line 7273 "MachineIndependent/glslang_tab.cpp" break; case 198: /* storage_qualifier: VOLATILE */ @@ -7272,7 +7278,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 7276 "MachineIndependent/glslang_tab.cpp" +#line 7282 "MachineIndependent/glslang_tab.cpp" break; case 199: /* storage_qualifier: RESTRICT */ @@ -7281,7 +7287,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 7285 "MachineIndependent/glslang_tab.cpp" +#line 7291 "MachineIndependent/glslang_tab.cpp" break; case 200: /* storage_qualifier: READONLY */ @@ -7290,7 +7296,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 7294 "MachineIndependent/glslang_tab.cpp" +#line 7300 "MachineIndependent/glslang_tab.cpp" break; case 201: /* storage_qualifier: WRITEONLY */ @@ -7299,7 +7305,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 7303 "MachineIndependent/glslang_tab.cpp" +#line 7309 "MachineIndependent/glslang_tab.cpp" break; case 202: /* storage_qualifier: SUBROUTINE */ @@ -7310,7 +7316,7 @@ yyreduce: parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 7314 "MachineIndependent/glslang_tab.cpp" +#line 7320 "MachineIndependent/glslang_tab.cpp" break; case 203: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ @@ -7321,7 +7327,7 @@ yyreduce: parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 7325 "MachineIndependent/glslang_tab.cpp" +#line 7331 "MachineIndependent/glslang_tab.cpp" break; case 204: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ @@ -7333,7 +7339,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT; } -#line 7337 "MachineIndependent/glslang_tab.cpp" +#line 7343 "MachineIndependent/glslang_tab.cpp" break; case 205: /* non_uniform_qualifier: NONUNIFORM */ @@ -7342,7 +7348,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 7346 "MachineIndependent/glslang_tab.cpp" +#line 7352 "MachineIndependent/glslang_tab.cpp" break; case 206: /* type_name_list: IDENTIFIER */ @@ -7350,7 +7356,7 @@ yyreduce: { // TODO } -#line 7354 "MachineIndependent/glslang_tab.cpp" +#line 7360 "MachineIndependent/glslang_tab.cpp" break; case 207: /* type_name_list: type_name_list COMMA IDENTIFIER */ @@ -7360,7 +7366,7 @@ yyreduce: // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 7364 "MachineIndependent/glslang_tab.cpp" +#line 7370 "MachineIndependent/glslang_tab.cpp" break; case 208: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ @@ -7370,7 +7376,7 @@ yyreduce: (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); (yyval.interm.type).typeParameters = (yyvsp[0].interm.typeParameters); } -#line 7374 "MachineIndependent/glslang_tab.cpp" +#line 7380 "MachineIndependent/glslang_tab.cpp" break; case 209: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ @@ -7382,7 +7388,7 @@ yyreduce: (yyval.interm.type).typeParameters = (yyvsp[-1].interm.typeParameters); (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 7386 "MachineIndependent/glslang_tab.cpp" +#line 7392 "MachineIndependent/glslang_tab.cpp" break; case 210: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ @@ -7392,7 +7398,7 @@ yyreduce: (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 7396 "MachineIndependent/glslang_tab.cpp" +#line 7402 "MachineIndependent/glslang_tab.cpp" break; case 211: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ @@ -7405,7 +7411,7 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7409 "MachineIndependent/glslang_tab.cpp" +#line 7415 "MachineIndependent/glslang_tab.cpp" break; case 212: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ @@ -7414,7 +7420,7 @@ yyreduce: (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 7418 "MachineIndependent/glslang_tab.cpp" +#line 7424 "MachineIndependent/glslang_tab.cpp" break; case 213: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ @@ -7426,7 +7432,7 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7430 "MachineIndependent/glslang_tab.cpp" +#line 7436 "MachineIndependent/glslang_tab.cpp" break; case 214: /* type_parameter_specifier_opt: type_parameter_specifier */ @@ -7434,7 +7440,7 @@ yyreduce: { (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); } -#line 7438 "MachineIndependent/glslang_tab.cpp" +#line 7444 "MachineIndependent/glslang_tab.cpp" break; case 215: /* type_parameter_specifier_opt: %empty */ @@ -7442,7 +7448,7 @@ yyreduce: { (yyval.interm.typeParameters) = 0; } -#line 7446 "MachineIndependent/glslang_tab.cpp" +#line 7452 "MachineIndependent/glslang_tab.cpp" break; case 216: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ @@ -7450,7 +7456,7 @@ yyreduce: { (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); } -#line 7454 "MachineIndependent/glslang_tab.cpp" +#line 7460 "MachineIndependent/glslang_tab.cpp" break; case 217: /* type_parameter_specifier_list: unary_expression */ @@ -7462,7 +7468,7 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 7466 "MachineIndependent/glslang_tab.cpp" +#line 7472 "MachineIndependent/glslang_tab.cpp" break; case 218: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ @@ -7474,7 +7480,7 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 7478 "MachineIndependent/glslang_tab.cpp" +#line 7484 "MachineIndependent/glslang_tab.cpp" break; case 219: /* type_specifier_nonarray: VOID */ @@ -7483,7 +7489,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 7487 "MachineIndependent/glslang_tab.cpp" +#line 7493 "MachineIndependent/glslang_tab.cpp" break; case 220: /* type_specifier_nonarray: FLOAT */ @@ -7492,7 +7498,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7496 "MachineIndependent/glslang_tab.cpp" +#line 7502 "MachineIndependent/glslang_tab.cpp" break; case 221: /* type_specifier_nonarray: INT */ @@ -7501,7 +7507,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7505 "MachineIndependent/glslang_tab.cpp" +#line 7511 "MachineIndependent/glslang_tab.cpp" break; case 222: /* type_specifier_nonarray: UINT */ @@ -7511,7 +7517,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7515 "MachineIndependent/glslang_tab.cpp" +#line 7521 "MachineIndependent/glslang_tab.cpp" break; case 223: /* type_specifier_nonarray: BOOL */ @@ -7520,7 +7526,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; } -#line 7524 "MachineIndependent/glslang_tab.cpp" +#line 7530 "MachineIndependent/glslang_tab.cpp" break; case 224: /* type_specifier_nonarray: VEC2 */ @@ -7530,7 +7536,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 7534 "MachineIndependent/glslang_tab.cpp" +#line 7540 "MachineIndependent/glslang_tab.cpp" break; case 225: /* type_specifier_nonarray: VEC3 */ @@ -7540,7 +7546,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 7544 "MachineIndependent/glslang_tab.cpp" +#line 7550 "MachineIndependent/glslang_tab.cpp" break; case 226: /* type_specifier_nonarray: VEC4 */ @@ -7550,7 +7556,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 7554 "MachineIndependent/glslang_tab.cpp" +#line 7560 "MachineIndependent/glslang_tab.cpp" break; case 227: /* type_specifier_nonarray: BVEC2 */ @@ -7560,7 +7566,7 @@ yyreduce: (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(2); } -#line 7564 "MachineIndependent/glslang_tab.cpp" +#line 7570 "MachineIndependent/glslang_tab.cpp" break; case 228: /* type_specifier_nonarray: BVEC3 */ @@ -7570,7 +7576,7 @@ yyreduce: (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(3); } -#line 7574 "MachineIndependent/glslang_tab.cpp" +#line 7580 "MachineIndependent/glslang_tab.cpp" break; case 229: /* type_specifier_nonarray: BVEC4 */ @@ -7580,7 +7586,7 @@ yyreduce: (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(4); } -#line 7584 "MachineIndependent/glslang_tab.cpp" +#line 7590 "MachineIndependent/glslang_tab.cpp" break; case 230: /* type_specifier_nonarray: IVEC2 */ @@ -7590,7 +7596,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 7594 "MachineIndependent/glslang_tab.cpp" +#line 7600 "MachineIndependent/glslang_tab.cpp" break; case 231: /* type_specifier_nonarray: IVEC3 */ @@ -7600,7 +7606,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 7604 "MachineIndependent/glslang_tab.cpp" +#line 7610 "MachineIndependent/glslang_tab.cpp" break; case 232: /* type_specifier_nonarray: IVEC4 */ @@ -7610,7 +7616,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 7614 "MachineIndependent/glslang_tab.cpp" +#line 7620 "MachineIndependent/glslang_tab.cpp" break; case 233: /* type_specifier_nonarray: UVEC2 */ @@ -7621,7 +7627,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 7625 "MachineIndependent/glslang_tab.cpp" +#line 7631 "MachineIndependent/glslang_tab.cpp" break; case 234: /* type_specifier_nonarray: UVEC3 */ @@ -7632,7 +7638,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 7636 "MachineIndependent/glslang_tab.cpp" +#line 7642 "MachineIndependent/glslang_tab.cpp" break; case 235: /* type_specifier_nonarray: UVEC4 */ @@ -7643,7 +7649,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 7647 "MachineIndependent/glslang_tab.cpp" +#line 7653 "MachineIndependent/glslang_tab.cpp" break; case 236: /* type_specifier_nonarray: MAT2 */ @@ -7653,7 +7659,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7657 "MachineIndependent/glslang_tab.cpp" +#line 7663 "MachineIndependent/glslang_tab.cpp" break; case 237: /* type_specifier_nonarray: MAT3 */ @@ -7663,7 +7669,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7667 "MachineIndependent/glslang_tab.cpp" +#line 7673 "MachineIndependent/glslang_tab.cpp" break; case 238: /* type_specifier_nonarray: MAT4 */ @@ -7673,7 +7679,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7677 "MachineIndependent/glslang_tab.cpp" +#line 7683 "MachineIndependent/glslang_tab.cpp" break; case 239: /* type_specifier_nonarray: MAT2X2 */ @@ -7683,7 +7689,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7687 "MachineIndependent/glslang_tab.cpp" +#line 7693 "MachineIndependent/glslang_tab.cpp" break; case 240: /* type_specifier_nonarray: MAT2X3 */ @@ -7693,7 +7699,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 7697 "MachineIndependent/glslang_tab.cpp" +#line 7703 "MachineIndependent/glslang_tab.cpp" break; case 241: /* type_specifier_nonarray: MAT2X4 */ @@ -7703,7 +7709,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 7707 "MachineIndependent/glslang_tab.cpp" +#line 7713 "MachineIndependent/glslang_tab.cpp" break; case 242: /* type_specifier_nonarray: MAT3X2 */ @@ -7713,7 +7719,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 7717 "MachineIndependent/glslang_tab.cpp" +#line 7723 "MachineIndependent/glslang_tab.cpp" break; case 243: /* type_specifier_nonarray: MAT3X3 */ @@ -7723,7 +7729,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7727 "MachineIndependent/glslang_tab.cpp" +#line 7733 "MachineIndependent/glslang_tab.cpp" break; case 244: /* type_specifier_nonarray: MAT3X4 */ @@ -7733,7 +7739,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7737 "MachineIndependent/glslang_tab.cpp" +#line 7743 "MachineIndependent/glslang_tab.cpp" break; case 245: /* type_specifier_nonarray: MAT4X2 */ @@ -7743,7 +7749,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7747 "MachineIndependent/glslang_tab.cpp" +#line 7753 "MachineIndependent/glslang_tab.cpp" break; case 246: /* type_specifier_nonarray: MAT4X3 */ @@ -7753,7 +7759,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7757 "MachineIndependent/glslang_tab.cpp" +#line 7763 "MachineIndependent/glslang_tab.cpp" break; case 247: /* type_specifier_nonarray: MAT4X4 */ @@ -7763,7 +7769,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7767 "MachineIndependent/glslang_tab.cpp" +#line 7773 "MachineIndependent/glslang_tab.cpp" break; case 248: /* type_specifier_nonarray: DOUBLE */ @@ -7775,7 +7781,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7779 "MachineIndependent/glslang_tab.cpp" +#line 7785 "MachineIndependent/glslang_tab.cpp" break; case 249: /* type_specifier_nonarray: FLOAT16_T */ @@ -7785,7 +7791,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 7789 "MachineIndependent/glslang_tab.cpp" +#line 7795 "MachineIndependent/glslang_tab.cpp" break; case 250: /* type_specifier_nonarray: FLOAT32_T */ @@ -7795,7 +7801,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7799 "MachineIndependent/glslang_tab.cpp" +#line 7805 "MachineIndependent/glslang_tab.cpp" break; case 251: /* type_specifier_nonarray: FLOAT64_T */ @@ -7805,7 +7811,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7809 "MachineIndependent/glslang_tab.cpp" +#line 7815 "MachineIndependent/glslang_tab.cpp" break; case 252: /* type_specifier_nonarray: INT8_T */ @@ -7815,7 +7821,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 7819 "MachineIndependent/glslang_tab.cpp" +#line 7825 "MachineIndependent/glslang_tab.cpp" break; case 253: /* type_specifier_nonarray: UINT8_T */ @@ -7825,7 +7831,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 7829 "MachineIndependent/glslang_tab.cpp" +#line 7835 "MachineIndependent/glslang_tab.cpp" break; case 254: /* type_specifier_nonarray: INT16_T */ @@ -7835,7 +7841,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 7839 "MachineIndependent/glslang_tab.cpp" +#line 7845 "MachineIndependent/glslang_tab.cpp" break; case 255: /* type_specifier_nonarray: UINT16_T */ @@ -7845,7 +7851,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 7849 "MachineIndependent/glslang_tab.cpp" +#line 7855 "MachineIndependent/glslang_tab.cpp" break; case 256: /* type_specifier_nonarray: INT32_T */ @@ -7855,7 +7861,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7859 "MachineIndependent/glslang_tab.cpp" +#line 7865 "MachineIndependent/glslang_tab.cpp" break; case 257: /* type_specifier_nonarray: UINT32_T */ @@ -7865,7 +7871,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7869 "MachineIndependent/glslang_tab.cpp" +#line 7875 "MachineIndependent/glslang_tab.cpp" break; case 258: /* type_specifier_nonarray: INT64_T */ @@ -7875,7 +7881,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 7879 "MachineIndependent/glslang_tab.cpp" +#line 7885 "MachineIndependent/glslang_tab.cpp" break; case 259: /* type_specifier_nonarray: UINT64_T */ @@ -7885,7 +7891,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 7889 "MachineIndependent/glslang_tab.cpp" +#line 7895 "MachineIndependent/glslang_tab.cpp" break; case 260: /* type_specifier_nonarray: DVEC2 */ @@ -7898,7 +7904,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 7902 "MachineIndependent/glslang_tab.cpp" +#line 7908 "MachineIndependent/glslang_tab.cpp" break; case 261: /* type_specifier_nonarray: DVEC3 */ @@ -7911,7 +7917,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 7915 "MachineIndependent/glslang_tab.cpp" +#line 7921 "MachineIndependent/glslang_tab.cpp" break; case 262: /* type_specifier_nonarray: DVEC4 */ @@ -7924,7 +7930,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 7928 "MachineIndependent/glslang_tab.cpp" +#line 7934 "MachineIndependent/glslang_tab.cpp" break; case 263: /* type_specifier_nonarray: F16VEC2 */ @@ -7935,7 +7941,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(2); } -#line 7939 "MachineIndependent/glslang_tab.cpp" +#line 7945 "MachineIndependent/glslang_tab.cpp" break; case 264: /* type_specifier_nonarray: F16VEC3 */ @@ -7946,7 +7952,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(3); } -#line 7950 "MachineIndependent/glslang_tab.cpp" +#line 7956 "MachineIndependent/glslang_tab.cpp" break; case 265: /* type_specifier_nonarray: F16VEC4 */ @@ -7957,7 +7963,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(4); } -#line 7961 "MachineIndependent/glslang_tab.cpp" +#line 7967 "MachineIndependent/glslang_tab.cpp" break; case 266: /* type_specifier_nonarray: F32VEC2 */ @@ -7968,7 +7974,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 7972 "MachineIndependent/glslang_tab.cpp" +#line 7978 "MachineIndependent/glslang_tab.cpp" break; case 267: /* type_specifier_nonarray: F32VEC3 */ @@ -7979,7 +7985,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 7983 "MachineIndependent/glslang_tab.cpp" +#line 7989 "MachineIndependent/glslang_tab.cpp" break; case 268: /* type_specifier_nonarray: F32VEC4 */ @@ -7990,7 +7996,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 7994 "MachineIndependent/glslang_tab.cpp" +#line 8000 "MachineIndependent/glslang_tab.cpp" break; case 269: /* type_specifier_nonarray: F64VEC2 */ @@ -8001,7 +8007,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 8005 "MachineIndependent/glslang_tab.cpp" +#line 8011 "MachineIndependent/glslang_tab.cpp" break; case 270: /* type_specifier_nonarray: F64VEC3 */ @@ -8012,7 +8018,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 8016 "MachineIndependent/glslang_tab.cpp" +#line 8022 "MachineIndependent/glslang_tab.cpp" break; case 271: /* type_specifier_nonarray: F64VEC4 */ @@ -8023,7 +8029,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 8027 "MachineIndependent/glslang_tab.cpp" +#line 8033 "MachineIndependent/glslang_tab.cpp" break; case 272: /* type_specifier_nonarray: I8VEC2 */ @@ -8034,7 +8040,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(2); } -#line 8038 "MachineIndependent/glslang_tab.cpp" +#line 8044 "MachineIndependent/glslang_tab.cpp" break; case 273: /* type_specifier_nonarray: I8VEC3 */ @@ -8045,7 +8051,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(3); } -#line 8049 "MachineIndependent/glslang_tab.cpp" +#line 8055 "MachineIndependent/glslang_tab.cpp" break; case 274: /* type_specifier_nonarray: I8VEC4 */ @@ -8056,7 +8062,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(4); } -#line 8060 "MachineIndependent/glslang_tab.cpp" +#line 8066 "MachineIndependent/glslang_tab.cpp" break; case 275: /* type_specifier_nonarray: I16VEC2 */ @@ -8067,7 +8073,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(2); } -#line 8071 "MachineIndependent/glslang_tab.cpp" +#line 8077 "MachineIndependent/glslang_tab.cpp" break; case 276: /* type_specifier_nonarray: I16VEC3 */ @@ -8078,7 +8084,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(3); } -#line 8082 "MachineIndependent/glslang_tab.cpp" +#line 8088 "MachineIndependent/glslang_tab.cpp" break; case 277: /* type_specifier_nonarray: I16VEC4 */ @@ -8089,7 +8095,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(4); } -#line 8093 "MachineIndependent/glslang_tab.cpp" +#line 8099 "MachineIndependent/glslang_tab.cpp" break; case 278: /* type_specifier_nonarray: I32VEC2 */ @@ -8100,7 +8106,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 8104 "MachineIndependent/glslang_tab.cpp" +#line 8110 "MachineIndependent/glslang_tab.cpp" break; case 279: /* type_specifier_nonarray: I32VEC3 */ @@ -8111,7 +8117,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 8115 "MachineIndependent/glslang_tab.cpp" +#line 8121 "MachineIndependent/glslang_tab.cpp" break; case 280: /* type_specifier_nonarray: I32VEC4 */ @@ -8122,7 +8128,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 8126 "MachineIndependent/glslang_tab.cpp" +#line 8132 "MachineIndependent/glslang_tab.cpp" break; case 281: /* type_specifier_nonarray: I64VEC2 */ @@ -8133,7 +8139,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(2); } -#line 8137 "MachineIndependent/glslang_tab.cpp" +#line 8143 "MachineIndependent/glslang_tab.cpp" break; case 282: /* type_specifier_nonarray: I64VEC3 */ @@ -8144,7 +8150,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(3); } -#line 8148 "MachineIndependent/glslang_tab.cpp" +#line 8154 "MachineIndependent/glslang_tab.cpp" break; case 283: /* type_specifier_nonarray: I64VEC4 */ @@ -8155,7 +8161,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 8159 "MachineIndependent/glslang_tab.cpp" +#line 8165 "MachineIndependent/glslang_tab.cpp" break; case 284: /* type_specifier_nonarray: U8VEC2 */ @@ -8166,7 +8172,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(2); } -#line 8170 "MachineIndependent/glslang_tab.cpp" +#line 8176 "MachineIndependent/glslang_tab.cpp" break; case 285: /* type_specifier_nonarray: U8VEC3 */ @@ -8177,7 +8183,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(3); } -#line 8181 "MachineIndependent/glslang_tab.cpp" +#line 8187 "MachineIndependent/glslang_tab.cpp" break; case 286: /* type_specifier_nonarray: U8VEC4 */ @@ -8188,7 +8194,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 8192 "MachineIndependent/glslang_tab.cpp" +#line 8198 "MachineIndependent/glslang_tab.cpp" break; case 287: /* type_specifier_nonarray: U16VEC2 */ @@ -8199,7 +8205,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(2); } -#line 8203 "MachineIndependent/glslang_tab.cpp" +#line 8209 "MachineIndependent/glslang_tab.cpp" break; case 288: /* type_specifier_nonarray: U16VEC3 */ @@ -8210,7 +8216,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(3); } -#line 8214 "MachineIndependent/glslang_tab.cpp" +#line 8220 "MachineIndependent/glslang_tab.cpp" break; case 289: /* type_specifier_nonarray: U16VEC4 */ @@ -8221,7 +8227,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(4); } -#line 8225 "MachineIndependent/glslang_tab.cpp" +#line 8231 "MachineIndependent/glslang_tab.cpp" break; case 290: /* type_specifier_nonarray: U32VEC2 */ @@ -8232,7 +8238,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 8236 "MachineIndependent/glslang_tab.cpp" +#line 8242 "MachineIndependent/glslang_tab.cpp" break; case 291: /* type_specifier_nonarray: U32VEC3 */ @@ -8243,7 +8249,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 8247 "MachineIndependent/glslang_tab.cpp" +#line 8253 "MachineIndependent/glslang_tab.cpp" break; case 292: /* type_specifier_nonarray: U32VEC4 */ @@ -8254,7 +8260,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 8258 "MachineIndependent/glslang_tab.cpp" +#line 8264 "MachineIndependent/glslang_tab.cpp" break; case 293: /* type_specifier_nonarray: U64VEC2 */ @@ -8265,7 +8271,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 8269 "MachineIndependent/glslang_tab.cpp" +#line 8275 "MachineIndependent/glslang_tab.cpp" break; case 294: /* type_specifier_nonarray: U64VEC3 */ @@ -8276,7 +8282,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 8280 "MachineIndependent/glslang_tab.cpp" +#line 8286 "MachineIndependent/glslang_tab.cpp" break; case 295: /* type_specifier_nonarray: U64VEC4 */ @@ -8287,7 +8293,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 8291 "MachineIndependent/glslang_tab.cpp" +#line 8297 "MachineIndependent/glslang_tab.cpp" break; case 296: /* type_specifier_nonarray: DMAT2 */ @@ -8300,7 +8306,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8304 "MachineIndependent/glslang_tab.cpp" +#line 8310 "MachineIndependent/glslang_tab.cpp" break; case 297: /* type_specifier_nonarray: DMAT3 */ @@ -8313,7 +8319,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8317 "MachineIndependent/glslang_tab.cpp" +#line 8323 "MachineIndependent/glslang_tab.cpp" break; case 298: /* type_specifier_nonarray: DMAT4 */ @@ -8326,7 +8332,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8330 "MachineIndependent/glslang_tab.cpp" +#line 8336 "MachineIndependent/glslang_tab.cpp" break; case 299: /* type_specifier_nonarray: DMAT2X2 */ @@ -8339,7 +8345,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8343 "MachineIndependent/glslang_tab.cpp" +#line 8349 "MachineIndependent/glslang_tab.cpp" break; case 300: /* type_specifier_nonarray: DMAT2X3 */ @@ -8352,7 +8358,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8356 "MachineIndependent/glslang_tab.cpp" +#line 8362 "MachineIndependent/glslang_tab.cpp" break; case 301: /* type_specifier_nonarray: DMAT2X4 */ @@ -8365,7 +8371,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8369 "MachineIndependent/glslang_tab.cpp" +#line 8375 "MachineIndependent/glslang_tab.cpp" break; case 302: /* type_specifier_nonarray: DMAT3X2 */ @@ -8378,7 +8384,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8382 "MachineIndependent/glslang_tab.cpp" +#line 8388 "MachineIndependent/glslang_tab.cpp" break; case 303: /* type_specifier_nonarray: DMAT3X3 */ @@ -8391,7 +8397,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8395 "MachineIndependent/glslang_tab.cpp" +#line 8401 "MachineIndependent/glslang_tab.cpp" break; case 304: /* type_specifier_nonarray: DMAT3X4 */ @@ -8404,7 +8410,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8408 "MachineIndependent/glslang_tab.cpp" +#line 8414 "MachineIndependent/glslang_tab.cpp" break; case 305: /* type_specifier_nonarray: DMAT4X2 */ @@ -8417,7 +8423,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8421 "MachineIndependent/glslang_tab.cpp" +#line 8427 "MachineIndependent/glslang_tab.cpp" break; case 306: /* type_specifier_nonarray: DMAT4X3 */ @@ -8430,7 +8436,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8434 "MachineIndependent/glslang_tab.cpp" +#line 8440 "MachineIndependent/glslang_tab.cpp" break; case 307: /* type_specifier_nonarray: DMAT4X4 */ @@ -8443,7 +8449,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8447 "MachineIndependent/glslang_tab.cpp" +#line 8453 "MachineIndependent/glslang_tab.cpp" break; case 308: /* type_specifier_nonarray: F16MAT2 */ @@ -8454,7 +8460,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8458 "MachineIndependent/glslang_tab.cpp" +#line 8464 "MachineIndependent/glslang_tab.cpp" break; case 309: /* type_specifier_nonarray: F16MAT3 */ @@ -8465,7 +8471,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8469 "MachineIndependent/glslang_tab.cpp" +#line 8475 "MachineIndependent/glslang_tab.cpp" break; case 310: /* type_specifier_nonarray: F16MAT4 */ @@ -8476,7 +8482,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8480 "MachineIndependent/glslang_tab.cpp" +#line 8486 "MachineIndependent/glslang_tab.cpp" break; case 311: /* type_specifier_nonarray: F16MAT2X2 */ @@ -8487,7 +8493,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8491 "MachineIndependent/glslang_tab.cpp" +#line 8497 "MachineIndependent/glslang_tab.cpp" break; case 312: /* type_specifier_nonarray: F16MAT2X3 */ @@ -8498,7 +8504,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 3); } -#line 8502 "MachineIndependent/glslang_tab.cpp" +#line 8508 "MachineIndependent/glslang_tab.cpp" break; case 313: /* type_specifier_nonarray: F16MAT2X4 */ @@ -8509,7 +8515,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 4); } -#line 8513 "MachineIndependent/glslang_tab.cpp" +#line 8519 "MachineIndependent/glslang_tab.cpp" break; case 314: /* type_specifier_nonarray: F16MAT3X2 */ @@ -8520,7 +8526,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 2); } -#line 8524 "MachineIndependent/glslang_tab.cpp" +#line 8530 "MachineIndependent/glslang_tab.cpp" break; case 315: /* type_specifier_nonarray: F16MAT3X3 */ @@ -8531,7 +8537,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8535 "MachineIndependent/glslang_tab.cpp" +#line 8541 "MachineIndependent/glslang_tab.cpp" break; case 316: /* type_specifier_nonarray: F16MAT3X4 */ @@ -8542,7 +8548,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 4); } -#line 8546 "MachineIndependent/glslang_tab.cpp" +#line 8552 "MachineIndependent/glslang_tab.cpp" break; case 317: /* type_specifier_nonarray: F16MAT4X2 */ @@ -8553,7 +8559,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 2); } -#line 8557 "MachineIndependent/glslang_tab.cpp" +#line 8563 "MachineIndependent/glslang_tab.cpp" break; case 318: /* type_specifier_nonarray: F16MAT4X3 */ @@ -8564,7 +8570,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 3); } -#line 8568 "MachineIndependent/glslang_tab.cpp" +#line 8574 "MachineIndependent/glslang_tab.cpp" break; case 319: /* type_specifier_nonarray: F16MAT4X4 */ @@ -8575,7 +8581,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8579 "MachineIndependent/glslang_tab.cpp" +#line 8585 "MachineIndependent/glslang_tab.cpp" break; case 320: /* type_specifier_nonarray: F32MAT2 */ @@ -8586,7 +8592,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8590 "MachineIndependent/glslang_tab.cpp" +#line 8596 "MachineIndependent/glslang_tab.cpp" break; case 321: /* type_specifier_nonarray: F32MAT3 */ @@ -8597,7 +8603,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8601 "MachineIndependent/glslang_tab.cpp" +#line 8607 "MachineIndependent/glslang_tab.cpp" break; case 322: /* type_specifier_nonarray: F32MAT4 */ @@ -8608,7 +8614,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8612 "MachineIndependent/glslang_tab.cpp" +#line 8618 "MachineIndependent/glslang_tab.cpp" break; case 323: /* type_specifier_nonarray: F32MAT2X2 */ @@ -8619,7 +8625,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8623 "MachineIndependent/glslang_tab.cpp" +#line 8629 "MachineIndependent/glslang_tab.cpp" break; case 324: /* type_specifier_nonarray: F32MAT2X3 */ @@ -8630,7 +8636,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 8634 "MachineIndependent/glslang_tab.cpp" +#line 8640 "MachineIndependent/glslang_tab.cpp" break; case 325: /* type_specifier_nonarray: F32MAT2X4 */ @@ -8641,7 +8647,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 8645 "MachineIndependent/glslang_tab.cpp" +#line 8651 "MachineIndependent/glslang_tab.cpp" break; case 326: /* type_specifier_nonarray: F32MAT3X2 */ @@ -8652,7 +8658,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 8656 "MachineIndependent/glslang_tab.cpp" +#line 8662 "MachineIndependent/glslang_tab.cpp" break; case 327: /* type_specifier_nonarray: F32MAT3X3 */ @@ -8663,7 +8669,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8667 "MachineIndependent/glslang_tab.cpp" +#line 8673 "MachineIndependent/glslang_tab.cpp" break; case 328: /* type_specifier_nonarray: F32MAT3X4 */ @@ -8674,7 +8680,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 8678 "MachineIndependent/glslang_tab.cpp" +#line 8684 "MachineIndependent/glslang_tab.cpp" break; case 329: /* type_specifier_nonarray: F32MAT4X2 */ @@ -8685,7 +8691,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 8689 "MachineIndependent/glslang_tab.cpp" +#line 8695 "MachineIndependent/glslang_tab.cpp" break; case 330: /* type_specifier_nonarray: F32MAT4X3 */ @@ -8696,7 +8702,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 8700 "MachineIndependent/glslang_tab.cpp" +#line 8706 "MachineIndependent/glslang_tab.cpp" break; case 331: /* type_specifier_nonarray: F32MAT4X4 */ @@ -8707,7 +8713,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8711 "MachineIndependent/glslang_tab.cpp" +#line 8717 "MachineIndependent/glslang_tab.cpp" break; case 332: /* type_specifier_nonarray: F64MAT2 */ @@ -8718,7 +8724,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8722 "MachineIndependent/glslang_tab.cpp" +#line 8728 "MachineIndependent/glslang_tab.cpp" break; case 333: /* type_specifier_nonarray: F64MAT3 */ @@ -8729,7 +8735,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8733 "MachineIndependent/glslang_tab.cpp" +#line 8739 "MachineIndependent/glslang_tab.cpp" break; case 334: /* type_specifier_nonarray: F64MAT4 */ @@ -8740,7 +8746,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8744 "MachineIndependent/glslang_tab.cpp" +#line 8750 "MachineIndependent/glslang_tab.cpp" break; case 335: /* type_specifier_nonarray: F64MAT2X2 */ @@ -8751,7 +8757,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8755 "MachineIndependent/glslang_tab.cpp" +#line 8761 "MachineIndependent/glslang_tab.cpp" break; case 336: /* type_specifier_nonarray: F64MAT2X3 */ @@ -8762,7 +8768,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8766 "MachineIndependent/glslang_tab.cpp" +#line 8772 "MachineIndependent/glslang_tab.cpp" break; case 337: /* type_specifier_nonarray: F64MAT2X4 */ @@ -8773,7 +8779,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8777 "MachineIndependent/glslang_tab.cpp" +#line 8783 "MachineIndependent/glslang_tab.cpp" break; case 338: /* type_specifier_nonarray: F64MAT3X2 */ @@ -8784,7 +8790,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8788 "MachineIndependent/glslang_tab.cpp" +#line 8794 "MachineIndependent/glslang_tab.cpp" break; case 339: /* type_specifier_nonarray: F64MAT3X3 */ @@ -8795,7 +8801,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8799 "MachineIndependent/glslang_tab.cpp" +#line 8805 "MachineIndependent/glslang_tab.cpp" break; case 340: /* type_specifier_nonarray: F64MAT3X4 */ @@ -8806,7 +8812,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8810 "MachineIndependent/glslang_tab.cpp" +#line 8816 "MachineIndependent/glslang_tab.cpp" break; case 341: /* type_specifier_nonarray: F64MAT4X2 */ @@ -8817,7 +8823,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8821 "MachineIndependent/glslang_tab.cpp" +#line 8827 "MachineIndependent/glslang_tab.cpp" break; case 342: /* type_specifier_nonarray: F64MAT4X3 */ @@ -8828,7 +8834,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8832 "MachineIndependent/glslang_tab.cpp" +#line 8838 "MachineIndependent/glslang_tab.cpp" break; case 343: /* type_specifier_nonarray: F64MAT4X4 */ @@ -8839,7 +8845,7 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8843 "MachineIndependent/glslang_tab.cpp" +#line 8849 "MachineIndependent/glslang_tab.cpp" break; case 344: /* type_specifier_nonarray: ACCSTRUCTNV */ @@ -8848,7 +8854,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8852 "MachineIndependent/glslang_tab.cpp" +#line 8858 "MachineIndependent/glslang_tab.cpp" break; case 345: /* type_specifier_nonarray: ACCSTRUCTEXT */ @@ -8857,7 +8863,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8861 "MachineIndependent/glslang_tab.cpp" +#line 8867 "MachineIndependent/glslang_tab.cpp" break; case 346: /* type_specifier_nonarray: RAYQUERYEXT */ @@ -8866,7 +8872,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtRayQuery; } -#line 8870 "MachineIndependent/glslang_tab.cpp" +#line 8876 "MachineIndependent/glslang_tab.cpp" break; case 347: /* type_specifier_nonarray: ATOMIC_UINT */ @@ -8876,7 +8882,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 8880 "MachineIndependent/glslang_tab.cpp" +#line 8886 "MachineIndependent/glslang_tab.cpp" break; case 348: /* type_specifier_nonarray: SAMPLER1D */ @@ -8886,7 +8892,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 8890 "MachineIndependent/glslang_tab.cpp" +#line 8896 "MachineIndependent/glslang_tab.cpp" break; case 349: /* type_specifier_nonarray: SAMPLER2D */ @@ -8896,7 +8902,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 8900 "MachineIndependent/glslang_tab.cpp" +#line 8906 "MachineIndependent/glslang_tab.cpp" break; case 350: /* type_specifier_nonarray: SAMPLER3D */ @@ -8906,7 +8912,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 8910 "MachineIndependent/glslang_tab.cpp" +#line 8916 "MachineIndependent/glslang_tab.cpp" break; case 351: /* type_specifier_nonarray: SAMPLERCUBE */ @@ -8916,7 +8922,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 8920 "MachineIndependent/glslang_tab.cpp" +#line 8926 "MachineIndependent/glslang_tab.cpp" break; case 352: /* type_specifier_nonarray: SAMPLER2DSHADOW */ @@ -8926,7 +8932,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 8930 "MachineIndependent/glslang_tab.cpp" +#line 8936 "MachineIndependent/glslang_tab.cpp" break; case 353: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ @@ -8936,7 +8942,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 8940 "MachineIndependent/glslang_tab.cpp" +#line 8946 "MachineIndependent/glslang_tab.cpp" break; case 354: /* type_specifier_nonarray: SAMPLER2DARRAY */ @@ -8946,7 +8952,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 8950 "MachineIndependent/glslang_tab.cpp" +#line 8956 "MachineIndependent/glslang_tab.cpp" break; case 355: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ @@ -8956,7 +8962,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 8960 "MachineIndependent/glslang_tab.cpp" +#line 8966 "MachineIndependent/glslang_tab.cpp" break; case 356: /* type_specifier_nonarray: SAMPLER1DSHADOW */ @@ -8966,7 +8972,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 8970 "MachineIndependent/glslang_tab.cpp" +#line 8976 "MachineIndependent/glslang_tab.cpp" break; case 357: /* type_specifier_nonarray: SAMPLER1DARRAY */ @@ -8976,7 +8982,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 8980 "MachineIndependent/glslang_tab.cpp" +#line 8986 "MachineIndependent/glslang_tab.cpp" break; case 358: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ @@ -8986,7 +8992,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 8990 "MachineIndependent/glslang_tab.cpp" +#line 8996 "MachineIndependent/glslang_tab.cpp" break; case 359: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ @@ -8996,7 +9002,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 9000 "MachineIndependent/glslang_tab.cpp" +#line 9006 "MachineIndependent/glslang_tab.cpp" break; case 360: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ @@ -9006,7 +9012,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 9010 "MachineIndependent/glslang_tab.cpp" +#line 9016 "MachineIndependent/glslang_tab.cpp" break; case 361: /* type_specifier_nonarray: F16SAMPLER1D */ @@ -9017,7 +9023,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); } -#line 9021 "MachineIndependent/glslang_tab.cpp" +#line 9027 "MachineIndependent/glslang_tab.cpp" break; case 362: /* type_specifier_nonarray: F16SAMPLER2D */ @@ -9028,7 +9034,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); } -#line 9032 "MachineIndependent/glslang_tab.cpp" +#line 9038 "MachineIndependent/glslang_tab.cpp" break; case 363: /* type_specifier_nonarray: F16SAMPLER3D */ @@ -9039,7 +9045,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); } -#line 9043 "MachineIndependent/glslang_tab.cpp" +#line 9049 "MachineIndependent/glslang_tab.cpp" break; case 364: /* type_specifier_nonarray: F16SAMPLERCUBE */ @@ -9050,7 +9056,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); } -#line 9054 "MachineIndependent/glslang_tab.cpp" +#line 9060 "MachineIndependent/glslang_tab.cpp" break; case 365: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ @@ -9061,7 +9067,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); } -#line 9065 "MachineIndependent/glslang_tab.cpp" +#line 9071 "MachineIndependent/glslang_tab.cpp" break; case 366: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ @@ -9072,7 +9078,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); } -#line 9076 "MachineIndependent/glslang_tab.cpp" +#line 9082 "MachineIndependent/glslang_tab.cpp" break; case 367: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ @@ -9083,7 +9089,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); } -#line 9087 "MachineIndependent/glslang_tab.cpp" +#line 9093 "MachineIndependent/glslang_tab.cpp" break; case 368: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ @@ -9094,7 +9100,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); } -#line 9098 "MachineIndependent/glslang_tab.cpp" +#line 9104 "MachineIndependent/glslang_tab.cpp" break; case 369: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ @@ -9105,7 +9111,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); } -#line 9109 "MachineIndependent/glslang_tab.cpp" +#line 9115 "MachineIndependent/glslang_tab.cpp" break; case 370: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ @@ -9116,7 +9122,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); } -#line 9120 "MachineIndependent/glslang_tab.cpp" +#line 9126 "MachineIndependent/glslang_tab.cpp" break; case 371: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ @@ -9127,7 +9133,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); } -#line 9131 "MachineIndependent/glslang_tab.cpp" +#line 9137 "MachineIndependent/glslang_tab.cpp" break; case 372: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ @@ -9138,7 +9144,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); } -#line 9142 "MachineIndependent/glslang_tab.cpp" +#line 9148 "MachineIndependent/glslang_tab.cpp" break; case 373: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ @@ -9149,7 +9155,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); } -#line 9153 "MachineIndependent/glslang_tab.cpp" +#line 9159 "MachineIndependent/glslang_tab.cpp" break; case 374: /* type_specifier_nonarray: ISAMPLER1D */ @@ -9159,7 +9165,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 9163 "MachineIndependent/glslang_tab.cpp" +#line 9169 "MachineIndependent/glslang_tab.cpp" break; case 375: /* type_specifier_nonarray: ISAMPLER2D */ @@ -9169,7 +9175,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 9173 "MachineIndependent/glslang_tab.cpp" +#line 9179 "MachineIndependent/glslang_tab.cpp" break; case 376: /* type_specifier_nonarray: ISAMPLER3D */ @@ -9179,7 +9185,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 9183 "MachineIndependent/glslang_tab.cpp" +#line 9189 "MachineIndependent/glslang_tab.cpp" break; case 377: /* type_specifier_nonarray: ISAMPLERCUBE */ @@ -9189,7 +9195,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 9193 "MachineIndependent/glslang_tab.cpp" +#line 9199 "MachineIndependent/glslang_tab.cpp" break; case 378: /* type_specifier_nonarray: ISAMPLER2DARRAY */ @@ -9199,7 +9205,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 9203 "MachineIndependent/glslang_tab.cpp" +#line 9209 "MachineIndependent/glslang_tab.cpp" break; case 379: /* type_specifier_nonarray: USAMPLER2D */ @@ -9209,7 +9215,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 9213 "MachineIndependent/glslang_tab.cpp" +#line 9219 "MachineIndependent/glslang_tab.cpp" break; case 380: /* type_specifier_nonarray: USAMPLER3D */ @@ -9219,7 +9225,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 9223 "MachineIndependent/glslang_tab.cpp" +#line 9229 "MachineIndependent/glslang_tab.cpp" break; case 381: /* type_specifier_nonarray: USAMPLERCUBE */ @@ -9229,7 +9235,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 9233 "MachineIndependent/glslang_tab.cpp" +#line 9239 "MachineIndependent/glslang_tab.cpp" break; case 382: /* type_specifier_nonarray: ISAMPLER1DARRAY */ @@ -9239,7 +9245,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 9243 "MachineIndependent/glslang_tab.cpp" +#line 9249 "MachineIndependent/glslang_tab.cpp" break; case 383: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ @@ -9249,7 +9255,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 9253 "MachineIndependent/glslang_tab.cpp" +#line 9259 "MachineIndependent/glslang_tab.cpp" break; case 384: /* type_specifier_nonarray: USAMPLER1D */ @@ -9259,7 +9265,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 9263 "MachineIndependent/glslang_tab.cpp" +#line 9269 "MachineIndependent/glslang_tab.cpp" break; case 385: /* type_specifier_nonarray: USAMPLER1DARRAY */ @@ -9269,7 +9275,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 9273 "MachineIndependent/glslang_tab.cpp" +#line 9279 "MachineIndependent/glslang_tab.cpp" break; case 386: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ @@ -9279,7 +9285,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 9283 "MachineIndependent/glslang_tab.cpp" +#line 9289 "MachineIndependent/glslang_tab.cpp" break; case 387: /* type_specifier_nonarray: TEXTURECUBEARRAY */ @@ -9289,7 +9295,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 9293 "MachineIndependent/glslang_tab.cpp" +#line 9299 "MachineIndependent/glslang_tab.cpp" break; case 388: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ @@ -9299,7 +9305,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 9303 "MachineIndependent/glslang_tab.cpp" +#line 9309 "MachineIndependent/glslang_tab.cpp" break; case 389: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ @@ -9309,7 +9315,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 9313 "MachineIndependent/glslang_tab.cpp" +#line 9319 "MachineIndependent/glslang_tab.cpp" break; case 390: /* type_specifier_nonarray: USAMPLER2DARRAY */ @@ -9319,7 +9325,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 9323 "MachineIndependent/glslang_tab.cpp" +#line 9329 "MachineIndependent/glslang_tab.cpp" break; case 391: /* type_specifier_nonarray: TEXTURE2D */ @@ -9329,7 +9335,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 9333 "MachineIndependent/glslang_tab.cpp" +#line 9339 "MachineIndependent/glslang_tab.cpp" break; case 392: /* type_specifier_nonarray: TEXTURE3D */ @@ -9339,7 +9345,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 9343 "MachineIndependent/glslang_tab.cpp" +#line 9349 "MachineIndependent/glslang_tab.cpp" break; case 393: /* type_specifier_nonarray: TEXTURE2DARRAY */ @@ -9349,7 +9355,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 9353 "MachineIndependent/glslang_tab.cpp" +#line 9359 "MachineIndependent/glslang_tab.cpp" break; case 394: /* type_specifier_nonarray: TEXTURECUBE */ @@ -9359,7 +9365,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 9363 "MachineIndependent/glslang_tab.cpp" +#line 9369 "MachineIndependent/glslang_tab.cpp" break; case 395: /* type_specifier_nonarray: ITEXTURE2D */ @@ -9369,7 +9375,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 9373 "MachineIndependent/glslang_tab.cpp" +#line 9379 "MachineIndependent/glslang_tab.cpp" break; case 396: /* type_specifier_nonarray: ITEXTURE3D */ @@ -9379,7 +9385,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 9383 "MachineIndependent/glslang_tab.cpp" +#line 9389 "MachineIndependent/glslang_tab.cpp" break; case 397: /* type_specifier_nonarray: ITEXTURECUBE */ @@ -9389,7 +9395,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 9393 "MachineIndependent/glslang_tab.cpp" +#line 9399 "MachineIndependent/glslang_tab.cpp" break; case 398: /* type_specifier_nonarray: ITEXTURE2DARRAY */ @@ -9399,7 +9405,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 9403 "MachineIndependent/glslang_tab.cpp" +#line 9409 "MachineIndependent/glslang_tab.cpp" break; case 399: /* type_specifier_nonarray: UTEXTURE2D */ @@ -9409,7 +9415,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 9413 "MachineIndependent/glslang_tab.cpp" +#line 9419 "MachineIndependent/glslang_tab.cpp" break; case 400: /* type_specifier_nonarray: UTEXTURE3D */ @@ -9419,7 +9425,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 9423 "MachineIndependent/glslang_tab.cpp" +#line 9429 "MachineIndependent/glslang_tab.cpp" break; case 401: /* type_specifier_nonarray: UTEXTURECUBE */ @@ -9429,7 +9435,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 9433 "MachineIndependent/glslang_tab.cpp" +#line 9439 "MachineIndependent/glslang_tab.cpp" break; case 402: /* type_specifier_nonarray: UTEXTURE2DARRAY */ @@ -9439,7 +9445,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 9443 "MachineIndependent/glslang_tab.cpp" +#line 9449 "MachineIndependent/glslang_tab.cpp" break; case 403: /* type_specifier_nonarray: SAMPLER */ @@ -9449,7 +9455,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 9453 "MachineIndependent/glslang_tab.cpp" +#line 9459 "MachineIndependent/glslang_tab.cpp" break; case 404: /* type_specifier_nonarray: SAMPLERSHADOW */ @@ -9459,7 +9465,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 9463 "MachineIndependent/glslang_tab.cpp" +#line 9469 "MachineIndependent/glslang_tab.cpp" break; case 405: /* type_specifier_nonarray: SAMPLER2DRECT */ @@ -9469,7 +9475,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 9473 "MachineIndependent/glslang_tab.cpp" +#line 9479 "MachineIndependent/glslang_tab.cpp" break; case 406: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ @@ -9479,7 +9485,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 9483 "MachineIndependent/glslang_tab.cpp" +#line 9489 "MachineIndependent/glslang_tab.cpp" break; case 407: /* type_specifier_nonarray: F16SAMPLER2DRECT */ @@ -9490,7 +9496,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); } -#line 9494 "MachineIndependent/glslang_tab.cpp" +#line 9500 "MachineIndependent/glslang_tab.cpp" break; case 408: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ @@ -9501,7 +9507,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); } -#line 9505 "MachineIndependent/glslang_tab.cpp" +#line 9511 "MachineIndependent/glslang_tab.cpp" break; case 409: /* type_specifier_nonarray: ISAMPLER2DRECT */ @@ -9511,7 +9517,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 9515 "MachineIndependent/glslang_tab.cpp" +#line 9521 "MachineIndependent/glslang_tab.cpp" break; case 410: /* type_specifier_nonarray: USAMPLER2DRECT */ @@ -9521,7 +9527,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 9525 "MachineIndependent/glslang_tab.cpp" +#line 9531 "MachineIndependent/glslang_tab.cpp" break; case 411: /* type_specifier_nonarray: SAMPLERBUFFER */ @@ -9531,7 +9537,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 9535 "MachineIndependent/glslang_tab.cpp" +#line 9541 "MachineIndependent/glslang_tab.cpp" break; case 412: /* type_specifier_nonarray: F16SAMPLERBUFFER */ @@ -9542,7 +9548,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); } -#line 9546 "MachineIndependent/glslang_tab.cpp" +#line 9552 "MachineIndependent/glslang_tab.cpp" break; case 413: /* type_specifier_nonarray: ISAMPLERBUFFER */ @@ -9552,7 +9558,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 9556 "MachineIndependent/glslang_tab.cpp" +#line 9562 "MachineIndependent/glslang_tab.cpp" break; case 414: /* type_specifier_nonarray: USAMPLERBUFFER */ @@ -9562,7 +9568,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 9566 "MachineIndependent/glslang_tab.cpp" +#line 9572 "MachineIndependent/glslang_tab.cpp" break; case 415: /* type_specifier_nonarray: SAMPLER2DMS */ @@ -9572,7 +9578,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 9576 "MachineIndependent/glslang_tab.cpp" +#line 9582 "MachineIndependent/glslang_tab.cpp" break; case 416: /* type_specifier_nonarray: F16SAMPLER2DMS */ @@ -9583,7 +9589,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); } -#line 9587 "MachineIndependent/glslang_tab.cpp" +#line 9593 "MachineIndependent/glslang_tab.cpp" break; case 417: /* type_specifier_nonarray: ISAMPLER2DMS */ @@ -9593,7 +9599,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 9597 "MachineIndependent/glslang_tab.cpp" +#line 9603 "MachineIndependent/glslang_tab.cpp" break; case 418: /* type_specifier_nonarray: USAMPLER2DMS */ @@ -9603,7 +9609,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 9607 "MachineIndependent/glslang_tab.cpp" +#line 9613 "MachineIndependent/glslang_tab.cpp" break; case 419: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ @@ -9613,7 +9619,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 9617 "MachineIndependent/glslang_tab.cpp" +#line 9623 "MachineIndependent/glslang_tab.cpp" break; case 420: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ @@ -9624,7 +9630,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); } -#line 9628 "MachineIndependent/glslang_tab.cpp" +#line 9634 "MachineIndependent/glslang_tab.cpp" break; case 421: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ @@ -9634,7 +9640,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 9638 "MachineIndependent/glslang_tab.cpp" +#line 9644 "MachineIndependent/glslang_tab.cpp" break; case 422: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ @@ -9644,7 +9650,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 9648 "MachineIndependent/glslang_tab.cpp" +#line 9654 "MachineIndependent/glslang_tab.cpp" break; case 423: /* type_specifier_nonarray: TEXTURE1D */ @@ -9654,7 +9660,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 9658 "MachineIndependent/glslang_tab.cpp" +#line 9664 "MachineIndependent/glslang_tab.cpp" break; case 424: /* type_specifier_nonarray: F16TEXTURE1D */ @@ -9665,7 +9671,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); } -#line 9669 "MachineIndependent/glslang_tab.cpp" +#line 9675 "MachineIndependent/glslang_tab.cpp" break; case 425: /* type_specifier_nonarray: F16TEXTURE2D */ @@ -9676,7 +9682,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); } -#line 9680 "MachineIndependent/glslang_tab.cpp" +#line 9686 "MachineIndependent/glslang_tab.cpp" break; case 426: /* type_specifier_nonarray: F16TEXTURE3D */ @@ -9687,7 +9693,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); } -#line 9691 "MachineIndependent/glslang_tab.cpp" +#line 9697 "MachineIndependent/glslang_tab.cpp" break; case 427: /* type_specifier_nonarray: F16TEXTURECUBE */ @@ -9698,7 +9704,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); } -#line 9702 "MachineIndependent/glslang_tab.cpp" +#line 9708 "MachineIndependent/glslang_tab.cpp" break; case 428: /* type_specifier_nonarray: TEXTURE1DARRAY */ @@ -9708,7 +9714,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 9712 "MachineIndependent/glslang_tab.cpp" +#line 9718 "MachineIndependent/glslang_tab.cpp" break; case 429: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ @@ -9719,7 +9725,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); } -#line 9723 "MachineIndependent/glslang_tab.cpp" +#line 9729 "MachineIndependent/glslang_tab.cpp" break; case 430: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ @@ -9730,7 +9736,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); } -#line 9734 "MachineIndependent/glslang_tab.cpp" +#line 9740 "MachineIndependent/glslang_tab.cpp" break; case 431: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ @@ -9741,7 +9747,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); } -#line 9745 "MachineIndependent/glslang_tab.cpp" +#line 9751 "MachineIndependent/glslang_tab.cpp" break; case 432: /* type_specifier_nonarray: ITEXTURE1D */ @@ -9751,7 +9757,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 9755 "MachineIndependent/glslang_tab.cpp" +#line 9761 "MachineIndependent/glslang_tab.cpp" break; case 433: /* type_specifier_nonarray: ITEXTURE1DARRAY */ @@ -9761,7 +9767,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 9765 "MachineIndependent/glslang_tab.cpp" +#line 9771 "MachineIndependent/glslang_tab.cpp" break; case 434: /* type_specifier_nonarray: UTEXTURE1D */ @@ -9771,7 +9777,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 9775 "MachineIndependent/glslang_tab.cpp" +#line 9781 "MachineIndependent/glslang_tab.cpp" break; case 435: /* type_specifier_nonarray: UTEXTURE1DARRAY */ @@ -9781,7 +9787,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 9785 "MachineIndependent/glslang_tab.cpp" +#line 9791 "MachineIndependent/glslang_tab.cpp" break; case 436: /* type_specifier_nonarray: TEXTURE2DRECT */ @@ -9791,7 +9797,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 9795 "MachineIndependent/glslang_tab.cpp" +#line 9801 "MachineIndependent/glslang_tab.cpp" break; case 437: /* type_specifier_nonarray: F16TEXTURE2DRECT */ @@ -9802,7 +9808,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); } -#line 9806 "MachineIndependent/glslang_tab.cpp" +#line 9812 "MachineIndependent/glslang_tab.cpp" break; case 438: /* type_specifier_nonarray: ITEXTURE2DRECT */ @@ -9812,7 +9818,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 9816 "MachineIndependent/glslang_tab.cpp" +#line 9822 "MachineIndependent/glslang_tab.cpp" break; case 439: /* type_specifier_nonarray: UTEXTURE2DRECT */ @@ -9822,7 +9828,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 9826 "MachineIndependent/glslang_tab.cpp" +#line 9832 "MachineIndependent/glslang_tab.cpp" break; case 440: /* type_specifier_nonarray: TEXTUREBUFFER */ @@ -9832,7 +9838,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 9836 "MachineIndependent/glslang_tab.cpp" +#line 9842 "MachineIndependent/glslang_tab.cpp" break; case 441: /* type_specifier_nonarray: F16TEXTUREBUFFER */ @@ -9843,7 +9849,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); } -#line 9847 "MachineIndependent/glslang_tab.cpp" +#line 9853 "MachineIndependent/glslang_tab.cpp" break; case 442: /* type_specifier_nonarray: ITEXTUREBUFFER */ @@ -9853,7 +9859,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 9857 "MachineIndependent/glslang_tab.cpp" +#line 9863 "MachineIndependent/glslang_tab.cpp" break; case 443: /* type_specifier_nonarray: UTEXTUREBUFFER */ @@ -9863,7 +9869,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 9867 "MachineIndependent/glslang_tab.cpp" +#line 9873 "MachineIndependent/glslang_tab.cpp" break; case 444: /* type_specifier_nonarray: TEXTURE2DMS */ @@ -9873,7 +9879,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 9877 "MachineIndependent/glslang_tab.cpp" +#line 9883 "MachineIndependent/glslang_tab.cpp" break; case 445: /* type_specifier_nonarray: F16TEXTURE2DMS */ @@ -9884,7 +9890,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); } -#line 9888 "MachineIndependent/glslang_tab.cpp" +#line 9894 "MachineIndependent/glslang_tab.cpp" break; case 446: /* type_specifier_nonarray: ITEXTURE2DMS */ @@ -9894,7 +9900,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 9898 "MachineIndependent/glslang_tab.cpp" +#line 9904 "MachineIndependent/glslang_tab.cpp" break; case 447: /* type_specifier_nonarray: UTEXTURE2DMS */ @@ -9904,7 +9910,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 9908 "MachineIndependent/glslang_tab.cpp" +#line 9914 "MachineIndependent/glslang_tab.cpp" break; case 448: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ @@ -9914,7 +9920,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 9918 "MachineIndependent/glslang_tab.cpp" +#line 9924 "MachineIndependent/glslang_tab.cpp" break; case 449: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ @@ -9925,7 +9931,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); } -#line 9929 "MachineIndependent/glslang_tab.cpp" +#line 9935 "MachineIndependent/glslang_tab.cpp" break; case 450: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ @@ -9935,7 +9941,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 9939 "MachineIndependent/glslang_tab.cpp" +#line 9945 "MachineIndependent/glslang_tab.cpp" break; case 451: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ @@ -9945,7 +9951,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 9949 "MachineIndependent/glslang_tab.cpp" +#line 9955 "MachineIndependent/glslang_tab.cpp" break; case 452: /* type_specifier_nonarray: IMAGE1D */ @@ -9955,7 +9961,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 9959 "MachineIndependent/glslang_tab.cpp" +#line 9965 "MachineIndependent/glslang_tab.cpp" break; case 453: /* type_specifier_nonarray: F16IMAGE1D */ @@ -9966,7 +9972,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); } -#line 9970 "MachineIndependent/glslang_tab.cpp" +#line 9976 "MachineIndependent/glslang_tab.cpp" break; case 454: /* type_specifier_nonarray: IIMAGE1D */ @@ -9976,7 +9982,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 9980 "MachineIndependent/glslang_tab.cpp" +#line 9986 "MachineIndependent/glslang_tab.cpp" break; case 455: /* type_specifier_nonarray: UIMAGE1D */ @@ -9986,7 +9992,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 9990 "MachineIndependent/glslang_tab.cpp" +#line 9996 "MachineIndependent/glslang_tab.cpp" break; case 456: /* type_specifier_nonarray: IMAGE2D */ @@ -9996,7 +10002,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 10000 "MachineIndependent/glslang_tab.cpp" +#line 10006 "MachineIndependent/glslang_tab.cpp" break; case 457: /* type_specifier_nonarray: F16IMAGE2D */ @@ -10007,7 +10013,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); } -#line 10011 "MachineIndependent/glslang_tab.cpp" +#line 10017 "MachineIndependent/glslang_tab.cpp" break; case 458: /* type_specifier_nonarray: IIMAGE2D */ @@ -10017,7 +10023,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 10021 "MachineIndependent/glslang_tab.cpp" +#line 10027 "MachineIndependent/glslang_tab.cpp" break; case 459: /* type_specifier_nonarray: UIMAGE2D */ @@ -10027,7 +10033,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 10031 "MachineIndependent/glslang_tab.cpp" +#line 10037 "MachineIndependent/glslang_tab.cpp" break; case 460: /* type_specifier_nonarray: IMAGE3D */ @@ -10037,7 +10043,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 10041 "MachineIndependent/glslang_tab.cpp" +#line 10047 "MachineIndependent/glslang_tab.cpp" break; case 461: /* type_specifier_nonarray: F16IMAGE3D */ @@ -10048,7 +10054,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); } -#line 10052 "MachineIndependent/glslang_tab.cpp" +#line 10058 "MachineIndependent/glslang_tab.cpp" break; case 462: /* type_specifier_nonarray: IIMAGE3D */ @@ -10058,7 +10064,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 10062 "MachineIndependent/glslang_tab.cpp" +#line 10068 "MachineIndependent/glslang_tab.cpp" break; case 463: /* type_specifier_nonarray: UIMAGE3D */ @@ -10068,7 +10074,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 10072 "MachineIndependent/glslang_tab.cpp" +#line 10078 "MachineIndependent/glslang_tab.cpp" break; case 464: /* type_specifier_nonarray: IMAGE2DRECT */ @@ -10078,7 +10084,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 10082 "MachineIndependent/glslang_tab.cpp" +#line 10088 "MachineIndependent/glslang_tab.cpp" break; case 465: /* type_specifier_nonarray: F16IMAGE2DRECT */ @@ -10089,7 +10095,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); } -#line 10093 "MachineIndependent/glslang_tab.cpp" +#line 10099 "MachineIndependent/glslang_tab.cpp" break; case 466: /* type_specifier_nonarray: IIMAGE2DRECT */ @@ -10099,7 +10105,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 10103 "MachineIndependent/glslang_tab.cpp" +#line 10109 "MachineIndependent/glslang_tab.cpp" break; case 467: /* type_specifier_nonarray: UIMAGE2DRECT */ @@ -10109,7 +10115,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 10113 "MachineIndependent/glslang_tab.cpp" +#line 10119 "MachineIndependent/glslang_tab.cpp" break; case 468: /* type_specifier_nonarray: IMAGECUBE */ @@ -10119,7 +10125,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 10123 "MachineIndependent/glslang_tab.cpp" +#line 10129 "MachineIndependent/glslang_tab.cpp" break; case 469: /* type_specifier_nonarray: F16IMAGECUBE */ @@ -10130,7 +10136,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); } -#line 10134 "MachineIndependent/glslang_tab.cpp" +#line 10140 "MachineIndependent/glslang_tab.cpp" break; case 470: /* type_specifier_nonarray: IIMAGECUBE */ @@ -10140,7 +10146,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 10144 "MachineIndependent/glslang_tab.cpp" +#line 10150 "MachineIndependent/glslang_tab.cpp" break; case 471: /* type_specifier_nonarray: UIMAGECUBE */ @@ -10150,7 +10156,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 10154 "MachineIndependent/glslang_tab.cpp" +#line 10160 "MachineIndependent/glslang_tab.cpp" break; case 472: /* type_specifier_nonarray: IMAGEBUFFER */ @@ -10160,7 +10166,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 10164 "MachineIndependent/glslang_tab.cpp" +#line 10170 "MachineIndependent/glslang_tab.cpp" break; case 473: /* type_specifier_nonarray: F16IMAGEBUFFER */ @@ -10171,7 +10177,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); } -#line 10175 "MachineIndependent/glslang_tab.cpp" +#line 10181 "MachineIndependent/glslang_tab.cpp" break; case 474: /* type_specifier_nonarray: IIMAGEBUFFER */ @@ -10181,7 +10187,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 10185 "MachineIndependent/glslang_tab.cpp" +#line 10191 "MachineIndependent/glslang_tab.cpp" break; case 475: /* type_specifier_nonarray: UIMAGEBUFFER */ @@ -10191,7 +10197,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 10195 "MachineIndependent/glslang_tab.cpp" +#line 10201 "MachineIndependent/glslang_tab.cpp" break; case 476: /* type_specifier_nonarray: IMAGE1DARRAY */ @@ -10201,7 +10207,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 10205 "MachineIndependent/glslang_tab.cpp" +#line 10211 "MachineIndependent/glslang_tab.cpp" break; case 477: /* type_specifier_nonarray: F16IMAGE1DARRAY */ @@ -10212,7 +10218,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); } -#line 10216 "MachineIndependent/glslang_tab.cpp" +#line 10222 "MachineIndependent/glslang_tab.cpp" break; case 478: /* type_specifier_nonarray: IIMAGE1DARRAY */ @@ -10222,7 +10228,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 10226 "MachineIndependent/glslang_tab.cpp" +#line 10232 "MachineIndependent/glslang_tab.cpp" break; case 479: /* type_specifier_nonarray: UIMAGE1DARRAY */ @@ -10232,7 +10238,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 10236 "MachineIndependent/glslang_tab.cpp" +#line 10242 "MachineIndependent/glslang_tab.cpp" break; case 480: /* type_specifier_nonarray: IMAGE2DARRAY */ @@ -10242,7 +10248,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 10246 "MachineIndependent/glslang_tab.cpp" +#line 10252 "MachineIndependent/glslang_tab.cpp" break; case 481: /* type_specifier_nonarray: F16IMAGE2DARRAY */ @@ -10253,7 +10259,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); } -#line 10257 "MachineIndependent/glslang_tab.cpp" +#line 10263 "MachineIndependent/glslang_tab.cpp" break; case 482: /* type_specifier_nonarray: IIMAGE2DARRAY */ @@ -10263,7 +10269,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 10267 "MachineIndependent/glslang_tab.cpp" +#line 10273 "MachineIndependent/glslang_tab.cpp" break; case 483: /* type_specifier_nonarray: UIMAGE2DARRAY */ @@ -10273,7 +10279,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 10277 "MachineIndependent/glslang_tab.cpp" +#line 10283 "MachineIndependent/glslang_tab.cpp" break; case 484: /* type_specifier_nonarray: IMAGECUBEARRAY */ @@ -10283,7 +10289,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 10287 "MachineIndependent/glslang_tab.cpp" +#line 10293 "MachineIndependent/glslang_tab.cpp" break; case 485: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ @@ -10294,7 +10300,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); } -#line 10298 "MachineIndependent/glslang_tab.cpp" +#line 10304 "MachineIndependent/glslang_tab.cpp" break; case 486: /* type_specifier_nonarray: IIMAGECUBEARRAY */ @@ -10304,7 +10310,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 10308 "MachineIndependent/glslang_tab.cpp" +#line 10314 "MachineIndependent/glslang_tab.cpp" break; case 487: /* type_specifier_nonarray: UIMAGECUBEARRAY */ @@ -10314,7 +10320,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 10318 "MachineIndependent/glslang_tab.cpp" +#line 10324 "MachineIndependent/glslang_tab.cpp" break; case 488: /* type_specifier_nonarray: IMAGE2DMS */ @@ -10324,7 +10330,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 10328 "MachineIndependent/glslang_tab.cpp" +#line 10334 "MachineIndependent/glslang_tab.cpp" break; case 489: /* type_specifier_nonarray: F16IMAGE2DMS */ @@ -10335,7 +10341,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); } -#line 10339 "MachineIndependent/glslang_tab.cpp" +#line 10345 "MachineIndependent/glslang_tab.cpp" break; case 490: /* type_specifier_nonarray: IIMAGE2DMS */ @@ -10345,7 +10351,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 10349 "MachineIndependent/glslang_tab.cpp" +#line 10355 "MachineIndependent/glslang_tab.cpp" break; case 491: /* type_specifier_nonarray: UIMAGE2DMS */ @@ -10355,7 +10361,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 10359 "MachineIndependent/glslang_tab.cpp" +#line 10365 "MachineIndependent/glslang_tab.cpp" break; case 492: /* type_specifier_nonarray: IMAGE2DMSARRAY */ @@ -10365,7 +10371,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 10369 "MachineIndependent/glslang_tab.cpp" +#line 10375 "MachineIndependent/glslang_tab.cpp" break; case 493: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ @@ -10376,7 +10382,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); } -#line 10380 "MachineIndependent/glslang_tab.cpp" +#line 10386 "MachineIndependent/glslang_tab.cpp" break; case 494: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ @@ -10386,7 +10392,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 10390 "MachineIndependent/glslang_tab.cpp" +#line 10396 "MachineIndependent/glslang_tab.cpp" break; case 495: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ @@ -10396,7 +10402,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 10400 "MachineIndependent/glslang_tab.cpp" +#line 10406 "MachineIndependent/glslang_tab.cpp" break; case 496: /* type_specifier_nonarray: I64IMAGE1D */ @@ -10406,7 +10412,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D); } -#line 10410 "MachineIndependent/glslang_tab.cpp" +#line 10416 "MachineIndependent/glslang_tab.cpp" break; case 497: /* type_specifier_nonarray: U64IMAGE1D */ @@ -10416,7 +10422,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D); } -#line 10420 "MachineIndependent/glslang_tab.cpp" +#line 10426 "MachineIndependent/glslang_tab.cpp" break; case 498: /* type_specifier_nonarray: I64IMAGE2D */ @@ -10426,7 +10432,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D); } -#line 10430 "MachineIndependent/glslang_tab.cpp" +#line 10436 "MachineIndependent/glslang_tab.cpp" break; case 499: /* type_specifier_nonarray: U64IMAGE2D */ @@ -10436,7 +10442,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D); } -#line 10440 "MachineIndependent/glslang_tab.cpp" +#line 10446 "MachineIndependent/glslang_tab.cpp" break; case 500: /* type_specifier_nonarray: I64IMAGE3D */ @@ -10446,7 +10452,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd3D); } -#line 10450 "MachineIndependent/glslang_tab.cpp" +#line 10456 "MachineIndependent/glslang_tab.cpp" break; case 501: /* type_specifier_nonarray: U64IMAGE3D */ @@ -10456,7 +10462,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd3D); } -#line 10460 "MachineIndependent/glslang_tab.cpp" +#line 10466 "MachineIndependent/glslang_tab.cpp" break; case 502: /* type_specifier_nonarray: I64IMAGE2DRECT */ @@ -10466,7 +10472,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdRect); } -#line 10470 "MachineIndependent/glslang_tab.cpp" +#line 10476 "MachineIndependent/glslang_tab.cpp" break; case 503: /* type_specifier_nonarray: U64IMAGE2DRECT */ @@ -10476,7 +10482,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdRect); } -#line 10480 "MachineIndependent/glslang_tab.cpp" +#line 10486 "MachineIndependent/glslang_tab.cpp" break; case 504: /* type_specifier_nonarray: I64IMAGECUBE */ @@ -10486,7 +10492,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube); } -#line 10490 "MachineIndependent/glslang_tab.cpp" +#line 10496 "MachineIndependent/glslang_tab.cpp" break; case 505: /* type_specifier_nonarray: U64IMAGECUBE */ @@ -10496,7 +10502,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube); } -#line 10500 "MachineIndependent/glslang_tab.cpp" +#line 10506 "MachineIndependent/glslang_tab.cpp" break; case 506: /* type_specifier_nonarray: I64IMAGEBUFFER */ @@ -10506,7 +10512,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdBuffer); } -#line 10510 "MachineIndependent/glslang_tab.cpp" +#line 10516 "MachineIndependent/glslang_tab.cpp" break; case 507: /* type_specifier_nonarray: U64IMAGEBUFFER */ @@ -10516,7 +10522,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdBuffer); } -#line 10520 "MachineIndependent/glslang_tab.cpp" +#line 10526 "MachineIndependent/glslang_tab.cpp" break; case 508: /* type_specifier_nonarray: I64IMAGE1DARRAY */ @@ -10526,7 +10532,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D, true); } -#line 10530 "MachineIndependent/glslang_tab.cpp" +#line 10536 "MachineIndependent/glslang_tab.cpp" break; case 509: /* type_specifier_nonarray: U64IMAGE1DARRAY */ @@ -10536,7 +10542,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D, true); } -#line 10540 "MachineIndependent/glslang_tab.cpp" +#line 10546 "MachineIndependent/glslang_tab.cpp" break; case 510: /* type_specifier_nonarray: I64IMAGE2DARRAY */ @@ -10546,7 +10552,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true); } -#line 10550 "MachineIndependent/glslang_tab.cpp" +#line 10556 "MachineIndependent/glslang_tab.cpp" break; case 511: /* type_specifier_nonarray: U64IMAGE2DARRAY */ @@ -10556,7 +10562,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true); } -#line 10560 "MachineIndependent/glslang_tab.cpp" +#line 10566 "MachineIndependent/glslang_tab.cpp" break; case 512: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ @@ -10566,7 +10572,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube, true); } -#line 10570 "MachineIndependent/glslang_tab.cpp" +#line 10576 "MachineIndependent/glslang_tab.cpp" break; case 513: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ @@ -10576,7 +10582,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube, true); } -#line 10580 "MachineIndependent/glslang_tab.cpp" +#line 10586 "MachineIndependent/glslang_tab.cpp" break; case 514: /* type_specifier_nonarray: I64IMAGE2DMS */ @@ -10586,7 +10592,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, false, false, true); } -#line 10590 "MachineIndependent/glslang_tab.cpp" +#line 10596 "MachineIndependent/glslang_tab.cpp" break; case 515: /* type_specifier_nonarray: U64IMAGE2DMS */ @@ -10596,7 +10602,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, false, false, true); } -#line 10600 "MachineIndependent/glslang_tab.cpp" +#line 10606 "MachineIndependent/glslang_tab.cpp" break; case 516: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ @@ -10606,7 +10612,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true, false, true); } -#line 10610 "MachineIndependent/glslang_tab.cpp" +#line 10616 "MachineIndependent/glslang_tab.cpp" break; case 517: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ @@ -10616,7 +10622,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true, false, true); } -#line 10620 "MachineIndependent/glslang_tab.cpp" +#line 10626 "MachineIndependent/glslang_tab.cpp" break; case 518: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ @@ -10627,7 +10633,7 @@ yyreduce: (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 10631 "MachineIndependent/glslang_tab.cpp" +#line 10637 "MachineIndependent/glslang_tab.cpp" break; case 519: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ @@ -10638,7 +10644,7 @@ yyreduce: (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.yuv = true; } -#line 10642 "MachineIndependent/glslang_tab.cpp" +#line 10648 "MachineIndependent/glslang_tab.cpp" break; case 520: /* type_specifier_nonarray: SUBPASSINPUT */ @@ -10649,7 +10655,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 10653 "MachineIndependent/glslang_tab.cpp" +#line 10659 "MachineIndependent/glslang_tab.cpp" break; case 521: /* type_specifier_nonarray: SUBPASSINPUTMS */ @@ -10660,7 +10666,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 10664 "MachineIndependent/glslang_tab.cpp" +#line 10670 "MachineIndependent/glslang_tab.cpp" break; case 522: /* type_specifier_nonarray: F16SUBPASSINPUT */ @@ -10672,7 +10678,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16); } -#line 10676 "MachineIndependent/glslang_tab.cpp" +#line 10682 "MachineIndependent/glslang_tab.cpp" break; case 523: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ @@ -10684,7 +10690,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); } -#line 10688 "MachineIndependent/glslang_tab.cpp" +#line 10694 "MachineIndependent/glslang_tab.cpp" break; case 524: /* type_specifier_nonarray: ISUBPASSINPUT */ @@ -10695,7 +10701,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 10699 "MachineIndependent/glslang_tab.cpp" +#line 10705 "MachineIndependent/glslang_tab.cpp" break; case 525: /* type_specifier_nonarray: ISUBPASSINPUTMS */ @@ -10706,7 +10712,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 10710 "MachineIndependent/glslang_tab.cpp" +#line 10716 "MachineIndependent/glslang_tab.cpp" break; case 526: /* type_specifier_nonarray: USUBPASSINPUT */ @@ -10717,7 +10723,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 10721 "MachineIndependent/glslang_tab.cpp" +#line 10727 "MachineIndependent/glslang_tab.cpp" break; case 527: /* type_specifier_nonarray: USUBPASSINPUTMS */ @@ -10728,7 +10734,7 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 10732 "MachineIndependent/glslang_tab.cpp" +#line 10738 "MachineIndependent/glslang_tab.cpp" break; case 528: /* type_specifier_nonarray: FCOOPMATNV */ @@ -10739,7 +10745,7 @@ yyreduce: (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).coopmat = true; } -#line 10743 "MachineIndependent/glslang_tab.cpp" +#line 10749 "MachineIndependent/glslang_tab.cpp" break; case 529: /* type_specifier_nonarray: ICOOPMATNV */ @@ -10750,7 +10756,7 @@ yyreduce: (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).coopmat = true; } -#line 10754 "MachineIndependent/glslang_tab.cpp" +#line 10760 "MachineIndependent/glslang_tab.cpp" break; case 530: /* type_specifier_nonarray: UCOOPMATNV */ @@ -10761,7 +10767,7 @@ yyreduce: (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).coopmat = true; } -#line 10765 "MachineIndependent/glslang_tab.cpp" +#line 10771 "MachineIndependent/glslang_tab.cpp" break; case 531: /* type_specifier_nonarray: spirv_type_specifier */ @@ -10770,7 +10776,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 10774 "MachineIndependent/glslang_tab.cpp" +#line 10780 "MachineIndependent/glslang_tab.cpp" break; case 532: /* type_specifier_nonarray: HITOBJECTNV */ @@ -10779,7 +10785,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtHitObjectNV; } -#line 10783 "MachineIndependent/glslang_tab.cpp" +#line 10789 "MachineIndependent/glslang_tab.cpp" break; case 533: /* type_specifier_nonarray: struct_specifier */ @@ -10789,7 +10795,7 @@ yyreduce: (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 10793 "MachineIndependent/glslang_tab.cpp" +#line 10799 "MachineIndependent/glslang_tab.cpp" break; case 534: /* type_specifier_nonarray: TYPE_NAME */ @@ -10807,7 +10813,7 @@ yyreduce: } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 10811 "MachineIndependent/glslang_tab.cpp" +#line 10817 "MachineIndependent/glslang_tab.cpp" break; case 535: /* precision_qualifier: HIGH_PRECISION */ @@ -10817,7 +10823,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 10821 "MachineIndependent/glslang_tab.cpp" +#line 10827 "MachineIndependent/glslang_tab.cpp" break; case 536: /* precision_qualifier: MEDIUM_PRECISION */ @@ -10827,7 +10833,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 10831 "MachineIndependent/glslang_tab.cpp" +#line 10837 "MachineIndependent/glslang_tab.cpp" break; case 537: /* precision_qualifier: LOW_PRECISION */ @@ -10837,13 +10843,13 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 10841 "MachineIndependent/glslang_tab.cpp" +#line 10847 "MachineIndependent/glslang_tab.cpp" break; case 538: /* $@3: %empty */ #line 3565 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 10847 "MachineIndependent/glslang_tab.cpp" +#line 10853 "MachineIndependent/glslang_tab.cpp" break; case 539: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ @@ -10859,13 +10865,13 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10863 "MachineIndependent/glslang_tab.cpp" +#line 10869 "MachineIndependent/glslang_tab.cpp" break; case 540: /* $@4: %empty */ #line 3576 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 10869 "MachineIndependent/glslang_tab.cpp" +#line 10875 "MachineIndependent/glslang_tab.cpp" break; case 541: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ @@ -10877,7 +10883,7 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10881 "MachineIndependent/glslang_tab.cpp" +#line 10887 "MachineIndependent/glslang_tab.cpp" break; case 542: /* struct_declaration_list: struct_declaration */ @@ -10885,7 +10891,7 @@ yyreduce: { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 10889 "MachineIndependent/glslang_tab.cpp" +#line 10895 "MachineIndependent/glslang_tab.cpp" break; case 543: /* struct_declaration_list: struct_declaration_list struct_declaration */ @@ -10900,7 +10906,7 @@ yyreduce: (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 10904 "MachineIndependent/glslang_tab.cpp" +#line 10910 "MachineIndependent/glslang_tab.cpp" break; case 544: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ @@ -10927,7 +10933,7 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 10931 "MachineIndependent/glslang_tab.cpp" +#line 10937 "MachineIndependent/glslang_tab.cpp" break; case 545: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ @@ -10956,7 +10962,7 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 10960 "MachineIndependent/glslang_tab.cpp" +#line 10966 "MachineIndependent/glslang_tab.cpp" break; case 546: /* struct_declarator_list: struct_declarator */ @@ -10965,7 +10971,7 @@ yyreduce: (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 10969 "MachineIndependent/glslang_tab.cpp" +#line 10975 "MachineIndependent/glslang_tab.cpp" break; case 547: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ @@ -10973,7 +10979,7 @@ yyreduce: { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 10977 "MachineIndependent/glslang_tab.cpp" +#line 10983 "MachineIndependent/glslang_tab.cpp" break; case 548: /* struct_declarator: IDENTIFIER */ @@ -10983,7 +10989,7 @@ yyreduce: (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 10987 "MachineIndependent/glslang_tab.cpp" +#line 10993 "MachineIndependent/glslang_tab.cpp" break; case 549: /* struct_declarator: IDENTIFIER array_specifier */ @@ -10996,7 +11002,7 @@ yyreduce: (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 11000 "MachineIndependent/glslang_tab.cpp" +#line 11006 "MachineIndependent/glslang_tab.cpp" break; case 550: /* initializer: assignment_expression */ @@ -11004,7 +11010,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11008 "MachineIndependent/glslang_tab.cpp" +#line 11014 "MachineIndependent/glslang_tab.cpp" break; case 551: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ @@ -11015,7 +11021,7 @@ yyreduce: parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 11019 "MachineIndependent/glslang_tab.cpp" +#line 11025 "MachineIndependent/glslang_tab.cpp" break; case 552: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ @@ -11026,7 +11032,7 @@ yyreduce: parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 11030 "MachineIndependent/glslang_tab.cpp" +#line 11036 "MachineIndependent/glslang_tab.cpp" break; case 553: /* initializer: LEFT_BRACE RIGHT_BRACE */ @@ -11037,7 +11043,7 @@ yyreduce: parseContext.profileRequires((yyvsp[-1].lex).loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); (yyval.interm.intermTypedNode) = parseContext.intermediate.makeAggregate((yyvsp[-1].lex).loc); } -#line 11041 "MachineIndependent/glslang_tab.cpp" +#line 11047 "MachineIndependent/glslang_tab.cpp" break; case 554: /* initializer_list: initializer */ @@ -11045,7 +11051,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 11049 "MachineIndependent/glslang_tab.cpp" +#line 11055 "MachineIndependent/glslang_tab.cpp" break; case 555: /* initializer_list: initializer_list COMMA initializer */ @@ -11053,73 +11059,73 @@ yyreduce: { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11057 "MachineIndependent/glslang_tab.cpp" +#line 11063 "MachineIndependent/glslang_tab.cpp" break; case 556: /* declaration_statement: declaration */ #line 3714 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11063 "MachineIndependent/glslang_tab.cpp" +#line 11069 "MachineIndependent/glslang_tab.cpp" break; case 557: /* statement: compound_statement */ #line 3718 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11069 "MachineIndependent/glslang_tab.cpp" +#line 11075 "MachineIndependent/glslang_tab.cpp" break; case 558: /* statement: simple_statement */ #line 3719 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11075 "MachineIndependent/glslang_tab.cpp" +#line 11081 "MachineIndependent/glslang_tab.cpp" break; case 559: /* simple_statement: declaration_statement */ #line 3725 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11081 "MachineIndependent/glslang_tab.cpp" +#line 11087 "MachineIndependent/glslang_tab.cpp" break; case 560: /* simple_statement: expression_statement */ #line 3726 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11087 "MachineIndependent/glslang_tab.cpp" +#line 11093 "MachineIndependent/glslang_tab.cpp" break; case 561: /* simple_statement: selection_statement */ #line 3727 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11093 "MachineIndependent/glslang_tab.cpp" +#line 11099 "MachineIndependent/glslang_tab.cpp" break; case 562: /* simple_statement: switch_statement */ #line 3728 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11099 "MachineIndependent/glslang_tab.cpp" +#line 11105 "MachineIndependent/glslang_tab.cpp" break; case 563: /* simple_statement: case_label */ #line 3729 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11105 "MachineIndependent/glslang_tab.cpp" +#line 11111 "MachineIndependent/glslang_tab.cpp" break; case 564: /* simple_statement: iteration_statement */ #line 3730 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11111 "MachineIndependent/glslang_tab.cpp" +#line 11117 "MachineIndependent/glslang_tab.cpp" break; case 565: /* simple_statement: jump_statement */ #line 3731 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11117 "MachineIndependent/glslang_tab.cpp" +#line 11123 "MachineIndependent/glslang_tab.cpp" break; case 566: /* simple_statement: demote_statement */ #line 3733 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11123 "MachineIndependent/glslang_tab.cpp" +#line 11129 "MachineIndependent/glslang_tab.cpp" break; case 567: /* demote_statement: DEMOTE SEMICOLON */ @@ -11129,13 +11135,13 @@ yyreduce: parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); } -#line 11133 "MachineIndependent/glslang_tab.cpp" +#line 11139 "MachineIndependent/glslang_tab.cpp" break; case 568: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ #line 3748 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11139 "MachineIndependent/glslang_tab.cpp" +#line 11145 "MachineIndependent/glslang_tab.cpp" break; case 569: /* $@5: %empty */ @@ -11144,7 +11150,7 @@ yyreduce: parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 11148 "MachineIndependent/glslang_tab.cpp" +#line 11154 "MachineIndependent/glslang_tab.cpp" break; case 570: /* $@6: %empty */ @@ -11153,7 +11159,7 @@ yyreduce: parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 11157 "MachineIndependent/glslang_tab.cpp" +#line 11163 "MachineIndependent/glslang_tab.cpp" break; case 571: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ @@ -11163,19 +11169,19 @@ yyreduce: (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 11167 "MachineIndependent/glslang_tab.cpp" +#line 11173 "MachineIndependent/glslang_tab.cpp" break; case 572: /* statement_no_new_scope: compound_statement_no_new_scope */ #line 3765 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11173 "MachineIndependent/glslang_tab.cpp" +#line 11179 "MachineIndependent/glslang_tab.cpp" break; case 573: /* statement_no_new_scope: simple_statement */ #line 3766 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11179 "MachineIndependent/glslang_tab.cpp" +#line 11185 "MachineIndependent/glslang_tab.cpp" break; case 574: /* $@7: %empty */ @@ -11183,7 +11189,7 @@ yyreduce: { ++parseContext.controlFlowNestingLevel; } -#line 11187 "MachineIndependent/glslang_tab.cpp" +#line 11193 "MachineIndependent/glslang_tab.cpp" break; case 575: /* statement_scoped: $@7 compound_statement */ @@ -11192,7 +11198,7 @@ yyreduce: --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11196 "MachineIndependent/glslang_tab.cpp" +#line 11202 "MachineIndependent/glslang_tab.cpp" break; case 576: /* $@8: %empty */ @@ -11202,7 +11208,7 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11206 "MachineIndependent/glslang_tab.cpp" +#line 11212 "MachineIndependent/glslang_tab.cpp" break; case 577: /* statement_scoped: $@8 simple_statement */ @@ -11213,7 +11219,7 @@ yyreduce: --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11217 "MachineIndependent/glslang_tab.cpp" +#line 11223 "MachineIndependent/glslang_tab.cpp" break; case 578: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ @@ -11221,7 +11227,7 @@ yyreduce: { (yyval.interm.intermNode) = 0; } -#line 11225 "MachineIndependent/glslang_tab.cpp" +#line 11231 "MachineIndependent/glslang_tab.cpp" break; case 579: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ @@ -11231,7 +11237,7 @@ yyreduce: (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 11235 "MachineIndependent/glslang_tab.cpp" +#line 11241 "MachineIndependent/glslang_tab.cpp" break; case 580: /* statement_list: statement */ @@ -11244,7 +11250,7 @@ yyreduce: (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 11248 "MachineIndependent/glslang_tab.cpp" +#line 11254 "MachineIndependent/glslang_tab.cpp" break; case 581: /* statement_list: statement_list statement */ @@ -11257,19 +11263,19 @@ yyreduce: } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11261 "MachineIndependent/glslang_tab.cpp" +#line 11267 "MachineIndependent/glslang_tab.cpp" break; case 582: /* expression_statement: SEMICOLON */ #line 3821 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11267 "MachineIndependent/glslang_tab.cpp" +#line 11273 "MachineIndependent/glslang_tab.cpp" break; case 583: /* expression_statement: expression SEMICOLON */ #line 3822 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 11273 "MachineIndependent/glslang_tab.cpp" +#line 11279 "MachineIndependent/glslang_tab.cpp" break; case 584: /* selection_statement: selection_statement_nonattributed */ @@ -11277,7 +11283,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11281 "MachineIndependent/glslang_tab.cpp" +#line 11287 "MachineIndependent/glslang_tab.cpp" break; case 585: /* selection_statement: attribute selection_statement_nonattributed */ @@ -11287,7 +11293,7 @@ yyreduce: parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11291 "MachineIndependent/glslang_tab.cpp" +#line 11297 "MachineIndependent/glslang_tab.cpp" break; case 586: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ @@ -11296,7 +11302,7 @@ yyreduce: parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 11300 "MachineIndependent/glslang_tab.cpp" +#line 11306 "MachineIndependent/glslang_tab.cpp" break; case 587: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ @@ -11305,7 +11311,7 @@ yyreduce: (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 11309 "MachineIndependent/glslang_tab.cpp" +#line 11315 "MachineIndependent/glslang_tab.cpp" break; case 588: /* selection_rest_statement: statement_scoped */ @@ -11314,7 +11320,7 @@ yyreduce: (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 11318 "MachineIndependent/glslang_tab.cpp" +#line 11324 "MachineIndependent/glslang_tab.cpp" break; case 589: /* condition: expression */ @@ -11323,7 +11329,7 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 11327 "MachineIndependent/glslang_tab.cpp" +#line 11333 "MachineIndependent/glslang_tab.cpp" break; case 590: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ @@ -11338,7 +11344,7 @@ yyreduce: else (yyval.interm.intermTypedNode) = 0; } -#line 11342 "MachineIndependent/glslang_tab.cpp" +#line 11348 "MachineIndependent/glslang_tab.cpp" break; case 591: /* switch_statement: switch_statement_nonattributed */ @@ -11346,7 +11352,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11350 "MachineIndependent/glslang_tab.cpp" +#line 11356 "MachineIndependent/glslang_tab.cpp" break; case 592: /* switch_statement: attribute switch_statement_nonattributed */ @@ -11356,7 +11362,7 @@ yyreduce: parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11360 "MachineIndependent/glslang_tab.cpp" +#line 11366 "MachineIndependent/glslang_tab.cpp" break; case 593: /* $@9: %empty */ @@ -11369,7 +11375,7 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 11373 "MachineIndependent/glslang_tab.cpp" +#line 11379 "MachineIndependent/glslang_tab.cpp" break; case 594: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ @@ -11383,7 +11389,7 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11387 "MachineIndependent/glslang_tab.cpp" +#line 11393 "MachineIndependent/glslang_tab.cpp" break; case 595: /* switch_statement_list: %empty */ @@ -11391,7 +11397,7 @@ yyreduce: { (yyval.interm.intermNode) = 0; } -#line 11395 "MachineIndependent/glslang_tab.cpp" +#line 11401 "MachineIndependent/glslang_tab.cpp" break; case 596: /* switch_statement_list: statement_list */ @@ -11399,7 +11405,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11403 "MachineIndependent/glslang_tab.cpp" +#line 11409 "MachineIndependent/glslang_tab.cpp" break; case 597: /* case_label: CASE expression COLON */ @@ -11416,7 +11422,7 @@ yyreduce: (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 11420 "MachineIndependent/glslang_tab.cpp" +#line 11426 "MachineIndependent/glslang_tab.cpp" break; case 598: /* case_label: DEFAULT COLON */ @@ -11430,7 +11436,7 @@ yyreduce: else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 11434 "MachineIndependent/glslang_tab.cpp" +#line 11440 "MachineIndependent/glslang_tab.cpp" break; case 599: /* iteration_statement: iteration_statement_nonattributed */ @@ -11438,7 +11444,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11442 "MachineIndependent/glslang_tab.cpp" +#line 11448 "MachineIndependent/glslang_tab.cpp" break; case 600: /* iteration_statement: attribute iteration_statement_nonattributed */ @@ -11448,7 +11454,7 @@ yyreduce: parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11452 "MachineIndependent/glslang_tab.cpp" +#line 11458 "MachineIndependent/glslang_tab.cpp" break; case 601: /* $@10: %empty */ @@ -11461,7 +11467,7 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11465 "MachineIndependent/glslang_tab.cpp" +#line 11471 "MachineIndependent/glslang_tab.cpp" break; case 602: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ @@ -11473,7 +11479,7 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11477 "MachineIndependent/glslang_tab.cpp" +#line 11483 "MachineIndependent/glslang_tab.cpp" break; case 603: /* $@11: %empty */ @@ -11484,7 +11490,7 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11488 "MachineIndependent/glslang_tab.cpp" +#line 11494 "MachineIndependent/glslang_tab.cpp" break; case 604: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ @@ -11501,7 +11507,7 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11505 "MachineIndependent/glslang_tab.cpp" +#line 11511 "MachineIndependent/glslang_tab.cpp" break; case 605: /* $@12: %empty */ @@ -11512,7 +11518,7 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11516 "MachineIndependent/glslang_tab.cpp" +#line 11522 "MachineIndependent/glslang_tab.cpp" break; case 606: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ @@ -11529,7 +11535,7 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11533 "MachineIndependent/glslang_tab.cpp" +#line 11539 "MachineIndependent/glslang_tab.cpp" break; case 607: /* for_init_statement: expression_statement */ @@ -11537,7 +11543,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11541 "MachineIndependent/glslang_tab.cpp" +#line 11547 "MachineIndependent/glslang_tab.cpp" break; case 608: /* for_init_statement: declaration_statement */ @@ -11545,7 +11551,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11549 "MachineIndependent/glslang_tab.cpp" +#line 11555 "MachineIndependent/glslang_tab.cpp" break; case 609: /* conditionopt: condition */ @@ -11553,7 +11559,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11557 "MachineIndependent/glslang_tab.cpp" +#line 11563 "MachineIndependent/glslang_tab.cpp" break; case 610: /* conditionopt: %empty */ @@ -11561,7 +11567,7 @@ yyreduce: { (yyval.interm.intermTypedNode) = 0; } -#line 11565 "MachineIndependent/glslang_tab.cpp" +#line 11571 "MachineIndependent/glslang_tab.cpp" break; case 611: /* for_rest_statement: conditionopt SEMICOLON */ @@ -11570,7 +11576,7 @@ yyreduce: (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 11574 "MachineIndependent/glslang_tab.cpp" +#line 11580 "MachineIndependent/glslang_tab.cpp" break; case 612: /* for_rest_statement: conditionopt SEMICOLON expression */ @@ -11579,7 +11585,7 @@ yyreduce: (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 11583 "MachineIndependent/glslang_tab.cpp" +#line 11589 "MachineIndependent/glslang_tab.cpp" break; case 613: /* jump_statement: CONTINUE SEMICOLON */ @@ -11589,7 +11595,7 @@ yyreduce: parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 11593 "MachineIndependent/glslang_tab.cpp" +#line 11599 "MachineIndependent/glslang_tab.cpp" break; case 614: /* jump_statement: BREAK SEMICOLON */ @@ -11599,7 +11605,7 @@ yyreduce: parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 11603 "MachineIndependent/glslang_tab.cpp" +#line 11609 "MachineIndependent/glslang_tab.cpp" break; case 615: /* jump_statement: RETURN SEMICOLON */ @@ -11611,7 +11617,7 @@ yyreduce: if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 11615 "MachineIndependent/glslang_tab.cpp" +#line 11621 "MachineIndependent/glslang_tab.cpp" break; case 616: /* jump_statement: RETURN expression SEMICOLON */ @@ -11619,7 +11625,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 11623 "MachineIndependent/glslang_tab.cpp" +#line 11629 "MachineIndependent/glslang_tab.cpp" break; case 617: /* jump_statement: DISCARD SEMICOLON */ @@ -11628,7 +11634,7 @@ yyreduce: parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 11632 "MachineIndependent/glslang_tab.cpp" +#line 11638 "MachineIndependent/glslang_tab.cpp" break; case 618: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ @@ -11637,7 +11643,7 @@ yyreduce: parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); } -#line 11641 "MachineIndependent/glslang_tab.cpp" +#line 11647 "MachineIndependent/glslang_tab.cpp" break; case 619: /* jump_statement: TERMINATE_RAY SEMICOLON */ @@ -11646,7 +11652,7 @@ yyreduce: parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); } -#line 11650 "MachineIndependent/glslang_tab.cpp" +#line 11656 "MachineIndependent/glslang_tab.cpp" break; case 620: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ @@ -11655,7 +11661,7 @@ yyreduce: parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); } -#line 11659 "MachineIndependent/glslang_tab.cpp" +#line 11665 "MachineIndependent/glslang_tab.cpp" break; case 621: /* translation_unit: external_declaration */ @@ -11664,7 +11670,7 @@ yyreduce: (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 11668 "MachineIndependent/glslang_tab.cpp" +#line 11674 "MachineIndependent/glslang_tab.cpp" break; case 622: /* translation_unit: translation_unit external_declaration */ @@ -11675,7 +11681,7 @@ yyreduce: parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 11679 "MachineIndependent/glslang_tab.cpp" +#line 11685 "MachineIndependent/glslang_tab.cpp" break; case 623: /* external_declaration: function_definition */ @@ -11683,7 +11689,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11687 "MachineIndependent/glslang_tab.cpp" +#line 11693 "MachineIndependent/glslang_tab.cpp" break; case 624: /* external_declaration: declaration */ @@ -11691,7 +11697,7 @@ yyreduce: { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11695 "MachineIndependent/glslang_tab.cpp" +#line 11701 "MachineIndependent/glslang_tab.cpp" break; case 625: /* external_declaration: SEMICOLON */ @@ -11701,7 +11707,7 @@ yyreduce: parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 11705 "MachineIndependent/glslang_tab.cpp" +#line 11711 "MachineIndependent/glslang_tab.cpp" break; case 626: /* $@13: %empty */ @@ -11718,7 +11724,7 @@ yyreduce: ++parseContext.statementNestingLevel; } } -#line 11722 "MachineIndependent/glslang_tab.cpp" +#line 11728 "MachineIndependent/glslang_tab.cpp" break; case 627: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ @@ -11749,7 +11755,7 @@ yyreduce: --parseContext.statementNestingLevel; } } -#line 11753 "MachineIndependent/glslang_tab.cpp" +#line 11759 "MachineIndependent/glslang_tab.cpp" break; case 628: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ @@ -11757,7 +11763,7 @@ yyreduce: { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); } -#line 11761 "MachineIndependent/glslang_tab.cpp" +#line 11767 "MachineIndependent/glslang_tab.cpp" break; case 629: /* attribute_list: single_attribute */ @@ -11765,7 +11771,7 @@ yyreduce: { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 11769 "MachineIndependent/glslang_tab.cpp" +#line 11775 "MachineIndependent/glslang_tab.cpp" break; case 630: /* attribute_list: attribute_list COMMA single_attribute */ @@ -11773,7 +11779,7 @@ yyreduce: { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 11777 "MachineIndependent/glslang_tab.cpp" +#line 11783 "MachineIndependent/glslang_tab.cpp" break; case 631: /* single_attribute: IDENTIFIER */ @@ -11781,7 +11787,7 @@ yyreduce: { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 11785 "MachineIndependent/glslang_tab.cpp" +#line 11791 "MachineIndependent/glslang_tab.cpp" break; case 632: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ @@ -11789,7 +11795,7 @@ yyreduce: { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 11793 "MachineIndependent/glslang_tab.cpp" +#line 11799 "MachineIndependent/glslang_tab.cpp" break; case 633: /* spirv_requirements_list: spirv_requirements_parameter */ @@ -11797,7 +11803,7 @@ yyreduce: { (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); } -#line 11801 "MachineIndependent/glslang_tab.cpp" +#line 11807 "MachineIndependent/glslang_tab.cpp" break; case 634: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ @@ -11805,7 +11811,7 @@ yyreduce: { (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); } -#line 11809 "MachineIndependent/glslang_tab.cpp" +#line 11815 "MachineIndependent/glslang_tab.cpp" break; case 635: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ @@ -11813,7 +11819,7 @@ yyreduce: { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); } -#line 11817 "MachineIndependent/glslang_tab.cpp" +#line 11823 "MachineIndependent/glslang_tab.cpp" break; case 636: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ @@ -11821,7 +11827,7 @@ yyreduce: { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11825 "MachineIndependent/glslang_tab.cpp" +#line 11831 "MachineIndependent/glslang_tab.cpp" break; case 637: /* spirv_extension_list: STRING_LITERAL */ @@ -11829,7 +11835,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11833 "MachineIndependent/glslang_tab.cpp" +#line 11839 "MachineIndependent/glslang_tab.cpp" break; case 638: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ @@ -11837,7 +11843,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11841 "MachineIndependent/glslang_tab.cpp" +#line 11847 "MachineIndependent/glslang_tab.cpp" break; case 639: /* spirv_capability_list: INTCONSTANT */ @@ -11845,7 +11851,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11849 "MachineIndependent/glslang_tab.cpp" +#line 11855 "MachineIndependent/glslang_tab.cpp" break; case 640: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ @@ -11853,7 +11859,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11857 "MachineIndependent/glslang_tab.cpp" +#line 11863 "MachineIndependent/glslang_tab.cpp" break; case 641: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ @@ -11862,7 +11868,7 @@ yyreduce: parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11866 "MachineIndependent/glslang_tab.cpp" +#line 11872 "MachineIndependent/glslang_tab.cpp" break; case 642: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ @@ -11872,7 +11878,7 @@ yyreduce: parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11876 "MachineIndependent/glslang_tab.cpp" +#line 11882 "MachineIndependent/glslang_tab.cpp" break; case 643: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ @@ -11881,7 +11887,7 @@ yyreduce: parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11885 "MachineIndependent/glslang_tab.cpp" +#line 11891 "MachineIndependent/glslang_tab.cpp" break; case 644: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ @@ -11891,7 +11897,7 @@ yyreduce: parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11895 "MachineIndependent/glslang_tab.cpp" +#line 11901 "MachineIndependent/glslang_tab.cpp" break; case 645: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ @@ -11900,7 +11906,7 @@ yyreduce: parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11904 "MachineIndependent/glslang_tab.cpp" +#line 11910 "MachineIndependent/glslang_tab.cpp" break; case 646: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ @@ -11910,7 +11916,7 @@ yyreduce: parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11914 "MachineIndependent/glslang_tab.cpp" +#line 11920 "MachineIndependent/glslang_tab.cpp" break; case 647: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ @@ -11918,7 +11924,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 11922 "MachineIndependent/glslang_tab.cpp" +#line 11928 "MachineIndependent/glslang_tab.cpp" break; case 648: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ @@ -11926,7 +11932,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11930 "MachineIndependent/glslang_tab.cpp" +#line 11936 "MachineIndependent/glslang_tab.cpp" break; case 649: /* spirv_execution_mode_parameter: FLOATCONSTANT */ @@ -11934,7 +11940,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 11938 "MachineIndependent/glslang_tab.cpp" +#line 11944 "MachineIndependent/glslang_tab.cpp" break; case 650: /* spirv_execution_mode_parameter: INTCONSTANT */ @@ -11942,7 +11948,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 11946 "MachineIndependent/glslang_tab.cpp" +#line 11952 "MachineIndependent/glslang_tab.cpp" break; case 651: /* spirv_execution_mode_parameter: UINTCONSTANT */ @@ -11950,7 +11956,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 11954 "MachineIndependent/glslang_tab.cpp" +#line 11960 "MachineIndependent/glslang_tab.cpp" break; case 652: /* spirv_execution_mode_parameter: BOOLCONSTANT */ @@ -11958,7 +11964,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 11962 "MachineIndependent/glslang_tab.cpp" +#line 11968 "MachineIndependent/glslang_tab.cpp" break; case 653: /* spirv_execution_mode_parameter: STRING_LITERAL */ @@ -11966,7 +11972,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 11970 "MachineIndependent/glslang_tab.cpp" +#line 11976 "MachineIndependent/glslang_tab.cpp" break; case 654: /* spirv_execution_mode_id_parameter_list: constant_expression */ @@ -11980,7 +11986,7 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); } -#line 11984 "MachineIndependent/glslang_tab.cpp" +#line 11990 "MachineIndependent/glslang_tab.cpp" break; case 655: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ @@ -11994,7 +12000,7 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11998 "MachineIndependent/glslang_tab.cpp" +#line 12004 "MachineIndependent/glslang_tab.cpp" break; case 656: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ @@ -12004,7 +12010,7 @@ yyreduce: (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 12008 "MachineIndependent/glslang_tab.cpp" +#line 12014 "MachineIndependent/glslang_tab.cpp" break; case 657: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ @@ -12015,7 +12021,7 @@ yyreduce: (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 12019 "MachineIndependent/glslang_tab.cpp" +#line 12025 "MachineIndependent/glslang_tab.cpp" break; case 658: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ @@ -12024,7 +12030,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12028 "MachineIndependent/glslang_tab.cpp" +#line 12034 "MachineIndependent/glslang_tab.cpp" break; case 659: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ @@ -12034,7 +12040,7 @@ yyreduce: parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12038 "MachineIndependent/glslang_tab.cpp" +#line 12044 "MachineIndependent/glslang_tab.cpp" break; case 660: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ @@ -12043,7 +12049,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12047 "MachineIndependent/glslang_tab.cpp" +#line 12053 "MachineIndependent/glslang_tab.cpp" break; case 661: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ @@ -12053,7 +12059,7 @@ yyreduce: parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12057 "MachineIndependent/glslang_tab.cpp" +#line 12063 "MachineIndependent/glslang_tab.cpp" break; case 662: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ @@ -12062,7 +12068,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12066 "MachineIndependent/glslang_tab.cpp" +#line 12072 "MachineIndependent/glslang_tab.cpp" break; case 663: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ @@ -12072,7 +12078,7 @@ yyreduce: parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12076 "MachineIndependent/glslang_tab.cpp" +#line 12082 "MachineIndependent/glslang_tab.cpp" break; case 664: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ @@ -12081,7 +12087,7 @@ yyreduce: (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12085 "MachineIndependent/glslang_tab.cpp" +#line 12091 "MachineIndependent/glslang_tab.cpp" break; case 665: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ @@ -12091,7 +12097,7 @@ yyreduce: parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12095 "MachineIndependent/glslang_tab.cpp" +#line 12101 "MachineIndependent/glslang_tab.cpp" break; case 666: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ @@ -12099,7 +12105,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12103 "MachineIndependent/glslang_tab.cpp" +#line 12109 "MachineIndependent/glslang_tab.cpp" break; case 667: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ @@ -12107,7 +12113,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12111 "MachineIndependent/glslang_tab.cpp" +#line 12117 "MachineIndependent/glslang_tab.cpp" break; case 668: /* spirv_decorate_parameter: FLOATCONSTANT */ @@ -12115,7 +12121,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12119 "MachineIndependent/glslang_tab.cpp" +#line 12125 "MachineIndependent/glslang_tab.cpp" break; case 669: /* spirv_decorate_parameter: INTCONSTANT */ @@ -12123,7 +12129,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12127 "MachineIndependent/glslang_tab.cpp" +#line 12133 "MachineIndependent/glslang_tab.cpp" break; case 670: /* spirv_decorate_parameter: UINTCONSTANT */ @@ -12131,7 +12137,7 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12135 "MachineIndependent/glslang_tab.cpp" +#line 12141 "MachineIndependent/glslang_tab.cpp" break; case 671: /* spirv_decorate_parameter: BOOLCONSTANT */ @@ -12139,165 +12145,198 @@ yyreduce: { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12143 "MachineIndependent/glslang_tab.cpp" +#line 12149 "MachineIndependent/glslang_tab.cpp" break; - case 672: /* spirv_decorate_id_parameter_list: constant_expression */ + case 672: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ #line 4350 "MachineIndependent/glslang.y" - { - if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && - (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && - (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtUint && - (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtBool) - parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); - (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12156 "MachineIndependent/glslang_tab.cpp" +#line 12157 "MachineIndependent/glslang_tab.cpp" break; - case 673: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA constant_expression */ + case 673: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ +#line 4353 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); + } +#line 12165 "MachineIndependent/glslang_tab.cpp" + break; + + case 674: /* spirv_decorate_id_parameter: variable_identifier */ #line 4358 "MachineIndependent/glslang.y" - { - if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && - (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && - (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtUint && - (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtBool) - parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); + { + if ((yyvsp[0].interm.intermTypedNode)->getAsConstantUnion() || (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode()) + (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); + else + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); } -#line 12169 "MachineIndependent/glslang_tab.cpp" +#line 12176 "MachineIndependent/glslang_tab.cpp" break; - case 674: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ -#line 4368 "MachineIndependent/glslang.y" + case 675: /* spirv_decorate_id_parameter: FLOATCONSTANT */ +#line 4364 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + } +#line 12184 "MachineIndependent/glslang_tab.cpp" + break; + + case 676: /* spirv_decorate_id_parameter: INTCONSTANT */ +#line 4367 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 12192 "MachineIndependent/glslang_tab.cpp" + break; + + case 677: /* spirv_decorate_id_parameter: UINTCONSTANT */ +#line 4370 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 12200 "MachineIndependent/glslang_tab.cpp" + break; + + case 678: /* spirv_decorate_id_parameter: BOOLCONSTANT */ +#line 4373 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); + } +#line 12208 "MachineIndependent/glslang_tab.cpp" + break; + + case 679: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ +#line 4378 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12178 "MachineIndependent/glslang_tab.cpp" +#line 12217 "MachineIndependent/glslang_tab.cpp" break; - case 675: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ -#line 4372 "MachineIndependent/glslang.y" + case 680: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ +#line 4382 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12186 "MachineIndependent/glslang_tab.cpp" +#line 12225 "MachineIndependent/glslang_tab.cpp" break; - case 676: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4377 "MachineIndependent/glslang.y" + case 681: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4387 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12195 "MachineIndependent/glslang_tab.cpp" +#line 12234 "MachineIndependent/glslang_tab.cpp" break; - case 677: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4381 "MachineIndependent/glslang.y" + case 682: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4391 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12205 "MachineIndependent/glslang_tab.cpp" +#line 12244 "MachineIndependent/glslang_tab.cpp" break; - case 678: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4386 "MachineIndependent/glslang.y" + case 683: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4396 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12214 "MachineIndependent/glslang_tab.cpp" +#line 12253 "MachineIndependent/glslang_tab.cpp" break; - case 679: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4390 "MachineIndependent/glslang.y" + case 684: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4400 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12224 "MachineIndependent/glslang_tab.cpp" +#line 12263 "MachineIndependent/glslang_tab.cpp" break; - case 680: /* spirv_type_parameter_list: spirv_type_parameter */ -#line 4397 "MachineIndependent/glslang.y" + case 685: /* spirv_type_parameter_list: spirv_type_parameter */ +#line 4407 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); } -#line 12232 "MachineIndependent/glslang_tab.cpp" +#line 12271 "MachineIndependent/glslang_tab.cpp" break; - case 681: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ -#line 4400 "MachineIndependent/glslang.y" + case 686: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ +#line 4410 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); } -#line 12240 "MachineIndependent/glslang_tab.cpp" +#line 12279 "MachineIndependent/glslang_tab.cpp" break; - case 682: /* spirv_type_parameter: constant_expression */ -#line 4405 "MachineIndependent/glslang.y" + case 687: /* spirv_type_parameter: constant_expression */ +#line 4415 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); } -#line 12248 "MachineIndependent/glslang_tab.cpp" +#line 12287 "MachineIndependent/glslang_tab.cpp" break; - case 683: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4410 "MachineIndependent/glslang.y" + case 688: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4420 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12256 "MachineIndependent/glslang_tab.cpp" +#line 12295 "MachineIndependent/glslang_tab.cpp" break; - case 684: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4413 "MachineIndependent/glslang.y" + case 689: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4423 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12265 "MachineIndependent/glslang_tab.cpp" +#line 12304 "MachineIndependent/glslang_tab.cpp" break; - case 685: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ -#line 4419 "MachineIndependent/glslang.y" + case 690: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ +#line 4429 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); } -#line 12273 "MachineIndependent/glslang_tab.cpp" +#line 12312 "MachineIndependent/glslang_tab.cpp" break; - case 686: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4422 "MachineIndependent/glslang.y" + case 691: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ +#line 4432 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } -#line 12281 "MachineIndependent/glslang_tab.cpp" +#line 12320 "MachineIndependent/glslang_tab.cpp" break; - case 687: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ -#line 4427 "MachineIndependent/glslang.y" + case 692: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ +#line 4437 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } -#line 12289 "MachineIndependent/glslang_tab.cpp" +#line 12328 "MachineIndependent/glslang_tab.cpp" break; - case 688: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4430 "MachineIndependent/glslang.y" + case 693: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ +#line 4440 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } -#line 12297 "MachineIndependent/glslang_tab.cpp" +#line 12336 "MachineIndependent/glslang_tab.cpp" break; -#line 12301 "MachineIndependent/glslang_tab.cpp" +#line 12340 "MachineIndependent/glslang_tab.cpp" default: break; } @@ -12522,5 +12561,5 @@ yyreturn: return yyresult; } -#line 4435 "MachineIndependent/glslang.y" +#line 4445 "MachineIndependent/glslang.y" From 90e6e6f7a0e3525a95c42b046b0234584247e7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:23:24 -0700 Subject: [PATCH 77/86] Updated spirv-headers. --- .../spirv-headers/include/spirv/spir-v.xml | 9 +- .../spirv/unified1/spirv.core.grammar.json | 124 ++++++++++++++++++ .../include/spirv/unified1/spirv.h | 19 +++ .../include/spirv/unified1/spirv.hpp11 | 19 +++ .../include/spirv/unified1/spirv.json | 17 ++- 5 files changed, 184 insertions(+), 4 deletions(-) diff --git a/3rdparty/spirv-headers/include/spirv/spir-v.xml b/3rdparty/spirv-headers/include/spirv/spir-v.xml index 6648b3374..9dea8d9bb 100644 --- a/3rdparty/spirv-headers/include/spirv/spir-v.xml +++ b/3rdparty/spirv-headers/include/spirv/spir-v.xml @@ -140,14 +140,16 @@ - + + + - + @@ -172,13 +174,14 @@ + - + diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json index 8f1e29a48..377e2ec08 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json @@ -4102,6 +4102,43 @@ "capabilities" : [ "Addresses", "VariablePointers", "VariablePointersStorageBuffer" ], "version" : "1.4" }, + { + "opname" : "OpColorAttachmentReadEXT", + "class" : "Image", + "opcode" : 4160, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Attachment'" }, + { "kind" : "IdRef", "name" : "'Sample'", "quantifier" : "?" } + ], + "capabilities": [ "TileImageColorReadAccessEXT" ], + "version" : "None" + }, + { + "opname" : "OpDepthAttachmentReadEXT", + "class" : "Image", + "opcode" : 4161, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sample'", "quantifier" : "?" } + ], + "capabilities" : [ "TileImageDepthReadAccessEXT" ], + "version" : "None" + }, + { + "opname" : "OpStencilAttachmentReadEXT", + "class" : "Image", + "opcode" : 4162, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Sample'", "quantifier" : "?" } + ], + "capabilities" : [ "TileImageStencilReadAccessEXT" ], + "version" : "None" + }, { "opname" : "OpTerminateInvocation", "class" : "Control-Flow", @@ -5446,6 +5483,25 @@ "extensions" : [ "SPV_NV_ray_tracing_motion_blur" ], "version" : "None" }, + { + "opname" : "OpRayQueryGetIntersectionTriangleVertexPositionsKHR", + "class" : "Reserved", + "opcode" : 5340, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { + "kind" : "IdRef", + "name" : "'RayQuery'" + }, + { + "kind" : "IdRef", + "name" : "'Intersection'" + } + ], + "capabilities" : [ "RayQueryPositionFetchKHR" ], + "version" : "None" + }, { "opname" : "OpTypeAccelerationStructureNV", "class" : "Reserved", @@ -10473,6 +10529,24 @@ ], "version" : "1.2" }, + { + "enumerant" : "NonCoherentColorAttachmentReadEXT", + "value" : 4169, + "capabilities" : [ "TileImageColorReadAccessEXT" ], + "version" : "None" + }, + { + "enumerant" : "NonCoherentDepthAttachmentReadEXT", + "value" : 4170, + "capabilities" : [ "TileImageDepthReadAccessEXT" ], + "version" : "None" + }, + { + "enumerant" : "NonCoherentStencilAttachmentReadEXT", + "value" : 4171, + "capabilities" : [ "TileImageStencilReadAccessEXT" ], + "version" : "None" + }, { "enumerant" : "SubgroupUniformControlFlowKHR", "value" : 4421, @@ -10887,6 +10961,12 @@ "capabilities" : [ "Shader" ], "version" : "1.3" }, + { + "enumerant" : "TileImageEXT", + "value" : 4172, + "capabilities" : [ "TileImageColorReadAccessEXT" ], + "version" : "None" + }, { "enumerant" : "CallableDataNV", "value" : 5328, @@ -11061,6 +11141,12 @@ "enumerant" : "SubpassData", "value" : 6, "capabilities" : [ "InputAttachment" ] + }, + { + "enumerant" : "TileImageDataEXT", + "value" : 4173, + "capabilities" : [ "TileImageColorReadAccessEXT" ], + "version" : "None" } ] }, @@ -13470,6 +13556,12 @@ "extensions" : [ "SPV_NV_ray_tracing_motion_blur" ], "version" : "None" }, + { + "enumerant" : "HitTriangleVertexPositionsKHR", + "value" : 5335, + "capabilities" : [ "RayTracingPositionFetchKHR" ], + "version" : "None" + }, { "enumerant" : "IncomingRayFlagsNV", "value" : 5351, @@ -13999,6 +14091,24 @@ "value" : 4165, "extensions" : [ "SPV_ARM_core_builtins" ] }, + { + "enumerant" : "TileImageColorReadAccessEXT", + "value" : 4166, + "extensions" : [ "SPV_EXT_shader_tile_image" ], + "version" : "None" + }, + { + "enumerant" : "TileImageDepthReadAccessEXT", + "value" : 4167, + "extensions" : [ "SPV_EXT_shader_tile_image" ], + "version" : "None" + }, + { + "enumerant" : "TileImageStencilReadAccessEXT", + "value" : 4168, + "extensions" : [ "SPV_EXT_shader_tile_image" ], + "version" : "None" + }, { "enumerant" : "FragmentShadingRateKHR", "value" : 4422, @@ -14542,6 +14652,13 @@ "extensions" : [ "SPV_EXT_descriptor_indexing" ], "version" : "1.5" }, + { + "enumerant" : "RayTracingPositionFetchKHR", + "value" : 5336, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_ray_tracing_position_fetch" ], + "version" : "None" + }, { "enumerant" : "RayTracingNV", "value" : 5340, @@ -14673,6 +14790,13 @@ "extensions" : [ "SPV_NV_bindless_texture" ], "version" : "None" }, + { + "enumerant" : "RayQueryPositionFetchKHR", + "value" : 5391, + "capabilities" : [ "Shader" ], + "extensions" : [ "SPV_KHR_ray_tracing_position_fetch" ], + "version" : "None" + }, { "enumerant" : "SubgroupShuffleINTEL", "value" : 5568, diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h index 28eb8ff49..b8de1b846 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.h +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.h @@ -160,6 +160,9 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeSubgroupsPerWorkgroupId = 37, SpvExecutionModeLocalSizeId = 38, SpvExecutionModeLocalSizeHintId = 39, + SpvExecutionModeNonCoherentColorAttachmentReadEXT = 4169, + SpvExecutionModeNonCoherentDepthAttachmentReadEXT = 4170, + SpvExecutionModeNonCoherentStencilAttachmentReadEXT = 4171, SpvExecutionModeSubgroupUniformControlFlowKHR = 4421, SpvExecutionModePostDepthCoverage = 4446, SpvExecutionModeDenormPreserve = 4459, @@ -219,6 +222,7 @@ typedef enum SpvStorageClass_ { SpvStorageClassAtomicCounter = 10, SpvStorageClassImage = 11, SpvStorageClassStorageBuffer = 12, + SpvStorageClassTileImageEXT = 4172, SpvStorageClassCallableDataKHR = 5328, SpvStorageClassCallableDataNV = 5328, SpvStorageClassIncomingCallableDataKHR = 5329, @@ -249,6 +253,7 @@ typedef enum SpvDim_ { SpvDimRect = 4, SpvDimBuffer = 5, SpvDimSubpassData = 6, + SpvDimTileImageDataEXT = 4173, SpvDimMax = 0x7fffffff, } SpvDim; @@ -721,6 +726,7 @@ typedef enum SpvBuiltIn_ { SpvBuiltInHitKindKHR = 5333, SpvBuiltInHitKindNV = 5333, SpvBuiltInCurrentRayTimeNV = 5334, + SpvBuiltInHitTriangleVertexPositionsKHR = 5335, SpvBuiltInIncomingRayFlagsKHR = 5351, SpvBuiltInIncomingRayFlagsNV = 5351, SpvBuiltInRayGeometryIndexKHR = 5352, @@ -992,6 +998,9 @@ typedef enum SpvCapability_ { SpvCapabilityShaderViewportIndex = 70, SpvCapabilityUniformDecoration = 71, SpvCapabilityCoreBuiltinsARM = 4165, + SpvCapabilityTileImageColorReadAccessEXT = 4166, + SpvCapabilityTileImageDepthReadAccessEXT = 4167, + SpvCapabilityTileImageStencilReadAccessEXT = 4168, SpvCapabilityFragmentShadingRateKHR = 4422, SpvCapabilitySubgroupBallotKHR = 4423, SpvCapabilityDrawParameters = 4427, @@ -1074,6 +1083,7 @@ typedef enum SpvCapability_ { SpvCapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, SpvCapabilityStorageTexelBufferArrayNonUniformIndexing = 5312, SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + SpvCapabilityRayTracingPositionFetchKHR = 5336, SpvCapabilityRayTracingNV = 5340, SpvCapabilityRayTracingMotionBlurNV = 5341, SpvCapabilityVulkanMemoryModel = 5345, @@ -1094,6 +1104,7 @@ typedef enum SpvCapability_ { SpvCapabilityRayTracingOpacityMicromapEXT = 5381, SpvCapabilityShaderInvocationReorderNV = 5383, SpvCapabilityBindlessTextureNV = 5390, + SpvCapabilityRayQueryPositionFetchKHR = 5391, SpvCapabilitySubgroupShuffleINTEL = 5568, SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, SpvCapabilitySubgroupImageBlockIOINTEL = 5570, @@ -1610,6 +1621,9 @@ typedef enum SpvOp_ { SpvOpPtrEqual = 401, SpvOpPtrNotEqual = 402, SpvOpPtrDiff = 403, + SpvOpColorAttachmentReadEXT = 4160, + SpvOpDepthAttachmentReadEXT = 4161, + SpvOpStencilAttachmentReadEXT = 4162, SpvOpTerminateInvocation = 4416, SpvOpSubgroupBallotKHR = 4421, SpvOpSubgroupFirstInvocationKHR = 4422, @@ -1702,6 +1716,7 @@ typedef enum SpvOp_ { SpvOpTraceNV = 5337, SpvOpTraceMotionNV = 5338, SpvOpTraceRayMotionNV = 5339, + SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, SpvOpTypeAccelerationStructureKHR = 5341, SpvOpTypeAccelerationStructureNV = 5341, SpvOpExecuteCallableNV = 5344, @@ -2330,6 +2345,9 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpPtrEqual: *hasResult = true; *hasResultType = true; break; case SpvOpPtrNotEqual: *hasResult = true; *hasResultType = true; break; case SpvOpPtrDiff: *hasResult = true; *hasResultType = true; break; + case SpvOpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case SpvOpTerminateInvocation: *hasResult = false; *hasResultType = false; break; case SpvOpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; case SpvOpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; @@ -2415,6 +2433,7 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpTraceNV: *hasResult = false; *hasResultType = false; break; case SpvOpTraceMotionNV: *hasResult = false; *hasResultType = false; break; case SpvOpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; case SpvOpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; case SpvOpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; case SpvOpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 index 362e8faeb..5b643aeea 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 @@ -156,6 +156,9 @@ enum class ExecutionMode : unsigned { SubgroupsPerWorkgroupId = 37, LocalSizeId = 38, LocalSizeHintId = 39, + NonCoherentColorAttachmentReadEXT = 4169, + NonCoherentDepthAttachmentReadEXT = 4170, + NonCoherentStencilAttachmentReadEXT = 4171, SubgroupUniformControlFlowKHR = 4421, PostDepthCoverage = 4446, DenormPreserve = 4459, @@ -215,6 +218,7 @@ enum class StorageClass : unsigned { AtomicCounter = 10, Image = 11, StorageBuffer = 12, + TileImageEXT = 4172, CallableDataKHR = 5328, CallableDataNV = 5328, IncomingCallableDataKHR = 5329, @@ -245,6 +249,7 @@ enum class Dim : unsigned { Rect = 4, Buffer = 5, SubpassData = 6, + TileImageDataEXT = 4173, Max = 0x7fffffff, }; @@ -717,6 +722,7 @@ enum class BuiltIn : unsigned { HitKindKHR = 5333, HitKindNV = 5333, CurrentRayTimeNV = 5334, + HitTriangleVertexPositionsKHR = 5335, IncomingRayFlagsKHR = 5351, IncomingRayFlagsNV = 5351, RayGeometryIndexKHR = 5352, @@ -988,6 +994,9 @@ enum class Capability : unsigned { ShaderViewportIndex = 70, UniformDecoration = 71, CoreBuiltinsARM = 4165, + TileImageColorReadAccessEXT = 4166, + TileImageDepthReadAccessEXT = 4167, + TileImageStencilReadAccessEXT = 4168, FragmentShadingRateKHR = 4422, SubgroupBallotKHR = 4423, DrawParameters = 4427, @@ -1070,6 +1079,7 @@ enum class Capability : unsigned { UniformTexelBufferArrayNonUniformIndexingEXT = 5311, StorageTexelBufferArrayNonUniformIndexing = 5312, StorageTexelBufferArrayNonUniformIndexingEXT = 5312, + RayTracingPositionFetchKHR = 5336, RayTracingNV = 5340, RayTracingMotionBlurNV = 5341, VulkanMemoryModel = 5345, @@ -1090,6 +1100,7 @@ enum class Capability : unsigned { RayTracingOpacityMicromapEXT = 5381, ShaderInvocationReorderNV = 5383, BindlessTextureNV = 5390, + RayQueryPositionFetchKHR = 5391, SubgroupShuffleINTEL = 5568, SubgroupBufferBlockIOINTEL = 5569, SubgroupImageBlockIOINTEL = 5570, @@ -1606,6 +1617,9 @@ enum class Op : unsigned { OpPtrEqual = 401, OpPtrNotEqual = 402, OpPtrDiff = 403, + OpColorAttachmentReadEXT = 4160, + OpDepthAttachmentReadEXT = 4161, + OpStencilAttachmentReadEXT = 4162, OpTerminateInvocation = 4416, OpSubgroupBallotKHR = 4421, OpSubgroupFirstInvocationKHR = 4422, @@ -1698,6 +1712,7 @@ enum class Op : unsigned { OpTraceNV = 5337, OpTraceMotionNV = 5338, OpTraceRayMotionNV = 5339, + OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, OpTypeAccelerationStructureKHR = 5341, OpTypeAccelerationStructureNV = 5341, OpExecuteCallableNV = 5344, @@ -2326,6 +2341,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpPtrEqual: *hasResult = true; *hasResultType = true; break; case Op::OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; case Op::OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; case Op::OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; case Op::OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; @@ -2411,6 +2429,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break; case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; case Op::OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; diff --git a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json index 5cad41c5e..908fe0573 100644 --- a/3rdparty/spirv-headers/include/spirv/unified1/spirv.json +++ b/3rdparty/spirv-headers/include/spirv/unified1/spirv.json @@ -175,6 +175,9 @@ "SubgroupsPerWorkgroupId": 37, "LocalSizeId": 38, "LocalSizeHintId": 39, + "NonCoherentColorAttachmentReadEXT": 4169, + "NonCoherentDepthAttachmentReadEXT": 4170, + "NonCoherentStencilAttachmentReadEXT": 4171, "SubgroupUniformControlFlowKHR": 4421, "PostDepthCoverage": 4446, "DenormPreserve": 4459, @@ -237,6 +240,7 @@ "AtomicCounter": 10, "Image": 11, "StorageBuffer": 12, + "TileImageEXT": 4172, "CallableDataKHR": 5328, "CallableDataNV": 5328, "IncomingCallableDataKHR": 5329, @@ -269,7 +273,8 @@ "Cube": 3, "Rect": 4, "Buffer": 5, - "SubpassData": 6 + "SubpassData": 6, + "TileImageDataEXT": 4173 } }, { @@ -746,6 +751,7 @@ "HitKindKHR": 5333, "HitKindNV": 5333, "CurrentRayTimeNV": 5334, + "HitTriangleVertexPositionsKHR": 5335, "IncomingRayFlagsKHR": 5351, "IncomingRayFlagsNV": 5351, "RayGeometryIndexKHR": 5352, @@ -968,6 +974,9 @@ "ShaderViewportIndex": 70, "UniformDecoration": 71, "CoreBuiltinsARM": 4165, + "TileImageColorReadAccessEXT": 4166, + "TileImageDepthReadAccessEXT": 4167, + "TileImageStencilReadAccessEXT": 4168, "FragmentShadingRateKHR": 4422, "SubgroupBallotKHR": 4423, "DrawParameters": 4427, @@ -1050,6 +1059,7 @@ "UniformTexelBufferArrayNonUniformIndexingEXT": 5311, "StorageTexelBufferArrayNonUniformIndexing": 5312, "StorageTexelBufferArrayNonUniformIndexingEXT": 5312, + "RayTracingPositionFetchKHR": 5336, "RayTracingNV": 5340, "RayTracingMotionBlurNV": 5341, "VulkanMemoryModel": 5345, @@ -1070,6 +1080,7 @@ "RayTracingOpacityMicromapEXT": 5381, "ShaderInvocationReorderNV": 5383, "BindlessTextureNV": 5390, + "RayQueryPositionFetchKHR": 5391, "SubgroupShuffleINTEL": 5568, "SubgroupBufferBlockIOINTEL": 5569, "SubgroupImageBlockIOINTEL": 5570, @@ -1596,6 +1607,9 @@ "OpPtrEqual": 401, "OpPtrNotEqual": 402, "OpPtrDiff": 403, + "OpColorAttachmentReadEXT": 4160, + "OpDepthAttachmentReadEXT": 4161, + "OpStencilAttachmentReadEXT": 4162, "OpTerminateInvocation": 4416, "OpSubgroupBallotKHR": 4421, "OpSubgroupFirstInvocationKHR": 4422, @@ -1688,6 +1702,7 @@ "OpTraceNV": 5337, "OpTraceMotionNV": 5338, "OpTraceRayMotionNV": 5339, + "OpRayQueryGetIntersectionTriangleVertexPositionsKHR": 5340, "OpTypeAccelerationStructureKHR": 5341, "OpTypeAccelerationStructureNV": 5341, "OpExecuteCallableNV": 5344, From 1097abfc57b8da6c7456758324c2fecb10d62876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:23:36 -0700 Subject: [PATCH 78/86] Updated spirv-tools. --- .../include/generated/build-version.inc | 2 +- .../include/generated/core.insts-unified1.inc | 8 + .../include/generated/enum_string_mapping.inc | 18 +- .../include/generated/extension_enum.inc | 2 + .../generated/operand.kinds-unified1.inc | 19 +- .../include/spirv-tools/instrument.hpp | 77 ++- .../source/opt/const_folding_rules.cpp | 56 +- .../source/opt/inst_bindless_check_pass.cpp | 585 ++++++++++++++++-- .../source/opt/inst_bindless_check_pass.h | 29 +- .../source/opt/inst_buff_addr_check_pass.cpp | 18 + .../source/opt/inst_buff_addr_check_pass.h | 3 + .../source/opt/instrument_pass.cpp | 13 + .../spirv-tools/source/opt/instrument_pass.h | 5 +- 3rdparty/spirv-tools/source/opt/ir_builder.h | 9 +- 3rdparty/spirv-tools/source/opt/licm_pass.cpp | 2 +- .../source/opt/loop_descriptor.cpp | 23 +- .../spirv-tools/source/opt/loop_descriptor.h | 8 +- .../spirv-tools/source/util/small_vector.h | 16 +- .../source/val/validate_annotation.cpp | 6 +- .../source/val/validate_constants.cpp | 2 +- .../source/val/validate_function.cpp | 1 + .../spirv-tools/source/val/validate_image.cpp | 57 +- .../source/val/validate_mode_setting.cpp | 3 + .../source/val/validation_state.cpp | 1 + 24 files changed, 827 insertions(+), 136 deletions(-) diff --git a/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/spirv-tools/include/generated/build-version.inc index e10c2bcb9..b04070ca6 100644 --- a/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2023.2", "SPIRV-Tools v2023.2 v2022.4-165-g574d9da4" +"v2023.2", "SPIRV-Tools v2023.2 v2022.4-192-ge472626b" diff --git a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc index 19617a5f7..97230242b 100644 --- a/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc @@ -50,6 +50,7 @@ static const spv::Capability pygen_variable_caps_NamedBarrier[] = {spv::Capabili static const spv::Capability pygen_variable_caps_PipeStorage[] = {spv::Capability::PipeStorage}; static const spv::Capability pygen_variable_caps_Pipes[] = {spv::Capability::Pipes}; static const spv::Capability pygen_variable_caps_RayQueryKHR[] = {spv::Capability::RayQueryKHR}; +static const spv::Capability pygen_variable_caps_RayQueryPositionFetchKHR[] = {spv::Capability::RayQueryPositionFetchKHR}; static const spv::Capability pygen_variable_caps_RayTracingKHR[] = {spv::Capability::RayTracingKHR}; static const spv::Capability pygen_variable_caps_RayTracingKHRRayQueryKHR[] = {spv::Capability::RayTracingKHR, spv::Capability::RayQueryKHR}; static const spv::Capability pygen_variable_caps_RayTracingMotionBlurNV[] = {spv::Capability::RayTracingMotionBlurNV}; @@ -76,6 +77,9 @@ static const spv::Capability pygen_variable_caps_SubgroupVoteKHR[] = {spv::Capab static const spv::Capability pygen_variable_caps_TextureBlockMatchQCOM[] = {spv::Capability::TextureBlockMatchQCOM}; static const spv::Capability pygen_variable_caps_TextureBoxFilterQCOM[] = {spv::Capability::TextureBoxFilterQCOM}; static const spv::Capability pygen_variable_caps_TextureSampleWeightedQCOM[] = {spv::Capability::TextureSampleWeightedQCOM}; +static const spv::Capability pygen_variable_caps_TileImageColorReadAccessEXT[] = {spv::Capability::TileImageColorReadAccessEXT}; +static const spv::Capability pygen_variable_caps_TileImageDepthReadAccessEXT[] = {spv::Capability::TileImageDepthReadAccessEXT}; +static const spv::Capability pygen_variable_caps_TileImageStencilReadAccessEXT[] = {spv::Capability::TileImageStencilReadAccessEXT}; static const spv::Capability pygen_variable_caps_USMStorageClassesINTEL[] = {spv::Capability::USMStorageClassesINTEL}; static const spv::Capability pygen_variable_caps_UnstructuredLoopControlsINTEL[] = {spv::Capability::UnstructuredLoopControlsINTEL}; static const spv::Capability pygen_variable_caps_VariableLengthArrayINTEL[] = {spv::Capability::VariableLengthArrayINTEL}; @@ -455,6 +459,9 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = { {"PtrEqual", spv::Op::OpPtrEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, {"PtrNotEqual", spv::Op::OpPtrNotEqual, 0, nullptr, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, {"PtrDiff", spv::Op::OpPtrDiff, 3, pygen_variable_caps_AddressesVariablePointersVariablePointersStorageBuffer, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, + {"ColorAttachmentReadEXT", spv::Op::OpColorAttachmentReadEXT, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"DepthAttachmentReadEXT", spv::Op::OpDepthAttachmentReadEXT, 1, pygen_variable_caps_TileImageDepthReadAccessEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, + {"StencilAttachmentReadEXT", spv::Op::OpStencilAttachmentReadEXT, 1, pygen_variable_caps_TileImageStencilReadAccessEXT, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_OPTIONAL_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"TerminateInvocation", spv::Op::OpTerminateInvocation, 1, pygen_variable_caps_Shader, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_KHR_terminate_invocation, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, {"SubgroupBallotKHR", spv::Op::OpSubgroupBallotKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, {"SubgroupFirstInvocationKHR", spv::Op::OpSubgroupFirstInvocationKHR, 1, pygen_variable_caps_SubgroupBallotKHR, 3, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 1, pygen_variable_exts_SPV_KHR_shader_ballot, 0xffffffffu, 0xffffffffu}, @@ -547,6 +554,7 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = { {"TraceNV", spv::Op::OpTraceNV, 1, pygen_variable_caps_RayTracingNV, 11, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, {"TraceMotionNV", spv::Op::OpTraceMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, {"TraceRayMotionNV", spv::Op::OpTraceRayMotionNV, 1, pygen_variable_caps_RayTracingMotionBlurNV, 12, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, 0xffffffffu, 0xffffffffu}, + {"RayQueryGetIntersectionTriangleVertexPositionsKHR", spv::Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, 1, pygen_variable_caps_RayQueryPositionFetchKHR, 4, {SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 1, 1, 0, nullptr, 0xffffffffu, 0xffffffffu}, {"TypeAccelerationStructureKHR", spv::Op::OpTypeAccelerationStructureKHR, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, {"TypeAccelerationStructureNV", spv::Op::OpTypeAccelerationStructureNV, 3, pygen_variable_caps_RayTracingNVRayTracingKHRRayQueryKHR, 1, {SPV_OPERAND_TYPE_RESULT_ID}, 1, 0, 3, pygen_variable_exts_SPV_NV_ray_tracingSPV_KHR_ray_tracingSPV_KHR_ray_query, 0xffffffffu, 0xffffffffu}, {"ExecuteCallableNV", spv::Op::OpExecuteCallableNV, 1, pygen_variable_caps_RayTracingNV, 2, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, 0, 0, 1, pygen_variable_exts_SPV_NV_ray_tracing, 0xffffffffu, 0xffffffffu}, diff --git a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc index 669b831e8..06d157014 100644 --- a/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc +++ b/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc @@ -50,6 +50,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_EXT_shader_image_int64"; case Extension::kSPV_EXT_shader_stencil_export: return "SPV_EXT_shader_stencil_export"; + case Extension::kSPV_EXT_shader_tile_image: + return "SPV_EXT_shader_tile_image"; case Extension::kSPV_EXT_shader_viewport_index_layer: return "SPV_EXT_shader_viewport_index_layer"; case Extension::kSPV_GOOGLE_decorate_string: @@ -166,6 +168,8 @@ const char* ExtensionToString(Extension extension) { return "SPV_KHR_ray_query"; case Extension::kSPV_KHR_ray_tracing: return "SPV_KHR_ray_tracing"; + case Extension::kSPV_KHR_ray_tracing_position_fetch: + return "SPV_KHR_ray_tracing_position_fetch"; case Extension::kSPV_KHR_shader_atomic_counter_ops: return "SPV_KHR_shader_atomic_counter_ops"; case Extension::kSPV_KHR_shader_ballot: @@ -237,8 +241,8 @@ const char* ExtensionToString(Extension extension) { bool GetExtensionFromString(const char* str, Extension* extension) { - static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_bfloat16_conversion", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_argument_interfaces", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_latency_control", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_QCOM_image_processing", "SPV_VALIDATOR_ignore_type_decl_unique" }; - static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_bfloat16_conversion, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_argument_interfaces, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_latency_control, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_QCOM_image_processing, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; + static const char* known_ext_strs[] = { "SPV_AMD_gcn_shader", "SPV_AMD_gpu_shader_half_float", "SPV_AMD_gpu_shader_half_float_fetch", "SPV_AMD_gpu_shader_int16", "SPV_AMD_shader_ballot", "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_fragment_mask", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_texture_gather_bias_lod", "SPV_ARM_core_builtins", "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing", "SPV_EXT_fragment_fully_covered", "SPV_EXT_fragment_invocation_density", "SPV_EXT_fragment_shader_interlock", "SPV_EXT_mesh_shader", "SPV_EXT_opacity_micromap", "SPV_EXT_physical_storage_buffer", "SPV_EXT_shader_atomic_float16_add", "SPV_EXT_shader_atomic_float_add", "SPV_EXT_shader_atomic_float_min_max", "SPV_EXT_shader_image_int64", "SPV_EXT_shader_stencil_export", "SPV_EXT_shader_tile_image", "SPV_EXT_shader_viewport_index_layer", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type", "SPV_INTEL_arbitrary_precision_fixed_point", "SPV_INTEL_arbitrary_precision_floating_point", "SPV_INTEL_arbitrary_precision_integers", "SPV_INTEL_bfloat16_conversion", "SPV_INTEL_blocking_pipes", "SPV_INTEL_debug_module", "SPV_INTEL_device_side_avc_motion_estimation", "SPV_INTEL_float_controls2", "SPV_INTEL_fp_fast_math_mode", "SPV_INTEL_fpga_argument_interfaces", "SPV_INTEL_fpga_buffer_location", "SPV_INTEL_fpga_cluster_attributes", "SPV_INTEL_fpga_dsp_control", "SPV_INTEL_fpga_invocation_pipelining_attributes", "SPV_INTEL_fpga_latency_control", "SPV_INTEL_fpga_loop_controls", "SPV_INTEL_fpga_memory_accesses", "SPV_INTEL_fpga_memory_attributes", "SPV_INTEL_fpga_reg", "SPV_INTEL_function_pointers", "SPV_INTEL_inline_assembly", "SPV_INTEL_io_pipes", "SPV_INTEL_kernel_attributes", "SPV_INTEL_long_constant_composite", "SPV_INTEL_loop_fuse", "SPV_INTEL_media_block_io", "SPV_INTEL_memory_access_aliasing", "SPV_INTEL_optnone", "SPV_INTEL_runtime_aligned", "SPV_INTEL_shader_integer_functions2", "SPV_INTEL_split_barrier", "SPV_INTEL_subgroups", "SPV_INTEL_unstructured_loop_controls", "SPV_INTEL_usm_storage_classes", "SPV_INTEL_variable_length_array", "SPV_INTEL_vector_compute", "SPV_KHR_16bit_storage", "SPV_KHR_8bit_storage", "SPV_KHR_bit_instructions", "SPV_KHR_device_group", "SPV_KHR_expect_assume", "SPV_KHR_float_controls", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_fragment_shading_rate", "SPV_KHR_integer_dot_product", "SPV_KHR_linkonce_odr", "SPV_KHR_multiview", "SPV_KHR_no_integer_wrap_decoration", "SPV_KHR_non_semantic_info", "SPV_KHR_physical_storage_buffer", "SPV_KHR_post_depth_coverage", "SPV_KHR_ray_cull_mask", "SPV_KHR_ray_query", "SPV_KHR_ray_tracing", "SPV_KHR_ray_tracing_position_fetch", "SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_shader_ballot", "SPV_KHR_shader_clock", "SPV_KHR_shader_draw_parameters", "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_subgroup_rotate", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_uniform_group_instructions", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_bindless_texture", "SPV_NV_compute_shader_derivatives", "SPV_NV_cooperative_matrix", "SPV_NV_fragment_shader_barycentric", "SPV_NV_geometry_shader_passthrough", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing", "SPV_NV_ray_tracing_motion_blur", "SPV_NV_sample_mask_override_coverage", "SPV_NV_shader_image_footprint", "SPV_NV_shader_invocation_reorder", "SPV_NV_shader_sm_builtins", "SPV_NV_shader_subgroup_partitioned", "SPV_NV_shading_rate", "SPV_NV_stereo_view_rendering", "SPV_NV_viewport_array2", "SPV_QCOM_image_processing", "SPV_VALIDATOR_ignore_type_decl_unique" }; + static const Extension known_ext_ids[] = { Extension::kSPV_AMD_gcn_shader, Extension::kSPV_AMD_gpu_shader_half_float, Extension::kSPV_AMD_gpu_shader_half_float_fetch, Extension::kSPV_AMD_gpu_shader_int16, Extension::kSPV_AMD_shader_ballot, Extension::kSPV_AMD_shader_early_and_late_fragment_tests, Extension::kSPV_AMD_shader_explicit_vertex_parameter, Extension::kSPV_AMD_shader_fragment_mask, Extension::kSPV_AMD_shader_image_load_store_lod, Extension::kSPV_AMD_shader_trinary_minmax, Extension::kSPV_AMD_texture_gather_bias_lod, Extension::kSPV_ARM_core_builtins, Extension::kSPV_EXT_demote_to_helper_invocation, Extension::kSPV_EXT_descriptor_indexing, Extension::kSPV_EXT_fragment_fully_covered, Extension::kSPV_EXT_fragment_invocation_density, Extension::kSPV_EXT_fragment_shader_interlock, Extension::kSPV_EXT_mesh_shader, Extension::kSPV_EXT_opacity_micromap, Extension::kSPV_EXT_physical_storage_buffer, Extension::kSPV_EXT_shader_atomic_float16_add, Extension::kSPV_EXT_shader_atomic_float_add, Extension::kSPV_EXT_shader_atomic_float_min_max, Extension::kSPV_EXT_shader_image_int64, Extension::kSPV_EXT_shader_stencil_export, Extension::kSPV_EXT_shader_tile_image, Extension::kSPV_EXT_shader_viewport_index_layer, Extension::kSPV_GOOGLE_decorate_string, Extension::kSPV_GOOGLE_hlsl_functionality1, Extension::kSPV_GOOGLE_user_type, Extension::kSPV_INTEL_arbitrary_precision_fixed_point, Extension::kSPV_INTEL_arbitrary_precision_floating_point, Extension::kSPV_INTEL_arbitrary_precision_integers, Extension::kSPV_INTEL_bfloat16_conversion, Extension::kSPV_INTEL_blocking_pipes, Extension::kSPV_INTEL_debug_module, Extension::kSPV_INTEL_device_side_avc_motion_estimation, Extension::kSPV_INTEL_float_controls2, Extension::kSPV_INTEL_fp_fast_math_mode, Extension::kSPV_INTEL_fpga_argument_interfaces, Extension::kSPV_INTEL_fpga_buffer_location, Extension::kSPV_INTEL_fpga_cluster_attributes, Extension::kSPV_INTEL_fpga_dsp_control, Extension::kSPV_INTEL_fpga_invocation_pipelining_attributes, Extension::kSPV_INTEL_fpga_latency_control, Extension::kSPV_INTEL_fpga_loop_controls, Extension::kSPV_INTEL_fpga_memory_accesses, Extension::kSPV_INTEL_fpga_memory_attributes, Extension::kSPV_INTEL_fpga_reg, Extension::kSPV_INTEL_function_pointers, Extension::kSPV_INTEL_inline_assembly, Extension::kSPV_INTEL_io_pipes, Extension::kSPV_INTEL_kernel_attributes, Extension::kSPV_INTEL_long_constant_composite, Extension::kSPV_INTEL_loop_fuse, Extension::kSPV_INTEL_media_block_io, Extension::kSPV_INTEL_memory_access_aliasing, Extension::kSPV_INTEL_optnone, Extension::kSPV_INTEL_runtime_aligned, Extension::kSPV_INTEL_shader_integer_functions2, Extension::kSPV_INTEL_split_barrier, Extension::kSPV_INTEL_subgroups, Extension::kSPV_INTEL_unstructured_loop_controls, Extension::kSPV_INTEL_usm_storage_classes, Extension::kSPV_INTEL_variable_length_array, Extension::kSPV_INTEL_vector_compute, Extension::kSPV_KHR_16bit_storage, Extension::kSPV_KHR_8bit_storage, Extension::kSPV_KHR_bit_instructions, Extension::kSPV_KHR_device_group, Extension::kSPV_KHR_expect_assume, Extension::kSPV_KHR_float_controls, Extension::kSPV_KHR_fragment_shader_barycentric, Extension::kSPV_KHR_fragment_shading_rate, Extension::kSPV_KHR_integer_dot_product, Extension::kSPV_KHR_linkonce_odr, Extension::kSPV_KHR_multiview, Extension::kSPV_KHR_no_integer_wrap_decoration, Extension::kSPV_KHR_non_semantic_info, Extension::kSPV_KHR_physical_storage_buffer, Extension::kSPV_KHR_post_depth_coverage, Extension::kSPV_KHR_ray_cull_mask, Extension::kSPV_KHR_ray_query, Extension::kSPV_KHR_ray_tracing, Extension::kSPV_KHR_ray_tracing_position_fetch, Extension::kSPV_KHR_shader_atomic_counter_ops, Extension::kSPV_KHR_shader_ballot, Extension::kSPV_KHR_shader_clock, Extension::kSPV_KHR_shader_draw_parameters, Extension::kSPV_KHR_storage_buffer_storage_class, Extension::kSPV_KHR_subgroup_rotate, Extension::kSPV_KHR_subgroup_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, Extension::kSPV_KHR_uniform_group_instructions, Extension::kSPV_KHR_variable_pointers, Extension::kSPV_KHR_vulkan_memory_model, Extension::kSPV_KHR_workgroup_memory_explicit_layout, Extension::kSPV_NVX_multiview_per_view_attributes, Extension::kSPV_NV_bindless_texture, Extension::kSPV_NV_compute_shader_derivatives, Extension::kSPV_NV_cooperative_matrix, Extension::kSPV_NV_fragment_shader_barycentric, Extension::kSPV_NV_geometry_shader_passthrough, Extension::kSPV_NV_mesh_shader, Extension::kSPV_NV_ray_tracing, Extension::kSPV_NV_ray_tracing_motion_blur, Extension::kSPV_NV_sample_mask_override_coverage, Extension::kSPV_NV_shader_image_footprint, Extension::kSPV_NV_shader_invocation_reorder, Extension::kSPV_NV_shader_sm_builtins, Extension::kSPV_NV_shader_subgroup_partitioned, Extension::kSPV_NV_shading_rate, Extension::kSPV_NV_stereo_view_rendering, Extension::kSPV_NV_viewport_array2, Extension::kSPV_QCOM_image_processing, Extension::kSPV_VALIDATOR_ignore_type_decl_unique }; const auto b = std::begin(known_ext_strs); const auto e = std::end(known_ext_strs); const auto found = std::equal_range( @@ -396,6 +400,12 @@ const char* CapabilityToString(spv::Capability capability) { return "UniformDecoration"; case spv::Capability::CoreBuiltinsARM: return "CoreBuiltinsARM"; + case spv::Capability::TileImageColorReadAccessEXT: + return "TileImageColorReadAccessEXT"; + case spv::Capability::TileImageDepthReadAccessEXT: + return "TileImageDepthReadAccessEXT"; + case spv::Capability::TileImageStencilReadAccessEXT: + return "TileImageStencilReadAccessEXT"; case spv::Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; case spv::Capability::SubgroupBallotKHR: @@ -526,6 +536,8 @@ const char* CapabilityToString(spv::Capability capability) { return "UniformTexelBufferArrayNonUniformIndexing"; case spv::Capability::StorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case spv::Capability::RayTracingPositionFetchKHR: + return "RayTracingPositionFetchKHR"; case spv::Capability::RayTracingNV: return "RayTracingNV"; case spv::Capability::RayTracingMotionBlurNV: @@ -558,6 +570,8 @@ const char* CapabilityToString(spv::Capability capability) { return "ShaderInvocationReorderNV"; case spv::Capability::BindlessTextureNV: return "BindlessTextureNV"; + case spv::Capability::RayQueryPositionFetchKHR: + return "RayQueryPositionFetchKHR"; case spv::Capability::SubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; case spv::Capability::SubgroupBufferBlockIOINTEL: diff --git a/3rdparty/spirv-tools/include/generated/extension_enum.inc b/3rdparty/spirv-tools/include/generated/extension_enum.inc index 92f489b63..09f6d92f5 100644 --- a/3rdparty/spirv-tools/include/generated/extension_enum.inc +++ b/3rdparty/spirv-tools/include/generated/extension_enum.inc @@ -23,6 +23,7 @@ kSPV_EXT_shader_atomic_float_add, kSPV_EXT_shader_atomic_float_min_max, kSPV_EXT_shader_image_int64, kSPV_EXT_shader_stencil_export, +kSPV_EXT_shader_tile_image, kSPV_EXT_shader_viewport_index_layer, kSPV_GOOGLE_decorate_string, kSPV_GOOGLE_hlsl_functionality1, @@ -81,6 +82,7 @@ kSPV_KHR_post_depth_coverage, kSPV_KHR_ray_cull_mask, kSPV_KHR_ray_query, kSPV_KHR_ray_tracing, +kSPV_KHR_ray_tracing_position_fetch, kSPV_KHR_shader_atomic_counter_ops, kSPV_KHR_shader_ballot, kSPV_KHR_shader_clock, diff --git a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc index 7a9318c55..3b23ce135 100644 --- a/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc +++ b/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc @@ -86,6 +86,7 @@ static const spv::Capability pygen_variable_caps_RayTracingMotionBlurNV[] = {spv static const spv::Capability pygen_variable_caps_RayTracingNV[] = {spv::Capability::RayTracingNV}; static const spv::Capability pygen_variable_caps_RayTracingNVRayTracingKHR[] = {spv::Capability::RayTracingNV, spv::Capability::RayTracingKHR}; static const spv::Capability pygen_variable_caps_RayTracingOpacityMicromapEXT[] = {spv::Capability::RayTracingOpacityMicromapEXT}; +static const spv::Capability pygen_variable_caps_RayTracingPositionFetchKHR[] = {spv::Capability::RayTracingPositionFetchKHR}; static const spv::Capability pygen_variable_caps_RayTraversalPrimitiveCullingKHR[] = {spv::Capability::RayTraversalPrimitiveCullingKHR}; static const spv::Capability pygen_variable_caps_RoundToInfinityINTEL[] = {spv::Capability::RoundToInfinityINTEL}; static const spv::Capability pygen_variable_caps_RoundingModeRTE[] = {spv::Capability::RoundingModeRTE}; @@ -119,6 +120,9 @@ static const spv::Capability pygen_variable_caps_StorageImageExtendedFormats[] = static const spv::Capability pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot[] = {spv::Capability::SubgroupBallotKHR, spv::Capability::GroupNonUniformBallot}; static const spv::Capability pygen_variable_caps_SubgroupDispatch[] = {spv::Capability::SubgroupDispatch}; static const spv::Capability pygen_variable_caps_Tessellation[] = {spv::Capability::Tessellation}; +static const spv::Capability pygen_variable_caps_TileImageColorReadAccessEXT[] = {spv::Capability::TileImageColorReadAccessEXT}; +static const spv::Capability pygen_variable_caps_TileImageDepthReadAccessEXT[] = {spv::Capability::TileImageDepthReadAccessEXT}; +static const spv::Capability pygen_variable_caps_TileImageStencilReadAccessEXT[] = {spv::Capability::TileImageStencilReadAccessEXT}; static const spv::Capability pygen_variable_caps_TransformFeedback[] = {spv::Capability::TransformFeedback}; static const spv::Capability pygen_variable_caps_USMStorageClassesINTEL[] = {spv::Capability::USMStorageClassesINTEL}; static const spv::Capability pygen_variable_caps_VariablePointersStorageBuffer[] = {spv::Capability::VariablePointersStorageBuffer}; @@ -151,6 +155,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_atomic_float static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_atomic_float_min_max[] = {spvtools::Extension::kSPV_EXT_shader_atomic_float_min_max}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_image_int64[] = {spvtools::Extension::kSPV_EXT_shader_image_int64}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_stencil_export[] = {spvtools::Extension::kSPV_EXT_shader_stencil_export}; +static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_tile_image[] = {spvtools::Extension::kSPV_EXT_shader_tile_image}; static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_viewport_index_layerSPV_NV_viewport_array2[] = {spvtools::Extension::kSPV_EXT_shader_viewport_index_layer, spvtools::Extension::kSPV_NV_viewport_array2}; static const spvtools::Extension pygen_variable_exts_SPV_GOOGLE_hlsl_functionality1[] = {spvtools::Extension::kSPV_GOOGLE_hlsl_functionality1}; static const spvtools::Extension pygen_variable_exts_SPV_GOOGLE_user_type[] = {spvtools::Extension::kSPV_GOOGLE_user_type}; @@ -208,6 +213,7 @@ static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_query[] = {spvt static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_querySPV_KHR_ray_tracing[] = {spvtools::Extension::kSPV_KHR_ray_query, spvtools::Extension::kSPV_KHR_ray_tracing}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_tracing[] = {spvtools::Extension::kSPV_KHR_ray_tracing}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing[] = {spvtools::Extension::kSPV_KHR_ray_tracing, spvtools::Extension::kSPV_NV_ray_tracing}; +static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_tracing_position_fetch[] = {spvtools::Extension::kSPV_KHR_ray_tracing_position_fetch}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_atomic_counter_ops[] = {spvtools::Extension::kSPV_KHR_shader_atomic_counter_ops}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_ballot[] = {spvtools::Extension::kSPV_KHR_shader_ballot}; static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_clock[] = {spvtools::Extension::kSPV_KHR_shader_clock}; @@ -468,6 +474,9 @@ static const spv_operand_desc_t pygen_variable_ExecutionModeEntries[] = { {"SubgroupsPerWorkgroupId", 37, 1, pygen_variable_caps_SubgroupDispatch, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, {"LocalSizeId", 38, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, {"LocalSizeHintId", 39, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1,2), 0xffffffffu}, + {"NonCoherentColorAttachmentReadEXT", 4169, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"NonCoherentDepthAttachmentReadEXT", 4170, 1, pygen_variable_caps_TileImageDepthReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, + {"NonCoherentStencilAttachmentReadEXT", 4171, 1, pygen_variable_caps_TileImageStencilReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"SubgroupUniformControlFlowKHR", 4421, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_subgroup_uniform_control_flow, {}, 0xffffffffu, 0xffffffffu}, {"PostDepthCoverage", 4446, 1, pygen_variable_caps_SampleMaskPostDepthCoverage, 1, pygen_variable_exts_SPV_KHR_post_depth_coverage, {}, 0xffffffffu, 0xffffffffu}, {"DenormPreserve", 4459, 1, pygen_variable_caps_DenormPreserve, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}, @@ -526,6 +535,7 @@ static const spv_operand_desc_t pygen_variable_StorageClassEntries[] = { {"AtomicCounter", 10, 1, pygen_variable_caps_AtomicStorage, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"Image", 11, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"StorageBuffer", 12, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_KHR_storage_buffer_storage_classSPV_KHR_variable_pointers, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, + {"TileImageEXT", 4172, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"CallableDataNV", 5328, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"CallableDataKHR", 5328, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"IncomingCallableDataNV", 5329, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, @@ -554,7 +564,8 @@ static const spv_operand_desc_t pygen_variable_DimEntries[] = { {"Cube", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"Rect", 4, 1, pygen_variable_caps_SampledRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"Buffer", 5, 1, pygen_variable_caps_SampledBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, - {"SubpassData", 6, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} + {"SubpassData", 6, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TileImageDataEXT", 4173, 1, pygen_variable_caps_TileImageColorReadAccessEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu} }; static const spv_operand_desc_t pygen_variable_SamplerAddressingModeEntries[] = { @@ -974,6 +985,7 @@ static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = { {"HitKindNV", 5333, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"HitKindKHR", 5333, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"CurrentRayTimeNV", 5334, 1, pygen_variable_caps_RayTracingMotionBlurNV, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, {}, 0xffffffffu, 0xffffffffu}, + {"HitTriangleVertexPositionsKHR", 5335, 1, pygen_variable_caps_RayTracingPositionFetchKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}, {"IncomingRayFlagsNV", 5351, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"IncomingRayFlagsKHR", 5351, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"RayGeometryIndexKHR", 5352, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_KHR_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, @@ -1083,6 +1095,9 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"ShaderViewportIndex", 70, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, {"UniformDecoration", 71, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}, {"CoreBuiltinsARM", 4165, 0, nullptr, 1, pygen_variable_exts_SPV_ARM_core_builtins, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, + {"TileImageColorReadAccessEXT", 4166, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, + {"TileImageDepthReadAccessEXT", 4167, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, + {"TileImageStencilReadAccessEXT", 4168, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_tile_image, {}, 0xffffffffu, 0xffffffffu}, {"FragmentShadingRateKHR", 4422, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu}, {"SubgroupBallotKHR", 4423, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, 0xffffffffu, 0xffffffffu}, {"DrawParameters", 4427, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu}, @@ -1165,6 +1180,7 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"UniformTexelBufferArrayNonUniformIndexingEXT", 5311, 2, pygen_variable_caps_SampledBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, {"StorageTexelBufferArrayNonUniformIndexing", 5312, 2, pygen_variable_caps_ImageBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, {"StorageTexelBufferArrayNonUniformIndexingEXT", 5312, 2, pygen_variable_caps_ImageBufferShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, + {"RayTracingPositionFetchKHR", 5336, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing_position_fetch, {}, 0xffffffffu, 0xffffffffu}, {"RayTracingNV", 5340, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu}, {"RayTracingMotionBlurNV", 5341, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_ray_tracing_motion_blur, {}, 0xffffffffu, 0xffffffffu}, {"VulkanMemoryModel", 5345, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}, @@ -1185,6 +1201,7 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = { {"RayTracingOpacityMicromapEXT", 5381, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 1, pygen_variable_exts_SPV_EXT_opacity_micromap, {}, 0xffffffffu, 0xffffffffu}, {"ShaderInvocationReorderNV", 5383, 1, pygen_variable_caps_RayTracingKHR, 1, pygen_variable_exts_SPV_NV_shader_invocation_reorder, {}, 0xffffffffu, 0xffffffffu}, {"BindlessTextureNV", 5390, 0, nullptr, 1, pygen_variable_exts_SPV_NV_bindless_texture, {}, 0xffffffffu, 0xffffffffu}, + {"RayQueryPositionFetchKHR", 5391, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_KHR_ray_tracing_position_fetch, {}, 0xffffffffu, 0xffffffffu}, {"SubgroupShuffleINTEL", 5568, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, {"SubgroupBufferBlockIOINTEL", 5569, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, {"SubgroupImageBlockIOINTEL", 5570, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu}, diff --git a/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp b/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp index a75561b50..448cf8ab7 100644 --- a/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp +++ b/3rdparty/spirv-tools/include/spirv-tools/instrument.hpp @@ -146,23 +146,29 @@ static const int kInstValidationOutError = kInstStageOutCnt; // about the validation error. // // A bindless bounds error will output the index and the bound. -static const int kInstBindlessBoundsOutDescIndex = kInstStageOutCnt + 1; -static const int kInstBindlessBoundsOutDescBound = kInstStageOutCnt + 2; -static const int kInstBindlessBoundsOutUnused = kInstStageOutCnt + 3; -static const int kInstBindlessBoundsOutCnt = kInstStageOutCnt + 4; +static const int kInstBindlessBoundsOutDescSet = kInstStageOutCnt + 1; +static const int kInstBindlessBoundsOutDescBinding = kInstStageOutCnt + 2; +static const int kInstBindlessBoundsOutDescIndex = kInstStageOutCnt + 3; +static const int kInstBindlessBoundsOutDescBound = kInstStageOutCnt + 4; +static const int kInstBindlessBoundsOutUnused = kInstStageOutCnt + 5; +static const int kInstBindlessBoundsOutCnt = kInstStageOutCnt + 6; // A descriptor uninitialized error will output the index. -static const int kInstBindlessUninitOutDescIndex = kInstStageOutCnt + 1; -static const int kInstBindlessUninitOutUnused = kInstStageOutCnt + 2; -static const int kInstBindlessUninitOutUnused2 = kInstStageOutCnt + 3; -static const int kInstBindlessUninitOutCnt = kInstStageOutCnt + 4; +static const int kInstBindlessUninitOutDescSet = kInstStageOutCnt + 1; +static const int kInstBindlessUninitOutBinding = kInstStageOutCnt + 2; +static const int kInstBindlessUninitOutDescIndex = kInstStageOutCnt + 3; +static const int kInstBindlessUninitOutUnused = kInstStageOutCnt + 4; +static const int kInstBindlessUninitOutUnused2 = kInstStageOutCnt + 5; +static const int kInstBindlessUninitOutCnt = kInstStageOutCnt + 6; // A buffer out-of-bounds error will output the descriptor // index, the buffer offset and the buffer size -static const int kInstBindlessBuffOOBOutDescIndex = kInstStageOutCnt + 1; -static const int kInstBindlessBuffOOBOutBuffOff = kInstStageOutCnt + 2; -static const int kInstBindlessBuffOOBOutBuffSize = kInstStageOutCnt + 3; -static const int kInstBindlessBuffOOBOutCnt = kInstStageOutCnt + 4; +static const int kInstBindlessBuffOOBOutDescSet = kInstStageOutCnt + 1; +static const int kInstBindlessBuffOOBOutDescBinding = kInstStageOutCnt + 2; +static const int kInstBindlessBuffOOBOutDescIndex = kInstStageOutCnt + 3; +static const int kInstBindlessBuffOOBOutBuffOff = kInstStageOutCnt + 4; +static const int kInstBindlessBuffOOBOutBuffSize = kInstStageOutCnt + 5; +static const int kInstBindlessBuffOOBOutCnt = kInstStageOutCnt + 6; // A buffer address unalloc error will output the 64-bit pointer in // two 32-bit pieces, lower bits first. @@ -171,7 +177,7 @@ static const int kInstBuffAddrUnallocOutDescPtrHi = kInstStageOutCnt + 2; static const int kInstBuffAddrUnallocOutCnt = kInstStageOutCnt + 3; // Maximum Output Record Member Count -static const int kInstMaxOutCnt = kInstStageOutCnt + 4; +static const int kInstMaxOutCnt = kInstStageOutCnt + 6; // Validation Error Codes // @@ -217,26 +223,37 @@ static const int kDebugInputBindingBuffAddr = 2; // This is the output buffer written by InstDebugPrintfPass. static const int kDebugOutputPrintfStream = 3; +// clang-format off // Bindless Validation Input Buffer Format // -// An input buffer for bindless validation consists of a single array of -// unsigned integers we will call Data[]. This array is formatted as follows. +// An input buffer for bindless validation has this structure: +// GLSL: +// layout(buffer_reference, std430, buffer_reference_align = 8) buffer DescriptorSetData { +// uint num_bindings; +// uint data[]; +// }; // -// At offset kDebugInputBindlessInitOffset in Data[] is a single uint which -// gives an offset to the start of the bindless initialization data. More -// specifically, if the following value is zero, we know that the descriptor at -// (set = s, binding = b, index = i) is not initialized; if the value is -// non-zero, and the descriptor points to a buffer, the value is the length of -// the buffer in bytes and can be used to check for out-of-bounds buffer -// references: -// Data[ i + Data[ b + Data[ s + Data[ kDebugInputBindlessInitOffset ] ] ] ] -static const int kDebugInputBindlessInitOffset = 0; - -// At offset kDebugInputBindlessOffsetLengths is some number of uints which -// provide the bindless length data. More specifically, the number of -// descriptors at (set=s, binding=b) is: -// Data[ Data[ s + kDebugInputBindlessOffsetLengths ] + b ] -static const int kDebugInputBindlessOffsetLengths = 1; +// layout(set = 7, binding = 1, std430) buffer inst_bindless_InputBuffer +// { +// DescriptorSetData desc_sets[32]; +// } inst_bindless_input_buffer; +// +// +// To look up the length of a binding: +// uint length = inst_bindless_input_buffer[set].data[binding]; +// Scalar bindings have a length of 1. +// +// To look up the initialization state of a descriptor in a binding: +// uint num_bindings = inst_bindless_input_buffer[set].num_bindings; +// uint binding_state_start = inst_bindless_input_buffer[set].data[num_bindings + binding]; +// uint init_state = inst_bindless_input_buffer[set].data[binding_state_start + index]; +// +// For scalar bindings, use 0 for the index. +// clang-format on +// +// The size of the inst_bindless_input_buffer array, regardless of how many +// descriptor sets the device supports. +static const int kDebugInputBindlessMaxDescSets = 32; // Buffer Device Address Input Buffer Format // diff --git a/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp b/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp index 516c34b3b..26108082f 100644 --- a/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp +++ b/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp @@ -398,12 +398,14 @@ ConstantFoldingRule FoldVectorTimesMatrix() { if (float_type->width() == 32) { for (uint32_t i = 0; i < resultVectorSize; ++i) { float result_scalar = 0.0f; - const analysis::VectorConstant* c2_vec = - c2_components[i]->AsVectorConstant(); - for (uint32_t j = 0; j < c2_vec->GetComponents().size(); ++j) { - float c1_scalar = c1_components[j]->GetFloat(); - float c2_scalar = c2_vec->GetComponents()[j]->GetFloat(); - result_scalar += c1_scalar * c2_scalar; + if (!c2_components[i]->AsNullConstant()) { + const analysis::VectorConstant* c2_vec = + c2_components[i]->AsVectorConstant(); + for (uint32_t j = 0; j < c2_vec->GetComponents().size(); ++j) { + float c1_scalar = c1_components[j]->GetFloat(); + float c2_scalar = c2_vec->GetComponents()[j]->GetFloat(); + result_scalar += c1_scalar * c2_scalar; + } } utils::FloatProxy result(result_scalar); std::vector words = result.GetWords(); @@ -415,12 +417,14 @@ ConstantFoldingRule FoldVectorTimesMatrix() { } else if (float_type->width() == 64) { for (uint32_t i = 0; i < c2_components.size(); ++i) { double result_scalar = 0.0; - const analysis::VectorConstant* c2_vec = - c2_components[i]->AsVectorConstant(); - for (uint32_t j = 0; j < c2_vec->GetComponents().size(); ++j) { - double c1_scalar = c1_components[j]->GetDouble(); - double c2_scalar = c2_vec->GetComponents()[j]->GetDouble(); - result_scalar += c1_scalar * c2_scalar; + if (!c2_components[i]->AsNullConstant()) { + const analysis::VectorConstant* c2_vec = + c2_components[i]->AsVectorConstant(); + for (uint32_t j = 0; j < c2_vec->GetComponents().size(); ++j) { + double c1_scalar = c1_components[j]->GetDouble(); + double c2_scalar = c2_vec->GetComponents()[j]->GetDouble(); + result_scalar += c1_scalar * c2_scalar; + } } utils::FloatProxy result(result_scalar); std::vector words = result.GetWords(); @@ -491,12 +495,14 @@ ConstantFoldingRule FoldMatrixTimesVector() { for (uint32_t i = 0; i < resultVectorSize; ++i) { float result_scalar = 0.0f; for (uint32_t j = 0; j < c1_components.size(); ++j) { - float c1_scalar = c1_components[j] - ->AsVectorConstant() - ->GetComponents()[i] - ->GetFloat(); - float c2_scalar = c2_components[j]->GetFloat(); - result_scalar += c1_scalar * c2_scalar; + if (!c1_components[j]->AsNullConstant()) { + float c1_scalar = c1_components[j] + ->AsVectorConstant() + ->GetComponents()[i] + ->GetFloat(); + float c2_scalar = c2_components[j]->GetFloat(); + result_scalar += c1_scalar * c2_scalar; + } } utils::FloatProxy result(result_scalar); std::vector words = result.GetWords(); @@ -509,12 +515,14 @@ ConstantFoldingRule FoldMatrixTimesVector() { for (uint32_t i = 0; i < resultVectorSize; ++i) { double result_scalar = 0.0; for (uint32_t j = 0; j < c1_components.size(); ++j) { - double c1_scalar = c1_components[j] - ->AsVectorConstant() - ->GetComponents()[i] - ->GetDouble(); - double c2_scalar = c2_components[j]->GetDouble(); - result_scalar += c1_scalar * c2_scalar; + if (!c1_components[j]->AsNullConstant()) { + double c1_scalar = c1_components[j] + ->AsVectorConstant() + ->GetComponents()[i] + ->GetDouble(); + double c2_scalar = c2_components[j]->GetDouble(); + result_scalar += c1_scalar * c2_scalar; + } } utils::FloatProxy result(result_scalar); std::vector words = result.GetWords(); diff --git a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp index cd712f068..e8c412ffe 100644 --- a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp @@ -16,6 +16,8 @@ #include "inst_bindless_check_pass.h" +#include "source/spirv_constant.h" + namespace spvtools { namespace opt { namespace { @@ -40,37 +42,521 @@ constexpr int kSpvTypeImageMS = 4; constexpr int kSpvTypeImageSampled = 5; } // namespace -uint32_t InstBindlessCheckPass::GenDebugReadLength( - uint32_t var_id, InstructionBuilder* builder) { - uint32_t desc_set_idx = - var2desc_set_[var_id] + kDebugInputBindlessOffsetLengths; - uint32_t desc_set_idx_id = builder->GetUintConstantId(desc_set_idx); - uint32_t binding_idx_id = builder->GetUintConstantId(var2binding_[var_id]); - return GenDebugDirectRead({desc_set_idx_id, binding_idx_id}, builder); +void InstBindlessCheckPass::SetupInputBufferIds() { + if (input_buffer_id_ != 0) { + return; + } + AddStorageBufferExt(); + if (!get_feature_mgr()->HasExtension(kSPV_KHR_physical_storage_buffer)) { + context()->AddExtension("SPV_KHR_physical_storage_buffer"); + } + context()->AddCapability(spv::Capability::PhysicalStorageBufferAddresses); + Instruction* memory_model = get_module()->GetMemoryModel(); + // TODO should this be just Physical64? + memory_model->SetInOperand( + 0u, {uint32_t(spv::AddressingModel::PhysicalStorageBuffer64)}); + + analysis::DecorationManager* deco_mgr = get_decoration_mgr(); + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + constexpr uint32_t width = 32u; + + // declare the DescriptorSetData struct + analysis::Struct* desc_set_struct = + GetStruct({type_mgr->GetUIntType(), GetUintRuntimeArrayType(width)}); + desc_set_type_id_ = type_mgr->GetTypeInstruction(desc_set_struct); + // By the Vulkan spec, a pre-existing struct containing a RuntimeArray + // must be a block, and will therefore be decorated with Block. Therefore + // the undecorated type returned here will not be pre-existing and can + // safely be decorated. Since this type is now decorated, it is out of + // sync with the TypeManager and therefore the TypeManager must be + // invalidated after this pass. + assert(context()->get_def_use_mgr()->NumUses(desc_set_type_id_) == 0 && + "used struct type returned"); + deco_mgr->AddDecoration(desc_set_type_id_, uint32_t(spv::Decoration::Block)); + deco_mgr->AddMemberDecoration(desc_set_type_id_, 0, + uint32_t(spv::Decoration::Offset), 0); + deco_mgr->AddMemberDecoration(desc_set_type_id_, 1, + uint32_t(spv::Decoration::Offset), 4); + context()->AddDebug2Inst( + NewGlobalName(desc_set_type_id_, "DescriptorSetData")); + context()->AddDebug2Inst(NewMemberName(desc_set_type_id_, 0, "num_bindings")); + context()->AddDebug2Inst(NewMemberName(desc_set_type_id_, 1, "data")); + + // declare buffer address reference to DescriptorSetData + desc_set_ptr_id_ = type_mgr->FindPointerToType( + desc_set_type_id_, spv::StorageClass::PhysicalStorageBuffer); + // runtime array of buffer addresses + analysis::Type* rarr_ty = GetArray(type_mgr->GetType(desc_set_ptr_id_), + kDebugInputBindlessMaxDescSets); + deco_mgr->AddDecorationVal(type_mgr->GetId(rarr_ty), + uint32_t(spv::Decoration::ArrayStride), 8u); + + // declare the InputBuffer type, a struct wrapper around the runtime array + analysis::Struct* input_buffer_struct = GetStruct({rarr_ty}); + input_buffer_struct_id_ = type_mgr->GetTypeInstruction(input_buffer_struct); + deco_mgr->AddDecoration(input_buffer_struct_id_, + uint32_t(spv::Decoration::Block)); + deco_mgr->AddMemberDecoration(input_buffer_struct_id_, 0, + uint32_t(spv::Decoration::Offset), 0); + context()->AddDebug2Inst( + NewGlobalName(input_buffer_struct_id_, "InputBuffer")); + context()->AddDebug2Inst( + NewMemberName(input_buffer_struct_id_, 0, "desc_sets")); + + input_buffer_ptr_id_ = type_mgr->FindPointerToType( + input_buffer_struct_id_, spv::StorageClass::StorageBuffer); + + // declare the input_buffer global variable + input_buffer_id_ = TakeNextId(); + + const std::vector var_operands = { + {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, + {uint32_t(spv::StorageClass::StorageBuffer)}}, + }; + auto new_var_op = spvtools::MakeUnique( + context(), spv::Op::OpVariable, input_buffer_ptr_id_, input_buffer_id_, + var_operands); + + context()->AddGlobalValue(std::move(new_var_op)); + context()->AddDebug2Inst(NewGlobalName(input_buffer_id_, "input_buffer")); + deco_mgr->AddDecorationVal( + input_buffer_id_, uint32_t(spv::Decoration::DescriptorSet), desc_set_); + deco_mgr->AddDecorationVal(input_buffer_id_, + uint32_t(spv::Decoration::Binding), + GetInputBufferBinding()); + if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) { + // Add the new buffer to all entry points. + for (auto& entry : get_module()->entry_points()) { + entry.AddOperand({SPV_OPERAND_TYPE_ID, {input_buffer_id_}}); + context()->AnalyzeUses(&entry); + } + } } +// clang-format off +// GLSL: +// uint inst_bindless_read_binding_length(uint desc_set_idx, uint binding_idx) +// { +// if (desc_set_idx >= inst_bindless_input_buffer.desc_sets.length()) { +// return 0; +// } +// +// DescriptorSetData set_data = inst_bindless_input_buffer.desc_sets[desc_set_idx]; +// uvec2 ptr_as_vec = uvec2(set_data); +// if ((ptr_as_vec.x == 0u) && (_ptr_as_vec.y == 0u)) +// { +// return 0u; +// } +// uint num_bindings = set_data.num_bindings; +// if (binding_idx >= num_bindings) { +// return 0; +// } +// return set_data.data[binding_idx]; +// } +// clang-format on +uint32_t InstBindlessCheckPass::GenDebugReadLengthFunctionId() { + if (read_length_func_id_ != 0) { + return read_length_func_id_; + } + SetupInputBufferIds(); + const analysis::Integer* uint_type = GetInteger(32, false); + const std::vector param_types(2, uint_type); + + const uint32_t func_id = TakeNextId(); + std::unique_ptr func = + StartFunction(func_id, uint_type, param_types); + + const std::vector param_ids = AddParameters(*func, param_types); + + // Create block + auto new_blk_ptr = MakeUnique(NewLabel(TakeNextId())); + InstructionBuilder builder( + context(), new_blk_ptr.get(), + IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); + Instruction* inst; + + inst = builder.AddBinaryOp( + GetBoolId(), spv::Op::OpUGreaterThanEqual, param_ids[0], + builder.GetUintConstantId(kDebugInputBindlessMaxDescSets)); + const uint32_t desc_cmp_id = inst->result_id(); + + uint32_t error_blk_id = TakeNextId(); + uint32_t merge_blk_id = TakeNextId(); + std::unique_ptr merge_label(NewLabel(merge_blk_id)); + std::unique_ptr error_label(NewLabel(error_blk_id)); + (void)builder.AddConditionalBranch(desc_cmp_id, error_blk_id, merge_blk_id, + merge_blk_id); + + func->AddBasicBlock(std::move(new_blk_ptr)); + + // error return + new_blk_ptr = MakeUnique(std::move(error_label)); + builder.SetInsertPoint(&*new_blk_ptr); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + builder.GetUintConstantId(0)); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // check descriptor set table entry is non-null + new_blk_ptr = MakeUnique(std::move(merge_label)); + builder.SetInsertPoint(&*new_blk_ptr); + + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + const uint32_t desc_set_ptr_ptr = type_mgr->FindPointerToType( + desc_set_ptr_id_, spv::StorageClass::StorageBuffer); + + inst = builder.AddAccessChain(desc_set_ptr_ptr, input_buffer_id_, + {builder.GetUintConstantId(0), param_ids[0]}); + const uint32_t set_access_chain_id = inst->result_id(); + + inst = builder.AddLoad(desc_set_ptr_id_, set_access_chain_id); + const uint32_t desc_set_ptr_id = inst->result_id(); + + inst = + builder.AddUnaryOp(GetVecUintId(2), spv::Op::OpBitcast, desc_set_ptr_id); + const uint32_t ptr_as_uvec_id = inst->result_id(); + + inst = builder.AddCompositeExtract(GetUintId(), ptr_as_uvec_id, {0}); + const uint32_t uvec_x = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, uvec_x, + builder.GetUintConstantId(0)); + const uint32_t x_is_zero_id = inst->result_id(); + + inst = builder.AddCompositeExtract(GetUintId(), ptr_as_uvec_id, {1}); + const uint32_t uvec_y = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, uvec_y, + builder.GetUintConstantId(0)); + const uint32_t y_is_zero_id = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpLogicalAnd, x_is_zero_id, + y_is_zero_id); + const uint32_t is_null_id = inst->result_id(); + + error_blk_id = TakeNextId(); + merge_blk_id = TakeNextId(); + merge_label = NewLabel(merge_blk_id); + error_label = NewLabel(error_blk_id); + (void)builder.AddConditionalBranch(is_null_id, error_blk_id, merge_blk_id, + merge_blk_id); + func->AddBasicBlock(std::move(new_blk_ptr)); + // error return + new_blk_ptr = MakeUnique(std::move(error_label)); + builder.SetInsertPoint(&*new_blk_ptr); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + builder.GetUintConstantId(0)); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // check binding is in range + new_blk_ptr = MakeUnique(std::move(merge_label)); + builder.SetInsertPoint(&*new_blk_ptr); + + const uint32_t uint_ptr = type_mgr->FindPointerToType( + GetUintId(), spv::StorageClass::PhysicalStorageBuffer); + + inst = builder.AddAccessChain(uint_ptr, desc_set_ptr_id, + {builder.GetUintConstantId(0)}); + const uint32_t binding_access_chain_id = inst->result_id(); + + inst = builder.AddLoad(GetUintId(), binding_access_chain_id, 8); + const uint32_t num_bindings_id = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThanEqual, + param_ids[1], num_bindings_id); + const uint32_t bindings_cmp_id = inst->result_id(); + + error_blk_id = TakeNextId(); + merge_blk_id = TakeNextId(); + merge_label = NewLabel(merge_blk_id); + error_label = NewLabel(error_blk_id); + (void)builder.AddConditionalBranch(bindings_cmp_id, error_blk_id, + merge_blk_id, merge_blk_id); + func->AddBasicBlock(std::move(new_blk_ptr)); + // error return + new_blk_ptr = MakeUnique(std::move(error_label)); + builder.SetInsertPoint(&*new_blk_ptr); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + builder.GetUintConstantId(0)); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // read binding length + new_blk_ptr = MakeUnique(std::move(merge_label)); + builder.SetInsertPoint(&*new_blk_ptr); + + inst = builder.AddAccessChain(uint_ptr, desc_set_ptr_id, + {{builder.GetUintConstantId(1), param_ids[1]}}); + const uint32_t length_ac_id = inst->result_id(); + + inst = builder.AddLoad(GetUintId(), length_ac_id, sizeof(uint32_t)); + const uint32_t length_id = inst->result_id(); + + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, length_id); + + func->AddBasicBlock(std::move(new_blk_ptr)); + func->SetFunctionEnd(EndFunction()); + + context()->AddFunction(std::move(func)); + context()->AddDebug2Inst(NewGlobalName(func_id, "read_binding_length")); + + read_length_func_id_ = func_id; + // Make sure this function doesn't get processed by + // InstrumentPass::InstProcessCallTreeFromRoots() + param2output_func_id_[2] = func_id; + return read_length_func_id_; +} + +// clang-format off +// GLSL: +// result = inst_bindless_read_binding_length(desc_set_id, binding_id); +// clang-format on +uint32_t InstBindlessCheckPass::GenDebugReadLength( + uint32_t var_id, InstructionBuilder* builder) { + const uint32_t func_id = GenDebugReadLengthFunctionId(); + + const std::vector args = { + builder->GetUintConstantId(var2desc_set_[var_id]), + builder->GetUintConstantId(var2binding_[var_id]), + }; + return GenReadFunctionCall(func_id, args, builder); +} + +// clang-format off +// GLSL: +// uint inst_bindless_read_desc_init(uint desc_set_idx, uint binding_idx, uint desc_idx) +// { +// if (desc_set_idx >= uint(inst_bindless_input_buffer.desc_sets.length())) +// { +// return 0u; +// } +// DescriptorSetData set_data = inst_bindless_input_buffer.desc_sets[desc_set_idx]; +// uvec2 ptr_as_vec = uvec2(set_data) +// if ((ptr_as_vec .x == 0u) && (ptr_as_vec.y == 0u)) +// { +// return 0u; +// } +// if (binding_idx >= set_data.num_bindings) +// { +// return 0u; +// } +// if (desc_idx >= set_data.data[binding_idx]) +// { +// return 0u; +// } +// uint desc_records_start = set_data.data[set_data.num_bindings + binding_idx]; +// return set_data.data[desc_records_start + desc_idx]; +// } +// clang-format on +uint32_t InstBindlessCheckPass::GenDebugReadInitFunctionId() { + if (read_init_func_id_ != 0) { + return read_init_func_id_; + } + SetupInputBufferIds(); + const analysis::Integer* uint_type = GetInteger(32, false); + const std::vector param_types(3, uint_type); + + const uint32_t func_id = TakeNextId(); + std::unique_ptr func = + StartFunction(func_id, uint_type, param_types); + + const std::vector param_ids = AddParameters(*func, param_types); + + // Create block + auto new_blk_ptr = MakeUnique(NewLabel(TakeNextId())); + InstructionBuilder builder( + context(), new_blk_ptr.get(), + IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping); + Instruction* inst; + + inst = builder.AddBinaryOp( + GetBoolId(), spv::Op::OpUGreaterThanEqual, param_ids[0], + builder.GetUintConstantId(kDebugInputBindlessMaxDescSets)); + const uint32_t desc_cmp_id = inst->result_id(); + + uint32_t error_blk_id = TakeNextId(); + uint32_t merge_blk_id = TakeNextId(); + std::unique_ptr merge_label(NewLabel(merge_blk_id)); + std::unique_ptr error_label(NewLabel(error_blk_id)); + (void)builder.AddConditionalBranch(desc_cmp_id, error_blk_id, merge_blk_id, + merge_blk_id); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // error return + new_blk_ptr = MakeUnique(std::move(error_label)); + builder.SetInsertPoint(&*new_blk_ptr); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + builder.GetUintConstantId(0)); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // check descriptor set table entry is non-null + new_blk_ptr = MakeUnique(std::move(merge_label)); + builder.SetInsertPoint(&*new_blk_ptr); + + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + const uint32_t desc_set_ptr_ptr = type_mgr->FindPointerToType( + desc_set_ptr_id_, spv::StorageClass::StorageBuffer); + + inst = builder.AddAccessChain(desc_set_ptr_ptr, input_buffer_id_, + {builder.GetUintConstantId(0), param_ids[0]}); + const uint32_t set_access_chain_id = inst->result_id(); + + inst = builder.AddLoad(desc_set_ptr_id_, set_access_chain_id); + const uint32_t desc_set_ptr_id = inst->result_id(); + + inst = + builder.AddUnaryOp(GetVecUintId(2), spv::Op::OpBitcast, desc_set_ptr_id); + const uint32_t ptr_as_uvec_id = inst->result_id(); + + inst = builder.AddCompositeExtract(GetUintId(), ptr_as_uvec_id, {0}); + const uint32_t uvec_x = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, uvec_x, + builder.GetUintConstantId(0)); + const uint32_t x_is_zero_id = inst->result_id(); + + inst = builder.AddCompositeExtract(GetUintId(), ptr_as_uvec_id, {1}); + const uint32_t uvec_y = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpIEqual, uvec_y, + builder.GetUintConstantId(0)); + const uint32_t y_is_zero_id = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpLogicalAnd, x_is_zero_id, + y_is_zero_id); + const uint32_t is_null_id = inst->result_id(); + + error_blk_id = TakeNextId(); + merge_blk_id = TakeNextId(); + merge_label = NewLabel(merge_blk_id); + error_label = NewLabel(error_blk_id); + (void)builder.AddConditionalBranch(is_null_id, error_blk_id, merge_blk_id, + merge_blk_id); + func->AddBasicBlock(std::move(new_blk_ptr)); + // error return + new_blk_ptr = MakeUnique(std::move(error_label)); + builder.SetInsertPoint(&*new_blk_ptr); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + builder.GetUintConstantId(0)); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // check binding is in range + new_blk_ptr = MakeUnique(std::move(merge_label)); + builder.SetInsertPoint(&*new_blk_ptr); + + const uint32_t uint_ptr = type_mgr->FindPointerToType( + GetUintId(), spv::StorageClass::PhysicalStorageBuffer); + + inst = builder.AddAccessChain(uint_ptr, desc_set_ptr_id, + {builder.GetUintConstantId(0)}); + const uint32_t binding_access_chain_id = inst->result_id(); + + inst = builder.AddLoad(GetUintId(), binding_access_chain_id, 8); + const uint32_t num_bindings_id = inst->result_id(); + + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThanEqual, + param_ids[1], num_bindings_id); + const uint32_t bindings_cmp_id = inst->result_id(); + + error_blk_id = TakeNextId(); + merge_blk_id = TakeNextId(); + merge_label = NewLabel(merge_blk_id); + error_label = NewLabel(error_blk_id); + (void)builder.AddConditionalBranch(bindings_cmp_id, error_blk_id, + merge_blk_id, merge_blk_id); + func->AddBasicBlock(std::move(new_blk_ptr)); + // error return + new_blk_ptr = MakeUnique(std::move(error_label)); + builder.SetInsertPoint(&*new_blk_ptr); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + builder.GetUintConstantId(0)); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // read binding length + new_blk_ptr = MakeUnique(std::move(merge_label)); + builder.SetInsertPoint(&*new_blk_ptr); + + inst = builder.AddAccessChain(uint_ptr, desc_set_ptr_id, + {{builder.GetUintConstantId(1), param_ids[1]}}); + const uint32_t length_ac_id = inst->result_id(); + + inst = builder.AddLoad(GetUintId(), length_ac_id, sizeof(uint32_t)); + const uint32_t length_id = inst->result_id(); + + // Check descriptor index in bounds + inst = builder.AddBinaryOp(GetBoolId(), spv::Op::OpUGreaterThanEqual, + param_ids[2], length_id); + const uint32_t desc_idx_range_id = inst->result_id(); + + error_blk_id = TakeNextId(); + merge_blk_id = TakeNextId(); + merge_label = NewLabel(merge_blk_id); + error_label = NewLabel(error_blk_id); + (void)builder.AddConditionalBranch(desc_idx_range_id, error_blk_id, + merge_blk_id, merge_blk_id); + func->AddBasicBlock(std::move(new_blk_ptr)); + // Error return + new_blk_ptr = MakeUnique(std::move(error_label)); + builder.SetInsertPoint(&*new_blk_ptr); + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, + builder.GetUintConstantId(0)); + func->AddBasicBlock(std::move(new_blk_ptr)); + + // Read descriptor init status + new_blk_ptr = MakeUnique(std::move(merge_label)); + builder.SetInsertPoint(&*new_blk_ptr); + + inst = builder.AddIAdd(GetUintId(), num_bindings_id, param_ids[1]); + const uint32_t state_offset_id = inst->result_id(); + + inst = + builder.AddAccessChain(uint_ptr, desc_set_ptr_id, + {{builder.GetUintConstantId(1), state_offset_id}}); + const uint32_t state_start_ac_id = inst->result_id(); + + inst = builder.AddLoad(GetUintId(), state_start_ac_id, sizeof(uint32_t)); + const uint32_t state_start_id = inst->result_id(); + + inst = builder.AddIAdd(GetUintId(), state_start_id, param_ids[2]); + const uint32_t state_entry_id = inst->result_id(); + + // Note: length starts from the beginning of the buffer, not the beginning of + // the data array + inst = + builder.AddAccessChain(uint_ptr, desc_set_ptr_id, + {{builder.GetUintConstantId(1), state_entry_id}}); + const uint32_t init_ac_id = inst->result_id(); + + inst = builder.AddLoad(GetUintId(), init_ac_id, sizeof(uint32_t)); + const uint32_t init_status_id = inst->result_id(); + + (void)builder.AddUnaryOp(0, spv::Op::OpReturnValue, init_status_id); + + func->AddBasicBlock(std::move(new_blk_ptr)); + func->SetFunctionEnd(EndFunction()); + + context()->AddFunction(std::move(func)); + context()->AddDebug2Inst(NewGlobalName(func_id, "read_desc_init")); + + read_init_func_id_ = func_id; + // Make sure function doesn't get processed by + // InstrumentPass::InstProcessCallTreeFromRoots() + param2output_func_id_[3] = func_id; + return read_init_func_id_; +} + +// clang-format off +// GLSL: +// result = inst_bindless_read_desc_init(desc_set_id, binding_id, desc_idx_id); +// +// clang-format on uint32_t InstBindlessCheckPass::GenDebugReadInit(uint32_t var_id, uint32_t desc_idx_id, InstructionBuilder* builder) { - uint32_t binding_idx_id = builder->GetUintConstantId(var2binding_[var_id]); - uint32_t u_desc_idx_id = GenUintCastCode(desc_idx_id, builder); - // If desc index checking is not enabled, we know the offset of initialization - // entries is 1, so we can avoid loading this value and just add 1 to the - // descriptor set. - if (!desc_idx_enabled_) { - uint32_t desc_set_idx_id = - builder->GetUintConstantId(var2desc_set_[var_id] + 1); - return GenDebugDirectRead({desc_set_idx_id, binding_idx_id, u_desc_idx_id}, - builder); - } else { - uint32_t desc_set_base_id = - builder->GetUintConstantId(kDebugInputBindlessInitOffset); - uint32_t desc_set_idx_id = - builder->GetUintConstantId(var2desc_set_[var_id]); - return GenDebugDirectRead( - {desc_set_base_id, desc_set_idx_id, binding_idx_id, u_desc_idx_id}, - builder); - } + const uint32_t func_id = GenDebugReadInitFunctionId(); + const std::vector args = { + builder->GetUintConstantId(var2desc_set_[var_id]), + builder->GetUintConstantId(var2binding_[var_id]), + GenUintCastCode(desc_idx_id, builder)}; + return GenReadFunctionCall(func_id, args, builder); } uint32_t InstBindlessCheckPass::CloneOriginalImage( @@ -248,9 +734,18 @@ bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst, ptr_inst->GetSingleWordInOperand(kSpvAccessChainIndex0IdInIdx); break; default: - ref->desc_idx_id = 0; break; } + auto decos = + context()->get_decoration_mgr()->GetDecorationsFor(ref->var_id, false); + for (const auto& deco : decos) { + spv::Decoration d = spv::Decoration(deco->GetSingleWordInOperand(1u)); + if (d == spv::Decoration::DescriptorSet) { + ref->set = deco->GetSingleWordInOperand(2u); + } else if (d == spv::Decoration::Binding) { + ref->binding = deco->GetSingleWordInOperand(2u); + } + } return true; } // Reference is not load or store. If not an image-based reference, return. @@ -300,6 +795,16 @@ bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst, // TODO(greg-lunarg): Handle additional possibilities? return false; } + auto decos = + context()->get_decoration_mgr()->GetDecorationsFor(ref->var_id, false); + for (const auto& deco : decos) { + spv::Decoration d = spv::Decoration(deco->GetSingleWordInOperand(1u)); + if (d == spv::Decoration::DescriptorSet) { + ref->set = deco->GetSingleWordInOperand(2u); + } else if (d == spv::Decoration::Binding) { + ref->binding = deco->GetSingleWordInOperand(2u); + } + } return true; } @@ -542,27 +1047,29 @@ void InstBindlessCheckPass::GenCheckCode( // Gen invalid block new_blk_ptr.reset(new BasicBlock(std::move(invalid_label))); builder.SetInsertPoint(&*new_blk_ptr); - uint32_t u_index_id = GenUintCastCode(ref->desc_idx_id, &builder); + const uint32_t u_set_id = builder.GetUintConstantId(ref->set); + const uint32_t u_binding_id = builder.GetUintConstantId(ref->binding); + const uint32_t u_index_id = GenUintCastCode(ref->desc_idx_id, &builder); + const uint32_t u_length_id = GenUintCastCode(length_id, &builder); if (offset_id != 0) { + const uint32_t u_offset_id = GenUintCastCode(offset_id, &builder); // Buffer OOB - uint32_t u_offset_id = GenUintCastCode(offset_id, &builder); - uint32_t u_length_id = GenUintCastCode(length_id, &builder); GenDebugStreamWrite(uid2offset_[ref->ref_inst->unique_id()], stage_idx, - {error_id, u_index_id, u_offset_id, u_length_id}, + {error_id, u_set_id, u_binding_id, u_index_id, + u_offset_id, u_length_id}, &builder); } else if (buffer_bounds_enabled_ || texel_buffer_enabled_) { // Uninitialized Descriptor - Return additional unused zero so all error // modes will use same debug stream write function - uint32_t u_length_id = GenUintCastCode(length_id, &builder); - GenDebugStreamWrite( - uid2offset_[ref->ref_inst->unique_id()], stage_idx, - {error_id, u_index_id, u_length_id, builder.GetUintConstantId(0)}, - &builder); + GenDebugStreamWrite(uid2offset_[ref->ref_inst->unique_id()], stage_idx, + {error_id, u_set_id, u_binding_id, u_index_id, + u_length_id, builder.GetUintConstantId(0)}, + &builder); } else { // Uninitialized Descriptor - Normal error return - uint32_t u_length_id = GenUintCastCode(length_id, &builder); - GenDebugStreamWrite(uid2offset_[ref->ref_inst->unique_id()], stage_idx, - {error_id, u_index_id, u_length_id}, &builder); + GenDebugStreamWrite( + uid2offset_[ref->ref_inst->unique_id()], stage_idx, + {error_id, u_set_id, u_binding_id, u_index_id, u_length_id}, &builder); } // Generate a ConstantNull, converting to uint64 if the type cannot be a null. if (new_ref_id != 0) { diff --git a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h index e6e6ef4f9..f89af025a 100644 --- a/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h +++ b/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h @@ -110,10 +110,14 @@ class InstBindlessCheckPass : public InstrumentPass { UptrVectorIterator ref_block_itr, uint32_t stage_idx, std::vector>* new_blocks); + void SetupInputBufferIds(); + uint32_t GenDebugReadLengthFunctionId(); + // Generate instructions into |builder| to read length of runtime descriptor // array |var_id| from debug input buffer and return id of value. uint32_t GenDebugReadLength(uint32_t var_id, InstructionBuilder* builder); + uint32_t GenDebugReadInitFunctionId(); // Generate instructions into |builder| to read initialization status of // descriptor array |image_id| at |index_id| from debug input buffer and // return id of value. @@ -124,14 +128,16 @@ class InstBindlessCheckPass : public InstrumentPass { // AnalyzeDescriptorReference. It is necessary and sufficient for further // analysis and regeneration of the reference. typedef struct RefAnalysis { - uint32_t desc_load_id; - uint32_t image_id; - uint32_t load_id; - uint32_t ptr_id; - uint32_t var_id; - uint32_t desc_idx_id; - uint32_t strg_class; - Instruction* ref_inst; + uint32_t desc_load_id{0}; + uint32_t image_id{0}; + uint32_t load_id{0}; + uint32_t ptr_id{0}; + uint32_t var_id{0}; + uint32_t set{0}; + uint32_t binding{0}; + uint32_t desc_idx_id{0}; + uint32_t strg_class{0}; + Instruction* ref_inst{nullptr}; } RefAnalysis; // Return size of type |ty_id| in bytes. Use |matrix_stride| and |col_major| @@ -201,6 +207,13 @@ class InstBindlessCheckPass : public InstrumentPass { // Mapping from variable to binding std::unordered_map var2binding_; + + uint32_t read_length_func_id_{0}; + uint32_t read_init_func_id_{0}; + uint32_t desc_set_type_id_{0}; + uint32_t desc_set_ptr_id_{0}; + uint32_t input_buffer_struct_id_{0}; + uint32_t input_buffer_ptr_id_{0}; }; } // namespace opt diff --git a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp index c18f91d7f..495470652 100644 --- a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp @@ -19,6 +19,24 @@ namespace spvtools { namespace opt { +bool InstBuffAddrCheckPass::InstrumentFunction(Function* func, + uint32_t stage_idx, + InstProcessFunction& pfn) { + // The bindless instrumentation pass adds functions that use + // BufferDeviceAddress They should not be instrumented by this pass. + Instruction* func_name_inst = + context()->GetNames(func->DefInst().result_id()).begin()->second; + if (func_name_inst) { + static const std::string kPrefix{"inst_bindless_"}; + std::string func_name = func_name_inst->GetOperand(1).AsString(); + if (func_name.size() >= kPrefix.size() && + func_name.compare(0, kPrefix.size(), kPrefix) == 0) { + return false; + } + } + return InstrumentPass::InstrumentFunction(func, stage_idx, pfn); +} + uint32_t InstBuffAddrCheckPass::CloneOriginalReference( Instruction* ref_inst, InstructionBuilder* builder) { // Clone original ref with new result id (if load) diff --git a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h index fb43c397a..2ec212bf8 100644 --- a/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h +++ b/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h @@ -41,6 +41,9 @@ class InstBuffAddrCheckPass : public InstrumentPass { const char* name() const override { return "inst-buff-addr-check-pass"; } + bool InstrumentFunction(Function* func, uint32_t stage_idx, + InstProcessFunction& pfn) override; + private: // Return byte alignment of type |type_id|. Must be int, float, vector, // matrix, struct, array or physical pointer. Uses std430 alignment. diff --git a/3rdparty/spirv-tools/source/opt/instrument_pass.cpp b/3rdparty/spirv-tools/source/opt/instrument_pass.cpp index c6e405051..9233ffd7f 100644 --- a/3rdparty/spirv-tools/source/opt/instrument_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/instrument_pass.cpp @@ -564,6 +564,19 @@ analysis::RuntimeArray* InstrumentPass::GetRuntimeArray( return type->AsRuntimeArray(); } +analysis::Array* InstrumentPass::GetArray(const analysis::Type* element, + uint32_t length) { + uint32_t length_id = context()->get_constant_mgr()->GetUIntConstId(length); + analysis::Array::LengthInfo length_info{ + length_id, {analysis::Array::LengthInfo::Case::kConstant, length}}; + + analysis::Array r(element, length_info); + + analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&r); + assert(type && type->AsArray()); + return type->AsArray(); +} + analysis::Function* InstrumentPass::GetFunction( const analysis::Type* return_val, const std::vector& args) { diff --git a/3rdparty/spirv-tools/source/opt/instrument_pass.h b/3rdparty/spirv-tools/source/opt/instrument_pass.h index 13119297c..4bbbb0981 100644 --- a/3rdparty/spirv-tools/source/opt/instrument_pass.h +++ b/3rdparty/spirv-tools/source/opt/instrument_pass.h @@ -270,6 +270,7 @@ class InstrumentPass : public Pass { analysis::Integer* GetInteger(uint32_t width, bool is_signed); analysis::Struct* GetStruct(const std::vector& fields); analysis::RuntimeArray* GetRuntimeArray(const analysis::Type* element); + analysis::Array* GetArray(const analysis::Type* element, uint32_t size); analysis::Function* GetFunction( const analysis::Type* return_val, const std::vector& args); @@ -339,8 +340,8 @@ class InstrumentPass : public Pass { // If code is generated for an instruction, replace the instruction's // block with the new blocks that are generated. Continue processing at the // top of the last new block. - bool InstrumentFunction(Function* func, uint32_t stage_idx, - InstProcessFunction& pfn); + virtual bool InstrumentFunction(Function* func, uint32_t stage_idx, + InstProcessFunction& pfn); // Call |pfn| on all functions in the call tree of the function // ids in |roots|. diff --git a/3rdparty/spirv-tools/source/opt/ir_builder.h b/3rdparty/spirv-tools/source/opt/ir_builder.h index 93289a61a..48e08ee7a 100644 --- a/3rdparty/spirv-tools/source/opt/ir_builder.h +++ b/3rdparty/spirv-tools/source/opt/ir_builder.h @@ -480,9 +480,16 @@ class InstructionBuilder { return AddInstruction(std::move(new_inst)); } - Instruction* AddLoad(uint32_t type_id, uint32_t base_ptr_id) { + Instruction* AddLoad(uint32_t type_id, uint32_t base_ptr_id, + uint32_t alignment = 0) { std::vector operands; operands.push_back({SPV_OPERAND_TYPE_ID, {base_ptr_id}}); + if (alignment != 0) { + operands.push_back( + {SPV_OPERAND_TYPE_MEMORY_ACCESS, + {static_cast(spv::MemoryAccessMask::Aligned)}}); + operands.push_back({SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER, {alignment}}); + } // TODO(1841): Handle id overflow. std::unique_ptr new_inst( diff --git a/3rdparty/spirv-tools/source/opt/licm_pass.cpp b/3rdparty/spirv-tools/source/opt/licm_pass.cpp index c485115fe..f2a6e4df5 100644 --- a/3rdparty/spirv-tools/source/opt/licm_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/licm_pass.cpp @@ -84,7 +84,7 @@ Pass::Status LICMPass::AnalyseAndHoistFromBB( bool modified = false; std::function hoist_inst = [this, &loop, &modified](Instruction* inst) { - if (loop->ShouldHoistInstruction(this->context(), inst)) { + if (loop->ShouldHoistInstruction(*inst)) { if (!HoistInstruction(loop, inst)) { return false; } diff --git a/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp b/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp index 2a9f90594..cbfc2e759 100644 --- a/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp +++ b/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp @@ -450,25 +450,20 @@ bool Loop::IsLCSSA() const { return true; } -bool Loop::ShouldHoistInstruction(IRContext* context, Instruction* inst) { - return AreAllOperandsOutsideLoop(context, inst) && - inst->IsOpcodeCodeMotionSafe(); +bool Loop::ShouldHoistInstruction(const Instruction& inst) const { + return inst.IsOpcodeCodeMotionSafe() && AreAllOperandsOutsideLoop(inst) && + (!inst.IsLoad() || inst.IsReadOnlyLoad()); } -bool Loop::AreAllOperandsOutsideLoop(IRContext* context, Instruction* inst) { - analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); - bool all_outside_loop = true; +bool Loop::AreAllOperandsOutsideLoop(const Instruction& inst) const { + analysis::DefUseManager* def_use_mgr = GetContext()->get_def_use_mgr(); - const std::function operand_outside_loop = - [this, &def_use_mgr, &all_outside_loop](uint32_t* id) { - if (this->IsInsideLoop(def_use_mgr->GetDef(*id))) { - all_outside_loop = false; - return; - } + const std::function operand_outside_loop = + [this, &def_use_mgr](const uint32_t* id) { + return !this->IsInsideLoop(def_use_mgr->GetDef(*id)); }; - inst->ForEachInId(operand_outside_loop); - return all_outside_loop; + return inst.WhileEachInId(operand_outside_loop); } void Loop::ComputeLoopStructuredOrder( diff --git a/3rdparty/spirv-tools/source/opt/loop_descriptor.h b/3rdparty/spirv-tools/source/opt/loop_descriptor.h index 35256bc3f..d451496e7 100644 --- a/3rdparty/spirv-tools/source/opt/loop_descriptor.h +++ b/3rdparty/spirv-tools/source/opt/loop_descriptor.h @@ -296,12 +296,12 @@ class Loop { // as a nested child loop. inline void SetParent(Loop* parent) { parent_ = parent; } - // Returns true is the instruction is invariant and safe to move wrt loop - bool ShouldHoistInstruction(IRContext* context, Instruction* inst); + // Returns true is the instruction is invariant and safe to move wrt loop. + bool ShouldHoistInstruction(const Instruction& inst) const; // Returns true if all operands of inst are in basic blocks not contained in - // loop - bool AreAllOperandsOutsideLoop(IRContext* context, Instruction* inst); + // loop. + bool AreAllOperandsOutsideLoop(const Instruction& inst) const; // Extract the initial value from the |induction| variable and store it in // |value|. If the function couldn't find the initial value of |induction| diff --git a/3rdparty/spirv-tools/source/util/small_vector.h b/3rdparty/spirv-tools/source/util/small_vector.h index 648a34824..1351475bd 100644 --- a/3rdparty/spirv-tools/source/util/small_vector.h +++ b/3rdparty/spirv-tools/source/util/small_vector.h @@ -15,7 +15,9 @@ #ifndef SOURCE_UTIL_SMALL_VECTOR_H_ #define SOURCE_UTIL_SMALL_VECTOR_H_ +#include #include +#include #include #include #include @@ -461,14 +463,18 @@ class SmallVector { // The number of elements in |small_data_| that have been constructed. size_t size_; - // The pointed used to access the array of elements when the number of - // elements is small. - T* small_data_; + // A type with the same alignment and size as T, but will is POD. + struct alignas(T) PodType { + std::array data; + }; // The actual data used to store the array elements. It must never be used // directly, but must only be accessed through |small_data_|. - typename std::aligned_storage::value>::type - buffer[small_size]; + PodType buffer[small_size]; + + // The pointed used to access the array of elements when the number of + // elements is small. + T* small_data_; // A pointer to a vector that is used to store the elements of the vector when // this size exceeds |small_size|. If |large_data_| is nullptr, then the data diff --git a/3rdparty/spirv-tools/source/val/validate_annotation.cpp b/3rdparty/spirv-tools/source/val/validate_annotation.cpp index bef753d9c..73d0285a1 100644 --- a/3rdparty/spirv-tools/source/val/validate_annotation.cpp +++ b/3rdparty/spirv-tools/source/val/validate_annotation.cpp @@ -193,7 +193,8 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec, switch (dec) { case spv::Decoration::Location: case spv::Decoration::Component: - // Location is used for input, output and ray tracing stages. + // Location is used for input, output, tile image, and ray tracing + // stages. if (sc != spv::StorageClass::Input && sc != spv::StorageClass::Output && sc != spv::StorageClass::RayPayloadKHR && sc != spv::StorageClass::IncomingRayPayloadKHR && @@ -201,7 +202,8 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec, sc != spv::StorageClass::CallableDataKHR && sc != spv::StorageClass::IncomingCallableDataKHR && sc != spv::StorageClass::ShaderRecordBufferKHR && - sc != spv::StorageClass::HitObjectAttributeNV) { + sc != spv::StorageClass::HitObjectAttributeNV && + sc != spv::StorageClass::TileImageEXT) { return _.diag(SPV_ERROR_INVALID_ID, target) << _.VkErrorID(6672) << _.SpvDecorationString(dec) << " decoration must not be applied to this storage class"; diff --git a/3rdparty/spirv-tools/source/val/validate_constants.cpp b/3rdparty/spirv-tools/source/val/validate_constants.cpp index a8ee5a6b1..006e504c0 100644 --- a/3rdparty/spirv-tools/source/val/validate_constants.cpp +++ b/3rdparty/spirv-tools/source/val/validate_constants.cpp @@ -76,7 +76,7 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _, } const auto constituent_result_type = _.FindDef(constituent->type_id()); if (!constituent_result_type || - component_type->opcode() != constituent_result_type->opcode()) { + component_type->id() != constituent_result_type->id()) { return _.diag(SPV_ERROR_INVALID_ID, inst) << opcode_name << " Constituent " << _.getIdName(constituent_id) diff --git a/3rdparty/spirv-tools/source/val/validate_function.cpp b/3rdparty/spirv-tools/source/val/validate_function.cpp index db402aa32..639817fef 100644 --- a/3rdparty/spirv-tools/source/val/validate_function.cpp +++ b/3rdparty/spirv-tools/source/val/validate_function.cpp @@ -14,6 +14,7 @@ #include +#include "source/enum_string_mapping.h" #include "source/opcode.h" #include "source/val/instruction.h" #include "source/val/validate.h" diff --git a/3rdparty/spirv-tools/source/val/validate_image.cpp b/3rdparty/spirv-tools/source/val/validate_image.cpp index ebcd8c3b7..733556b1d 100644 --- a/3rdparty/spirv-tools/source/val/validate_image.cpp +++ b/3rdparty/spirv-tools/source/val/validate_image.cpp @@ -210,6 +210,7 @@ uint32_t GetPlaneCoordSize(const ImageTypeInfo& info) { case spv::Dim::Dim2D: case spv::Dim::Rect: case spv::Dim::SubpassData: + case spv::Dim::TileImageDataEXT: plane_size = 2; break; case spv::Dim::Dim3D: @@ -218,6 +219,7 @@ uint32_t GetPlaneCoordSize(const ImageTypeInfo& info) { plane_size = 3; break; case spv::Dim::Max: + default: assert(0); break; } @@ -853,6 +855,28 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Dim SubpassData requires format Unknown"; } + } else if (info.dim == spv::Dim::TileImageDataEXT) { + if (_.IsVoidType(info.sampled_type)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Dim TileImageDataEXT requires Sampled Type to be not " + "OpTypeVoid"; + } + if (info.sampled != 2) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Dim TileImageDataEXT requires Sampled to be 2"; + } + if (info.format != spv::ImageFormat::Unknown) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Dim TileImageDataEXT requires format Unknown"; + } + if (info.depth != 0) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Dim TileImageDataEXT requires Depth to be 0"; + } + if (info.arrayed != 0) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Dim TileImageDataEXT requires Arrayed to be 0"; + } } else { if (info.multisampled && (info.sampled == 2) && !_.HasCapability(spv::Capability::StorageImageMultisample)) { @@ -918,6 +942,8 @@ spv_result_t ValidateTypeSampledImage(ValidationState_t& _, } // OpenCL requires Sampled=0, checked elsewhere. // Vulkan uses the Sampled=1 case. + // If Dim is TileImageDataEXT, Sampled must be 2 and this is validated + // elsewhere. if ((info.sampled != 0) && (info.sampled != 1)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << _.VkErrorID(4657) @@ -1117,6 +1143,12 @@ spv_result_t ValidateImageTexelPointer(ValidationState_t& _, << "Image Dim SubpassData cannot be used with OpImageTexelPointer"; } + if (info.dim == spv::Dim::TileImageDataEXT) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Image Dim TileImageDataEXT cannot be used with " + "OpImageTexelPointer"; + } + const uint32_t coord_type = _.GetOperandTypeId(inst, 3); if (!coord_type || !_.IsIntScalarOrVectorType(coord_type)) { return _.diag(SPV_ERROR_INVALID_DATA, inst) @@ -1623,6 +1655,12 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { spvOpcodeString(opcode)); } + if (info.dim == spv::Dim::TileImageDataEXT) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Image Dim TileImageDataEXT cannot be used with " + << spvOpcodeString(opcode); + } + if (_.GetIdOpcode(info.sampled_type) != spv::Op::OpTypeVoid) { const uint32_t result_component_type = _.GetComponentType(actual_result_type); @@ -1685,6 +1723,11 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { << "Image 'Dim' cannot be SubpassData"; } + if (info.dim == spv::Dim::TileImageDataEXT) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Image 'Dim' cannot be TileImageDataEXT"; + } + if (spv_result_t result = ValidateImageReadWrite(_, inst, info)) return result; @@ -1899,10 +1942,22 @@ spv_result_t ValidateImageQueryFormatOrOrder(ValidationState_t& _, << "Expected Result Type to be int scalar type"; } - if (_.GetIdOpcode(_.GetOperandTypeId(inst, 2)) != spv::Op::OpTypeImage) { + const uint32_t image_type = _.GetOperandTypeId(inst, 2); + if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) { return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected operand to be of type OpTypeImage"; } + + ImageTypeInfo info; + if (!GetImageTypeInfo(_, image_type, &info)) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Corrupt image type definition"; + } + + if (info.dim == spv::Dim::TileImageDataEXT) { + return _.diag(SPV_ERROR_INVALID_DATA, inst) + << "Image 'Dim' cannot be TileImageDataEXT"; + } return SPV_SUCCESS; } diff --git a/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp b/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp index dfa46466f..d757d4f82 100644 --- a/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp +++ b/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp @@ -502,6 +502,9 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _, case spv::ExecutionMode::DepthGreater: case spv::ExecutionMode::DepthLess: case spv::ExecutionMode::DepthUnchanged: + case spv::ExecutionMode::NonCoherentColorAttachmentReadEXT: + case spv::ExecutionMode::NonCoherentDepthAttachmentReadEXT: + case spv::ExecutionMode::NonCoherentStencilAttachmentReadEXT: case spv::ExecutionMode::PixelInterlockOrderedEXT: case spv::ExecutionMode::PixelInterlockUnorderedEXT: case spv::ExecutionMode::SampleInterlockOrderedEXT: diff --git a/3rdparty/spirv-tools/source/val/validation_state.cpp b/3rdparty/spirv-tools/source/val/validation_state.cpp index e43517850..dbf0ba6d9 100644 --- a/3rdparty/spirv-tools/source/val/validation_state.cpp +++ b/3rdparty/spirv-tools/source/val/validation_state.cpp @@ -1572,6 +1572,7 @@ bool ValidationState_t::IsValidStorageClass( case spv::StorageClass::ShaderRecordBufferKHR: case spv::StorageClass::TaskPayloadWorkgroupEXT: case spv::StorageClass::HitObjectAttributeNV: + case spv::StorageClass::TileImageEXT: return true; default: return false; From 6253c23c2927661091a8e1d2ccb978eae19ae0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:23:50 -0700 Subject: [PATCH 79/86] Updated spirv-cross. --- 3rdparty/spirv-cross/spirv_glsl.cpp | 7 ++++--- 3rdparty/spirv-cross/spirv_hlsl.cpp | 8 +++----- 3rdparty/spirv-cross/spirv_msl.cpp | 10 +++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 2ccc1a472..f4ceab6ae 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -1786,16 +1786,17 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin packed_size = type_to_packed_size(memb_type, member_flags, packing); // We only need to care about this if we have non-array types which can straddle the vec4 boundary. + uint32_t actual_offset = type_struct_member_offset(type, i); + if (packing_is_hlsl(packing)) { // If a member straddles across a vec4 boundary, alignment is actually vec4. - uint32_t begin_word = offset / 16; - uint32_t end_word = (offset + packed_size - 1) / 16; + uint32_t begin_word = actual_offset / 16; + uint32_t end_word = (actual_offset + packed_size - 1) / 16; if (begin_word != end_word) packed_alignment = max(packed_alignment, 16u); } - uint32_t actual_offset = type_struct_member_offset(type, i); // Field is not in the specified range anymore and we can ignore any further fields. if (actual_offset >= end_offset) break; diff --git a/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/spirv-cross/spirv_hlsl.cpp index 5763b5ffa..01b601033 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -724,10 +724,8 @@ void CompilerHLSL::emit_builtin_primitive_outputs_in_struct() { case BuiltInLayer: { - const ExecutionModel model = get_entry_point().model; - if (hlsl_options.shader_model < 50 || - (model != ExecutionModelGeometry && model != ExecutionModelMeshEXT)) - SPIRV_CROSS_THROW("Render target array index output is only supported in GS/MS 5.0 or higher."); + if (hlsl_options.shader_model < 50) + SPIRV_CROSS_THROW("Render target array index output is only supported in SM 5.0 or higher."); type = "uint"; semantic = "SV_RenderTargetArrayIndex"; break; @@ -3526,7 +3524,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i, bool sparse) { if (gather) { - SPIRV_CROSS_THROW("GatherCmp does not exist in HLSL."); + texop += ".GatherCmp"; } else if (lod || grad_x || grad_y) { diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index 5ff98b7be..3791264a4 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -2142,8 +2142,7 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: func.add_parameter(type_id, next_id, true); set(next_id, type_id, StorageClassFunction, 0, arg_id); - // Ensure the existing variable has a valid name and the new variable has all the same meta info - set_name(arg_id, ensure_valid_name(to_name(arg_id), "v")); + // Ensure the new variable has all the same meta info ir.meta[next_id] = ir.meta[arg_id]; } } @@ -10332,7 +10331,7 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) { if (arg_type.array.empty()) { - decl += join(", ", sampler_type(arg_type, arg.id), " ", to_sampler_expression(arg.id)); + decl += join(", ", sampler_type(arg_type, arg.id), " ", to_sampler_expression(name_id)); } else { @@ -10340,7 +10339,8 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) descriptor_address_space(name_id, StorageClassUniformConstant, "thread const"); - decl += join(", ", sampler_address_space, " ", sampler_type(arg_type, arg.id), "& ", to_sampler_expression(arg.id)); + decl += join(", ", sampler_address_space, " ", sampler_type(arg_type, name_id), "& ", + to_sampler_expression(name_id)); } } } @@ -10350,7 +10350,7 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) !is_dynamic_img_sampler) { bool arg_is_array = !arg_type.array.empty(); - decl += join(", constant uint", arg_is_array ? "* " : "& ", to_swizzle_expression(arg.id)); + decl += join(", constant uint", arg_is_array ? "* " : "& ", to_swizzle_expression(name_id)); } if (buffer_requires_array_length(name_id)) From f7ce1a7b1b30bc5bc5163b7f25e080e4f5e660f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:24:03 -0700 Subject: [PATCH 80/86] Updated vulkan headers. --- 3rdparty/khronos/vulkan-local/vulkan_core.h | 51 +++++++++++++++++---- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/3rdparty/khronos/vulkan-local/vulkan_core.h b/3rdparty/khronos/vulkan-local/vulkan_core.h index c09369640..a2e7ed3cb 100644 --- a/3rdparty/khronos/vulkan-local/vulkan_core.h +++ b/3rdparty/khronos/vulkan-local/vulkan_core.h @@ -68,7 +68,7 @@ extern "C" { #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 246 +#define VK_HEADER_VERSION 250 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) @@ -1002,6 +1002,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV = 1000464010, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT = 1000465000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT = 1000466000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR = 1000481000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT = 1000482000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT = 1000482001, VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT = 1000482002, @@ -1019,6 +1020,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM = 1000510000, VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM = 1000510001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT = 1000524000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, @@ -1871,6 +1873,7 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV = 1000455030, VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV = 1000455031, VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV = 1000455032, + VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT = 1000524000, VK_DYNAMIC_STATE_CULL_MODE_EXT = VK_DYNAMIC_STATE_CULL_MODE, VK_DYNAMIC_STATE_FRONT_FACE_EXT = VK_DYNAMIC_STATE_FRONT_FACE, VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT = VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY, @@ -9419,11 +9422,11 @@ typedef struct VkVideoDecodeH265SessionParametersCreateInfoKHR { } VkVideoDecodeH265SessionParametersCreateInfoKHR; typedef struct VkVideoDecodeH265PictureInfoKHR { - VkStructureType sType; - const void* pNext; - StdVideoDecodeH265PictureInfo* pStdPictureInfo; - uint32_t sliceSegmentCount; - const uint32_t* pSliceSegmentOffsets; + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH265PictureInfo* pStdPictureInfo; + uint32_t sliceSegmentCount; + const uint32_t* pSliceSegmentOffsets; } VkVideoDecodeH265PictureInfoKHR; typedef struct VkVideoDecodeH265DpbSlotInfoKHR { @@ -10230,6 +10233,17 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirementsKHR( #endif +#define VK_KHR_ray_tracing_position_fetch 1 +#define VK_KHR_RAY_TRACING_POSITION_FETCH_SPEC_VERSION 1 +#define VK_KHR_RAY_TRACING_POSITION_FETCH_EXTENSION_NAME "VK_KHR_ray_tracing_position_fetch" +typedef struct VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 rayTracingPositionFetch; +} VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR; + + + #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) #define VK_EXT_DEBUG_REPORT_SPEC_VERSION 10 @@ -12090,6 +12104,7 @@ typedef enum VkBuildAccelerationStructureFlagBitsKHR { #ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISPLACEMENT_MICROMAP_UPDATE_NV = 0x00000200, #endif + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DATA_ACCESS_KHR = 0x00000800, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR, VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR, @@ -14695,7 +14710,7 @@ typedef struct VkPhysicalDevice4444FormatsFeaturesEXT { #define VK_EXT_device_fault 1 -#define VK_EXT_DEVICE_FAULT_SPEC_VERSION 1 +#define VK_EXT_DEVICE_FAULT_SPEC_VERSION 2 #define VK_EXT_DEVICE_FAULT_EXTENSION_NAME "VK_EXT_device_fault" typedef enum VkDeviceFaultAddressTypeEXT { @@ -14759,6 +14774,8 @@ typedef struct VkDeviceFaultVendorBinaryHeaderVersionOneEXT { uint32_t applicationNameOffset; uint32_t applicationVersion; uint32_t engineNameOffset; + uint32_t engineVersion; + uint32_t apiVersion; } VkDeviceFaultVendorBinaryHeaderVersionOneEXT; typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceFaultInfoEXT)(VkDevice device, VkDeviceFaultCountsEXT* pFaultCounts, VkDeviceFaultInfoEXT* pFaultInfo); @@ -15540,7 +15557,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetMicromapBuildSizesEXT( #define VK_HUAWEI_cluster_culling_shader 1 -#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 1 +#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 2 #define VK_HUAWEI_CLUSTER_CULLING_SHADER_EXTENSION_NAME "VK_HUAWEI_cluster_culling_shader" typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI { VkStructureType sType; @@ -16667,6 +16684,24 @@ typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM { +#define VK_EXT_attachment_feedback_loop_dynamic_state 1 +#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION 1 +#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_dynamic_state" +typedef struct VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 attachmentFeedbackLoopDynamicState; +} VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT; + +typedef void (VKAPI_PTR *PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT)(VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetAttachmentFeedbackLoopEnableEXT( + VkCommandBuffer commandBuffer, + VkImageAspectFlags aspectMask); +#endif + + #define VK_KHR_acceleration_structure 1 #define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 #define VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME "VK_KHR_acceleration_structure" From d015ec082e96e2c1ba8779ad98079500729b51b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 May 2023 22:24:26 -0700 Subject: [PATCH 81/86] Updated version number. --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index f3e90aa40..138f994fb 100644 --- a/src/version.h +++ b/src/version.h @@ -9,5 +9,5 @@ * */ -#define BGFX_REV_NUMBER 8454 -#define BGFX_REV_SHA1 "6b29d8ee2be8383edd49c11026f5dc2cce0f907d" +#define BGFX_REV_NUMBER 8474 +#define BGFX_REV_SHA1 "f7ce1a7b1b30bc5bc5163b7f25e080e4f5e660f1" From cd4f64b643dca0df484f40140196033c9ffcef62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 5 May 2023 19:22:44 -0700 Subject: [PATCH 82/86] Issue #3093. --- src/renderer_d3d12.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index c302bc0ed..b4c2ea515 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -1282,7 +1282,7 @@ namespace bgfx { namespace d3d12 ); } m_samplerAllocator.create(D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER - , 1024 + , 2048 , BGFX_CONFIG_MAX_TEXTURE_SAMPLERS ); @@ -3840,7 +3840,7 @@ namespace bgfx { namespace d3d12 void DescriptorAllocatorD3D12::create(D3D12_DESCRIPTOR_HEAP_TYPE _type, uint16_t _maxDescriptors, uint16_t _numDescriptorsPerBlock) { - m_handleAlloc = bx::createHandleAlloc(g_allocator, _maxDescriptors); + m_handleAlloc = bx::createHandleAlloc(g_allocator, _maxDescriptors/_numDescriptorsPerBlock); m_numDescriptorsPerBlock = _numDescriptorsPerBlock; ID3D12Device* device = s_renderD3D12->m_device; @@ -3871,6 +3871,7 @@ namespace bgfx { namespace d3d12 uint16_t DescriptorAllocatorD3D12::alloc(ID3D12Resource* _ptr, const D3D12_SHADER_RESOURCE_VIEW_DESC* _desc) { uint16_t idx = m_handleAlloc->alloc(); + BX_ASSERT(bx::kInvalidHandle != idx, "DescriptorAllocatorD3D12 is out of memory."); D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle = { m_cpuHandle.ptr + idx * m_incrementSize }; @@ -3886,6 +3887,7 @@ namespace bgfx { namespace d3d12 uint16_t DescriptorAllocatorD3D12::alloc(const uint32_t* _flags, uint32_t _num, const float _palette[][4]) { uint16_t idx = m_handleAlloc->alloc(); + BX_ASSERT(bx::kInvalidHandle != idx, "DescriptorAllocatorD3D12 is out of memory."); ID3D12Device* device = s_renderD3D12->m_device; uint32_t maxAnisotropy = s_renderD3D12->m_maxAnisotropy; From f611d68f72347daaf8e09e7e96949f43af7857ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Tue, 9 May 2023 18:14:30 -0700 Subject: [PATCH 83/86] Fixed validation when creating dynamic index buffer with compute read flag. --- src/bgfx_p.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index c7661faac..c2c8d4a95 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1977,7 +1977,7 @@ namespace bgfx m_height = _height; m_depth = _depth; m_format = uint8_t(_format); - m_numSamples = 1 << bx::uint32_satsub((_flags & BGFX_TEXTURE_RT_MSAA_MASK) >> BGFX_TEXTURE_RT_MSAA_SHIFT, 1); + m_numSamples = 1 << bx::uint32_satsub( (_flags & BGFX_TEXTURE_RT_MSAA_MASK) >> BGFX_TEXTURE_RT_MSAA_SHIFT, 1); m_numMips = _numMips; m_numLayers = _numLayers; m_owned = false; @@ -3572,7 +3572,8 @@ namespace bgfx { BGFX_MUTEX_SCOPE(m_resourceApiLock); - BX_ASSERT(0 == (_flags & BGFX_BUFFER_COMPUTE_READ_WRITE), "Cannot initialize compute buffer from CPU."); + BX_ASSERT(0 == (_flags & BGFX_BUFFER_COMPUTE_WRITE), "Can't initialize compute write buffer from CPU."); + const uint32_t indexSize = 0 == (_flags & BGFX_BUFFER_INDEX32) ? 2 : 4; DynamicIndexBufferHandle handle = createDynamicIndexBuffer(_mem->size/indexSize, _flags); @@ -3594,7 +3595,7 @@ namespace bgfx BGFX_CHECK_HANDLE("updateDynamicIndexBuffer", m_dynamicIndexBufferHandle, _handle); DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx]; - BX_ASSERT(0 == (dib.m_flags & BGFX_BUFFER_COMPUTE_WRITE), "Can't update GPU buffer from CPU."); + BX_ASSERT(0 == (dib.m_flags & BGFX_BUFFER_COMPUTE_WRITE), "Can't update GPU write buffer from CPU."); const uint32_t indexSize = 0 == (dib.m_flags & BGFX_BUFFER_INDEX32) ? 2 : 4; if (dib.m_size < _mem->size @@ -3640,16 +3641,16 @@ namespace bgfx void destroy(const DynamicIndexBuffer& _dib) { - if (0 != (_dib.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE)) + if (0 != (_dib.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE) ) { destroyIndexBuffer(_dib.m_handle); } else { m_dynIndexBufferAllocator.free(uint64_t(_dib.m_handle.idx) << 32 | _dib.m_offset); - if (m_dynIndexBufferAllocator.compact()) + if (m_dynIndexBufferAllocator.compact() ) { - for (uint64_t ptr = m_dynIndexBufferAllocator.remove(); 0 != ptr; ptr = m_dynIndexBufferAllocator.remove()) + for (uint64_t ptr = m_dynIndexBufferAllocator.remove(); 0 != ptr; ptr = m_dynIndexBufferAllocator.remove() ) { IndexBufferHandle handle = { uint16_t(ptr >> 32) }; destroyIndexBuffer(handle); @@ -3769,6 +3770,8 @@ namespace bgfx { BGFX_MUTEX_SCOPE(m_resourceApiLock); + BX_ASSERT(0 == (_flags & BGFX_BUFFER_COMPUTE_WRITE), "Can't initialize compute write buffer from CPU."); + uint32_t numVertices = _mem->size/_layout.m_stride; DynamicVertexBufferHandle handle = createDynamicVertexBuffer(numVertices, _layout, _flags); @@ -3790,7 +3793,7 @@ namespace bgfx BGFX_CHECK_HANDLE("updateDynamicVertexBuffer", m_dynamicVertexBufferHandle, _handle); DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx]; - BX_ASSERT(0 == (dvb.m_flags & BGFX_BUFFER_COMPUTE_WRITE), "Can't update GPU write buffer from CPU."); + BX_ASSERT(0 == (dvb.m_flags & BGFX_BUFFER_COMPUTE_WRITE), "Can't update GPU write buffer from CPU."); if (dvb.m_size < _mem->size && 0 != (dvb.m_flags & BGFX_BUFFER_ALLOW_RESIZE) ) @@ -3839,16 +3842,16 @@ namespace bgfx void destroy(const DynamicVertexBuffer& _dvb) { - if (0 != (_dvb.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE)) + if (0 != (_dvb.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE) ) { destroyVertexBuffer(_dvb.m_handle); } else { m_dynVertexBufferAllocator.free(uint64_t(_dvb.m_handle.idx) << 32 | _dvb.m_offset); - if (m_dynVertexBufferAllocator.compact()) + if (m_dynVertexBufferAllocator.compact() ) { - for (uint64_t ptr = m_dynVertexBufferAllocator.remove(); 0 != ptr; ptr = m_dynVertexBufferAllocator.remove()) + for (uint64_t ptr = m_dynVertexBufferAllocator.remove(); 0 != ptr; ptr = m_dynVertexBufferAllocator.remove() ) { VertexBufferHandle handle = { uint16_t(ptr >> 32) }; destroyVertexBuffer(handle); From 1929ca061b52b532063f32cdd7482465e3f2e7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 14 May 2023 08:48:02 -0700 Subject: [PATCH 84/86] Updated glslang. --- 3rdparty/glslang/SPIRV/GLSL.ext.EXT.h | 1 + 3rdparty/glslang/SPIRV/GLSL.ext.KHR.h | 1 + 3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 120 +- 3rdparty/glslang/SPIRV/SPVRemapper.cpp | 6 - 3rdparty/glslang/SPIRV/SPVRemapper.h | 28 - 3rdparty/glslang/SPIRV/doc.cpp | 27 + 3rdparty/glslang/SPIRV/hex_float.h | 13 - 3rdparty/glslang/SPIRV/spirv.hpp | 178 +- 3rdparty/glslang/StandAlone/spirv-remap.cpp | 2 - .../CInterface/glslang_c_interface.cpp | 53 +- .../glslang/glslang/HLSL/hlslAttributes.h | 1 + 3rdparty/glslang/glslang/Include/BaseTypes.h | 4 + 3rdparty/glslang/glslang/Include/Common.h | 1 + 3rdparty/glslang/glslang/Include/Types.h | 48 +- .../glslang/Include/glslang_c_interface.h | 36 +- .../glslang/glslang/Include/intermediate.h | 13 + .../glslang/MachineIndependent/Initialize.cpp | 40 +- .../MachineIndependent/ParseHelper.cpp | 69 +- .../glslang/MachineIndependent/Scan.cpp | 9 + .../glslang/MachineIndependent/Versions.cpp | 3 + .../glslang/MachineIndependent/Versions.h | 3 + .../glslang/MachineIndependent/glslang.m4 | 26 +- .../glslang/MachineIndependent/glslang.y | 26 +- .../MachineIndependent/glslang_tab.cpp | 9934 +++++++++-------- .../MachineIndependent/glslang_tab.cpp.h | 268 +- .../glslang/MachineIndependent/intermOut.cpp | 13 + .../MachineIndependent/linkValidate.cpp | 25 +- .../MachineIndependent/localintermediate.h | 19 +- .../preprocessor/PpTokens.cpp | 3 - 29 files changed, 5762 insertions(+), 5208 deletions(-) mode change 100644 => 100755 3rdparty/glslang/SPIRV/GlslangToSpv.cpp mode change 100644 => 100755 3rdparty/glslang/SPIRV/doc.cpp mode change 100644 => 100755 3rdparty/glslang/glslang/Include/BaseTypes.h mode change 100644 => 100755 3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp mode change 100644 => 100755 3rdparty/glslang/glslang/MachineIndependent/Versions.h diff --git a/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h b/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h index a247b4cd1..caab27938 100644 --- a/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h +++ b/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h @@ -39,6 +39,7 @@ static const char* const E_SPV_EXT_shader_atomic_float_add = "SPV_EXT_shader_ato static const char* const E_SPV_EXT_shader_atomic_float16_add = "SPV_EXT_shader_atomic_float16_add"; static const char* const E_SPV_EXT_shader_atomic_float_min_max = "SPV_EXT_shader_atomic_float_min_max"; static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_int64"; +static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image"; static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader"; #endif // #ifndef GLSLextEXT_H diff --git a/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h b/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h index d5c670f0e..45549c143 100644 --- a/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h +++ b/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h @@ -54,5 +54,6 @@ static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_w static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subgroup_uniform_control_flow"; static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric"; static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests"; +static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch"; #endif // #ifndef GLSLextKHR_H diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp old mode 100644 new mode 100755 index 47c0a38b9..5926582fa --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -351,6 +351,7 @@ spv::Dim TranslateDimensionality(const glslang::TSampler& sampler) case glslang::EsdRect: return spv::DimRect; case glslang::EsdBuffer: return spv::DimBuffer; case glslang::EsdSubpass: return spv::DimSubpassData; + case glslang::EsdAttachmentEXT: return spv::DimTileImageDataEXT; default: assert(0); return spv::Dim2D; @@ -1010,6 +1011,8 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInRayTmaxKHR; case glslang::EbvCullMask: return spv::BuiltInCullMaskKHR; + case glslang::EbvPositionFetch: + return spv::BuiltInHitTriangleVertexPositionsKHR; case glslang::EbvInstanceCustomIndex: return spv::BuiltInInstanceCustomIndexKHR; case glslang::EbvHitT: @@ -1309,6 +1312,11 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T return spv::StorageClassInput; if (type.getQualifier().isPipeOutput()) return spv::StorageClassOutput; + if (type.getQualifier().storage == glslang::EvqTileImageEXT || type.isAttachmentEXT()) { + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.addCapability(spv::CapabilityTileImageColorReadAccessEXT); + return spv::StorageClassTileImageEXT; + } if (glslangIntermediate->getSource() != glslang::EShSourceHlsl || type.getQualifier().storage == glslang::EvqUniform) { @@ -1680,6 +1688,24 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addExtension(spv::E_SPV_KHR_post_depth_coverage); } + if (glslangIntermediate->getNonCoherentColorAttachmentReadEXT()) { + builder.addCapability(spv::CapabilityTileImageColorReadAccessEXT); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeNonCoherentColorAttachmentReadEXT); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + } + + if (glslangIntermediate->getNonCoherentDepthAttachmentReadEXT()) { + builder.addCapability(spv::CapabilityTileImageDepthReadAccessEXT); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeNonCoherentDepthAttachmentReadEXT); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + } + + if (glslangIntermediate->getNonCoherentStencilAttachmentReadEXT()) { + builder.addCapability(spv::CapabilityTileImageStencilReadAccessEXT); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeNonCoherentStencilAttachmentReadEXT); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + } + if (glslangIntermediate->isDepthReplacing()) builder.addExecutionMode(shaderEntry, spv::ExecutionModeDepthReplacing); @@ -1857,13 +1883,16 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addCapability(spv::CapabilityRayTracingNV); builder.addExtension("SPV_NV_ray_tracing"); } - if (glslangIntermediate->getStage() != EShLangRayGen && glslangIntermediate->getStage() != EShLangCallable) - { - if (extensions.find("GL_EXT_ray_cull_mask") != extensions.end()) { - builder.addCapability(spv::CapabilityRayCullMaskKHR); - builder.addExtension("SPV_KHR_ray_cull_mask"); - } - } + if (glslangIntermediate->getStage() != EShLangRayGen && glslangIntermediate->getStage() != EShLangCallable) { + if (extensions.find("GL_EXT_ray_cull_mask") != extensions.end()) { + builder.addCapability(spv::CapabilityRayCullMaskKHR); + builder.addExtension("SPV_KHR_ray_cull_mask"); + } + if (extensions.find("GL_EXT_ray_tracing_position_fetch") != extensions.end()) { + builder.addCapability(spv::CapabilityRayTracingPositionFetchKHR); + builder.addExtension("SPV_KHR_ray_tracing_position_fetch"); + } + } break; } case EShLangTask: @@ -3301,6 +3330,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.addExtension(spv::E_SPV_NV_shader_invocation_reorder); builder.addCapability(spv::CapabilityShaderInvocationReorderNV); break; + case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: + builder.addExtension(spv::E_SPV_KHR_ray_tracing_position_fetch); + builder.addCapability(spv::CapabilityRayQueryPositionFetchKHR); + noReturnValue = true; + break; #endif case glslang::EOpDebugPrintf: @@ -3479,6 +3513,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt if (arg == 0 && glslangOperands.size() != 2) lvalue = true; break; + case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: + if (arg == 0 || arg == 2) + lvalue = true; + break; #endif default: break; @@ -3571,7 +3609,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayDirection || glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayOrigin || glslangOp == glslang::EOpRayQueryGetIntersectionObjectToWorld || - glslangOp == glslang::EOpRayQueryGetIntersectionWorldToObject + glslangOp == glslang::EOpRayQueryGetIntersectionWorldToObject || + glslangOp == glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT )) { bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst(); operands.push_back(builder.makeIntConstant(cond ? 1 : 0)); @@ -3637,6 +3676,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.createNoResultOp(spv::OpCooperativeMatrixStoreNV, idImmOps); result = 0; + } else if (node->getOp() == glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT) { + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // q + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // committed + + spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), + builder.makeUintConstant(3), 0); + // do the op + spv::Id result = builder.createOp(spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[2]); + result = 0; } else #endif if (atomic) { @@ -5561,6 +5613,10 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (i == 7) lvalue = true; break; + case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: + if (i == 2) + lvalue = true; + break; default: break; } @@ -5720,6 +5776,17 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO return result; } + if (cracked.attachmentEXT) { + if (opIt != arguments.end()) { + spv::IdImmediate sample = { true, *opIt }; + operands.push_back(sample); + } + spv::Id result = builder.createOp(spv::OpColorAttachmentReadEXT, resultType(), operands); + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.setPrecision(result, precision); + return result; + } + spv::IdImmediate coord = { true, *(opIt++) }; operands.push_back(coord); if (node->getOp() == glslang::EOpImageLoad || node->getOp() == glslang::EOpImageLoadLod) { @@ -7140,6 +7207,19 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe unaryOp = spv::OpCopyObject; break; + case glslang::EOpDepthAttachmentReadEXT: + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.addCapability(spv::CapabilityTileImageDepthReadAccessEXT); + unaryOp = spv::OpDepthAttachmentReadEXT; + decorations.precision = spv::NoPrecision; + break; + case glslang::EOpStencilAttachmentReadEXT: + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + builder.addCapability(spv::CapabilityTileImageStencilReadAccessEXT); + unaryOp = spv::OpStencilAttachmentReadEXT; + decorations.precision = spv::DecorationRelaxedPrecision; + break; + default: return 0; } @@ -9230,6 +9310,30 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv: return builder.createOp(spv::OpReadClockKHR, typeId, args); } #endif + case glslang::EOpStencilAttachmentReadEXT: + case glslang::EOpDepthAttachmentReadEXT: + { + builder.addExtension(spv::E_SPV_EXT_shader_tile_image); + + spv::Decoration precision; + spv::Op spv_op; + if (op == glslang::EOpStencilAttachmentReadEXT) + { + precision = spv::DecorationRelaxedPrecision; + spv_op = spv::OpStencilAttachmentReadEXT; + builder.addCapability(spv::CapabilityTileImageStencilReadAccessEXT); + } + else + { + precision = spv::NoPrecision; + spv_op = spv::OpDepthAttachmentReadEXT; + builder.addCapability(spv::CapabilityTileImageDepthReadAccessEXT); + } + + std::vector args; // Dummy args + spv::Id result = builder.createOp(spv_op, typeId, args); + return builder.setPrecision(result, precision); + } default: break; } diff --git a/3rdparty/glslang/SPIRV/SPVRemapper.cpp b/3rdparty/glslang/SPIRV/SPVRemapper.cpp index 6aca8cbcf..4b2c4395e 100644 --- a/3rdparty/glslang/SPIRV/SPVRemapper.cpp +++ b/3rdparty/glslang/SPIRV/SPVRemapper.cpp @@ -36,10 +36,6 @@ #include "SPVRemapper.h" #include "doc.h" -#if !defined (use_cpp11) -// ... not supported before C++11 -#else // defined (use_cpp11) - #include #include #include "../glslang/Include/Common.h" @@ -1528,5 +1524,3 @@ namespace spv { } // namespace SPV -#endif // defined (use_cpp11) - diff --git a/3rdparty/glslang/SPIRV/SPVRemapper.h b/3rdparty/glslang/SPIRV/SPVRemapper.h index d21694635..42b01686e 100644 --- a/3rdparty/glslang/SPIRV/SPVRemapper.h +++ b/3rdparty/glslang/SPIRV/SPVRemapper.h @@ -43,12 +43,6 @@ namespace spv { -// MSVC defines __cplusplus as an older value, even when it supports almost all of 11. -// We handle that here by making our own symbol. -#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1700) -# define use_cpp11 1 -#endif - class spirvbin_base_t { public: @@ -74,27 +68,6 @@ public: } // namespace SPV -#if !defined (use_cpp11) -#include -#include - -namespace spv { -class spirvbin_t : public spirvbin_base_t -{ -public: - spirvbin_t(int /*verbose = 0*/) { } - - void remap(std::vector& /*spv*/, unsigned int /*opts = 0*/) - { - printf("Tool not compiled for C++11, which is required for SPIR-V remapping.\n"); - exit(5); - } -}; - -} // namespace SPV - -#else // defined (use_cpp11) - #include #include #include @@ -308,5 +281,4 @@ private: } // namespace SPV -#endif // defined (use_cpp11) #endif // SPIRVREMAPPER_H diff --git a/3rdparty/glslang/SPIRV/doc.cpp b/3rdparty/glslang/SPIRV/doc.cpp old mode 100644 new mode 100755 index 87ab12032..571ef7880 --- a/3rdparty/glslang/SPIRV/doc.cpp +++ b/3rdparty/glslang/SPIRV/doc.cpp @@ -215,6 +215,10 @@ const char* ExecutionModeString(int mode) case ExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; case ExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case ExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case ExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case ExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case ExecutionModeCeiling: default: return "Bad"; } @@ -247,6 +251,7 @@ const char* StorageClassString(int StorageClass) case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT"; case StorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; case StorageClassHitObjectAttributeNV: return "HitObjectAttributeNV"; + case StorageClassTileImageEXT: return "TileImageEXT"; default: return "Bad"; } } @@ -404,6 +409,7 @@ const char* BuiltInString(int builtIn) case BuiltInRayTminKHR: return "RayTminKHR"; case BuiltInRayTmaxKHR: return "RayTmaxKHR"; case BuiltInCullMaskKHR: return "CullMaskKHR"; + case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; @@ -463,6 +469,7 @@ const char* DimensionString(int dim) case 4: return "Rect"; case 5: return "Buffer"; case 6: return "SubpassData"; + case DimTileImageDataEXT: return "TileImageDataEXT"; default: return "Bad"; } @@ -950,6 +957,8 @@ const char* CapabilityString(int info) case CapabilityRayQueryKHR: return "RayQueryKHR"; case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; case CapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR"; @@ -989,6 +998,10 @@ const char* CapabilityString(int info) case CapabilityFragmentShaderPixelInterlockEXT: return "CapabilityFragmentShaderPixelInterlockEXT"; case CapabilityFragmentShaderShadingRateInterlockEXT: return "CapabilityFragmentShaderShadingRateInterlockEXT"; + case CapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case CapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case CapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case CapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR"; case CapabilityDemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT"; @@ -1452,6 +1465,7 @@ const char* OpcodeString(int op) case OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; case OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; case OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; @@ -1498,6 +1512,10 @@ const char* OpcodeString(int op) case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + default: return "Bad"; } @@ -3025,6 +3043,10 @@ void Parameterize() InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].operands.push(OperandId, "'Committed'"); InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true); + InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true); + InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Granularity'"); @@ -3260,6 +3282,11 @@ void Parameterize() InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Time'"); InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Payload'"); InstructionDesc[OpHitObjectTraceRayMotionNV].setResultAndType(false, false); + + InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Attachment'"); + InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); + InstructionDesc[OpStencilAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); + InstructionDesc[OpDepthAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); } }; // end spv namespace diff --git a/3rdparty/glslang/SPIRV/hex_float.h b/3rdparty/glslang/SPIRV/hex_float.h index 8be8e9f7e..785e8af11 100644 --- a/3rdparty/glslang/SPIRV/hex_float.h +++ b/3rdparty/glslang/SPIRV/hex_float.h @@ -23,19 +23,6 @@ #include #include -#if defined(_MSC_VER) && _MSC_VER < 1800 -namespace std { -bool isnan(double f) -{ - return ::_isnan(f) != 0; -} -bool isinf(double f) -{ - return ::_finite(f) == 0; -} -} -#endif - #include "bitutils.h" namespace spvutils { diff --git a/3rdparty/glslang/SPIRV/spirv.hpp b/3rdparty/glslang/SPIRV/spirv.hpp index 768a6f564..111285326 100644 --- a/3rdparty/glslang/SPIRV/spirv.hpp +++ b/3rdparty/glslang/SPIRV/spirv.hpp @@ -1,19 +1,19 @@ // Copyright (c) 2014-2020 The Khronos Group Inc. -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), // to deal in the Materials without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Materials, and to permit persons to whom the // Materials are furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Materials. -// +// // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS // STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -26,8 +26,8 @@ // the Binary Section of the SPIR-V specification. // Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python, C#, D -// +// C, C++, C++11, JSON, Lua, Python, C#, D, Beef +// // - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL // - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL // - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL @@ -36,7 +36,9 @@ // - C# will use enum classes in the Specification class located in the "Spv" namespace, // e.g.: Spv.Specification.SourceLanguage.GLSL // - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL -// +// - Beef will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// // Some tokens act like mask values, which can be OR'd together, // while others are mutually exclusive. The mask-like ones have // "Mask" in their name, and a parallel enum that has the shift @@ -66,6 +68,7 @@ enum SourceLanguage { SourceLanguageOpenCL_CPP = 4, SourceLanguageHLSL = 5, SourceLanguageCPP_for_OpenCL = 6, + SourceLanguageSYCL = 7, SourceLanguageMax = 0x7fffffff, }; @@ -153,6 +156,9 @@ enum ExecutionMode { ExecutionModeSubgroupsPerWorkgroupId = 37, ExecutionModeLocalSizeId = 38, ExecutionModeLocalSizeHintId = 39, + ExecutionModeNonCoherentColorAttachmentReadEXT = 4169, + ExecutionModeNonCoherentDepthAttachmentReadEXT = 4170, + ExecutionModeNonCoherentStencilAttachmentReadEXT = 4171, ExecutionModeSubgroupUniformControlFlowKHR = 4421, ExecutionModePostDepthCoverage = 4446, ExecutionModeDenormPreserve = 4459, @@ -192,6 +198,8 @@ enum ExecutionMode { ExecutionModeNoGlobalOffsetINTEL = 5895, ExecutionModeNumSIMDWorkitemsINTEL = 5896, ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903, + ExecutionModeStreamingInterfaceINTEL = 6154, + ExecutionModeNamedBarrierCountINTEL = 6417, ExecutionModeMax = 0x7fffffff, }; @@ -209,6 +217,7 @@ enum StorageClass { StorageClassAtomicCounter = 10, StorageClassImage = 11, StorageClassStorageBuffer = 12, + StorageClassTileImageEXT = 4172, StorageClassCallableDataKHR = 5328, StorageClassCallableDataNV = 5328, StorageClassIncomingCallableDataKHR = 5329, @@ -239,6 +248,7 @@ enum Dim { DimRect = 4, DimBuffer = 5, DimSubpassData = 6, + DimTileImageDataEXT = 4173, DimMax = 0x7fffffff, }; @@ -449,6 +459,7 @@ enum FunctionParameterAttribute { FunctionParameterAttributeNoCapture = 5, FunctionParameterAttributeNoWrite = 6, FunctionParameterAttributeNoReadWrite = 7, + FunctionParameterAttributeRuntimeAlignedINTEL = 5940, FunctionParameterAttributeMax = 0x7fffffff, }; @@ -558,12 +569,27 @@ enum Decoration { DecorationPrefetchINTEL = 5902, DecorationStallEnableINTEL = 5905, DecorationFuseLoopsInFunctionINTEL = 5907, + DecorationMathOpDSPModeINTEL = 5909, + DecorationAliasScopeINTEL = 5914, + DecorationNoAliasINTEL = 5915, + DecorationInitiationIntervalINTEL = 5917, + DecorationMaxConcurrencyINTEL = 5918, + DecorationPipelineEnableINTEL = 5919, DecorationBufferLocationINTEL = 5921, DecorationIOPipeStorageINTEL = 5944, DecorationFunctionFloatingPointModeINTEL = 6080, DecorationSingleElementVectorINTEL = 6085, DecorationVectorComputeCallableFunctionINTEL = 6087, DecorationMediaBlockIOINTEL = 6140, + DecorationConduitKernelArgumentINTEL = 6175, + DecorationRegisterMapKernelArgumentINTEL = 6176, + DecorationMMHostInterfaceAddressWidthINTEL = 6177, + DecorationMMHostInterfaceDataWidthINTEL = 6178, + DecorationMMHostInterfaceLatencyINTEL = 6179, + DecorationMMHostInterfaceReadWriteModeINTEL = 6180, + DecorationMMHostInterfaceMaxBurstINTEL = 6181, + DecorationMMHostInterfaceWaitRequestINTEL = 6182, + DecorationStableKernelArgumentINTEL = 6183, DecorationMax = 0x7fffffff, }; @@ -609,8 +635,8 @@ enum BuiltIn { BuiltInSubgroupLocalInvocationId = 41, BuiltInVertexIndex = 42, BuiltInInstanceIndex = 43, - BuiltInCoreCountARM = 4161, BuiltInCoreIDARM = 4160, + BuiltInCoreCountARM = 4161, BuiltInCoreMaxIDARM = 4162, BuiltInWarpIDARM = 4163, BuiltInWarpMaxIDARM = 4164, @@ -691,6 +717,7 @@ enum BuiltIn { BuiltInHitKindKHR = 5333, BuiltInHitKindNV = 5333, BuiltInCurrentRayTimeNV = 5334, + BuiltInHitTriangleVertexPositionsKHR = 5335, BuiltInIncomingRayFlagsKHR = 5351, BuiltInIncomingRayFlagsNV = 5351, BuiltInRayGeometryIndexKHR = 5352, @@ -732,6 +759,8 @@ enum LoopControlShift { LoopControlMaxInterleavingINTELShift = 21, LoopControlSpeculatedIterationsINTELShift = 22, LoopControlNoFusionINTELShift = 23, + LoopControlLoopCountINTELShift = 24, + LoopControlMaxReinvocationDelayINTELShift = 25, LoopControlMax = 0x7fffffff, }; @@ -754,6 +783,8 @@ enum LoopControlMask { LoopControlMaxInterleavingINTELMask = 0x00200000, LoopControlSpeculatedIterationsINTELMask = 0x00400000, LoopControlNoFusionINTELMask = 0x00800000, + LoopControlLoopCountINTELMask = 0x01000000, + LoopControlMaxReinvocationDelayINTELMask = 0x02000000, }; enum FunctionControlShift { @@ -826,6 +857,8 @@ enum MemoryAccessShift { MemoryAccessMakePointerVisibleKHRShift = 4, MemoryAccessNonPrivatePointerShift = 5, MemoryAccessNonPrivatePointerKHRShift = 5, + MemoryAccessAliasScopeINTELMaskShift = 16, + MemoryAccessNoAliasINTELMaskShift = 17, MemoryAccessMax = 0x7fffffff, }; @@ -840,6 +873,8 @@ enum MemoryAccessMask { MemoryAccessMakePointerVisibleKHRMask = 0x00000010, MemoryAccessNonPrivatePointerMask = 0x00000020, MemoryAccessNonPrivatePointerKHRMask = 0x00000020, + MemoryAccessAliasScopeINTELMaskMask = 0x00010000, + MemoryAccessNoAliasINTELMaskMask = 0x00020000, }; enum Scope { @@ -954,6 +989,9 @@ enum Capability { CapabilityShaderViewportIndex = 70, CapabilityUniformDecoration = 71, CapabilityCoreBuiltinsARM = 4165, + CapabilityTileImageColorReadAccessEXT = 4166, + CapabilityTileImageDepthReadAccessEXT = 4167, + CapabilityTileImageStencilReadAccessEXT = 4168, CapabilityFragmentShadingRateKHR = 4422, CapabilitySubgroupBallotKHR = 4423, CapabilityDrawParameters = 4427, @@ -1003,7 +1041,7 @@ enum Capability { CapabilityMeshShadingNV = 5266, CapabilityImageFootprintNV = 5282, CapabilityMeshShadingEXT = 5283, - CapabilityFragmentBarycentricKHR = 5284, + CapabilityFragmentBarycentricKHR = 5284, CapabilityFragmentBarycentricNV = 5284, CapabilityComputeDerivativeGroupQuadsNV = 5288, CapabilityFragmentDensityEXT = 5291, @@ -1033,6 +1071,7 @@ enum Capability { CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312, CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + CapabilityRayTracingPositionFetchKHR = 5336, CapabilityRayTracingNV = 5340, CapabilityRayTracingMotionBlurNV = 5341, CapabilityVulkanMemoryModel = 5345, @@ -1050,8 +1089,10 @@ enum Capability { CapabilityFragmentShaderPixelInterlockEXT = 5378, CapabilityDemoteToHelperInvocation = 5379, CapabilityDemoteToHelperInvocationEXT = 5379, + CapabilityRayTracingOpacityMicromapEXT = 5381, CapabilityShaderInvocationReorderNV = 5383, CapabilityBindlessTextureNV = 5390, + CapabilityRayQueryPositionFetchKHR = 5391, CapabilitySubgroupShuffleINTEL = 5568, CapabilitySubgroupBufferBlockIOINTEL = 5569, CapabilitySubgroupImageBlockIOINTEL = 5570, @@ -1084,9 +1125,13 @@ enum Capability { CapabilityFPGAMemoryAccessesINTEL = 5898, CapabilityFPGAClusterAttributesINTEL = 5904, CapabilityLoopFuseINTEL = 5906, + CapabilityFPGADSPControlINTEL = 5908, + CapabilityMemoryAccessAliasingINTEL = 5910, + CapabilityFPGAInvocationPipeliningAttributesINTEL = 5916, CapabilityFPGABufferLocationINTEL = 5920, CapabilityArbitraryPrecisionFixedPointINTEL = 5922, CapabilityUSMStorageClassesINTEL = 5935, + CapabilityRuntimeAlignedAttributeINTEL = 5939, CapabilityIOPipesINTEL = 5943, CapabilityBlockingPipesINTEL = 5945, CapabilityFPGARegINTEL = 5948, @@ -1100,12 +1145,16 @@ enum Capability { CapabilityDotProductKHR = 6019, CapabilityRayCullMaskKHR = 6020, CapabilityBitInstructions = 6025, + CapabilityGroupNonUniformRotateKHR = 6026, CapabilityAtomicFloat32AddEXT = 6033, CapabilityAtomicFloat64AddEXT = 6034, CapabilityLongConstantCompositeINTEL = 6089, CapabilityOptNoneINTEL = 6094, CapabilityAtomicFloat16AddEXT = 6095, CapabilityDebugInfoModuleINTEL = 6114, + CapabilitySplitBarrierINTEL = 6141, + CapabilityFPGAArgumentInterfacesINTEL = 6174, + CapabilityGroupUniformArithmeticKHR = 6400, CapabilityMax = 0x7fffffff, }; @@ -1120,6 +1169,7 @@ enum RayFlagsShift { RayFlagsCullNoOpaqueKHRShift = 7, RayFlagsSkipTrianglesKHRShift = 8, RayFlagsSkipAABBsKHRShift = 9, + RayFlagsForceOpacityMicromap2StateEXTShift = 10, RayFlagsMax = 0x7fffffff, }; @@ -1135,6 +1185,7 @@ enum RayFlagsMask { RayFlagsCullNoOpaqueKHRMask = 0x00000080, RayFlagsSkipTrianglesKHRMask = 0x00000100, RayFlagsSkipAABBsKHRMask = 0x00000200, + RayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400, }; enum RayQueryIntersection { @@ -1555,12 +1606,16 @@ enum Op { OpPtrEqual = 401, OpPtrNotEqual = 402, OpPtrDiff = 403, + OpColorAttachmentReadEXT = 4160, + OpDepthAttachmentReadEXT = 4161, + OpStencilAttachmentReadEXT = 4162, OpTerminateInvocation = 4416, OpSubgroupBallotKHR = 4421, OpSubgroupFirstInvocationKHR = 4422, OpSubgroupAllKHR = 4428, OpSubgroupAnyKHR = 4429, OpSubgroupAllEqualKHR = 4430, + OpGroupNonUniformRotateKHR = 4431, OpSubgroupReadInvocationKHR = 4432, OpTraceRayKHR = 4445, OpExecuteCallableKHR = 4446, @@ -1642,6 +1697,7 @@ enum Op { OpTraceNV = 5337, OpTraceMotionNV = 5338, OpTraceRayMotionNV = 5339, + OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, OpTypeAccelerationStructureKHR = 5341, OpTypeAccelerationStructureNV = 5341, OpExecuteCallableNV = 5344, @@ -1862,6 +1918,9 @@ enum Op { OpArbitraryFloatPowRINTEL = 5881, OpArbitraryFloatPowNINTEL = 5882, OpLoopControlINTEL = 5887, + OpAliasDomainDeclINTEL = 5911, + OpAliasScopeDeclINTEL = 5912, + OpAliasScopeListDeclINTEL = 5913, OpFixedSqrtINTEL = 5923, OpFixedRecipINTEL = 5924, OpFixedRsqrtINTEL = 5925, @@ -1900,10 +1959,23 @@ enum Op { OpTypeStructContinuedINTEL = 6090, OpConstantCompositeContinuedINTEL = 6091, OpSpecConstantCompositeContinuedINTEL = 6092, + OpControlBarrierArriveINTEL = 6142, + OpControlBarrierWaitINTEL = 6143, + OpGroupIMulKHR = 6401, + OpGroupFMulKHR = 6402, + OpGroupBitwiseAndKHR = 6403, + OpGroupBitwiseOrKHR = 6404, + OpGroupBitwiseXorKHR = 6405, + OpGroupLogicalAndKHR = 6406, + OpGroupLogicalOrKHR = 6407, + OpGroupLogicalXorKHR = 6408, OpMax = 0x7fffffff, }; #ifdef SPV_ENABLE_UTILITY_CODE +#ifndef __cplusplus +#include +#endif inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { *hasResult = *hasResultType = false; switch (opcode) { @@ -2252,12 +2324,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpPtrEqual: *hasResult = true; *hasResultType = true; break; case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; case OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; @@ -2288,10 +2364,43 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; case OpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; - case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; case OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; case OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; + case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; @@ -2299,6 +2408,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpTraceNV: *hasResult = false; *hasResultType = false; break; case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; @@ -2515,6 +2625,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; + case OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break; + case OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break; + case OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break; case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; @@ -2553,23 +2666,64 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; + case OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; } } #endif /* SPV_ENABLE_UTILITY_CODE */ -// Overload operator| for mask bit combining +// Overload bitwise operators for mask bit combining inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); } +inline ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); } +inline ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); } inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); } +inline FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); } +inline FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); } inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); } +inline SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); } +inline SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); } inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); } +inline LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); } +inline LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); } inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); } +inline FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); } +inline FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); } inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); } +inline MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); } +inline MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); } inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); } +inline MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); } +inline MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); } inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); } +inline KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); } +inline KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); } inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } +inline RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); } +inline RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); } +inline RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); } inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } +inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } +inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } +inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } } // end namespace spv #endif // #ifndef spirv_HPP + diff --git a/3rdparty/glslang/StandAlone/spirv-remap.cpp b/3rdparty/glslang/StandAlone/spirv-remap.cpp index 301bb0cb5..c54cbb9d5 100644 --- a/3rdparty/glslang/StandAlone/spirv-remap.cpp +++ b/3rdparty/glslang/StandAlone/spirv-remap.cpp @@ -352,13 +352,11 @@ int main(int argc, char** argv) int opts; int verbosity; -#ifdef use_cpp11 // handle errors by exiting spv::spirvbin_t::registerErrorHandler(errHandler); // Log messages to std::cout spv::spirvbin_t::registerLogHandler(logHandler); -#endif if (argc < 2) usage(argv[0]); diff --git a/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp b/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp index 1465ce17a..870698f2a 100644 --- a/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp +++ b/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp @@ -80,25 +80,6 @@ typedef struct glslang_program_s { (CallbackIncluder::callbacks::free_include_result) */ class CallbackIncluder : public glslang::TShader::Includer { -public: - /* Wrapper of IncludeResult which stores a glsl_include_result object internally */ - class CallbackIncludeResult : public glslang::TShader::Includer::IncludeResult { - public: - CallbackIncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength, - void* userData, glsl_include_result_t* includeResult) - : glslang::TShader::Includer::IncludeResult(headerName, headerData, headerLength, userData), - includeResult(includeResult) - { - } - - virtual ~CallbackIncludeResult() {} - - protected: - friend class CallbackIncluder; - - glsl_include_result_t* includeResult; - }; - public: CallbackIncluder(glsl_include_callbacks_t _callbacks, void* _context) : callbacks(_callbacks), context(_context) {} @@ -110,9 +91,7 @@ public: if (this->callbacks.include_system) { glsl_include_result_t* result = this->callbacks.include_system(this->context, headerName, includerName, inclusionDepth); - - return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length, - nullptr, result); + return makeIncludeResult(result); } return glslang::TShader::Includer::includeSystem(headerName, includerName, inclusionDepth); @@ -124,9 +103,7 @@ public: if (this->callbacks.include_local) { glsl_include_result_t* result = this->callbacks.include_local(this->context, headerName, includerName, inclusionDepth); - - return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length, - nullptr, result); + return makeIncludeResult(result); } return glslang::TShader::Includer::includeLocal(headerName, includerName, inclusionDepth); @@ -139,22 +116,25 @@ public: if (result == nullptr) return; - if (this->callbacks.free_include_result && (result->userData == nullptr)) { - CallbackIncludeResult* innerResult = static_cast(result); - /* use internal free() function */ - this->callbacks.free_include_result(this->context, innerResult->includeResult); - /* ignore internal fields of TShader::Includer::IncludeResult */ - delete result; - return; + if (this->callbacks.free_include_result) { + this->callbacks.free_include_result(this->context, static_cast(result->userData)); } - delete[] static_cast(result->userData); delete result; } private: CallbackIncluder() {} + IncludeResult* makeIncludeResult(glsl_include_result_t* result) { + if (!result) { + return nullptr; + } + + return new glslang::TShader::Includer::IncludeResult( + std::string(result->header_name), result->header_data, result->header_length, result); + } + /* C callback pointers */ glsl_include_callbacks_t callbacks; /* User-defined context */ @@ -394,8 +374,11 @@ GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input) { - DirStackFileIncluder Includer; - /* TODO: use custom callbacks if they are available in 'i->callbacks' */ + DirStackFileIncluder dirStackFileIncluder; + CallbackIncluder callbackIncluder(input->callbacks, input->callbacks_ctx); + glslang::TShader::Includer& Includer = (input->callbacks.include_local||input->callbacks.include_system) + ? static_cast(callbackIncluder) + : static_cast(dirStackFileIncluder); return shader->shader->preprocess( reinterpret_cast(input->resource), input->default_version, diff --git a/3rdparty/glslang/glslang/HLSL/hlslAttributes.h b/3rdparty/glslang/glslang/HLSL/hlslAttributes.h index 62faa5b88..f25269a83 100644 --- a/3rdparty/glslang/glslang/HLSL/hlslAttributes.h +++ b/3rdparty/glslang/glslang/HLSL/hlslAttributes.h @@ -36,6 +36,7 @@ #ifndef HLSLATTRIBUTES_H_ #define HLSLATTRIBUTES_H_ +#include #include #include diff --git a/3rdparty/glslang/glslang/Include/BaseTypes.h b/3rdparty/glslang/glslang/Include/BaseTypes.h old mode 100644 new mode 100755 index cf93193d3..f41941e73 --- a/3rdparty/glslang/glslang/Include/BaseTypes.h +++ b/3rdparty/glslang/glslang/Include/BaseTypes.h @@ -134,6 +134,8 @@ enum TStorageQualifier { EvqFragDepth, EvqFragStencil, + EvqTileImageEXT, + // end of list EvqLast }; @@ -325,6 +327,8 @@ enum TBuiltInVariable { EbvWarpIDARM, EbvWarpMaxIDARM, + EbvPositionFetch, + EbvLast }; diff --git a/3rdparty/glslang/glslang/Include/Common.h b/3rdparty/glslang/glslang/Include/Common.h index 7dbe4559c..6bb16e00d 100644 --- a/3rdparty/glslang/glslang/Include/Common.h +++ b/3rdparty/glslang/glslang/Include/Common.h @@ -56,6 +56,7 @@ #include #if defined(__ANDROID__) || (defined(_MSC_VER) && _MSC_VER < 1700) +#include namespace std { template diff --git a/3rdparty/glslang/glslang/Include/Types.h b/3rdparty/glslang/glslang/Include/Types.h index 59a447c91..c3d0bff44 100644 --- a/3rdparty/glslang/glslang/Include/Types.h +++ b/3rdparty/glslang/glslang/Include/Types.h @@ -72,6 +72,7 @@ enum TSamplerDim { EsdRect, EsdBuffer, EsdSubpass, // goes only with non-sampled image (image is true) + EsdAttachmentEXT, EsdNumDims }; @@ -90,6 +91,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, bool isBuffer() const { return false; } bool isRect() const { return false; } bool isSubpass() const { return false; } + bool isAttachmentEXT() const { return false; } bool isCombined() const { return true; } bool isImage() const { return false; } bool isImageClass() const { return false; } @@ -122,8 +124,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler, bool isBuffer() const { return dim == EsdBuffer; } bool isRect() const { return dim == EsdRect; } bool isSubpass() const { return dim == EsdSubpass; } + bool isAttachmentEXT() const { return dim == EsdAttachmentEXT; } bool isCombined() const { return combined; } - bool isImage() const { return image && !isSubpass(); } + bool isImage() const { return image && !isSubpass() && !isAttachmentEXT();} bool isImageClass() const { return image; } bool isMultiSample() const { return ms; } bool isExternal() const { return external; } @@ -214,6 +217,15 @@ struct TSampler { // misnomer now; includes images, textures without sampler, dim = EsdSubpass; ms = m; } + + // make an AttachmentEXT + void setAttachmentEXT(TBasicType t) + { + clear(); + type = t; + image = true; + dim = EsdAttachmentEXT; + } #endif bool operator==(const TSampler& right) const @@ -264,7 +276,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler, default: break; } if (isImageClass()) { - if (isSubpass()) + if (isAttachmentEXT()) + s.append("attachmentEXT"); + else if (isSubpass()) s.append("subpass"); else s.append("image"); @@ -285,10 +299,11 @@ struct TSampler { // misnomer now; includes images, textures without sampler, case Esd3D: s.append("3D"); break; case EsdCube: s.append("Cube"); break; #ifndef GLSLANG_WEB - case Esd1D: s.append("1D"); break; - case EsdRect: s.append("2DRect"); break; - case EsdBuffer: s.append("Buffer"); break; - case EsdSubpass: s.append("Input"); break; + case Esd1D: s.append("1D"); break; + case EsdRect: s.append("2DRect"); break; + case EsdBuffer: s.append("Buffer"); break; + case EsdSubpass: s.append("Input"); break; + case EsdAttachmentEXT: s.append(""); break; #endif default: break; // some compilers want this } @@ -1394,6 +1409,9 @@ struct TShaderQualifiers { bool earlyFragmentTests; // fragment input bool postDepthCoverage; // fragment input bool earlyAndLateFragmentTestsAMD; //fragment input + bool nonCoherentColorAttachmentReadEXT; // fragment input + bool nonCoherentDepthAttachmentReadEXT; // fragment input + bool nonCoherentStencilAttachmentReadEXT; // fragment input TLayoutDepth layoutDepth; TLayoutStencil layoutStencil; bool blendEquation; // true if any blend equation was specified @@ -1433,6 +1451,9 @@ struct TShaderQualifiers { earlyFragmentTests = false; earlyAndLateFragmentTestsAMD = false; postDepthCoverage = false; + nonCoherentColorAttachmentReadEXT = false; + nonCoherentDepthAttachmentReadEXT = false; + nonCoherentStencilAttachmentReadEXT = false; layoutDepth = EldNone; layoutStencil = ElsNone; blendEquation = false; @@ -1490,6 +1511,12 @@ struct TShaderQualifiers { earlyAndLateFragmentTestsAMD = true; if (src.postDepthCoverage) postDepthCoverage = true; + if (src.nonCoherentColorAttachmentReadEXT) + nonCoherentColorAttachmentReadEXT = true; + if (src.nonCoherentDepthAttachmentReadEXT) + nonCoherentDepthAttachmentReadEXT = true; + if (src.nonCoherentStencilAttachmentReadEXT) + nonCoherentStencilAttachmentReadEXT = true; if (src.layoutDepth) layoutDepth = src.layoutDepth; if (src.layoutStencil) @@ -1603,8 +1630,9 @@ public: #endif // "Image" is a superset of "Subpass" - bool isImage() const { return basicType == EbtSampler && sampler.isImage(); } - bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); } + bool isImage() const { return basicType == EbtSampler && sampler.isImage(); } + bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); } + bool isAttachmentEXT() const { return basicType == EbtSampler && sampler.isAttachmentEXT(); } }; // @@ -1927,8 +1955,8 @@ public: ; } virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } - // "Image" is a superset of "Subpass" - virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } + virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); } + virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); } virtual bool isTexture() const { return basicType == EbtSampler && getSampler().isTexture(); } virtual bool isBindlessImage() const { return isImage() && qualifier.layoutBindlessImage; } diff --git a/3rdparty/glslang/glslang/Include/glslang_c_interface.h b/3rdparty/glslang/glslang/Include/glslang_c_interface.h index 28d52330e..a519f6358 100644 --- a/3rdparty/glslang/glslang/Include/glslang_c_interface.h +++ b/3rdparty/glslang/glslang/Include/glslang_c_interface.h @@ -168,23 +168,6 @@ typedef struct glslang_resource_s { glslang_limits_t limits; } glslang_resource_t; -typedef struct glslang_input_s { - glslang_source_t language; - glslang_stage_t stage; - glslang_client_t client; - glslang_target_client_version_t client_version; - glslang_target_language_t target_language; - glslang_target_language_version_t target_language_version; - /** Shader source code */ - const char* code; - int default_version; - glslang_profile_t default_profile; - int force_default_version_and_profile; - int forward_compatible; - glslang_messages_t messages; - const glslang_resource_t* resource; -} glslang_input_t; - /* Inclusion result structure allocated by C include_local/include_system callbacks */ typedef struct glsl_include_result_s { /* Header file name or NULL if inclusion failed */ @@ -214,6 +197,25 @@ typedef struct glsl_include_callbacks_s { glsl_free_include_result_func free_include_result; } glsl_include_callbacks_t; +typedef struct glslang_input_s { + glslang_source_t language; + glslang_stage_t stage; + glslang_client_t client; + glslang_target_client_version_t client_version; + glslang_target_language_t target_language; + glslang_target_language_version_t target_language_version; + /** Shader source code */ + const char* code; + int default_version; + glslang_profile_t default_profile; + int force_default_version_and_profile; + int forward_compatible; + glslang_messages_t messages; + const glslang_resource_t* resource; + glsl_include_callbacks_t callbacks; + void* callbacks_ctx; +} glslang_input_t; + /* SpvOptions counterpart */ typedef struct glslang_spv_options_s { bool generate_debug_info; diff --git a/3rdparty/glslang/glslang/Include/intermediate.h b/3rdparty/glslang/glslang/Include/intermediate.h index ec2b28a9b..e6b4df4b6 100644 --- a/3rdparty/glslang/glslang/Include/intermediate.h +++ b/3rdparty/glslang/glslang/Include/intermediate.h @@ -827,6 +827,7 @@ enum TOperator { EOpSubpassLoadMS, EOpSparseImageLoad, EOpSparseImageLoadLod, + EOpColorAttachmentReadEXT, // Fragment only EOpImageGuardEnd, @@ -1090,6 +1091,13 @@ enum TOperator { // Shader Clock Ops EOpReadClockSubgroupKHR, EOpReadClockDeviceKHR, + + // GL_EXT_ray_tracing_position_fetch + EOpRayQueryGetIntersectionTriangleVertexPositionsEXT, + + // Shader tile image ops + EOpStencilAttachmentReadEXT, // Fragment only + EOpDepthAttachmentReadEXT, // Fragment only }; class TIntermTraverser; @@ -1393,6 +1401,7 @@ struct TCrackedTextureOp { bool subpass; bool lodClamp; bool fragMask; + bool attachmentEXT; }; // @@ -1449,6 +1458,7 @@ public: cracked.gather = false; cracked.grad = false; cracked.subpass = false; + cracked.attachmentEXT = false; cracked.lodClamp = false; cracked.fragMask = false; @@ -1609,6 +1619,9 @@ public: case EOpSubpassLoadMS: cracked.subpass = true; break; + case EOpColorAttachmentReadEXT: + cracked.attachmentEXT = true; + break; #endif default: break; diff --git a/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp old mode 100644 new mode 100755 index 16287dfd1..39f42b62f --- a/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp @@ -524,6 +524,7 @@ TBuiltIns::TBuiltIns() dimMap[EsdRect] = 2; dimMap[EsdBuffer] = 1; dimMap[EsdSubpass] = 2; // potentially unused for now + dimMap[EsdAttachmentEXT] = 2; // potentially unused for now #endif } @@ -4440,6 +4441,24 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + // GL_EXT_shader_tile_image + if (spvVersion.vulkan > 0) { + stageBuiltins[EShLangFragment].append( + "lowp uint stencilAttachmentReadEXT();" + "lowp uint stencilAttachmentReadEXT(int);" + "highp float depthAttachmentReadEXT();" + "highp float depthAttachmentReadEXT(int);" + "\n"); + stageBuiltins[EShLangFragment].append( + "vec4 colorAttachmentReadEXT(attachmentEXT);" + "vec4 colorAttachmentReadEXT(attachmentEXT, int);" + "ivec4 colorAttachmentReadEXT(iattachmentEXT);" + "ivec4 colorAttachmentReadEXT(iattachmentEXT, int);" + "uvec4 colorAttachmentReadEXT(uattachmentEXT);" + "uvec4 colorAttachmentReadEXT(uattachmentEXT, int);" + "\n"); + } + // GL_ARB_derivative_control if (profile != EEsProfile && version >= 400) { stageBuiltins[EShLangFragment].append(derivativeControls); @@ -4551,7 +4570,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV } // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query/ - // GL_NV_shader_invocation_reorder + // GL_NV_shader_invocation_reorder/GL_KHR_ray_tracing_position_Fetch if (profile != EEsProfile && version >= 460) { commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);" "void rayQueryTerminateEXT(rayQueryEXT);" @@ -4576,6 +4595,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec3 rayQueryGetIntersectionObjectRayOriginEXT(rayQueryEXT, bool);" "mat4x3 rayQueryGetIntersectionObjectToWorldEXT(rayQueryEXT, bool);" "mat4x3 rayQueryGetIntersectionWorldToObjectEXT(rayQueryEXT, bool);" + "void rayQueryGetIntersectionTriangleVertexPositionsEXT(rayQueryEXT, bool, out vec3[3]);" "\n"); stageBuiltins[EShLangRayGen].append( @@ -6018,6 +6038,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in uint gl_IncomingRayFlagsEXT;" "in float gl_CurrentRayTimeNV;" "in uint gl_CullMaskEXT;" + "in vec3 gl_HitTriangleVertexPositionsEXT[3];" "\n"; const char *missDecls = "in uvec3 gl_LaunchIDNV;" @@ -6199,6 +6220,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c for (int dim = Esd2D; dim <= EsdCube; ++dim) { // 2D, 3D, and Cube #else for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass + if (dim == EsdAttachmentEXT) + continue; if (dim == EsdSubpass && spvVersion.vulkan == 0) continue; if (dim == EsdSubpass && (image || shadow || arrayed)) @@ -6244,6 +6267,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c #ifndef GLSLANG_WEB if (dim == EsdSubpass) { sampler.setSubpass(bTypes[bType], ms ? true : false); + } else if (dim == EsdAttachmentEXT) { + sampler.setAttachmentEXT(bTypes[bType]); } else #endif if (image) { @@ -8235,6 +8260,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("rayQueryGetIntersectionWorldToObjectEXT", 1, &E_GL_EXT_ray_query); symbolTable.setFunctionExtensions("rayQueryGetWorldRayOriginEXT", 1, &E_GL_EXT_ray_query); symbolTable.setFunctionExtensions("rayQueryGetWorldRayDirectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); symbolTable.setVariableExtensions("gl_RayFlagsSkipAABBEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); symbolTable.setVariableExtensions("gl_RayFlagsSkipTrianglesEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); symbolTable.setVariableExtensions("gl_RayFlagsForceOpacityMicromap2StateEXT", 1, &E_GL_EXT_opacity_micromap); @@ -8729,6 +8755,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); } + + // GL_EXT_shader_tile_image + symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); + symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); + symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); #endif // !GLSLANG_WEB break; @@ -8932,6 +8963,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing); symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur); + symbolTable.setVariableExtensions("gl_HitTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); @@ -9015,6 +9047,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable); BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable); + BuiltInVariable("gl_HitTriangleVertexPositionsEXT", EbvPositionFetch, symbolTable); // GL_ARB_shader_ballot symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); @@ -9939,6 +9972,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("rayQueryGetWorldRayOriginEXT", EOpRayQueryGetWorldRayOrigin); symbolTable.relateToOperator("rayQueryGetIntersectionObjectToWorldEXT", EOpRayQueryGetIntersectionObjectToWorld); symbolTable.relateToOperator("rayQueryGetIntersectionWorldToObjectEXT", EOpRayQueryGetIntersectionWorldToObject); + symbolTable.relateToOperator("rayQueryGetIntersectionTriangleVertexPositionsEXT", EOpRayQueryGetIntersectionTriangleVertexPositionsEXT); } symbolTable.relateToOperator("interpolateAtCentroid", EOpInterpolateAtCentroid); @@ -9951,6 +9985,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("beginInvocationInterlockARB", EOpBeginInvocationInterlock); symbolTable.relateToOperator("endInvocationInterlockARB", EOpEndInvocationInterlock); + symbolTable.relateToOperator("stencilAttachmentReadEXT", EOpStencilAttachmentReadEXT); + symbolTable.relateToOperator("depthAttachmentReadEXT", EOpDepthAttachmentReadEXT); + symbolTable.relateToOperator("colorAttachmentReadEXT", EOpColorAttachmentReadEXT); + break; case EShLangCompute: diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 6e79f0c2e..c6f947d9b 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -2467,6 +2467,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpRayQueryGetIntersectionObjectRayOrigin: case EOpRayQueryGetIntersectionObjectToWorld: case EOpRayQueryGetIntersectionWorldToObject: + case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: if (!(*argp)[1]->getAsConstantUnion()) error(loc, "argument must be compile-time constant", "committed", ""); break; @@ -3811,7 +3812,10 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const // non-uniform sampler // not yet: okay if it has an initializer // if (! initializer) - error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); + if (type.getSampler().isAttachmentEXT() && type.getQualifier().storage != EvqTileImageEXT) + error(loc, "can only be used in tileImageEXT variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); + else if (type.getQualifier().storage != EvqTileImageEXT) + error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } } } @@ -5172,6 +5176,7 @@ void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQu case EvqIn: case EvqOut: case EvqInOut: + case EvqTileImageEXT: type.getQualifier().storage = qualifier; break; case EvqGlobal: @@ -5779,6 +5784,22 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.shaderQualifiers.postDepthCoverage = true; return; } + /* id is transformed into lower case in the beginning of this function. */ + if (id == "non_coherent_color_attachment_readext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_color_attachment_readEXT"); + publicType.shaderQualifiers.nonCoherentColorAttachmentReadEXT = true; + return; + } + if (id == "non_coherent_depth_attachment_readext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_depth_attachment_readEXT"); + publicType.shaderQualifiers.nonCoherentDepthAttachmentReadEXT = true; + return; + } + if (id == "non_coherent_stencil_attachment_readext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_stencil_attachment_readEXT"); + publicType.shaderQualifiers.nonCoherentStencilAttachmentReadEXT = true; + return; + } for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth+1)) { if (id == TQualifier::getLayoutDepthString(depth)) { requireProfile(loc, ECoreProfile | ECompatibilityProfile, "depth layout qualifier"); @@ -6473,6 +6494,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqBuffer: if (type.getBasicType() == EbtBlock) error(loc, "cannot apply to uniform or buffer block", "location", ""); + else if (type.getBasicType() == EbtSampler && type.getSampler().isAttachmentEXT()) + error(loc, "only applies to", "location", "%s with storage tileImageEXT", type.getBasicTypeString().c_str()); break; case EvqtaskPayloadSharedEXT: error(loc, "cannot apply to taskPayloadSharedEXT", "location", ""); @@ -6486,6 +6509,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqHitObjectAttrNV: break; #endif + case EvqTileImageEXT: + break; default: error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); break; @@ -6495,10 +6520,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) int repeated = intermediate.addUsedLocation(qualifier, type, typeCollision); if (repeated >= 0 && ! typeCollision) error(loc, "overlapping use of location", "location", "%d", repeated); - // "fragment-shader outputs ... if two variables are placed within the same + // "fragment-shader outputs/tileImageEXT ... if two variables are placed within the same // location, they must have the same underlying type (floating-point or integer)" - if (typeCollision && language == EShLangFragment && qualifier.isPipeOutput()) - error(loc, "fragment outputs sharing the same location must be the same basic type", "location", "%d", repeated); + if (typeCollision && language == EShLangFragment && (qualifier.isPipeOutput() || qualifier.storage == EvqTileImageEXT)) + error(loc, "fragment outputs or tileImageEXTs sharing the same location", "location", "%d must be the same basic type", repeated); } #ifndef GLSLANG_WEB @@ -6582,7 +6607,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) !qualifier.hasAttachment() && !qualifier.hasBufferReference()) error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", ""); - else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler) + else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler && !type.getSampler().isAttachmentEXT()) error(loc, "sampler/texture/image requires layout(binding=X)", "binding", ""); } } @@ -6644,6 +6669,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) // input attachment if (type.isSubpass()) { + if (extensionTurnedOn(E_GL_EXT_shader_tile_image)) + error(loc, "can not be used with GL_EXT_shader_tile_image enabled", type.getSampler().getString().c_str(), ""); if (! qualifier.hasAttachment()) error(loc, "requires an input_attachment_index layout qualifier", "subpass", ""); } else { @@ -6811,6 +6838,14 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier error(loc, "cannot be used with shaderRecordNV", "set", ""); } + + if (qualifier.storage == EvqTileImageEXT) { + if (qualifier.hasSet()) + error(loc, "cannot be used with tileImageEXT", "set", ""); + if (!qualifier.hasLocation()) + error(loc, "can only be used with an explicit location", "tileImageEXT", ""); + } + if (qualifier.storage == EvqHitAttr && qualifier.hasLayout()) { error(loc, "cannot apply layout qualifiers to hitAttributeNV variable", "hitAttributeNV", ""); } @@ -6850,6 +6885,12 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua error(loc, message, "early_fragment_tests", ""); if (shaderQualifiers.postDepthCoverage) error(loc, message, "post_depth_coverage", ""); + if (shaderQualifiers.nonCoherentColorAttachmentReadEXT) + error(loc, message, "non_coherent_color_attachment_readEXT", ""); + if (shaderQualifiers.nonCoherentDepthAttachmentReadEXT) + error(loc, message, "non_coherent_depth_attachment_readEXT", ""); + if (shaderQualifiers.nonCoherentStencilAttachmentReadEXT) + error(loc, message, "non_coherent_stencil_attachment_readEXT", ""); if (shaderQualifiers.primitives != TQualifier::layoutNotSet) { if (language == EShLangMesh) error(loc, message, "max_primitives", ""); @@ -9459,6 +9500,24 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con else error(loc, "can only apply to 'in'", "post_coverage_coverage", ""); } + if (publicType.shaderQualifiers.nonCoherentColorAttachmentReadEXT) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setNonCoherentColorAttachmentReadEXT(); + else + error(loc, "can only apply to 'in'", "non_coherent_color_attachment_readEXT", ""); + } + if (publicType.shaderQualifiers.nonCoherentDepthAttachmentReadEXT) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setNonCoherentDepthAttachmentReadEXT(); + else + error(loc, "can only apply to 'in'", "non_coherent_depth_attachment_readEXT", ""); + } + if (publicType.shaderQualifiers.nonCoherentStencilAttachmentReadEXT) { + if (publicType.qualifier.storage == EvqVaryingIn) + intermediate.setNonCoherentStencilAttachmentReadEXT(); + else + error(loc, "can only apply to 'in'", "non_coherent_stencil_attachment_readEXT", ""); + } if (publicType.shaderQualifiers.hasBlendEquation()) { if (publicType.qualifier.storage != EvqVaryingOut) error(loc, "can only apply to 'out'", "blend equation", ""); diff --git a/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp index c20048a9e..bb21c2034 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp @@ -343,6 +343,7 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["const"] = CONST; (*KeywordMap)["uniform"] = UNIFORM; + (*KeywordMap)["tileImageEXT"] = TILEIMAGEEXT; (*KeywordMap)["buffer"] = BUFFER; (*KeywordMap)["in"] = IN; (*KeywordMap)["out"] = OUT; @@ -685,6 +686,10 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["texture2DRect"] = TEXTURE2DRECT; (*KeywordMap)["texture1DArray"] = TEXTURE1DARRAY; + (*KeywordMap)["attachmentEXT"] = ATTACHMENTEXT; + (*KeywordMap)["iattachmentEXT"] = IATTACHMENTEXT; + (*KeywordMap)["uattachmentEXT"] = UATTACHMENTEXT; + (*KeywordMap)["subpassInput"] = SUBPASSINPUT; (*KeywordMap)["subpassInputMS"] = SUBPASSINPUTMS; (*KeywordMap)["isubpassInput"] = ISUBPASSINPUT; @@ -942,6 +947,7 @@ int TScanContext::tokenizeIdentifier() switch (keyword) { case CONST: case UNIFORM: + case TILEIMAGEEXT: case IN: case OUT: case INOUT: @@ -1658,6 +1664,9 @@ int TScanContext::tokenizeIdentifier() case ISUBPASSINPUTMS: case USUBPASSINPUT: case USUBPASSINPUTMS: + case ATTACHMENTEXT: + case IATTACHMENTEXT: + case UATTACHMENTEXT: if (parseContext.spvVersion.vulkan > 0) return keyword; else diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index bf5ce2f67..71032c8d1 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -354,6 +354,8 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_spirv_intrinsics] = EBhDisable; extensionBehavior[E_GL_EXT_mesh_shader] = EBhDisable; extensionBehavior[E_GL_EXT_opacity_micromap] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_tracing_position_fetch] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_tile_image] = EBhDisable; // OVR extensions extensionBehavior[E_GL_OVR_multiview] = EBhDisable; @@ -522,6 +524,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_ray_query 1\n" "#define GL_EXT_ray_flags_primitive_culling 1\n" "#define GL_EXT_ray_cull_mask 1\n" + "#define GL_EXT_ray_tracing_position_fetch 1\n" "#define GL_EXT_spirv_intrinsics 1\n" "#define GL_EXT_mesh_shader 1\n" diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/3rdparty/glslang/glslang/MachineIndependent/Versions.h old mode 100644 new mode 100755 index 9e4c9feaa..01b8b5d3c --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.h +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.h @@ -265,6 +265,7 @@ const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragmen const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives"; const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; +const char* const E_GL_EXT_ray_tracing_position_fetch = "GL_EXT_ray_tracing_position_fetch"; // ARM const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; @@ -327,6 +328,8 @@ const char* const E_GL_EXT_terminate_invocation = "GL_EXT_terminate_invocation"; const char* const E_GL_EXT_shader_atomic_float = "GL_EXT_shader_atomic_float"; const char* const E_GL_EXT_shader_atomic_float2 = "GL_EXT_shader_atomic_float2"; +const char* const E_GL_EXT_shader_tile_image = "GL_EXT_shader_tile_image"; + // Arrays of extensions for the above AEP duplications const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 b/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 index 914919f92..c3fea4fe6 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 @@ -279,6 +279,7 @@ GLSLANG_WEB_EXCLUDE_ON %token SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID %token SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING %token SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL +%token ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT GLSLANG_WEB_EXCLUDE_OFF @@ -304,7 +305,7 @@ GLSLANG_WEB_EXCLUDE_OFF %token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT %token TERMINATE_INVOCATION %token TERMINATE_RAY IGNORE_INTERSECTION -%token UNIFORM SHARED BUFFER +%token UNIFORM SHARED BUFFER TILEIMAGEEXT %token FLAT SMOOTH LAYOUT GLSLANG_WEB_EXCLUDE_ON @@ -1476,6 +1477,11 @@ storage_qualifier $$.init($1.loc); $$.qualifier.storage = EvqUniform; } + | TILEIMAGEEXT { + parseContext.globalCheck($1.loc, "tileImageEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqTileImageEXT; + } | SHARED { parseContext.globalCheck($1.loc, "shared"); parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -3446,6 +3452,24 @@ GLSLANG_WEB_EXCLUDE_ON $$.sampler.set(EbtFloat, Esd2D); $$.sampler.yuv = true; } + | ATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtFloat); + } + | IATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtInt); + } + | UATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtUint); + } | SUBPASSINPUT { parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/3rdparty/glslang/glslang/MachineIndependent/glslang.y index 1eec08ee6..362c13aa9 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.y +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang.y @@ -279,6 +279,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID %token SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING %token SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL +%token ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT @@ -304,7 +305,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT %token TERMINATE_INVOCATION %token TERMINATE_RAY IGNORE_INTERSECTION -%token UNIFORM SHARED BUFFER +%token UNIFORM SHARED BUFFER TILEIMAGEEXT %token FLAT SMOOTH LAYOUT @@ -1476,6 +1477,11 @@ storage_qualifier $$.init($1.loc); $$.qualifier.storage = EvqUniform; } + | TILEIMAGEEXT { + parseContext.globalCheck($1.loc, "tileImageEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqTileImageEXT; + } | SHARED { parseContext.globalCheck($1.loc, "shared"); parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -3446,6 +3452,24 @@ type_specifier_nonarray $$.sampler.set(EbtFloat, Esd2D); $$.sampler.yuv = true; } + | ATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtFloat); + } + | IATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtInt); + } + | UATTACHMENTEXT { + parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setAttachmentEXT(EbtUint); + } | SUBPASSINPUT { parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp index b79f699df..8ff2af348 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -450,269 +450,273 @@ enum yysymbol_kind_t YYSYMBOL_SPIRV_STORAGE_CLASS = 326, /* SPIRV_STORAGE_CLASS */ YYSYMBOL_SPIRV_BY_REFERENCE = 327, /* SPIRV_BY_REFERENCE */ YYSYMBOL_SPIRV_LITERAL = 328, /* SPIRV_LITERAL */ - YYSYMBOL_LEFT_OP = 329, /* LEFT_OP */ - YYSYMBOL_RIGHT_OP = 330, /* RIGHT_OP */ - YYSYMBOL_INC_OP = 331, /* INC_OP */ - YYSYMBOL_DEC_OP = 332, /* DEC_OP */ - YYSYMBOL_LE_OP = 333, /* LE_OP */ - YYSYMBOL_GE_OP = 334, /* GE_OP */ - YYSYMBOL_EQ_OP = 335, /* EQ_OP */ - YYSYMBOL_NE_OP = 336, /* NE_OP */ - YYSYMBOL_AND_OP = 337, /* AND_OP */ - YYSYMBOL_OR_OP = 338, /* OR_OP */ - YYSYMBOL_XOR_OP = 339, /* XOR_OP */ - YYSYMBOL_MUL_ASSIGN = 340, /* MUL_ASSIGN */ - YYSYMBOL_DIV_ASSIGN = 341, /* DIV_ASSIGN */ - YYSYMBOL_ADD_ASSIGN = 342, /* ADD_ASSIGN */ - YYSYMBOL_MOD_ASSIGN = 343, /* MOD_ASSIGN */ - YYSYMBOL_LEFT_ASSIGN = 344, /* LEFT_ASSIGN */ - YYSYMBOL_RIGHT_ASSIGN = 345, /* RIGHT_ASSIGN */ - YYSYMBOL_AND_ASSIGN = 346, /* AND_ASSIGN */ - YYSYMBOL_XOR_ASSIGN = 347, /* XOR_ASSIGN */ - YYSYMBOL_OR_ASSIGN = 348, /* OR_ASSIGN */ - YYSYMBOL_SUB_ASSIGN = 349, /* SUB_ASSIGN */ - YYSYMBOL_STRING_LITERAL = 350, /* STRING_LITERAL */ - YYSYMBOL_LEFT_PAREN = 351, /* LEFT_PAREN */ - YYSYMBOL_RIGHT_PAREN = 352, /* RIGHT_PAREN */ - YYSYMBOL_LEFT_BRACKET = 353, /* LEFT_BRACKET */ - YYSYMBOL_RIGHT_BRACKET = 354, /* RIGHT_BRACKET */ - YYSYMBOL_LEFT_BRACE = 355, /* LEFT_BRACE */ - YYSYMBOL_RIGHT_BRACE = 356, /* RIGHT_BRACE */ - YYSYMBOL_DOT = 357, /* DOT */ - YYSYMBOL_COMMA = 358, /* COMMA */ - YYSYMBOL_COLON = 359, /* COLON */ - YYSYMBOL_EQUAL = 360, /* EQUAL */ - YYSYMBOL_SEMICOLON = 361, /* SEMICOLON */ - YYSYMBOL_BANG = 362, /* BANG */ - YYSYMBOL_DASH = 363, /* DASH */ - YYSYMBOL_TILDE = 364, /* TILDE */ - YYSYMBOL_PLUS = 365, /* PLUS */ - YYSYMBOL_STAR = 366, /* STAR */ - YYSYMBOL_SLASH = 367, /* SLASH */ - YYSYMBOL_PERCENT = 368, /* PERCENT */ - YYSYMBOL_LEFT_ANGLE = 369, /* LEFT_ANGLE */ - YYSYMBOL_RIGHT_ANGLE = 370, /* RIGHT_ANGLE */ - YYSYMBOL_VERTICAL_BAR = 371, /* VERTICAL_BAR */ - YYSYMBOL_CARET = 372, /* CARET */ - YYSYMBOL_AMPERSAND = 373, /* AMPERSAND */ - YYSYMBOL_QUESTION = 374, /* QUESTION */ - YYSYMBOL_INVARIANT = 375, /* INVARIANT */ - YYSYMBOL_HIGH_PRECISION = 376, /* HIGH_PRECISION */ - YYSYMBOL_MEDIUM_PRECISION = 377, /* MEDIUM_PRECISION */ - YYSYMBOL_LOW_PRECISION = 378, /* LOW_PRECISION */ - YYSYMBOL_PRECISION = 379, /* PRECISION */ - YYSYMBOL_PACKED = 380, /* PACKED */ - YYSYMBOL_RESOURCE = 381, /* RESOURCE */ - YYSYMBOL_SUPERP = 382, /* SUPERP */ - YYSYMBOL_FLOATCONSTANT = 383, /* FLOATCONSTANT */ - YYSYMBOL_INTCONSTANT = 384, /* INTCONSTANT */ - YYSYMBOL_UINTCONSTANT = 385, /* UINTCONSTANT */ - YYSYMBOL_BOOLCONSTANT = 386, /* BOOLCONSTANT */ - YYSYMBOL_IDENTIFIER = 387, /* IDENTIFIER */ - YYSYMBOL_TYPE_NAME = 388, /* TYPE_NAME */ - YYSYMBOL_CENTROID = 389, /* CENTROID */ - YYSYMBOL_IN = 390, /* IN */ - YYSYMBOL_OUT = 391, /* OUT */ - YYSYMBOL_INOUT = 392, /* INOUT */ - YYSYMBOL_STRUCT = 393, /* STRUCT */ - YYSYMBOL_VOID = 394, /* VOID */ - YYSYMBOL_WHILE = 395, /* WHILE */ - YYSYMBOL_BREAK = 396, /* BREAK */ - YYSYMBOL_CONTINUE = 397, /* CONTINUE */ - YYSYMBOL_DO = 398, /* DO */ - YYSYMBOL_ELSE = 399, /* ELSE */ - YYSYMBOL_FOR = 400, /* FOR */ - YYSYMBOL_IF = 401, /* IF */ - YYSYMBOL_DISCARD = 402, /* DISCARD */ - YYSYMBOL_RETURN = 403, /* RETURN */ - YYSYMBOL_SWITCH = 404, /* SWITCH */ - YYSYMBOL_CASE = 405, /* CASE */ - YYSYMBOL_DEFAULT = 406, /* DEFAULT */ - YYSYMBOL_TERMINATE_INVOCATION = 407, /* TERMINATE_INVOCATION */ - YYSYMBOL_TERMINATE_RAY = 408, /* TERMINATE_RAY */ - YYSYMBOL_IGNORE_INTERSECTION = 409, /* IGNORE_INTERSECTION */ - YYSYMBOL_UNIFORM = 410, /* UNIFORM */ - YYSYMBOL_SHARED = 411, /* SHARED */ - YYSYMBOL_BUFFER = 412, /* BUFFER */ - YYSYMBOL_FLAT = 413, /* FLAT */ - YYSYMBOL_SMOOTH = 414, /* SMOOTH */ - YYSYMBOL_LAYOUT = 415, /* LAYOUT */ - YYSYMBOL_DOUBLECONSTANT = 416, /* DOUBLECONSTANT */ - YYSYMBOL_INT16CONSTANT = 417, /* INT16CONSTANT */ - YYSYMBOL_UINT16CONSTANT = 418, /* UINT16CONSTANT */ - YYSYMBOL_FLOAT16CONSTANT = 419, /* FLOAT16CONSTANT */ - YYSYMBOL_INT32CONSTANT = 420, /* INT32CONSTANT */ - YYSYMBOL_UINT32CONSTANT = 421, /* UINT32CONSTANT */ - YYSYMBOL_INT64CONSTANT = 422, /* INT64CONSTANT */ - YYSYMBOL_UINT64CONSTANT = 423, /* UINT64CONSTANT */ - YYSYMBOL_SUBROUTINE = 424, /* SUBROUTINE */ - YYSYMBOL_DEMOTE = 425, /* DEMOTE */ - YYSYMBOL_PAYLOADNV = 426, /* PAYLOADNV */ - YYSYMBOL_PAYLOADINNV = 427, /* PAYLOADINNV */ - YYSYMBOL_HITATTRNV = 428, /* HITATTRNV */ - YYSYMBOL_CALLDATANV = 429, /* CALLDATANV */ - YYSYMBOL_CALLDATAINNV = 430, /* CALLDATAINNV */ - YYSYMBOL_PAYLOADEXT = 431, /* PAYLOADEXT */ - YYSYMBOL_PAYLOADINEXT = 432, /* PAYLOADINEXT */ - YYSYMBOL_HITATTREXT = 433, /* HITATTREXT */ - YYSYMBOL_CALLDATAEXT = 434, /* CALLDATAEXT */ - YYSYMBOL_CALLDATAINEXT = 435, /* CALLDATAINEXT */ - YYSYMBOL_PATCH = 436, /* PATCH */ - YYSYMBOL_SAMPLE = 437, /* SAMPLE */ - YYSYMBOL_NONUNIFORM = 438, /* NONUNIFORM */ - YYSYMBOL_COHERENT = 439, /* COHERENT */ - YYSYMBOL_VOLATILE = 440, /* VOLATILE */ - YYSYMBOL_RESTRICT = 441, /* RESTRICT */ - YYSYMBOL_READONLY = 442, /* READONLY */ - YYSYMBOL_WRITEONLY = 443, /* WRITEONLY */ - YYSYMBOL_DEVICECOHERENT = 444, /* DEVICECOHERENT */ - YYSYMBOL_QUEUEFAMILYCOHERENT = 445, /* QUEUEFAMILYCOHERENT */ - YYSYMBOL_WORKGROUPCOHERENT = 446, /* WORKGROUPCOHERENT */ - YYSYMBOL_SUBGROUPCOHERENT = 447, /* SUBGROUPCOHERENT */ - YYSYMBOL_NONPRIVATE = 448, /* NONPRIVATE */ - YYSYMBOL_SHADERCALLCOHERENT = 449, /* SHADERCALLCOHERENT */ - YYSYMBOL_NOPERSPECTIVE = 450, /* NOPERSPECTIVE */ - YYSYMBOL_EXPLICITINTERPAMD = 451, /* EXPLICITINTERPAMD */ - YYSYMBOL_PERVERTEXEXT = 452, /* PERVERTEXEXT */ - YYSYMBOL_PERVERTEXNV = 453, /* PERVERTEXNV */ - YYSYMBOL_PERPRIMITIVENV = 454, /* PERPRIMITIVENV */ - YYSYMBOL_PERVIEWNV = 455, /* PERVIEWNV */ - YYSYMBOL_PERTASKNV = 456, /* PERTASKNV */ - YYSYMBOL_PERPRIMITIVEEXT = 457, /* PERPRIMITIVEEXT */ - YYSYMBOL_TASKPAYLOADWORKGROUPEXT = 458, /* TASKPAYLOADWORKGROUPEXT */ - YYSYMBOL_PRECISE = 459, /* PRECISE */ - YYSYMBOL_YYACCEPT = 460, /* $accept */ - YYSYMBOL_variable_identifier = 461, /* variable_identifier */ - YYSYMBOL_primary_expression = 462, /* primary_expression */ - YYSYMBOL_postfix_expression = 463, /* postfix_expression */ - YYSYMBOL_integer_expression = 464, /* integer_expression */ - YYSYMBOL_function_call = 465, /* function_call */ - YYSYMBOL_function_call_or_method = 466, /* function_call_or_method */ - YYSYMBOL_function_call_generic = 467, /* function_call_generic */ - YYSYMBOL_function_call_header_no_parameters = 468, /* function_call_header_no_parameters */ - YYSYMBOL_function_call_header_with_parameters = 469, /* function_call_header_with_parameters */ - YYSYMBOL_function_call_header = 470, /* function_call_header */ - YYSYMBOL_function_identifier = 471, /* function_identifier */ - YYSYMBOL_unary_expression = 472, /* unary_expression */ - YYSYMBOL_unary_operator = 473, /* unary_operator */ - YYSYMBOL_multiplicative_expression = 474, /* multiplicative_expression */ - YYSYMBOL_additive_expression = 475, /* additive_expression */ - YYSYMBOL_shift_expression = 476, /* shift_expression */ - YYSYMBOL_relational_expression = 477, /* relational_expression */ - YYSYMBOL_equality_expression = 478, /* equality_expression */ - YYSYMBOL_and_expression = 479, /* and_expression */ - YYSYMBOL_exclusive_or_expression = 480, /* exclusive_or_expression */ - YYSYMBOL_inclusive_or_expression = 481, /* inclusive_or_expression */ - YYSYMBOL_logical_and_expression = 482, /* logical_and_expression */ - YYSYMBOL_logical_xor_expression = 483, /* logical_xor_expression */ - YYSYMBOL_logical_or_expression = 484, /* logical_or_expression */ - YYSYMBOL_conditional_expression = 485, /* conditional_expression */ - YYSYMBOL_486_1 = 486, /* $@1 */ - YYSYMBOL_assignment_expression = 487, /* assignment_expression */ - YYSYMBOL_assignment_operator = 488, /* assignment_operator */ - YYSYMBOL_expression = 489, /* expression */ - YYSYMBOL_constant_expression = 490, /* constant_expression */ - YYSYMBOL_declaration = 491, /* declaration */ - YYSYMBOL_block_structure = 492, /* block_structure */ - YYSYMBOL_493_2 = 493, /* $@2 */ - YYSYMBOL_identifier_list = 494, /* identifier_list */ - YYSYMBOL_function_prototype = 495, /* function_prototype */ - YYSYMBOL_function_declarator = 496, /* function_declarator */ - YYSYMBOL_function_header_with_parameters = 497, /* function_header_with_parameters */ - YYSYMBOL_function_header = 498, /* function_header */ - YYSYMBOL_parameter_declarator = 499, /* parameter_declarator */ - YYSYMBOL_parameter_declaration = 500, /* parameter_declaration */ - YYSYMBOL_parameter_type_specifier = 501, /* parameter_type_specifier */ - YYSYMBOL_init_declarator_list = 502, /* init_declarator_list */ - YYSYMBOL_single_declaration = 503, /* single_declaration */ - YYSYMBOL_fully_specified_type = 504, /* fully_specified_type */ - YYSYMBOL_invariant_qualifier = 505, /* invariant_qualifier */ - YYSYMBOL_interpolation_qualifier = 506, /* interpolation_qualifier */ - YYSYMBOL_layout_qualifier = 507, /* layout_qualifier */ - YYSYMBOL_layout_qualifier_id_list = 508, /* layout_qualifier_id_list */ - YYSYMBOL_layout_qualifier_id = 509, /* layout_qualifier_id */ - YYSYMBOL_precise_qualifier = 510, /* precise_qualifier */ - YYSYMBOL_type_qualifier = 511, /* type_qualifier */ - YYSYMBOL_single_type_qualifier = 512, /* single_type_qualifier */ - YYSYMBOL_storage_qualifier = 513, /* storage_qualifier */ - YYSYMBOL_non_uniform_qualifier = 514, /* non_uniform_qualifier */ - YYSYMBOL_type_name_list = 515, /* type_name_list */ - YYSYMBOL_type_specifier = 516, /* type_specifier */ - YYSYMBOL_array_specifier = 517, /* array_specifier */ - YYSYMBOL_type_parameter_specifier_opt = 518, /* type_parameter_specifier_opt */ - YYSYMBOL_type_parameter_specifier = 519, /* type_parameter_specifier */ - YYSYMBOL_type_parameter_specifier_list = 520, /* type_parameter_specifier_list */ - YYSYMBOL_type_specifier_nonarray = 521, /* type_specifier_nonarray */ - YYSYMBOL_precision_qualifier = 522, /* precision_qualifier */ - YYSYMBOL_struct_specifier = 523, /* struct_specifier */ - YYSYMBOL_524_3 = 524, /* $@3 */ - YYSYMBOL_525_4 = 525, /* $@4 */ - YYSYMBOL_struct_declaration_list = 526, /* struct_declaration_list */ - YYSYMBOL_struct_declaration = 527, /* struct_declaration */ - YYSYMBOL_struct_declarator_list = 528, /* struct_declarator_list */ - YYSYMBOL_struct_declarator = 529, /* struct_declarator */ - YYSYMBOL_initializer = 530, /* initializer */ - YYSYMBOL_initializer_list = 531, /* initializer_list */ - YYSYMBOL_declaration_statement = 532, /* declaration_statement */ - YYSYMBOL_statement = 533, /* statement */ - YYSYMBOL_simple_statement = 534, /* simple_statement */ - YYSYMBOL_demote_statement = 535, /* demote_statement */ - YYSYMBOL_compound_statement = 536, /* compound_statement */ - YYSYMBOL_537_5 = 537, /* $@5 */ - YYSYMBOL_538_6 = 538, /* $@6 */ - YYSYMBOL_statement_no_new_scope = 539, /* statement_no_new_scope */ - YYSYMBOL_statement_scoped = 540, /* statement_scoped */ - YYSYMBOL_541_7 = 541, /* $@7 */ - YYSYMBOL_542_8 = 542, /* $@8 */ - YYSYMBOL_compound_statement_no_new_scope = 543, /* compound_statement_no_new_scope */ - YYSYMBOL_statement_list = 544, /* statement_list */ - YYSYMBOL_expression_statement = 545, /* expression_statement */ - YYSYMBOL_selection_statement = 546, /* selection_statement */ - YYSYMBOL_selection_statement_nonattributed = 547, /* selection_statement_nonattributed */ - YYSYMBOL_selection_rest_statement = 548, /* selection_rest_statement */ - YYSYMBOL_condition = 549, /* condition */ - YYSYMBOL_switch_statement = 550, /* switch_statement */ - YYSYMBOL_switch_statement_nonattributed = 551, /* switch_statement_nonattributed */ - YYSYMBOL_552_9 = 552, /* $@9 */ - YYSYMBOL_switch_statement_list = 553, /* switch_statement_list */ - YYSYMBOL_case_label = 554, /* case_label */ - YYSYMBOL_iteration_statement = 555, /* iteration_statement */ - YYSYMBOL_iteration_statement_nonattributed = 556, /* iteration_statement_nonattributed */ - YYSYMBOL_557_10 = 557, /* $@10 */ - YYSYMBOL_558_11 = 558, /* $@11 */ - YYSYMBOL_559_12 = 559, /* $@12 */ - YYSYMBOL_for_init_statement = 560, /* for_init_statement */ - YYSYMBOL_conditionopt = 561, /* conditionopt */ - YYSYMBOL_for_rest_statement = 562, /* for_rest_statement */ - YYSYMBOL_jump_statement = 563, /* jump_statement */ - YYSYMBOL_translation_unit = 564, /* translation_unit */ - YYSYMBOL_external_declaration = 565, /* external_declaration */ - YYSYMBOL_function_definition = 566, /* function_definition */ - YYSYMBOL_567_13 = 567, /* $@13 */ - YYSYMBOL_attribute = 568, /* attribute */ - YYSYMBOL_attribute_list = 569, /* attribute_list */ - YYSYMBOL_single_attribute = 570, /* single_attribute */ - YYSYMBOL_spirv_requirements_list = 571, /* spirv_requirements_list */ - YYSYMBOL_spirv_requirements_parameter = 572, /* spirv_requirements_parameter */ - YYSYMBOL_spirv_extension_list = 573, /* spirv_extension_list */ - YYSYMBOL_spirv_capability_list = 574, /* spirv_capability_list */ - YYSYMBOL_spirv_execution_mode_qualifier = 575, /* spirv_execution_mode_qualifier */ - YYSYMBOL_spirv_execution_mode_parameter_list = 576, /* spirv_execution_mode_parameter_list */ - YYSYMBOL_spirv_execution_mode_parameter = 577, /* spirv_execution_mode_parameter */ - YYSYMBOL_spirv_execution_mode_id_parameter_list = 578, /* spirv_execution_mode_id_parameter_list */ - YYSYMBOL_spirv_storage_class_qualifier = 579, /* spirv_storage_class_qualifier */ - YYSYMBOL_spirv_decorate_qualifier = 580, /* spirv_decorate_qualifier */ - YYSYMBOL_spirv_decorate_parameter_list = 581, /* spirv_decorate_parameter_list */ - YYSYMBOL_spirv_decorate_parameter = 582, /* spirv_decorate_parameter */ - YYSYMBOL_spirv_decorate_id_parameter_list = 583, /* spirv_decorate_id_parameter_list */ - YYSYMBOL_spirv_decorate_id_parameter = 584, /* spirv_decorate_id_parameter */ - YYSYMBOL_spirv_decorate_string_parameter_list = 585, /* spirv_decorate_string_parameter_list */ - YYSYMBOL_spirv_type_specifier = 586, /* spirv_type_specifier */ - YYSYMBOL_spirv_type_parameter_list = 587, /* spirv_type_parameter_list */ - YYSYMBOL_spirv_type_parameter = 588, /* spirv_type_parameter */ - YYSYMBOL_spirv_instruction_qualifier = 589, /* spirv_instruction_qualifier */ - YYSYMBOL_spirv_instruction_qualifier_list = 590, /* spirv_instruction_qualifier_list */ - YYSYMBOL_spirv_instruction_qualifier_id = 591 /* spirv_instruction_qualifier_id */ + YYSYMBOL_ATTACHMENTEXT = 329, /* ATTACHMENTEXT */ + YYSYMBOL_IATTACHMENTEXT = 330, /* IATTACHMENTEXT */ + YYSYMBOL_UATTACHMENTEXT = 331, /* UATTACHMENTEXT */ + YYSYMBOL_LEFT_OP = 332, /* LEFT_OP */ + YYSYMBOL_RIGHT_OP = 333, /* RIGHT_OP */ + YYSYMBOL_INC_OP = 334, /* INC_OP */ + YYSYMBOL_DEC_OP = 335, /* DEC_OP */ + YYSYMBOL_LE_OP = 336, /* LE_OP */ + YYSYMBOL_GE_OP = 337, /* GE_OP */ + YYSYMBOL_EQ_OP = 338, /* EQ_OP */ + YYSYMBOL_NE_OP = 339, /* NE_OP */ + YYSYMBOL_AND_OP = 340, /* AND_OP */ + YYSYMBOL_OR_OP = 341, /* OR_OP */ + YYSYMBOL_XOR_OP = 342, /* XOR_OP */ + YYSYMBOL_MUL_ASSIGN = 343, /* MUL_ASSIGN */ + YYSYMBOL_DIV_ASSIGN = 344, /* DIV_ASSIGN */ + YYSYMBOL_ADD_ASSIGN = 345, /* ADD_ASSIGN */ + YYSYMBOL_MOD_ASSIGN = 346, /* MOD_ASSIGN */ + YYSYMBOL_LEFT_ASSIGN = 347, /* LEFT_ASSIGN */ + YYSYMBOL_RIGHT_ASSIGN = 348, /* RIGHT_ASSIGN */ + YYSYMBOL_AND_ASSIGN = 349, /* AND_ASSIGN */ + YYSYMBOL_XOR_ASSIGN = 350, /* XOR_ASSIGN */ + YYSYMBOL_OR_ASSIGN = 351, /* OR_ASSIGN */ + YYSYMBOL_SUB_ASSIGN = 352, /* SUB_ASSIGN */ + YYSYMBOL_STRING_LITERAL = 353, /* STRING_LITERAL */ + YYSYMBOL_LEFT_PAREN = 354, /* LEFT_PAREN */ + YYSYMBOL_RIGHT_PAREN = 355, /* RIGHT_PAREN */ + YYSYMBOL_LEFT_BRACKET = 356, /* LEFT_BRACKET */ + YYSYMBOL_RIGHT_BRACKET = 357, /* RIGHT_BRACKET */ + YYSYMBOL_LEFT_BRACE = 358, /* LEFT_BRACE */ + YYSYMBOL_RIGHT_BRACE = 359, /* RIGHT_BRACE */ + YYSYMBOL_DOT = 360, /* DOT */ + YYSYMBOL_COMMA = 361, /* COMMA */ + YYSYMBOL_COLON = 362, /* COLON */ + YYSYMBOL_EQUAL = 363, /* EQUAL */ + YYSYMBOL_SEMICOLON = 364, /* SEMICOLON */ + YYSYMBOL_BANG = 365, /* BANG */ + YYSYMBOL_DASH = 366, /* DASH */ + YYSYMBOL_TILDE = 367, /* TILDE */ + YYSYMBOL_PLUS = 368, /* PLUS */ + YYSYMBOL_STAR = 369, /* STAR */ + YYSYMBOL_SLASH = 370, /* SLASH */ + YYSYMBOL_PERCENT = 371, /* PERCENT */ + YYSYMBOL_LEFT_ANGLE = 372, /* LEFT_ANGLE */ + YYSYMBOL_RIGHT_ANGLE = 373, /* RIGHT_ANGLE */ + YYSYMBOL_VERTICAL_BAR = 374, /* VERTICAL_BAR */ + YYSYMBOL_CARET = 375, /* CARET */ + YYSYMBOL_AMPERSAND = 376, /* AMPERSAND */ + YYSYMBOL_QUESTION = 377, /* QUESTION */ + YYSYMBOL_INVARIANT = 378, /* INVARIANT */ + YYSYMBOL_HIGH_PRECISION = 379, /* HIGH_PRECISION */ + YYSYMBOL_MEDIUM_PRECISION = 380, /* MEDIUM_PRECISION */ + YYSYMBOL_LOW_PRECISION = 381, /* LOW_PRECISION */ + YYSYMBOL_PRECISION = 382, /* PRECISION */ + YYSYMBOL_PACKED = 383, /* PACKED */ + YYSYMBOL_RESOURCE = 384, /* RESOURCE */ + YYSYMBOL_SUPERP = 385, /* SUPERP */ + YYSYMBOL_FLOATCONSTANT = 386, /* FLOATCONSTANT */ + YYSYMBOL_INTCONSTANT = 387, /* INTCONSTANT */ + YYSYMBOL_UINTCONSTANT = 388, /* UINTCONSTANT */ + YYSYMBOL_BOOLCONSTANT = 389, /* BOOLCONSTANT */ + YYSYMBOL_IDENTIFIER = 390, /* IDENTIFIER */ + YYSYMBOL_TYPE_NAME = 391, /* TYPE_NAME */ + YYSYMBOL_CENTROID = 392, /* CENTROID */ + YYSYMBOL_IN = 393, /* IN */ + YYSYMBOL_OUT = 394, /* OUT */ + YYSYMBOL_INOUT = 395, /* INOUT */ + YYSYMBOL_STRUCT = 396, /* STRUCT */ + YYSYMBOL_VOID = 397, /* VOID */ + YYSYMBOL_WHILE = 398, /* WHILE */ + YYSYMBOL_BREAK = 399, /* BREAK */ + YYSYMBOL_CONTINUE = 400, /* CONTINUE */ + YYSYMBOL_DO = 401, /* DO */ + YYSYMBOL_ELSE = 402, /* ELSE */ + YYSYMBOL_FOR = 403, /* FOR */ + YYSYMBOL_IF = 404, /* IF */ + YYSYMBOL_DISCARD = 405, /* DISCARD */ + YYSYMBOL_RETURN = 406, /* RETURN */ + YYSYMBOL_SWITCH = 407, /* SWITCH */ + YYSYMBOL_CASE = 408, /* CASE */ + YYSYMBOL_DEFAULT = 409, /* DEFAULT */ + YYSYMBOL_TERMINATE_INVOCATION = 410, /* TERMINATE_INVOCATION */ + YYSYMBOL_TERMINATE_RAY = 411, /* TERMINATE_RAY */ + YYSYMBOL_IGNORE_INTERSECTION = 412, /* IGNORE_INTERSECTION */ + YYSYMBOL_UNIFORM = 413, /* UNIFORM */ + YYSYMBOL_SHARED = 414, /* SHARED */ + YYSYMBOL_BUFFER = 415, /* BUFFER */ + YYSYMBOL_TILEIMAGEEXT = 416, /* TILEIMAGEEXT */ + YYSYMBOL_FLAT = 417, /* FLAT */ + YYSYMBOL_SMOOTH = 418, /* SMOOTH */ + YYSYMBOL_LAYOUT = 419, /* LAYOUT */ + YYSYMBOL_DOUBLECONSTANT = 420, /* DOUBLECONSTANT */ + YYSYMBOL_INT16CONSTANT = 421, /* INT16CONSTANT */ + YYSYMBOL_UINT16CONSTANT = 422, /* UINT16CONSTANT */ + YYSYMBOL_FLOAT16CONSTANT = 423, /* FLOAT16CONSTANT */ + YYSYMBOL_INT32CONSTANT = 424, /* INT32CONSTANT */ + YYSYMBOL_UINT32CONSTANT = 425, /* UINT32CONSTANT */ + YYSYMBOL_INT64CONSTANT = 426, /* INT64CONSTANT */ + YYSYMBOL_UINT64CONSTANT = 427, /* UINT64CONSTANT */ + YYSYMBOL_SUBROUTINE = 428, /* SUBROUTINE */ + YYSYMBOL_DEMOTE = 429, /* DEMOTE */ + YYSYMBOL_PAYLOADNV = 430, /* PAYLOADNV */ + YYSYMBOL_PAYLOADINNV = 431, /* PAYLOADINNV */ + YYSYMBOL_HITATTRNV = 432, /* HITATTRNV */ + YYSYMBOL_CALLDATANV = 433, /* CALLDATANV */ + YYSYMBOL_CALLDATAINNV = 434, /* CALLDATAINNV */ + YYSYMBOL_PAYLOADEXT = 435, /* PAYLOADEXT */ + YYSYMBOL_PAYLOADINEXT = 436, /* PAYLOADINEXT */ + YYSYMBOL_HITATTREXT = 437, /* HITATTREXT */ + YYSYMBOL_CALLDATAEXT = 438, /* CALLDATAEXT */ + YYSYMBOL_CALLDATAINEXT = 439, /* CALLDATAINEXT */ + YYSYMBOL_PATCH = 440, /* PATCH */ + YYSYMBOL_SAMPLE = 441, /* SAMPLE */ + YYSYMBOL_NONUNIFORM = 442, /* NONUNIFORM */ + YYSYMBOL_COHERENT = 443, /* COHERENT */ + YYSYMBOL_VOLATILE = 444, /* VOLATILE */ + YYSYMBOL_RESTRICT = 445, /* RESTRICT */ + YYSYMBOL_READONLY = 446, /* READONLY */ + YYSYMBOL_WRITEONLY = 447, /* WRITEONLY */ + YYSYMBOL_DEVICECOHERENT = 448, /* DEVICECOHERENT */ + YYSYMBOL_QUEUEFAMILYCOHERENT = 449, /* QUEUEFAMILYCOHERENT */ + YYSYMBOL_WORKGROUPCOHERENT = 450, /* WORKGROUPCOHERENT */ + YYSYMBOL_SUBGROUPCOHERENT = 451, /* SUBGROUPCOHERENT */ + YYSYMBOL_NONPRIVATE = 452, /* NONPRIVATE */ + YYSYMBOL_SHADERCALLCOHERENT = 453, /* SHADERCALLCOHERENT */ + YYSYMBOL_NOPERSPECTIVE = 454, /* NOPERSPECTIVE */ + YYSYMBOL_EXPLICITINTERPAMD = 455, /* EXPLICITINTERPAMD */ + YYSYMBOL_PERVERTEXEXT = 456, /* PERVERTEXEXT */ + YYSYMBOL_PERVERTEXNV = 457, /* PERVERTEXNV */ + YYSYMBOL_PERPRIMITIVENV = 458, /* PERPRIMITIVENV */ + YYSYMBOL_PERVIEWNV = 459, /* PERVIEWNV */ + YYSYMBOL_PERTASKNV = 460, /* PERTASKNV */ + YYSYMBOL_PERPRIMITIVEEXT = 461, /* PERPRIMITIVEEXT */ + YYSYMBOL_TASKPAYLOADWORKGROUPEXT = 462, /* TASKPAYLOADWORKGROUPEXT */ + YYSYMBOL_PRECISE = 463, /* PRECISE */ + YYSYMBOL_YYACCEPT = 464, /* $accept */ + YYSYMBOL_variable_identifier = 465, /* variable_identifier */ + YYSYMBOL_primary_expression = 466, /* primary_expression */ + YYSYMBOL_postfix_expression = 467, /* postfix_expression */ + YYSYMBOL_integer_expression = 468, /* integer_expression */ + YYSYMBOL_function_call = 469, /* function_call */ + YYSYMBOL_function_call_or_method = 470, /* function_call_or_method */ + YYSYMBOL_function_call_generic = 471, /* function_call_generic */ + YYSYMBOL_function_call_header_no_parameters = 472, /* function_call_header_no_parameters */ + YYSYMBOL_function_call_header_with_parameters = 473, /* function_call_header_with_parameters */ + YYSYMBOL_function_call_header = 474, /* function_call_header */ + YYSYMBOL_function_identifier = 475, /* function_identifier */ + YYSYMBOL_unary_expression = 476, /* unary_expression */ + YYSYMBOL_unary_operator = 477, /* unary_operator */ + YYSYMBOL_multiplicative_expression = 478, /* multiplicative_expression */ + YYSYMBOL_additive_expression = 479, /* additive_expression */ + YYSYMBOL_shift_expression = 480, /* shift_expression */ + YYSYMBOL_relational_expression = 481, /* relational_expression */ + YYSYMBOL_equality_expression = 482, /* equality_expression */ + YYSYMBOL_and_expression = 483, /* and_expression */ + YYSYMBOL_exclusive_or_expression = 484, /* exclusive_or_expression */ + YYSYMBOL_inclusive_or_expression = 485, /* inclusive_or_expression */ + YYSYMBOL_logical_and_expression = 486, /* logical_and_expression */ + YYSYMBOL_logical_xor_expression = 487, /* logical_xor_expression */ + YYSYMBOL_logical_or_expression = 488, /* logical_or_expression */ + YYSYMBOL_conditional_expression = 489, /* conditional_expression */ + YYSYMBOL_490_1 = 490, /* $@1 */ + YYSYMBOL_assignment_expression = 491, /* assignment_expression */ + YYSYMBOL_assignment_operator = 492, /* assignment_operator */ + YYSYMBOL_expression = 493, /* expression */ + YYSYMBOL_constant_expression = 494, /* constant_expression */ + YYSYMBOL_declaration = 495, /* declaration */ + YYSYMBOL_block_structure = 496, /* block_structure */ + YYSYMBOL_497_2 = 497, /* $@2 */ + YYSYMBOL_identifier_list = 498, /* identifier_list */ + YYSYMBOL_function_prototype = 499, /* function_prototype */ + YYSYMBOL_function_declarator = 500, /* function_declarator */ + YYSYMBOL_function_header_with_parameters = 501, /* function_header_with_parameters */ + YYSYMBOL_function_header = 502, /* function_header */ + YYSYMBOL_parameter_declarator = 503, /* parameter_declarator */ + YYSYMBOL_parameter_declaration = 504, /* parameter_declaration */ + YYSYMBOL_parameter_type_specifier = 505, /* parameter_type_specifier */ + YYSYMBOL_init_declarator_list = 506, /* init_declarator_list */ + YYSYMBOL_single_declaration = 507, /* single_declaration */ + YYSYMBOL_fully_specified_type = 508, /* fully_specified_type */ + YYSYMBOL_invariant_qualifier = 509, /* invariant_qualifier */ + YYSYMBOL_interpolation_qualifier = 510, /* interpolation_qualifier */ + YYSYMBOL_layout_qualifier = 511, /* layout_qualifier */ + YYSYMBOL_layout_qualifier_id_list = 512, /* layout_qualifier_id_list */ + YYSYMBOL_layout_qualifier_id = 513, /* layout_qualifier_id */ + YYSYMBOL_precise_qualifier = 514, /* precise_qualifier */ + YYSYMBOL_type_qualifier = 515, /* type_qualifier */ + YYSYMBOL_single_type_qualifier = 516, /* single_type_qualifier */ + YYSYMBOL_storage_qualifier = 517, /* storage_qualifier */ + YYSYMBOL_non_uniform_qualifier = 518, /* non_uniform_qualifier */ + YYSYMBOL_type_name_list = 519, /* type_name_list */ + YYSYMBOL_type_specifier = 520, /* type_specifier */ + YYSYMBOL_array_specifier = 521, /* array_specifier */ + YYSYMBOL_type_parameter_specifier_opt = 522, /* type_parameter_specifier_opt */ + YYSYMBOL_type_parameter_specifier = 523, /* type_parameter_specifier */ + YYSYMBOL_type_parameter_specifier_list = 524, /* type_parameter_specifier_list */ + YYSYMBOL_type_specifier_nonarray = 525, /* type_specifier_nonarray */ + YYSYMBOL_precision_qualifier = 526, /* precision_qualifier */ + YYSYMBOL_struct_specifier = 527, /* struct_specifier */ + YYSYMBOL_528_3 = 528, /* $@3 */ + YYSYMBOL_529_4 = 529, /* $@4 */ + YYSYMBOL_struct_declaration_list = 530, /* struct_declaration_list */ + YYSYMBOL_struct_declaration = 531, /* struct_declaration */ + YYSYMBOL_struct_declarator_list = 532, /* struct_declarator_list */ + YYSYMBOL_struct_declarator = 533, /* struct_declarator */ + YYSYMBOL_initializer = 534, /* initializer */ + YYSYMBOL_initializer_list = 535, /* initializer_list */ + YYSYMBOL_declaration_statement = 536, /* declaration_statement */ + YYSYMBOL_statement = 537, /* statement */ + YYSYMBOL_simple_statement = 538, /* simple_statement */ + YYSYMBOL_demote_statement = 539, /* demote_statement */ + YYSYMBOL_compound_statement = 540, /* compound_statement */ + YYSYMBOL_541_5 = 541, /* $@5 */ + YYSYMBOL_542_6 = 542, /* $@6 */ + YYSYMBOL_statement_no_new_scope = 543, /* statement_no_new_scope */ + YYSYMBOL_statement_scoped = 544, /* statement_scoped */ + YYSYMBOL_545_7 = 545, /* $@7 */ + YYSYMBOL_546_8 = 546, /* $@8 */ + YYSYMBOL_compound_statement_no_new_scope = 547, /* compound_statement_no_new_scope */ + YYSYMBOL_statement_list = 548, /* statement_list */ + YYSYMBOL_expression_statement = 549, /* expression_statement */ + YYSYMBOL_selection_statement = 550, /* selection_statement */ + YYSYMBOL_selection_statement_nonattributed = 551, /* selection_statement_nonattributed */ + YYSYMBOL_selection_rest_statement = 552, /* selection_rest_statement */ + YYSYMBOL_condition = 553, /* condition */ + YYSYMBOL_switch_statement = 554, /* switch_statement */ + YYSYMBOL_switch_statement_nonattributed = 555, /* switch_statement_nonattributed */ + YYSYMBOL_556_9 = 556, /* $@9 */ + YYSYMBOL_switch_statement_list = 557, /* switch_statement_list */ + YYSYMBOL_case_label = 558, /* case_label */ + YYSYMBOL_iteration_statement = 559, /* iteration_statement */ + YYSYMBOL_iteration_statement_nonattributed = 560, /* iteration_statement_nonattributed */ + YYSYMBOL_561_10 = 561, /* $@10 */ + YYSYMBOL_562_11 = 562, /* $@11 */ + YYSYMBOL_563_12 = 563, /* $@12 */ + YYSYMBOL_for_init_statement = 564, /* for_init_statement */ + YYSYMBOL_conditionopt = 565, /* conditionopt */ + YYSYMBOL_for_rest_statement = 566, /* for_rest_statement */ + YYSYMBOL_jump_statement = 567, /* jump_statement */ + YYSYMBOL_translation_unit = 568, /* translation_unit */ + YYSYMBOL_external_declaration = 569, /* external_declaration */ + YYSYMBOL_function_definition = 570, /* function_definition */ + YYSYMBOL_571_13 = 571, /* $@13 */ + YYSYMBOL_attribute = 572, /* attribute */ + YYSYMBOL_attribute_list = 573, /* attribute_list */ + YYSYMBOL_single_attribute = 574, /* single_attribute */ + YYSYMBOL_spirv_requirements_list = 575, /* spirv_requirements_list */ + YYSYMBOL_spirv_requirements_parameter = 576, /* spirv_requirements_parameter */ + YYSYMBOL_spirv_extension_list = 577, /* spirv_extension_list */ + YYSYMBOL_spirv_capability_list = 578, /* spirv_capability_list */ + YYSYMBOL_spirv_execution_mode_qualifier = 579, /* spirv_execution_mode_qualifier */ + YYSYMBOL_spirv_execution_mode_parameter_list = 580, /* spirv_execution_mode_parameter_list */ + YYSYMBOL_spirv_execution_mode_parameter = 581, /* spirv_execution_mode_parameter */ + YYSYMBOL_spirv_execution_mode_id_parameter_list = 582, /* spirv_execution_mode_id_parameter_list */ + YYSYMBOL_spirv_storage_class_qualifier = 583, /* spirv_storage_class_qualifier */ + YYSYMBOL_spirv_decorate_qualifier = 584, /* spirv_decorate_qualifier */ + YYSYMBOL_spirv_decorate_parameter_list = 585, /* spirv_decorate_parameter_list */ + YYSYMBOL_spirv_decorate_parameter = 586, /* spirv_decorate_parameter */ + YYSYMBOL_spirv_decorate_id_parameter_list = 587, /* spirv_decorate_id_parameter_list */ + YYSYMBOL_spirv_decorate_id_parameter = 588, /* spirv_decorate_id_parameter */ + YYSYMBOL_spirv_decorate_string_parameter_list = 589, /* spirv_decorate_string_parameter_list */ + YYSYMBOL_spirv_type_specifier = 590, /* spirv_type_specifier */ + YYSYMBOL_spirv_type_parameter_list = 591, /* spirv_type_parameter_list */ + YYSYMBOL_spirv_type_parameter = 592, /* spirv_type_parameter */ + YYSYMBOL_spirv_instruction_qualifier = 593, /* spirv_instruction_qualifier */ + YYSYMBOL_spirv_instruction_qualifier_list = 594, /* spirv_instruction_qualifier_list */ + YYSYMBOL_spirv_instruction_qualifier_id = 595 /* spirv_instruction_qualifier_id */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -734,7 +738,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; extern int yylex(YYSTYPE*, TParseContext&); -#line 738 "MachineIndependent/glslang_tab.cpp" +#line 742 "MachineIndependent/glslang_tab.cpp" #ifdef short @@ -1038,21 +1042,21 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 447 +#define YYFINAL 451 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 12562 +#define YYLAST 12669 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 460 +#define YYNTOKENS 464 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 132 /* YYNRULES -- Number of rules. */ -#define YYNRULES 693 +#define YYNRULES 697 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 939 +#define YYNSTATES 943 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 714 +#define YYMAXUTOK 718 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM @@ -1137,83 +1141,83 @@ static const yytype_int16 yytranslate[] = 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459 + 455, 456, 457, 458, 459, 460, 461, 462, 463 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 393, 393, 399, 402, 407, 410, 413, 417, 421, - 424, 428, 432, 436, 440, 444, 448, 454, 462, 465, - 468, 471, 474, 479, 487, 494, 501, 507, 511, 518, - 521, 527, 534, 544, 552, 557, 585, 594, 600, 604, - 608, 628, 629, 630, 631, 637, 638, 643, 648, 657, - 658, 663, 671, 672, 678, 687, 688, 693, 698, 703, - 711, 712, 721, 733, 734, 743, 744, 753, 754, 763, - 764, 772, 773, 781, 782, 790, 791, 791, 809, 810, - 826, 830, 834, 838, 843, 847, 851, 855, 859, 863, - 867, 874, 877, 888, 895, 901, 908, 914, 919, 926, - 930, 934, 938, 943, 948, 957, 957, 968, 972, 979, - 983, 989, 995, 1005, 1008, 1015, 1023, 1043, 1066, 1081, - 1106, 1117, 1127, 1137, 1147, 1156, 1159, 1163, 1167, 1172, - 1180, 1187, 1192, 1197, 1202, 1211, 1221, 1248, 1257, 1264, - 1272, 1279, 1286, 1294, 1302, 1312, 1322, 1329, 1340, 1346, - 1349, 1356, 1360, 1364, 1373, 1383, 1386, 1397, 1400, 1403, - 1407, 1411, 1416, 1420, 1423, 1428, 1432, 1437, 1446, 1450, - 1455, 1461, 1467, 1474, 1479, 1487, 1493, 1505, 1519, 1525, - 1530, 1538, 1546, 1554, 1562, 1570, 1578, 1586, 1594, 1602, - 1609, 1616, 1620, 1625, 1630, 1635, 1640, 1645, 1650, 1654, - 1658, 1662, 1666, 1672, 1678, 1690, 1697, 1700, 1709, 1714, - 1724, 1729, 1737, 1741, 1751, 1754, 1760, 1766, 1773, 1783, - 1787, 1791, 1795, 1800, 1804, 1809, 1814, 1819, 1824, 1829, - 1834, 1839, 1844, 1849, 1855, 1861, 1867, 1872, 1877, 1882, - 1887, 1892, 1897, 1902, 1907, 1912, 1917, 1922, 1928, 1935, - 1940, 1945, 1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, - 1990, 1998, 2006, 2014, 2020, 2026, 2032, 2038, 2044, 2050, + 0, 394, 394, 400, 403, 408, 411, 414, 418, 422, + 425, 429, 433, 437, 441, 445, 449, 455, 463, 466, + 469, 472, 475, 480, 488, 495, 502, 508, 512, 519, + 522, 528, 535, 545, 553, 558, 586, 595, 601, 605, + 609, 629, 630, 631, 632, 638, 639, 644, 649, 658, + 659, 664, 672, 673, 679, 688, 689, 694, 699, 704, + 712, 713, 722, 734, 735, 744, 745, 754, 755, 764, + 765, 773, 774, 782, 783, 791, 792, 792, 810, 811, + 827, 831, 835, 839, 844, 848, 852, 856, 860, 864, + 868, 875, 878, 889, 896, 902, 909, 915, 920, 927, + 931, 935, 939, 944, 949, 958, 958, 969, 973, 980, + 984, 990, 996, 1006, 1009, 1016, 1024, 1044, 1067, 1082, + 1107, 1118, 1128, 1138, 1148, 1157, 1160, 1164, 1168, 1173, + 1181, 1188, 1193, 1198, 1203, 1212, 1222, 1249, 1258, 1265, + 1273, 1280, 1287, 1295, 1303, 1313, 1323, 1330, 1341, 1347, + 1350, 1357, 1361, 1365, 1374, 1384, 1387, 1398, 1401, 1404, + 1408, 1412, 1417, 1421, 1424, 1429, 1433, 1438, 1447, 1451, + 1456, 1462, 1468, 1475, 1480, 1485, 1493, 1499, 1511, 1525, + 1531, 1536, 1544, 1552, 1560, 1568, 1576, 1584, 1592, 1600, + 1608, 1615, 1622, 1626, 1631, 1636, 1641, 1646, 1651, 1656, + 1660, 1664, 1668, 1672, 1678, 1684, 1696, 1703, 1706, 1715, + 1720, 1730, 1735, 1743, 1747, 1757, 1760, 1766, 1772, 1779, + 1789, 1793, 1797, 1801, 1806, 1810, 1815, 1820, 1825, 1830, + 1835, 1840, 1845, 1850, 1855, 1861, 1867, 1873, 1878, 1883, + 1888, 1893, 1898, 1903, 1908, 1913, 1918, 1923, 1928, 1934, + 1941, 1946, 1951, 1956, 1961, 1966, 1971, 1976, 1981, 1986, + 1991, 1996, 2004, 2012, 2020, 2026, 2032, 2038, 2044, 2050, 2056, 2062, 2068, 2074, 2080, 2086, 2092, 2098, 2104, 2110, 2116, 2122, 2128, 2134, 2140, 2146, 2152, 2158, 2164, 2170, - 2176, 2182, 2188, 2194, 2200, 2206, 2212, 2220, 2228, 2236, - 2244, 2252, 2260, 2268, 2276, 2284, 2292, 2300, 2308, 2314, + 2176, 2182, 2188, 2194, 2200, 2206, 2212, 2218, 2226, 2234, + 2242, 2250, 2258, 2266, 2274, 2282, 2290, 2298, 2306, 2314, 2320, 2326, 2332, 2338, 2344, 2350, 2356, 2362, 2368, 2374, 2380, 2386, 2392, 2398, 2404, 2410, 2416, 2422, 2428, 2434, 2440, 2446, 2452, 2458, 2464, 2470, 2476, 2482, 2488, 2494, - 2500, 2506, 2512, 2518, 2524, 2528, 2532, 2536, 2541, 2547, - 2552, 2557, 2562, 2567, 2572, 2577, 2583, 2588, 2593, 2598, - 2603, 2608, 2614, 2620, 2626, 2632, 2638, 2644, 2650, 2656, - 2662, 2668, 2674, 2680, 2686, 2692, 2697, 2702, 2707, 2712, - 2717, 2722, 2728, 2733, 2738, 2743, 2748, 2753, 2758, 2763, - 2769, 2774, 2779, 2784, 2789, 2794, 2799, 2804, 2809, 2814, - 2819, 2824, 2829, 2834, 2839, 2845, 2850, 2855, 2861, 2867, - 2872, 2877, 2882, 2888, 2893, 2898, 2903, 2909, 2914, 2919, - 2924, 2930, 2935, 2940, 2945, 2951, 2957, 2963, 2969, 2974, - 2980, 2986, 2992, 2997, 3002, 3007, 3012, 3017, 3023, 3028, - 3033, 3038, 3044, 3049, 3054, 3059, 3065, 3070, 3075, 3080, - 3086, 3091, 3096, 3101, 3107, 3112, 3117, 3122, 3128, 3133, - 3138, 3143, 3149, 3154, 3159, 3164, 3170, 3175, 3180, 3185, - 3191, 3196, 3201, 3206, 3212, 3217, 3222, 3227, 3233, 3238, - 3243, 3248, 3254, 3259, 3264, 3269, 3275, 3280, 3285, 3290, - 3296, 3301, 3306, 3311, 3317, 3322, 3327, 3332, 3337, 3342, - 3347, 3352, 3357, 3362, 3367, 3372, 3377, 3382, 3387, 3392, - 3397, 3402, 3407, 3412, 3417, 3422, 3427, 3432, 3437, 3443, - 3449, 3455, 3461, 3468, 3475, 3481, 3487, 3493, 3499, 3505, - 3511, 3517, 3521, 3526, 3531, 3547, 3552, 3557, 3565, 3565, - 3576, 3576, 3586, 3589, 3602, 3624, 3651, 3655, 3661, 3666, - 3677, 3681, 3687, 3693, 3704, 3707, 3714, 3718, 3719, 3725, - 3726, 3727, 3728, 3729, 3730, 3731, 3733, 3739, 3748, 3749, - 3753, 3749, 3765, 3766, 3770, 3770, 3777, 3777, 3791, 3794, - 3802, 3810, 3821, 3822, 3826, 3830, 3838, 3845, 3849, 3857, - 3861, 3874, 3878, 3886, 3886, 3906, 3909, 3915, 3927, 3939, - 3943, 3951, 3951, 3966, 3966, 3984, 3984, 4005, 4008, 4014, - 4017, 4023, 4027, 4034, 4039, 4044, 4051, 4054, 4058, 4063, - 4067, 4077, 4081, 4090, 4093, 4097, 4106, 4106, 4148, 4153, - 4156, 4161, 4164, 4171, 4174, 4179, 4182, 4187, 4190, 4195, - 4198, 4203, 4207, 4212, 4216, 4221, 4225, 4232, 4235, 4240, - 4243, 4246, 4249, 4252, 4257, 4266, 4277, 4282, 4290, 4294, - 4299, 4303, 4308, 4312, 4317, 4321, 4328, 4331, 4336, 4339, - 4342, 4345, 4350, 4353, 4358, 4364, 4367, 4370, 4373, 4378, - 4382, 4387, 4391, 4396, 4400, 4407, 4410, 4415, 4420, 4423, - 4429, 4432, 4437, 4440 + 2500, 2506, 2512, 2518, 2524, 2530, 2534, 2538, 2542, 2547, + 2553, 2558, 2563, 2568, 2573, 2578, 2583, 2589, 2594, 2599, + 2604, 2609, 2614, 2620, 2626, 2632, 2638, 2644, 2650, 2656, + 2662, 2668, 2674, 2680, 2686, 2692, 2698, 2703, 2708, 2713, + 2718, 2723, 2728, 2734, 2739, 2744, 2749, 2754, 2759, 2764, + 2769, 2775, 2780, 2785, 2790, 2795, 2800, 2805, 2810, 2815, + 2820, 2825, 2830, 2835, 2840, 2845, 2851, 2856, 2861, 2867, + 2873, 2878, 2883, 2888, 2894, 2899, 2904, 2909, 2915, 2920, + 2925, 2930, 2936, 2941, 2946, 2951, 2957, 2963, 2969, 2975, + 2980, 2986, 2992, 2998, 3003, 3008, 3013, 3018, 3023, 3029, + 3034, 3039, 3044, 3050, 3055, 3060, 3065, 3071, 3076, 3081, + 3086, 3092, 3097, 3102, 3107, 3113, 3118, 3123, 3128, 3134, + 3139, 3144, 3149, 3155, 3160, 3165, 3170, 3176, 3181, 3186, + 3191, 3197, 3202, 3207, 3212, 3218, 3223, 3228, 3233, 3239, + 3244, 3249, 3254, 3260, 3265, 3270, 3275, 3281, 3286, 3291, + 3296, 3302, 3307, 3312, 3317, 3323, 3328, 3333, 3338, 3343, + 3348, 3353, 3358, 3363, 3368, 3373, 3378, 3383, 3388, 3393, + 3398, 3403, 3408, 3413, 3418, 3423, 3428, 3433, 3438, 3443, + 3449, 3455, 3461, 3467, 3473, 3479, 3485, 3492, 3499, 3505, + 3511, 3517, 3523, 3529, 3535, 3541, 3545, 3550, 3555, 3571, + 3576, 3581, 3589, 3589, 3600, 3600, 3610, 3613, 3626, 3648, + 3675, 3679, 3685, 3690, 3701, 3705, 3711, 3717, 3728, 3731, + 3738, 3742, 3743, 3749, 3750, 3751, 3752, 3753, 3754, 3755, + 3757, 3763, 3772, 3773, 3777, 3773, 3789, 3790, 3794, 3794, + 3801, 3801, 3815, 3818, 3826, 3834, 3845, 3846, 3850, 3854, + 3862, 3869, 3873, 3881, 3885, 3898, 3902, 3910, 3910, 3930, + 3933, 3939, 3951, 3963, 3967, 3975, 3975, 3990, 3990, 4008, + 4008, 4029, 4032, 4038, 4041, 4047, 4051, 4058, 4063, 4068, + 4075, 4078, 4082, 4087, 4091, 4101, 4105, 4114, 4117, 4121, + 4130, 4130, 4172, 4177, 4180, 4185, 4188, 4195, 4198, 4203, + 4206, 4211, 4214, 4219, 4222, 4227, 4231, 4236, 4240, 4245, + 4249, 4256, 4259, 4264, 4267, 4270, 4273, 4276, 4281, 4290, + 4301, 4306, 4314, 4318, 4323, 4327, 4332, 4336, 4341, 4345, + 4352, 4355, 4360, 4363, 4366, 4369, 4374, 4377, 4382, 4388, + 4391, 4394, 4397, 4402, 4406, 4411, 4415, 4420, 4424, 4431, + 4434, 4439, 4444, 4447, 4453, 4456, 4461, 4464 }; #endif @@ -1303,33 +1307,34 @@ static const char *const yytname[] = "F16SUBPASSINPUTMS", "SPIRV_INSTRUCTION", "SPIRV_EXECUTION_MODE", "SPIRV_EXECUTION_MODE_ID", "SPIRV_DECORATE", "SPIRV_DECORATE_ID", "SPIRV_DECORATE_STRING", "SPIRV_TYPE", "SPIRV_STORAGE_CLASS", - "SPIRV_BY_REFERENCE", "SPIRV_LITERAL", "LEFT_OP", "RIGHT_OP", "INC_OP", - "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", - "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", - "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", - "SUB_ASSIGN", "STRING_LITERAL", "LEFT_PAREN", "RIGHT_PAREN", - "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", - "COMMA", "COLON", "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", - "STAR", "SLASH", "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", - "CARET", "AMPERSAND", "QUESTION", "INVARIANT", "HIGH_PRECISION", - "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "PACKED", "RESOURCE", - "SUPERP", "FLOATCONSTANT", "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", + "SPIRV_BY_REFERENCE", "SPIRV_LITERAL", "ATTACHMENTEXT", "IATTACHMENTEXT", + "UATTACHMENTEXT", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", + "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", + "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", + "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "STRING_LITERAL", + "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET", "RIGHT_BRACKET", + "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON", "EQUAL", + "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH", "PERCENT", + "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", "AMPERSAND", + "QUESTION", "INVARIANT", "HIGH_PRECISION", "MEDIUM_PRECISION", + "LOW_PRECISION", "PRECISION", "PACKED", "RESOURCE", "SUPERP", + "FLOATCONSTANT", "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", "IDENTIFIER", "TYPE_NAME", "CENTROID", "IN", "OUT", "INOUT", "STRUCT", "VOID", "WHILE", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "TERMINATE_INVOCATION", "TERMINATE_RAY", "IGNORE_INTERSECTION", "UNIFORM", "SHARED", "BUFFER", - "FLAT", "SMOOTH", "LAYOUT", "DOUBLECONSTANT", "INT16CONSTANT", - "UINT16CONSTANT", "FLOAT16CONSTANT", "INT32CONSTANT", "UINT32CONSTANT", - "INT64CONSTANT", "UINT64CONSTANT", "SUBROUTINE", "DEMOTE", "PAYLOADNV", - "PAYLOADINNV", "HITATTRNV", "CALLDATANV", "CALLDATAINNV", "PAYLOADEXT", - "PAYLOADINEXT", "HITATTREXT", "CALLDATAEXT", "CALLDATAINEXT", "PATCH", - "SAMPLE", "NONUNIFORM", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", - "WRITEONLY", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT", - "WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE", - "SHADERCALLCOHERENT", "NOPERSPECTIVE", "EXPLICITINTERPAMD", - "PERVERTEXEXT", "PERVERTEXNV", "PERPRIMITIVENV", "PERVIEWNV", - "PERTASKNV", "PERPRIMITIVEEXT", "TASKPAYLOADWORKGROUPEXT", "PRECISE", - "$accept", "variable_identifier", "primary_expression", + "TILEIMAGEEXT", "FLAT", "SMOOTH", "LAYOUT", "DOUBLECONSTANT", + "INT16CONSTANT", "UINT16CONSTANT", "FLOAT16CONSTANT", "INT32CONSTANT", + "UINT32CONSTANT", "INT64CONSTANT", "UINT64CONSTANT", "SUBROUTINE", + "DEMOTE", "PAYLOADNV", "PAYLOADINNV", "HITATTRNV", "CALLDATANV", + "CALLDATAINNV", "PAYLOADEXT", "PAYLOADINEXT", "HITATTREXT", + "CALLDATAEXT", "CALLDATAINEXT", "PATCH", "SAMPLE", "NONUNIFORM", + "COHERENT", "VOLATILE", "RESTRICT", "READONLY", "WRITEONLY", + "DEVICECOHERENT", "QUEUEFAMILYCOHERENT", "WORKGROUPCOHERENT", + "SUBGROUPCOHERENT", "NONPRIVATE", "SHADERCALLCOHERENT", "NOPERSPECTIVE", + "EXPLICITINTERPAMD", "PERVERTEXEXT", "PERVERTEXNV", "PERPRIMITIVENV", + "PERVIEWNV", "PERTASKNV", "PERPRIMITIVEEXT", "TASKPAYLOADWORKGROUPEXT", + "PRECISE", "$accept", "variable_identifier", "primary_expression", "postfix_expression", "integer_expression", "function_call", "function_call_or_method", "function_call_generic", "function_call_header_no_parameters", @@ -1438,16 +1443,17 @@ static const yytype_int16 yytoknum[] = 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714 + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718 }; #endif -#define YYPACT_NINF (-867) +#define YYPACT_NINF (-833) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-575) +#define YYTABLE_NINF (-579) #define yytable_value_is_error(Yyn) \ 0 @@ -1456,100 +1462,101 @@ static const yytype_int16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 4598, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -289, -262, -241, - -203, -191, -181, -98, -73, -867, -867, -178, -867, -867, - -867, -867, -867, -60, -867, -867, -867, -867, -867, -312, - -867, -867, -867, -867, -867, -867, -62, -28, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -330, -314, -225, -109, 7797, -260, -867, - -207, -867, -867, -867, -867, 5512, -867, -867, -867, -867, - -173, -867, -867, 942, -867, -867, 7797, -30, -867, -867, - -867, 5969, -52, -222, -162, -148, -124, -123, -52, -122, - -48, 12168, -867, -14, -332, -45, -867, -313, -867, -12, - -7, 7797, -867, -867, -867, 7797, -39, -38, -867, -299, - -867, -259, -867, -867, 10863, -2, -867, -867, -867, 1, - -35, 7797, -867, -6, -4, -1, -867, -302, -867, -261, - 3, 4, 6, 7, -249, 8, 11, 12, 15, 16, - 17, -229, 19, 18, 10, -171, -867, -3, 7797, -867, - 21, -867, -226, -867, -867, -221, 9123, -867, -271, 1399, - -867, -867, -867, -867, -867, -2, -300, -867, 9558, -266, - -867, -33, -867, -233, 10863, 10863, -867, 10863, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -246, -867, -867, - -867, 20, -218, 11298, 26, -867, 10863, -867, -867, -319, - 25, -7, 31, -867, -316, -52, -867, -27, -867, -320, - 30, -118, 10863, -117, -867, -138, -116, -143, -112, 34, - -102, -52, -867, 11733, -867, -101, 10863, 5, -48, -867, - 7797, -20, 6426, -867, 7797, 10863, -867, -332, -867, 22, - -867, -867, -47, -41, -37, -298, -22, 24, 27, 29, - 48, 47, -305, 35, 9993, -867, 32, -867, -867, 40, - 37, 53, -867, 42, 50, 57, 10428, 68, 10863, 49, - 62, 65, 66, 67, -227, -867, -867, -176, -867, -314, - 78, 79, -867, -867, -867, -867, -867, 1856, -867, -867, - -867, -867, -867, -867, -867, -867, -867, 5055, 25, 9558, - -265, 8253, -867, -867, 9558, 7797, -867, 46, -867, -867, - -867, -216, -867, -867, 10863, 51, -867, -867, 10863, 82, - -867, -867, -867, 10863, -867, -867, -867, -306, -867, -867, - -213, 76, -867, -867, -867, -867, -867, -867, -202, -867, - -201, -867, -867, -199, 81, -867, -867, -867, -867, -194, - -867, -179, -867, -867, -867, -867, -867, -174, -867, 83, - -867, -155, 84, -154, 76, -867, -153, -867, 85, 91, - -867, -867, -20, -2, -129, -867, -867, -867, 6883, -867, - -867, -867, 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, - 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, 10863, - 10863, -867, -867, -867, 92, -867, 2313, -867, -867, -867, - 2313, -867, 10863, -867, -867, -128, 10863, -31, -867, -867, - -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, 10863, 10863, -867, -867, -867, -867, - -867, -867, -867, 9558, -867, -867, -215, -867, 7340, -867, - -867, 93, 87, -867, -867, -867, -867, -867, -131, -130, - -867, -304, -867, -320, -867, -320, -867, 10863, 10863, -867, - -138, -867, -138, -867, -143, -143, -867, 98, 34, -867, - 11733, -867, 10863, -867, -867, -74, 25, -20, -867, -867, - -867, -867, -867, -47, -47, -41, -41, -37, -37, -37, - -37, -298, -298, -22, 24, 27, 29, 48, 47, 10863, - -867, 2313, 4141, 54, 3684, -152, -867, -151, -867, -867, - -867, -867, -867, 8688, -867, -867, -867, 100, -867, 69, - -867, -144, -867, -142, -867, -141, -867, -140, -867, -139, - -137, -867, -867, -867, -29, 99, 87, 70, 102, 105, - -867, -867, 4141, 103, -867, -867, -867, -867, -867, -867, - -867, -867, -867, -867, -867, 10863, -867, 101, 2770, 10863, - -867, 104, 107, 63, 108, 3227, -867, 109, -867, 9558, - -867, -867, -867, -132, 10863, 2770, 103, -867, -867, 2313, - -867, 106, 87, -867, -867, 2313, 112, -867, -867 + 4634, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -322, -303, -269, + -258, -250, -241, -204, -105, -833, -833, -833, -833, -833, + -219, -833, -833, -833, -833, -833, -57, -833, -833, -833, + -833, -833, -320, -833, -833, -833, -833, -833, -833, -833, + -80, -63, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -325, -182, -130, + -109, 7861, -222, -833, -71, -833, -833, -833, -833, 5556, + -833, -833, -833, -833, -141, -833, -833, 946, -833, -833, + 7861, -85, -833, -833, -833, 6017, -54, -279, -155, -133, + -129, -125, -54, -124, -51, 12272, -833, -25, -341, -49, + -833, -310, -833, -15, -12, 7861, -833, -833, -833, 7861, + -42, -41, -833, -265, -833, -311, -833, -833, 10955, -9, + -833, -833, -833, -5, -39, 7861, -833, -10, -11, -6, + -833, -267, -833, -256, -4, -3, -1, 1, -221, 3, + 5, 6, 8, 10, 11, -217, 13, 12, 20, -309, + -833, -7, 7861, -833, -2, -833, -195, -833, -833, -188, + 9199, -833, -280, 1407, -833, -833, -833, -833, -833, -9, + -294, -833, 9638, -263, -833, -27, -833, -169, 10955, 10955, + -833, 10955, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -253, -833, -833, -833, 21, -185, 11394, 25, -833, + 10955, -833, -833, -318, 19, -12, 26, -833, -326, -54, + -833, -8, -833, -329, 27, -123, 10955, -119, -833, -146, + -112, -160, -107, 28, -102, -54, -833, 11833, -833, -75, + 10955, 29, -51, -833, 7861, 14, 6478, -833, 7861, 10955, + -833, -341, -833, 15, -833, -833, -40, -79, -170, -295, + -120, 17, 22, 24, 44, 23, -313, 30, 10077, -833, + 35, -833, -833, 31, 37, 39, -833, 34, 41, 42, + 10516, 64, 10955, 58, 57, 59, 63, 65, -220, -833, + -833, -111, -833, -182, 76, 77, -833, -833, -833, -833, + -833, 1868, -833, -833, -833, -833, -833, -833, -833, -833, + -833, 5095, 19, 9638, -254, 8321, -833, -833, 9638, 7861, + -833, 43, -833, -833, -833, -184, -833, -833, 10955, 47, + -833, -833, 10955, 79, -833, -833, -833, 10955, -833, -833, + -833, -319, -833, -833, -183, 69, -833, -833, -833, -833, + -833, -833, -181, -833, -176, -833, -833, -174, 80, -833, + -833, -833, -833, -172, -833, -171, -833, -833, -833, -833, + -833, -164, -833, 81, -833, -162, 82, -161, 69, -833, + -159, -833, 83, 85, -833, -833, 14, -9, -48, -833, + -833, -833, 6939, -833, -833, -833, 10955, 10955, 10955, 10955, + 10955, 10955, 10955, 10955, 10955, 10955, 10955, 10955, 10955, 10955, + 10955, 10955, 10955, 10955, 10955, -833, -833, -833, 32, -833, + 2329, -833, -833, -833, 2329, -833, 10955, -833, -833, -47, + 10955, -92, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, 10955, 10955, + -833, -833, -833, -833, -833, -833, -833, 9638, -833, -833, + -122, -833, 7400, -833, -833, 88, 86, -833, -833, -833, + -833, -833, -202, -137, -833, -316, -833, -329, -833, -329, + -833, 10955, 10955, -833, -146, -833, -146, -833, -160, -160, + -833, 93, 28, -833, 11833, -833, 10955, -833, -833, -43, + 19, 14, -833, -833, -833, -833, -833, -40, -40, -79, + -79, -170, -170, -170, -170, -295, -295, -120, 17, 22, + 24, 44, 23, 10955, -833, 2329, 4173, 52, 3712, -152, + -833, -151, -833, -833, -833, -833, -833, 8760, -833, -833, + -833, 98, -833, 66, -833, -150, -833, -149, -833, -148, + -833, -147, -833, -140, -139, -833, -833, -833, -36, 95, + 86, 62, 101, 103, -833, -833, 4173, 100, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, 10955, + -833, 96, 2790, 10955, -833, 97, 105, 60, 107, 3251, + -833, 109, -833, 9638, -833, -833, -833, -138, 10955, 2790, + 100, -833, -833, 2329, -833, 99, 86, -833, -833, 2329, + 110, -833, -833 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1557,138 +1564,139 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 0, 168, 223, 221, 222, 220, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 224, 225, 226, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 349, 350, 351, 352, 353, 354, 355, 375, 376, 377, - 378, 379, 380, 381, 390, 403, 404, 391, 392, 394, - 393, 395, 396, 397, 398, 399, 400, 401, 402, 176, - 177, 249, 250, 248, 251, 258, 259, 256, 257, 254, - 255, 252, 253, 281, 282, 283, 293, 294, 295, 278, - 279, 280, 290, 291, 292, 275, 276, 277, 287, 288, - 289, 272, 273, 274, 284, 285, 286, 260, 261, 262, - 296, 297, 298, 263, 264, 265, 308, 309, 310, 266, - 267, 268, 320, 321, 322, 269, 270, 271, 332, 333, - 334, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 335, 336, - 337, 338, 339, 340, 341, 342, 343, 347, 344, 345, - 346, 528, 529, 530, 532, 181, 359, 360, 383, 386, - 348, 357, 358, 374, 356, 405, 406, 409, 410, 411, - 413, 414, 415, 417, 418, 419, 421, 422, 518, 519, - 382, 384, 385, 361, 362, 363, 407, 364, 368, 369, - 372, 412, 416, 420, 365, 366, 370, 371, 408, 367, - 373, 452, 454, 455, 456, 458, 459, 460, 462, 463, - 464, 466, 467, 468, 470, 471, 472, 474, 475, 476, - 478, 479, 480, 482, 483, 484, 486, 487, 488, 490, - 491, 492, 494, 495, 453, 457, 461, 465, 469, 477, - 481, 485, 473, 489, 493, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 387, 388, 389, - 423, 432, 434, 428, 433, 435, 436, 438, 439, 440, - 442, 443, 444, 446, 447, 448, 450, 451, 424, 425, - 426, 437, 427, 429, 430, 431, 441, 445, 449, 520, - 521, 524, 525, 526, 527, 522, 523, 0, 0, 0, - 0, 0, 0, 0, 0, 166, 167, 0, 625, 137, - 535, 536, 537, 0, 534, 172, 170, 171, 169, 0, - 219, 173, 174, 175, 139, 138, 0, 202, 183, 185, - 180, 187, 189, 184, 186, 182, 188, 190, 178, 179, - 205, 191, 198, 199, 200, 201, 192, 193, 194, 195, - 196, 197, 140, 141, 143, 142, 144, 146, 147, 145, - 204, 154, 624, 0, 626, 0, 114, 113, 0, 125, - 130, 161, 160, 158, 162, 0, 155, 157, 163, 135, - 215, 159, 533, 0, 621, 623, 0, 0, 164, 165, - 531, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 540, 0, 0, 0, 99, 0, 94, 0, - 109, 0, 121, 115, 123, 0, 124, 0, 97, 131, - 102, 0, 156, 136, 0, 208, 214, 1, 622, 0, - 0, 0, 96, 0, 0, 0, 633, 0, 690, 0, + 0, 168, 224, 222, 223, 221, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 225, 226, 227, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 350, 351, 352, 353, 354, 355, 356, 376, 377, 378, + 379, 380, 381, 382, 391, 404, 405, 392, 393, 395, + 394, 396, 397, 398, 399, 400, 401, 402, 403, 177, + 178, 250, 251, 249, 252, 259, 260, 257, 258, 255, + 256, 253, 254, 282, 283, 284, 294, 295, 296, 279, + 280, 281, 291, 292, 293, 276, 277, 278, 288, 289, + 290, 273, 274, 275, 285, 286, 287, 261, 262, 263, + 297, 298, 299, 264, 265, 266, 309, 310, 311, 267, + 268, 269, 321, 322, 323, 270, 271, 272, 333, 334, + 335, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 348, 345, 346, + 347, 532, 533, 534, 536, 182, 360, 361, 384, 387, + 349, 358, 359, 375, 357, 406, 407, 410, 411, 412, + 414, 415, 416, 418, 419, 420, 422, 423, 519, 520, + 383, 385, 386, 362, 363, 364, 408, 365, 369, 370, + 373, 413, 417, 421, 366, 367, 371, 372, 409, 368, + 374, 453, 455, 456, 457, 459, 460, 461, 463, 464, + 465, 467, 468, 469, 471, 472, 473, 475, 476, 477, + 479, 480, 481, 483, 484, 485, 487, 488, 489, 491, + 492, 493, 495, 496, 454, 458, 462, 466, 470, 478, + 482, 486, 474, 490, 494, 497, 498, 499, 500, 501, + 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 388, 389, 390, + 424, 433, 435, 429, 434, 436, 437, 439, 440, 441, + 443, 444, 445, 447, 448, 449, 451, 452, 425, 426, + 427, 438, 428, 430, 431, 432, 442, 446, 450, 524, + 525, 528, 529, 530, 531, 526, 527, 0, 0, 0, + 0, 0, 0, 0, 0, 166, 167, 521, 522, 523, + 0, 629, 137, 539, 540, 541, 0, 538, 172, 170, + 171, 169, 0, 220, 173, 175, 176, 174, 139, 138, + 0, 203, 184, 186, 181, 188, 190, 185, 187, 183, + 189, 191, 179, 180, 206, 192, 199, 200, 201, 202, + 193, 194, 195, 196, 197, 198, 140, 141, 143, 142, + 144, 146, 147, 145, 205, 154, 628, 0, 630, 0, + 114, 113, 0, 125, 130, 161, 160, 158, 162, 0, + 155, 157, 163, 135, 216, 159, 537, 0, 625, 627, + 0, 0, 164, 165, 535, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 544, 0, 0, 0, + 99, 0, 94, 0, 109, 0, 121, 115, 123, 0, + 124, 0, 97, 131, 102, 0, 156, 136, 0, 209, + 215, 1, 626, 0, 0, 0, 96, 0, 0, 0, + 637, 0, 694, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 635, 0, + 633, 0, 0, 542, 151, 153, 0, 149, 207, 0, + 0, 100, 0, 0, 631, 110, 116, 120, 122, 118, + 126, 117, 0, 132, 105, 0, 103, 0, 0, 0, + 9, 0, 43, 42, 44, 41, 5, 6, 7, 8, + 2, 16, 14, 15, 17, 10, 11, 12, 13, 3, + 18, 37, 20, 25, 26, 0, 0, 30, 0, 218, + 0, 36, 34, 0, 210, 111, 0, 95, 0, 0, + 692, 0, 645, 0, 0, 0, 0, 0, 662, 0, + 0, 0, 0, 0, 0, 0, 687, 0, 660, 0, + 0, 0, 0, 98, 0, 0, 0, 546, 0, 0, + 148, 0, 204, 0, 211, 45, 49, 52, 55, 60, + 63, 65, 67, 69, 71, 73, 75, 0, 0, 101, + 573, 582, 586, 0, 0, 0, 607, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 45, 78, + 91, 0, 560, 0, 163, 135, 563, 584, 562, 570, + 561, 0, 564, 565, 588, 566, 595, 567, 568, 603, + 569, 0, 119, 0, 127, 0, 554, 134, 0, 0, + 107, 0, 104, 38, 39, 0, 22, 23, 0, 0, + 28, 27, 0, 220, 31, 33, 40, 0, 217, 112, + 696, 0, 697, 638, 0, 0, 695, 657, 653, 654, + 655, 656, 0, 651, 0, 93, 658, 0, 0, 672, + 673, 674, 675, 0, 670, 0, 679, 680, 681, 682, + 678, 0, 676, 0, 683, 0, 0, 0, 2, 691, + 0, 689, 0, 0, 632, 634, 0, 552, 0, 550, + 545, 547, 0, 152, 150, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 631, 0, 629, 0, 0, 538, - 151, 153, 0, 149, 206, 0, 0, 100, 0, 0, - 627, 110, 116, 120, 122, 118, 126, 117, 0, 132, - 105, 0, 103, 0, 0, 0, 9, 0, 43, 42, - 44, 41, 5, 6, 7, 8, 2, 16, 14, 15, - 17, 10, 11, 12, 13, 3, 18, 37, 20, 25, - 26, 0, 0, 30, 0, 217, 0, 36, 34, 0, - 209, 111, 0, 95, 0, 0, 688, 0, 641, 0, - 0, 0, 0, 0, 658, 0, 0, 0, 0, 0, - 0, 0, 683, 0, 656, 0, 0, 0, 0, 98, - 0, 0, 0, 542, 0, 0, 148, 0, 203, 0, - 210, 45, 49, 52, 55, 60, 63, 65, 67, 69, - 71, 73, 75, 0, 0, 101, 569, 578, 582, 0, - 0, 0, 603, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 45, 78, 91, 0, 556, 0, - 163, 135, 559, 580, 558, 566, 557, 0, 560, 561, - 584, 562, 591, 563, 564, 599, 565, 0, 119, 0, - 127, 0, 550, 134, 0, 0, 107, 0, 104, 38, - 39, 0, 22, 23, 0, 0, 28, 27, 0, 219, - 31, 33, 40, 0, 216, 112, 692, 0, 693, 634, - 0, 0, 691, 653, 649, 650, 651, 652, 0, 647, - 0, 93, 654, 0, 0, 668, 669, 670, 671, 0, - 666, 0, 675, 676, 677, 678, 674, 0, 672, 0, - 679, 0, 0, 0, 2, 687, 0, 685, 0, 0, - 628, 630, 0, 548, 0, 546, 541, 543, 0, 152, - 150, 207, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 76, 211, 212, 0, 568, 0, 601, 614, 613, - 0, 605, 0, 617, 615, 0, 0, 0, 598, 618, - 619, 620, 567, 81, 82, 84, 83, 86, 87, 88, - 89, 90, 85, 80, 0, 0, 583, 579, 581, 585, - 592, 600, 129, 0, 553, 554, 0, 133, 0, 108, - 4, 0, 24, 21, 32, 218, 637, 639, 0, 0, - 689, 0, 643, 0, 642, 0, 645, 0, 0, 660, - 0, 659, 0, 662, 0, 0, 664, 0, 0, 684, - 0, 681, 0, 657, 632, 0, 549, 0, 544, 539, - 46, 47, 48, 51, 50, 53, 54, 58, 59, 56, - 57, 61, 62, 64, 66, 68, 70, 72, 74, 0, - 213, 570, 0, 0, 0, 0, 616, 0, 597, 79, - 92, 128, 551, 0, 106, 19, 635, 0, 636, 0, - 648, 0, 655, 0, 667, 0, 673, 0, 680, 0, - 0, 686, 545, 547, 0, 0, 589, 0, 0, 0, - 608, 607, 610, 576, 593, 552, 555, 638, 640, 644, - 646, 661, 663, 665, 682, 0, 571, 0, 0, 0, - 609, 0, 0, 588, 0, 0, 586, 0, 77, 0, - 573, 602, 572, 0, 611, 0, 576, 575, 577, 595, - 590, 0, 612, 606, 587, 596, 0, 604, 594 + 0, 0, 0, 0, 0, 76, 212, 213, 0, 572, + 0, 605, 618, 617, 0, 609, 0, 621, 619, 0, + 0, 0, 602, 622, 623, 624, 571, 81, 82, 84, + 83, 86, 87, 88, 89, 90, 85, 80, 0, 0, + 587, 583, 585, 589, 596, 604, 129, 0, 557, 558, + 0, 133, 0, 108, 4, 0, 24, 21, 32, 219, + 641, 643, 0, 0, 693, 0, 647, 0, 646, 0, + 649, 0, 0, 664, 0, 663, 0, 666, 0, 0, + 668, 0, 0, 688, 0, 685, 0, 661, 636, 0, + 553, 0, 548, 543, 46, 47, 48, 51, 50, 53, + 54, 58, 59, 56, 57, 61, 62, 64, 66, 68, + 70, 72, 74, 0, 214, 574, 0, 0, 0, 0, + 620, 0, 601, 79, 92, 128, 555, 0, 106, 19, + 639, 0, 640, 0, 652, 0, 659, 0, 671, 0, + 677, 0, 684, 0, 0, 690, 549, 551, 0, 0, + 593, 0, 0, 0, 612, 611, 614, 580, 597, 556, + 559, 642, 644, 648, 650, 665, 667, 669, 686, 0, + 575, 0, 0, 0, 613, 0, 0, 592, 0, 0, + 590, 0, 77, 0, 577, 606, 576, 0, 615, 0, + 580, 579, 581, 599, 594, 0, 616, 610, 591, 600, + 0, 608, 598 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -867, -538, -867, -867, -867, -867, -867, -867, -867, -867, - -867, -867, -428, -867, -392, -391, -474, -389, -264, -267, - -263, -268, -258, -257, -867, -482, -867, -495, -867, -502, - -534, 13, -867, -867, -867, 14, -385, -867, -867, 38, - 41, 44, -867, -867, -400, -867, -867, -867, -867, -100, - -867, -386, -368, -867, 9, -867, 0, -422, -867, -867, - -867, -867, 142, -867, -867, -867, -545, -550, -236, -347, - -629, -867, -372, -620, -866, -867, -430, -867, -867, -440, - -438, -867, -867, 61, -720, -363, -867, -136, -867, -406, - -867, -135, -867, -867, -867, -867, -134, -867, -867, -867, - -867, -867, -867, -867, -867, 90, -867, -867, 2, -867, - -72, -224, -384, -867, -867, -867, -311, -308, -309, -867, - -867, -315, -310, -307, -303, -301, -867, -297, -318, -867, - -390, -539 + -833, -546, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -434, -833, -395, -394, -489, -392, -271, -270, + -268, -266, -272, -264, -833, -484, -833, -497, -833, -500, + -535, 4, -833, -833, -833, 7, -393, -833, -833, 33, + 40, 38, -833, -833, -407, -833, -833, -833, -833, -103, + -833, -390, -376, -833, 9, -833, 0, -433, -833, -833, + -833, -833, 138, -833, -833, -833, -559, -554, -237, -350, + -612, -833, -375, -619, -832, -833, -432, -833, -833, -445, + -443, -833, -833, 55, -732, -373, -833, -145, -833, -406, + -833, -144, -833, -833, -833, -833, -143, -833, -833, -833, + -833, -833, -833, -833, -833, 87, -833, -833, 2, -833, + -77, -302, -408, -833, -833, -833, -317, -308, -312, -833, + -833, -315, -307, -314, -306, -305, -833, -321, -304, -833, + -396, -538 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 525, 526, 527, 791, 528, 529, 530, 531, 532, - 533, 534, 614, 536, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 615, 849, 616, 774, 617, - 705, 618, 383, 645, 503, 619, 385, 386, 387, 432, - 433, 434, 388, 389, 390, 391, 392, 393, 482, 483, - 394, 395, 396, 397, 537, 485, 538, 488, 445, 446, - 539, 400, 401, 402, 574, 478, 572, 573, 714, 715, - 643, 786, 622, 623, 624, 625, 626, 746, 885, 921, - 913, 914, 915, 922, 627, 628, 629, 630, 916, 888, - 631, 632, 917, 936, 633, 634, 635, 852, 750, 854, - 892, 911, 912, 636, 403, 404, 405, 429, 637, 475, - 476, 455, 456, 798, 799, 407, 678, 679, 683, 408, - 409, 689, 690, 697, 698, 701, 410, 706, 707, 411, - 457, 458 + -1, 529, 530, 531, 795, 532, 533, 534, 535, 536, + 537, 538, 618, 540, 586, 587, 588, 589, 590, 591, + 592, 593, 594, 595, 596, 619, 853, 620, 778, 621, + 709, 622, 387, 649, 507, 623, 389, 390, 391, 436, + 437, 438, 392, 393, 394, 395, 396, 397, 486, 487, + 398, 399, 400, 401, 541, 489, 542, 492, 449, 450, + 543, 404, 405, 406, 578, 482, 576, 577, 718, 719, + 647, 790, 626, 627, 628, 629, 630, 750, 889, 925, + 917, 918, 919, 926, 631, 632, 633, 634, 920, 892, + 635, 636, 921, 940, 637, 638, 639, 856, 754, 858, + 896, 915, 916, 640, 407, 408, 409, 433, 641, 479, + 480, 459, 460, 802, 803, 411, 682, 683, 687, 412, + 413, 693, 694, 701, 702, 705, 414, 710, 711, 415, + 461, 462 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1696,192 +1704,101 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 399, 435, 406, 642, 593, 651, 450, 778, 672, 398, - 782, 450, 785, 382, 384, 787, 535, 499, 682, 696, - 451, 449, 717, 540, 672, 451, 851, 442, 471, 718, - 673, 426, 709, 740, 666, 729, 730, 667, 660, 663, - 486, 719, 920, 422, 796, 435, 666, 428, 487, 928, - 546, 664, 497, 486, 486, 480, 547, 427, 581, 920, - 639, 498, 412, 674, 675, 676, 677, 442, 668, 741, - 681, 731, 732, 638, 640, 423, 649, 650, 797, 481, - 668, 681, 594, 442, 681, 652, 653, 594, 594, 413, - 595, 548, 570, 681, 644, 783, 500, 549, 437, 501, - 788, 438, 502, 554, 755, -35, 757, 654, 662, 555, - 414, 655, 744, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 562, 581, 647, 576, 430, 648, 563, - 853, 578, 577, 773, 657, 581, 790, 579, 581, 800, - 658, 862, 775, 863, 642, 547, 642, 581, 415, 642, - 802, 804, 792, 806, 861, 670, 803, 805, 809, 807, - 416, 669, 459, 794, 810, 460, 581, 669, 717, 669, - 417, 703, 669, 811, 669, 420, 669, 669, 813, 812, - 439, 669, 775, 567, 814, 776, 570, 568, 570, 461, - 463, 465, 467, 469, 470, 473, 444, 816, 819, 821, - 893, 894, 442, 817, 820, 822, 775, 775, 899, 935, - 900, 901, 902, 903, 803, 904, 807, 810, 814, 817, - 931, 822, 462, 866, 868, 460, 775, 867, 869, 827, - 775, 778, 828, 856, 896, 795, 464, 450, 717, 460, - 692, 693, 694, 695, 516, 685, 686, 687, 688, 431, - 855, 451, 449, 418, 857, 837, 838, 839, 840, 570, - 466, 468, 472, 460, 460, 460, 680, 684, 691, 460, - 460, 460, 699, 872, 682, 460, 696, 696, 419, 859, - 860, 672, 702, 708, 827, 460, 460, 882, 642, 424, - 930, 826, 727, 728, 830, 831, 832, 581, 581, 581, - 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, - 581, 581, 581, 733, 734, 778, 330, 331, 332, 722, - 723, 724, 725, 425, 726, 681, 681, 775, 858, 775, - 905, 452, 570, 833, 834, 454, 835, 836, 681, 474, - 681, 479, 484, 489, 841, 842, 327, 884, 495, 496, - 886, 486, 542, 541, 646, 543, 544, 545, 569, 710, - 671, 566, 551, 550, 552, 553, 556, 713, 642, 557, - 558, 564, 656, 559, 560, 561, 565, 661, 594, 581, - 581, 575, 497, 667, 700, 738, 739, 436, 745, 742, - 886, 747, 581, 751, 581, 443, 398, 735, 748, 736, - 737, 752, 570, 399, 398, 406, 399, 923, 758, 721, - 918, 399, 398, 406, 749, 398, 382, 384, 753, 756, - 398, 477, 932, 759, 642, 453, 760, 761, 762, -36, - -34, 436, 491, 789, -29, 436, 801, 823, 793, 808, - 398, 815, 818, 824, 398, 775, 850, 865, 878, 889, - 897, 443, 887, 898, 908, 906, 909, 907, -574, 925, - 398, 919, 926, 596, 929, 924, 451, 937, 938, 844, - 846, 843, 492, 493, 845, 421, 825, 720, 571, 494, - 883, 847, 890, 848, 927, 933, 910, 398, 934, 621, - 490, 891, 887, 448, 871, 870, 711, 875, 620, 873, - 874, 779, 780, 781, 881, 0, 451, 0, 877, 0, - 0, 876, 0, 0, 0, 0, 0, 879, 0, 0, - 0, 0, 0, 880, 0, 0, 0, 0, 0, 0, + 403, 439, 410, 454, 386, 646, 597, 388, 454, 402, + 503, 655, 782, 676, 539, 700, 544, 453, 855, 722, + 455, 686, 721, 446, 677, 455, 475, 670, 744, 676, + 671, 786, 416, 789, 800, 713, 791, 670, 426, 430, + 664, 733, 734, 667, 723, 439, 490, 504, 571, 484, + 505, 417, 572, 506, 491, 668, 585, 678, 679, 680, + 681, 672, 490, 446, 745, 431, 642, 644, 801, 643, + 427, 672, 685, 485, 653, 654, 598, 735, 736, 446, + 924, 656, 657, 685, 599, 418, 685, 932, 550, 501, + 792, 490, 574, 598, 551, 685, 419, 924, 502, 552, + 648, -35, 598, 658, 420, 553, 666, 659, 463, 787, + 759, 464, 761, 421, 748, 465, 467, 469, 471, 473, + 474, 477, 585, 767, 768, 769, 770, 771, 772, 773, + 774, 775, 776, 585, 558, 857, 585, 424, 566, 441, + 559, 673, 442, 777, 567, 585, 646, 673, 646, 673, + 422, 646, 673, 674, 673, 870, 673, 673, 796, 871, + 580, 673, 731, 732, 585, 798, 581, 582, 721, 707, + 661, 794, 804, 583, 806, 865, 662, 779, 551, 808, + 807, 810, 432, 813, 815, 809, 574, 811, 574, 814, + 816, 817, 651, 820, 823, 652, 825, 818, 446, 821, + 824, 939, 826, 897, 898, 903, 904, 905, 906, 779, + 779, 807, 811, 814, 818, 907, 908, 935, 737, 738, + 872, 821, 826, 779, 873, 434, 696, 697, 698, 699, + 520, 448, 466, 799, 454, 464, 782, 866, 721, 867, + 689, 690, 691, 692, 841, 842, 843, 844, 453, 423, + 779, 455, 435, 780, 468, 900, 859, 464, 470, 574, + 861, 464, 472, 476, 684, 464, 464, 464, 688, 779, + 862, 464, 700, 700, 428, 695, 876, 686, 464, 456, + 703, 863, 864, 464, 830, 706, 676, 729, 464, 730, + 646, 429, 834, 835, 836, 585, 585, 585, 585, 585, + 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, + 585, 934, 712, 831, 779, 464, 832, 860, 831, 443, + 782, 886, 333, 334, 335, 779, 909, 685, 685, 726, + 727, 728, 574, 483, 837, 838, 458, 839, 840, 478, + 685, 488, 685, 493, 330, 845, 846, 490, 499, 500, + 545, 546, 548, 888, 547, 549, 890, 573, 555, 554, + 556, 579, 557, 650, 560, 743, 561, 562, 568, 563, + 646, 564, 565, 569, 570, 598, 660, 585, 585, 665, + 501, 704, 675, 671, 742, 751, 714, 746, 755, 854, + 585, 440, 585, 739, 749, 756, 890, 740, 741, 447, + 402, 752, 574, 753, 717, 725, 757, 403, 402, 410, + 403, 386, 922, 927, 388, 403, 402, 410, 760, 402, + 762, 763, 457, 764, 402, 481, 646, 765, 936, 766, + -36, -34, 805, 793, -29, 440, 495, 797, 827, 440, + 828, 812, 819, 822, 402, 869, 882, 779, 402, 891, + 893, 901, 911, 902, 910, 447, 912, 913, -578, 923, + 929, 928, 930, 941, 402, 600, 455, 933, 847, 942, + 848, 851, 497, 849, 425, 496, 850, 498, 724, 829, + 852, 887, 575, 894, 937, 895, 931, 938, 494, 891, + 914, 402, 875, 625, 452, 715, 783, 784, 785, 874, + 877, 879, 624, 884, 0, 881, 455, 878, 0, 0, + 0, 0, 880, 0, 0, 0, 0, 883, 0, 0, + 0, 0, 885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 665, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 669, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 712, 0, 571, 0, 571, 0, 0, 0, 0, 398, - 0, 398, 0, 398, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 716, 0, 575, 0, 575, 0, + 0, 0, 0, 402, 0, 402, 0, 402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 621, 0, 0, - 0, 0, 0, 0, 0, 0, 620, 399, 0, 0, - 0, 0, 0, 0, 0, 571, 398, 0, 0, 0, - 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 625, 0, 0, 0, 0, 0, 0, 0, 0, + 624, 403, 0, 0, 0, 0, 0, 0, 0, 575, + 402, 0, 0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, - 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 621, 0, 0, 0, - 621, 0, 0, 0, 0, 620, 0, 0, 0, 620, + 0, 0, 575, 0, 0, 0, 0, 0, 0, 0, + 0, 402, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 625, 0, 0, 0, 625, 0, 0, 0, 0, 624, + 0, 0, 0, 624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, - 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, + 0, 0, 575, 0, 0, 0, 0, 0, 0, 0, + 0, 402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 621, 621, 0, 621, 0, 406, 0, 0, 0, - 620, 620, 0, 620, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 625, 625, 0, 625, 0, + 410, 0, 0, 0, 624, 624, 0, 624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 621, 0, 0, 0, 0, 0, 0, 0, - 0, 620, 0, 0, 0, 0, 0, 0, 621, 0, - 0, 0, 0, 0, 0, 621, 0, 620, 0, 0, - 0, 0, 0, 0, 620, 621, 0, 0, 0, 621, - 0, 0, 0, 0, 620, 621, 0, 0, 620, 0, - 0, 0, 447, 0, 620, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, - 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, - 332, 333, 0, 0, 0, 0, 0, 0, 0, 0, - 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 341, 342, 343, 344, 345, 346, 0, 0, - 0, 0, 0, 0, 0, 0, 347, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 0, 0, - 504, 505, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 506, - 507, 0, 327, 0, 596, 597, 0, 0, 0, 0, - 598, 508, 509, 510, 511, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 329, 330, 331, 332, 333, 0, - 0, 0, 512, 513, 514, 515, 516, 334, 335, 336, - 337, 338, 339, 340, 599, 600, 601, 602, 0, 603, - 604, 605, 606, 607, 608, 609, 610, 611, 612, 341, - 342, 343, 344, 345, 346, 517, 518, 519, 520, 521, - 522, 523, 524, 347, 613, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, 379, 380, 381, 1, + 0, 0, 0, 0, 0, 0, 625, 0, 0, 0, + 0, 0, 0, 0, 0, 624, 0, 0, 0, 0, + 0, 0, 625, 0, 0, 0, 0, 0, 0, 625, + 0, 624, 0, 0, 0, 0, 0, 0, 624, 625, + 0, 0, 0, 625, 0, 0, 0, 0, 624, 625, + 0, 0, 624, 0, 0, 0, 451, 0, 624, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -1914,111 +1831,20 @@ static const yytype_int16 yytable[] = 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 0, 0, 504, 505, 0, + 322, 323, 324, 325, 326, 327, 328, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 506, 507, 0, 327, - 0, 596, 777, 0, 0, 0, 0, 598, 508, 509, - 510, 511, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 329, 330, 331, 332, 333, 0, 0, 0, 512, - 513, 514, 515, 516, 334, 335, 336, 337, 338, 339, - 340, 599, 600, 601, 602, 0, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 341, 342, 343, 344, - 345, 346, 517, 518, 519, 520, 521, 522, 523, 524, - 347, 613, 348, 349, 350, 351, 352, 353, 354, 355, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 330, 0, 0, 0, 0, 0, 0, 0, + 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 332, 333, 334, 335, 336, 0, + 0, 0, 0, 0, 0, 0, 0, 337, 338, 339, + 340, 341, 342, 343, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 344, + 345, 346, 347, 348, 349, 350, 0, 0, 0, 0, + 0, 0, 0, 0, 351, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, 379, 380, 381, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 327, 0, 596, 0, - 0, 0, 0, 0, 598, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, - 331, 332, 333, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 335, 336, 337, 338, 339, 340, 599, 600, - 601, 602, 0, 603, 604, 605, 606, 607, 608, 609, - 610, 611, 612, 341, 342, 343, 344, 345, 346, 517, - 518, 519, 520, 521, 522, 523, 524, 347, 613, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 0, - 0, 504, 505, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 506, 507, 0, 327, 0, 489, 0, 0, 0, 0, - 0, 598, 508, 509, 510, 511, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 329, 330, 331, 332, 333, - 0, 0, 0, 512, 513, 514, 515, 516, 334, 335, - 336, 337, 338, 339, 340, 599, 600, 601, 602, 0, - 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, - 341, 342, 343, 344, 345, 346, 517, 518, 519, 520, - 521, 522, 523, 524, 347, 613, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, @@ -2051,112 +1877,21 @@ static const yytype_int16 yytable[] = 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 0, 0, 504, 505, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, + 0, 508, 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 506, 507, 0, - 327, 0, 0, 0, 0, 0, 0, 0, 598, 508, - 509, 510, 511, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 329, 330, 331, 332, 333, 0, 0, 0, - 512, 513, 514, 515, 516, 334, 335, 336, 337, 338, - 339, 340, 599, 600, 601, 602, 0, 603, 604, 605, - 606, 607, 608, 609, 610, 611, 612, 341, 342, 343, - 344, 345, 346, 517, 518, 519, 520, 521, 522, 523, - 524, 347, 613, 348, 349, 350, 351, 352, 353, 354, + 510, 511, 0, 330, 0, 600, 601, 0, 0, 0, + 0, 602, 512, 513, 514, 515, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 332, 333, 334, 335, 336, + 0, 0, 0, 516, 517, 518, 519, 520, 337, 338, + 339, 340, 341, 342, 343, 603, 604, 605, 606, 0, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 344, 345, 346, 347, 348, 349, 350, 521, 522, 523, + 524, 525, 526, 527, 528, 351, 617, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 0, 0, 504, 505, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 506, 507, 0, 327, 0, 0, - 0, 0, 0, 0, 0, 598, 508, 509, 510, 511, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, - 330, 331, 332, 333, 0, 0, 0, 512, 513, 514, - 515, 516, 334, 335, 336, 337, 338, 339, 340, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 341, 342, 343, 344, 345, 346, - 517, 518, 519, 520, 521, 522, 523, 524, 347, 0, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 0, 0, 0, 320, 321, 322, 323, 324, 325, 326, - 0, 0, 504, 505, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 506, 507, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 508, 509, 510, 511, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 329, 330, 331, 332, - 0, 0, 0, 0, 512, 513, 514, 515, 516, 334, - 335, 336, 337, 338, 339, 340, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 341, 342, 343, 344, 345, 346, 517, 518, 519, - 520, 521, 522, 523, 524, 347, 0, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, @@ -2188,112 +1923,21 @@ static const yytype_int16 yytable[] = 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 0, 0, 0, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 0, 0, 508, 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 327, 0, 0, 0, 0, 0, 0, 0, 328, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 329, 330, 331, 332, 333, 0, 0, - 0, 0, 0, 0, 0, 0, 334, 335, 336, 337, - 338, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 341, 342, - 343, 344, 345, 346, 0, 0, 0, 0, 0, 0, - 0, 0, 347, 0, 348, 349, 350, 351, 352, 353, + 0, 510, 511, 0, 330, 0, 600, 781, 0, 0, + 0, 0, 602, 512, 513, 514, 515, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, + 336, 0, 0, 0, 516, 517, 518, 519, 520, 337, + 338, 339, 340, 341, 342, 343, 603, 604, 605, 606, + 0, 607, 608, 609, 610, 611, 612, 613, 614, 615, + 616, 344, 345, 346, 347, 348, 349, 350, 521, 522, + 523, 524, 525, 526, 527, 528, 351, 617, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 0, 0, 0, 320, 321, 322, - 323, 324, 325, 326, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 329, 330, 331, 332, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 334, 335, 336, 337, 338, 339, 340, - 599, 0, 0, 602, 0, 603, 604, 0, 0, 607, - 0, 0, 0, 0, 0, 341, 342, 343, 344, 345, - 346, 0, 0, 0, 0, 0, 0, 0, 0, 347, - 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 380, 381, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 0, 0, 0, 320, 321, 322, 323, 324, 325, - 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 440, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 329, 330, 331, - 332, 0, 0, 0, 0, 0, 0, 0, 0, 441, - 334, 335, 336, 337, 338, 339, 340, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 341, 342, 343, 344, 345, 346, 0, 0, - 0, 0, 0, 0, 0, 0, 347, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 1, 2, 3, 4, 5, 6, 7, 8, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, @@ -2324,734 +1968,22 @@ static const yytype_int16 yytable[] = 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 0, 0, - 0, 320, 321, 322, 323, 324, 325, 326, 0, 0, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 0, 0, 508, 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 329, 330, 331, 332, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 334, 335, 336, - 337, 338, 339, 340, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, - 342, 343, 344, 345, 346, 0, 0, 0, 0, 0, - 0, 0, 0, 347, 0, 348, 349, 350, 351, 352, + 0, 0, 510, 511, 0, 330, 0, 600, 0, 0, + 0, 0, 0, 602, 512, 513, 514, 515, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 332, 333, 334, + 335, 336, 0, 0, 0, 516, 517, 518, 519, 520, + 337, 338, 339, 340, 341, 342, 343, 603, 604, 605, + 606, 0, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 344, 345, 346, 347, 348, 349, 350, 521, + 522, 523, 524, 525, 526, 527, 528, 351, 617, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, 379, 380, 381, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 0, 0, 0, 320, 321, - 322, 323, 324, 325, 326, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 716, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 329, 330, 331, 332, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 334, 335, 336, 337, 338, 339, - 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 341, 342, 343, 344, - 345, 346, 0, 0, 0, 0, 0, 0, 0, 0, - 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, 379, 380, 381, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 320, 321, 322, 323, 324, - 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 829, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 329, 330, - 331, 332, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 334, 335, 336, 337, 338, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 341, 342, 343, 344, 345, 346, 0, - 0, 0, 0, 0, 0, 0, 0, 347, 0, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 0, - 0, 0, 320, 321, 322, 323, 324, 325, 326, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 864, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 329, 330, 331, 332, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 334, 335, - 336, 337, 338, 339, 340, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 341, 342, 343, 344, 345, 346, 0, 0, 0, 0, - 0, 0, 0, 0, 347, 0, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 0, 0, 0, 320, - 321, 322, 323, 324, 325, 326, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 329, 330, 331, 332, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 334, 335, 336, 337, 338, - 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 341, 342, 343, - 344, 345, 346, 0, 0, 0, 0, 0, 0, 0, - 0, 347, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 0, 641, 784, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 0, 641, 895, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 580, 0, 0, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 0, 641, 0, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 743, 0, 0, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 754, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 340, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 516, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 504, - 505, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 506, 507, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 334, 0, 0, 0, - 0, 339, 659, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 517, 518, 519, 520, 521, 522, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, - 0, 0, 0, 0, 504, 505, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 506, 507, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 508, 509, 510, 511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, - 704, 334, 0, 0, 0, 0, 339, 340, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, - 518, 519, 520, 521, 522, 523, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, - 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, - 0, 0, 0, 323, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 334, 0, 0, 0, - 0, 339, 340 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 387, 0, 498, 486, 507, 406, 627, 547, 0, - 639, 411, 641, 0, 0, 644, 444, 439, 552, 557, - 406, 406, 572, 445, 563, 411, 746, 395, 418, 574, - 350, 361, 566, 338, 350, 333, 334, 353, 533, 358, - 353, 575, 908, 355, 350, 431, 350, 361, 361, 915, - 352, 370, 351, 353, 353, 387, 358, 387, 486, 925, - 360, 360, 351, 383, 384, 385, 386, 435, 384, 374, - 552, 369, 370, 495, 496, 387, 504, 505, 384, 411, - 384, 563, 353, 451, 566, 331, 332, 353, 353, 351, - 361, 352, 478, 575, 360, 360, 355, 358, 358, 358, - 645, 361, 361, 352, 606, 351, 608, 353, 536, 358, - 351, 357, 594, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 352, 552, 358, 352, 352, 361, 358, - 750, 352, 358, 360, 352, 563, 352, 358, 566, 352, - 358, 356, 358, 358, 639, 358, 641, 575, 351, 644, - 352, 352, 654, 352, 783, 545, 358, 358, 352, 358, - 351, 545, 384, 658, 358, 387, 594, 551, 718, 553, - 351, 561, 556, 352, 558, 353, 560, 561, 352, 358, - 387, 565, 358, 354, 358, 361, 572, 358, 574, 413, - 414, 415, 416, 417, 418, 419, 369, 352, 352, 352, - 352, 352, 570, 358, 358, 358, 358, 358, 352, 929, - 352, 352, 352, 352, 358, 352, 358, 358, 358, 358, - 352, 358, 384, 354, 354, 387, 358, 358, 358, 358, - 358, 851, 361, 361, 863, 663, 384, 637, 788, 387, - 383, 384, 385, 386, 387, 383, 384, 385, 386, 358, - 752, 637, 637, 351, 756, 729, 730, 731, 732, 645, - 384, 384, 384, 387, 387, 387, 384, 384, 384, 387, - 387, 387, 384, 807, 808, 387, 814, 815, 351, 774, - 775, 820, 384, 384, 358, 387, 387, 361, 783, 351, - 919, 713, 329, 330, 722, 723, 724, 725, 726, 727, - 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, - 738, 739, 740, 335, 336, 935, 376, 377, 378, 366, - 367, 368, 363, 351, 365, 807, 808, 358, 359, 358, - 359, 361, 718, 725, 726, 387, 727, 728, 820, 387, - 822, 355, 387, 355, 733, 734, 353, 849, 387, 387, - 852, 353, 387, 352, 387, 361, 360, 358, 361, 354, - 387, 351, 358, 360, 358, 358, 358, 387, 863, 358, - 358, 352, 352, 358, 358, 358, 358, 351, 353, 807, - 808, 360, 351, 353, 350, 337, 339, 387, 356, 354, - 892, 351, 820, 351, 822, 395, 387, 373, 361, 372, - 371, 351, 788, 403, 395, 403, 406, 909, 359, 387, - 905, 411, 403, 411, 361, 406, 403, 403, 361, 351, - 411, 421, 924, 361, 919, 411, 361, 361, 361, 351, - 351, 431, 430, 387, 352, 435, 360, 352, 387, 358, - 431, 358, 358, 352, 435, 358, 354, 354, 350, 395, - 350, 451, 852, 384, 352, 356, 351, 387, 355, 352, - 451, 360, 399, 355, 355, 361, 852, 361, 356, 736, - 738, 735, 431, 435, 737, 333, 712, 577, 478, 435, - 827, 739, 854, 740, 914, 925, 892, 478, 926, 489, - 429, 854, 892, 403, 805, 803, 568, 812, 489, 808, - 810, 637, 637, 637, 822, -1, 892, -1, 815, -1, - -1, 814, -1, -1, -1, -1, -1, 818, -1, -1, - -1, -1, -1, 820, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 541, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 570, -1, 572, -1, 574, -1, -1, -1, -1, 570, - -1, 572, -1, 574, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 627, -1, -1, - -1, -1, -1, -1, -1, -1, 627, 637, -1, -1, - -1, -1, -1, -1, -1, 645, 637, -1, -1, -1, - -1, -1, -1, -1, 645, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 718, -1, - -1, -1, -1, -1, -1, -1, -1, 718, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 746, -1, -1, -1, - 750, -1, -1, -1, -1, 746, -1, -1, -1, 750, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 788, -1, - -1, -1, -1, -1, -1, -1, -1, 788, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 851, 852, -1, 854, -1, 854, -1, -1, -1, - 851, 852, -1, 854, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 892, -1, -1, -1, -1, -1, -1, -1, - -1, 892, -1, -1, -1, -1, -1, -1, 908, -1, - -1, -1, -1, -1, -1, 915, -1, 908, -1, -1, - -1, -1, -1, -1, 915, 925, -1, -1, -1, 929, - -1, -1, -1, -1, 925, 935, -1, -1, 929, -1, - -1, -1, 0, -1, 935, 3, 4, 5, 6, 7, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, @@ -3084,111 +2016,20 @@ static const yytype_int16 yycheck[] = 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 353, -1, -1, -1, -1, - -1, -1, -1, 361, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, - 378, 379, -1, -1, -1, -1, -1, -1, -1, -1, - 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 410, 411, 412, 413, 414, 415, -1, -1, - -1, -1, -1, -1, -1, -1, 424, -1, 426, 427, - 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, - 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, -1, -1, - 331, 332, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 350, - 351, -1, 353, -1, 355, 356, -1, -1, -1, -1, - 361, 362, 363, 364, 365, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 375, 376, 377, 378, 379, -1, - -1, -1, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, -1, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, -1, -1, 331, 332, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 350, 351, -1, 353, - -1, 355, 356, -1, -1, -1, -1, 361, 362, 363, - 364, 365, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 375, 376, 377, 378, 379, -1, -1, -1, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 458, 459, 3, 4, 5, 6, + 328, 329, 0, 0, 508, 509, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 510, 511, 0, 330, 0, 493, 0, + 0, 0, 0, 0, 602, 512, 513, 514, 515, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 332, 333, + 334, 335, 336, 0, 0, 0, 516, 517, 518, 519, + 520, 337, 338, 339, 340, 341, 342, 343, 603, 604, + 605, 606, 0, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 344, 345, 346, 347, 348, 349, 350, + 521, 522, 523, 524, 525, 526, 527, 528, 351, 617, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, @@ -3221,111 +2062,20 @@ static const yytype_int16 yycheck[] = 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, -1, -1, 331, 332, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, 353, -1, 355, -1, - -1, -1, -1, -1, 361, 362, 363, 364, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, - 377, 378, 379, -1, -1, -1, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, - 457, 458, 459, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, 328, -1, - -1, 331, 332, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 350, 351, -1, 353, -1, 355, -1, -1, -1, -1, - -1, 361, 362, 363, 364, 365, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 375, 376, 377, 378, 379, - -1, -1, -1, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 397, 398, -1, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, -1, -1, 331, 332, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 350, 351, -1, - 353, -1, -1, -1, -1, -1, -1, -1, 361, 362, - 363, 364, 365, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 375, 376, 377, 378, 379, -1, -1, -1, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, -1, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 3, 4, 5, + 327, 328, 329, 0, 0, 508, 509, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 510, 511, 0, 330, 0, 0, + 0, 0, 0, 0, 0, 602, 512, 513, 514, 515, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, + 333, 334, 335, 336, 0, 0, 0, 516, 517, 518, + 519, 520, 337, 338, 339, 340, 341, 342, 343, 603, + 604, 605, 606, 0, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 344, 345, 346, 347, 348, 349, + 350, 521, 522, 523, 524, 525, 526, 527, 528, 351, + 617, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, @@ -3358,111 +2108,20 @@ static const yytype_int16 yycheck[] = 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, -1, -1, 331, 332, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 350, 351, -1, 353, -1, -1, - -1, -1, -1, -1, -1, 361, 362, 363, 364, 365, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, - 376, 377, 378, 379, -1, -1, -1, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 410, 411, 412, 413, 414, 415, - 416, 417, 418, 419, 420, 421, 422, 423, 424, -1, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, - 456, 457, 458, 459, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - -1, -1, -1, 322, 323, 324, 325, 326, 327, 328, - -1, -1, 331, 332, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 350, 351, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 362, 363, 364, 365, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 375, 376, 377, 378, - -1, -1, -1, -1, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, -1, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 353, -1, -1, -1, -1, -1, -1, -1, 361, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 375, 376, 377, 378, 379, -1, -1, - -1, -1, -1, -1, -1, -1, 388, 389, 390, 391, - 392, 393, 394, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 410, 411, - 412, 413, 414, 415, -1, -1, -1, -1, -1, -1, - -1, -1, 424, -1, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 3, 4, + 326, 327, 328, 329, 0, 0, 508, 509, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 510, 511, 0, 330, 0, + 0, 0, 0, 0, 0, 0, 602, 512, 513, 514, + 515, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 332, 333, 334, 335, 336, 0, 0, 0, 516, 517, + 518, 519, 520, 337, 338, 339, 340, 341, 342, 343, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 344, 345, 346, 347, 348, + 349, 350, 521, 522, 523, 524, 525, 526, 527, 528, + 351, 0, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, @@ -3494,112 +2153,21 @@ static const yytype_int16 yycheck[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, -1, -1, -1, 322, 323, 324, - 325, 326, 327, 328, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 375, 376, 377, 378, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 388, 389, 390, 391, 392, 393, 394, - 395, -1, -1, 398, -1, 400, 401, -1, -1, 404, - -1, -1, -1, -1, -1, 410, 411, 412, 413, 414, - 415, -1, -1, -1, -1, -1, -1, -1, -1, 424, - -1, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, -1, -1, -1, 322, 323, 324, 325, 326, 327, - 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 361, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 375, 376, 377, - 378, -1, -1, -1, -1, -1, -1, -1, -1, 387, - 388, 389, 390, 391, 392, 393, 394, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 410, 411, 412, 413, 414, 415, -1, -1, - -1, -1, -1, -1, -1, -1, 424, -1, 426, 427, - 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, - 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, - -1, 322, 323, 324, 325, 326, 327, 328, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 353, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 375, 376, 377, 378, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 388, 389, 390, - 391, 392, 393, 394, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, - 411, 412, 413, 414, 415, -1, -1, -1, -1, -1, - -1, -1, -1, 424, -1, 426, 427, 428, 429, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 3, + 315, 316, 0, 0, 0, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 0, 0, 508, 509, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 510, 511, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 512, 513, + 514, 515, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 332, 333, 334, 335, 0, 0, 0, 0, 516, + 517, 518, 519, 520, 337, 338, 339, 340, 341, 342, + 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 344, 345, 346, 347, + 348, 349, 350, 521, 522, 523, 524, 525, 526, 527, + 528, 351, 0, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, @@ -3631,21 +2199,1200 @@ static const yytype_int16 yycheck[] = 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, -1, -1, -1, 322, 323, - 324, 325, 326, 327, 328, -1, -1, -1, -1, -1, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 330, 0, 0, 0, 0, 0, 0, 0, 331, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 332, 333, 334, 335, 336, 0, 0, 0, + 0, 0, 0, 0, 0, 337, 338, 339, 340, 341, + 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 344, 345, 346, + 347, 348, 349, 350, 0, 0, 0, 0, 0, 0, + 0, 0, 351, 0, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 0, 0, 0, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 332, 333, 334, 335, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 337, 338, 339, 340, + 341, 342, 343, 603, 0, 0, 606, 0, 607, 608, + 0, 0, 611, 0, 0, 0, 0, 0, 344, 345, + 346, 347, 348, 349, 350, 0, 0, 0, 0, 0, + 0, 0, 0, 351, 0, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 0, 0, 0, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 332, 333, 334, 335, 0, 0, + 0, 0, 0, 0, 0, 0, 445, 337, 338, 339, + 340, 341, 342, 343, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 344, + 345, 346, 347, 348, 349, 350, 0, 0, 0, 0, + 0, 0, 0, 0, 351, 0, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 0, 0, 0, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 330, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 332, 333, 334, 335, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 337, 338, + 339, 340, 341, 342, 343, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 344, 345, 346, 347, 348, 349, 350, 0, 0, 0, + 0, 0, 0, 0, 0, 351, 0, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 720, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 337, + 338, 339, 340, 341, 342, 343, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 344, 345, 346, 347, 348, 349, 350, 0, 0, + 0, 0, 0, 0, 0, 0, 351, 0, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 0, 0, + 0, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 833, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 332, 333, 334, + 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 337, 338, 339, 340, 341, 342, 343, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 344, 345, 346, 347, 348, 349, 350, 0, + 0, 0, 0, 0, 0, 0, 0, 351, 0, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 0, + 0, 0, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 868, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 332, 333, + 334, 335, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 337, 338, 339, 340, 341, 342, 343, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 344, 345, 346, 347, 348, 349, 350, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 0, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 0, 0, 0, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, + 333, 334, 335, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 337, 338, 339, 340, 341, 342, 343, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 344, 345, 346, 347, 348, 349, + 350, 0, 0, 0, 0, 0, 0, 0, 0, 351, + 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 0, 0, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 0, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 0, 0, 0, 0, 0, 0, 323, 0, 0, 0, + 327, 328, 329, 0, 0, 508, 509, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 510, 511, 0, 0, 0, 645, + 788, 0, 0, 0, 0, 0, 512, 513, 514, 515, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 516, 517, 518, + 519, 520, 337, 0, 0, 0, 0, 342, 343, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 521, 522, 523, 524, 525, 526, 527, 528, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 364, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 0, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 0, + 0, 0, 0, 0, 0, 323, 0, 0, 0, 327, + 328, 329, 0, 0, 508, 509, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 510, 511, 0, 0, 0, 645, 899, + 0, 0, 0, 0, 0, 512, 513, 514, 515, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 516, 517, 518, 519, + 520, 337, 0, 0, 0, 0, 342, 343, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 521, 522, 523, 524, 525, 526, 527, 528, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 364, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 0, 0, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 0, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 0, 0, + 0, 0, 0, 0, 323, 0, 0, 0, 327, 328, + 329, 0, 0, 508, 509, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 510, 511, 0, 0, 584, 0, 0, 0, + 0, 0, 0, 0, 512, 513, 514, 515, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 516, 517, 518, 519, 520, + 337, 0, 0, 0, 0, 342, 343, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 521, + 522, 523, 524, 525, 526, 527, 528, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 364, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 0, 0, 0, + 0, 0, 0, 323, 0, 0, 0, 327, 328, 329, + 0, 0, 508, 509, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 510, 511, 0, 0, 0, 645, 0, 0, 0, + 0, 0, 0, 512, 513, 514, 515, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 516, 517, 518, 519, 520, 337, + 0, 0, 0, 0, 342, 343, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 521, 522, + 523, 524, 525, 526, 527, 528, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 364, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 0, 0, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 0, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 0, 0, 0, 0, + 0, 0, 323, 0, 0, 0, 327, 328, 329, 0, + 0, 508, 509, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 510, 511, 0, 0, 747, 0, 0, 0, 0, 0, + 0, 0, 512, 513, 514, 515, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 516, 517, 518, 519, 520, 337, 0, + 0, 0, 0, 342, 343, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 521, 522, 523, + 524, 525, 526, 527, 528, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 364, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 0, 0, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 0, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 0, 0, 0, 0, 0, + 0, 323, 0, 0, 0, 327, 328, 329, 0, 0, + 508, 509, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 510, + 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 758, 512, 513, 514, 515, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 516, 517, 518, 519, 520, 337, 0, 0, + 0, 0, 342, 343, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 521, 522, 523, 524, + 525, 526, 527, 528, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 364, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 0, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 0, 0, 0, 0, 0, 0, + 323, 0, 0, 0, 327, 328, 329, 0, 0, 508, + 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 510, 511, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 512, 513, 514, 515, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 516, 517, 518, 519, 520, 337, 0, 0, 0, + 0, 342, 343, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 521, 522, 523, 524, 525, + 526, 527, 528, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 364, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 0, 0, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 0, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 0, 0, 0, 0, 0, 0, 323, + 0, 0, 0, 327, 328, 329, 0, 0, 508, 509, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 510, 511, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 512, + 513, 514, 515, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 516, 517, 518, 519, 520, 337, 0, 0, 0, 0, + 342, 663, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 521, 522, 523, 524, 525, 526, + 527, 528, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 364, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 0, 0, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 0, 0, 0, 0, 0, 0, 323, 0, + 0, 0, 327, 328, 329, 0, 0, 508, 509, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 510, 511, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 512, 513, + 514, 515, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 516, + 517, 518, 519, 708, 337, 0, 0, 0, 0, 342, + 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 521, 522, 523, 524, 525, 526, 527, + 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 364, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 0, 0, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 0, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 0, 0, 0, 0, 0, 0, 323, 0, 0, + 0, 327, 328, 329, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 337, 0, 0, 0, 0, 342, 343 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 391, 0, 410, 0, 502, 490, 0, 415, 0, + 443, 511, 631, 551, 448, 561, 449, 410, 750, 578, + 410, 556, 576, 399, 353, 415, 422, 353, 341, 567, + 356, 643, 354, 645, 353, 570, 648, 353, 358, 364, + 537, 336, 337, 361, 579, 435, 356, 358, 357, 390, + 361, 354, 361, 364, 364, 373, 490, 386, 387, 388, + 389, 387, 356, 439, 377, 390, 499, 500, 387, 363, + 390, 387, 556, 414, 508, 509, 356, 372, 373, 455, + 912, 334, 335, 567, 364, 354, 570, 919, 355, 354, + 649, 356, 482, 356, 361, 579, 354, 929, 363, 355, + 363, 354, 356, 356, 354, 361, 540, 360, 387, 363, + 610, 390, 612, 354, 598, 417, 418, 419, 420, 421, + 422, 423, 556, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 567, 355, 754, 570, 356, 355, 361, + 361, 549, 364, 363, 361, 579, 643, 555, 645, 557, + 354, 648, 560, 549, 562, 357, 564, 565, 658, 361, + 355, 569, 332, 333, 598, 662, 361, 355, 722, 565, + 355, 355, 355, 361, 355, 787, 361, 361, 361, 355, + 361, 355, 364, 355, 355, 361, 576, 361, 578, 361, + 361, 355, 361, 355, 355, 364, 355, 361, 574, 361, + 361, 933, 361, 355, 355, 355, 355, 355, 355, 361, + 361, 361, 361, 361, 361, 355, 355, 355, 338, 339, + 357, 361, 361, 361, 361, 355, 386, 387, 388, 389, + 390, 372, 387, 667, 641, 390, 855, 359, 792, 361, + 386, 387, 388, 389, 733, 734, 735, 736, 641, 354, + 361, 641, 361, 364, 387, 867, 756, 390, 387, 649, + 760, 390, 387, 387, 387, 390, 390, 390, 387, 361, + 362, 390, 818, 819, 354, 387, 811, 812, 390, 364, + 387, 778, 779, 390, 717, 387, 824, 366, 390, 368, + 787, 354, 726, 727, 728, 729, 730, 731, 732, 733, + 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, + 744, 923, 387, 361, 361, 390, 364, 364, 361, 390, + 939, 364, 379, 380, 381, 361, 362, 811, 812, 369, + 370, 371, 722, 358, 729, 730, 390, 731, 732, 390, + 824, 390, 826, 358, 356, 737, 738, 356, 390, 390, + 355, 390, 363, 853, 364, 361, 856, 364, 361, 363, + 361, 363, 361, 390, 361, 342, 361, 361, 355, 361, + 867, 361, 361, 361, 354, 356, 355, 811, 812, 354, + 354, 353, 390, 356, 340, 354, 357, 357, 354, 357, + 824, 391, 826, 376, 359, 354, 896, 375, 374, 399, + 391, 364, 792, 364, 390, 390, 364, 407, 399, 407, + 410, 407, 909, 913, 407, 415, 407, 415, 354, 410, + 362, 364, 415, 364, 415, 425, 923, 364, 928, 364, + 354, 354, 363, 390, 355, 435, 434, 390, 355, 439, + 355, 361, 361, 361, 435, 357, 353, 361, 439, 856, + 398, 353, 390, 387, 359, 455, 355, 354, 358, 363, + 355, 364, 402, 364, 455, 358, 856, 358, 739, 359, + 740, 743, 439, 741, 336, 435, 742, 439, 581, 716, + 744, 831, 482, 858, 929, 858, 918, 930, 433, 896, + 896, 482, 809, 493, 407, 572, 641, 641, 641, 807, + 812, 816, 493, 824, -1, 819, 896, 814, -1, -1, + -1, -1, 818, -1, -1, -1, -1, 822, -1, -1, + -1, -1, 826, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 545, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 574, -1, 576, -1, 578, -1, + -1, -1, -1, 574, -1, 576, -1, 578, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 631, -1, -1, -1, -1, -1, -1, -1, -1, + 631, 641, -1, -1, -1, -1, -1, -1, -1, 649, + 641, -1, -1, -1, -1, -1, -1, -1, 649, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 722, -1, -1, -1, -1, -1, -1, -1, + -1, 722, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 750, -1, -1, -1, 754, -1, -1, -1, -1, 750, + -1, -1, -1, 754, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 792, -1, -1, -1, -1, -1, -1, -1, + -1, 792, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 855, 856, -1, 858, -1, + 858, -1, -1, -1, 855, 856, -1, 858, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 896, -1, -1, -1, + -1, -1, -1, -1, -1, 896, -1, -1, -1, -1, + -1, -1, 912, -1, -1, -1, -1, -1, -1, 919, + -1, 912, -1, -1, -1, -1, -1, -1, 919, 929, + -1, -1, -1, 933, -1, -1, -1, -1, 929, 939, + -1, -1, 933, -1, -1, -1, 0, -1, 939, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 356, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 375, 376, 377, 378, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 388, 389, 390, 391, 392, 393, - 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 410, 411, 412, 413, - 414, 415, -1, -1, -1, -1, -1, -1, -1, -1, - 424, -1, 426, 427, 428, 429, 430, 431, 432, 433, + 364, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 378, 379, 380, 381, 382, -1, + -1, -1, -1, -1, -1, -1, -1, 391, 392, 393, + 394, 395, 396, 397, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 413, + 414, 415, 416, 417, 418, 419, -1, -1, -1, -1, + -1, -1, -1, -1, 428, -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 458, 459, 3, 4, 5, 6, + 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, -1, + -1, 334, 335, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 353, 354, -1, 356, -1, 358, 359, -1, -1, -1, + -1, 364, 365, 366, 367, 368, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 378, 379, 380, 381, 382, + -1, -1, -1, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, -1, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + -1, -1, 334, 335, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 353, 354, -1, 356, -1, 358, 359, -1, -1, + -1, -1, 364, 365, 366, 367, 368, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 378, 379, 380, 381, + 382, -1, -1, -1, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + -1, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, -1, -1, 334, 335, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 353, 354, -1, 356, -1, 358, -1, -1, + -1, -1, -1, 364, 365, 366, 367, 368, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 378, 379, 380, + 381, 382, -1, -1, -1, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, -1, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, -1, -1, 334, 335, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 353, 354, -1, 356, -1, 358, -1, + -1, -1, -1, -1, 364, 365, 366, 367, 368, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 378, 379, + 380, 381, 382, -1, -1, -1, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, -1, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, + 460, 461, 462, 463, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, -1, -1, 334, 335, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 353, 354, -1, 356, -1, -1, + -1, -1, -1, -1, -1, 364, 365, 366, 367, 368, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, + 379, 380, 381, 382, -1, -1, -1, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, -1, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, -1, -1, 334, 335, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 353, 354, -1, 356, -1, + -1, -1, -1, -1, -1, -1, 364, 365, 366, 367, + 368, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 378, 379, 380, 381, 382, -1, -1, -1, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, -1, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, @@ -3678,65 +3425,158 @@ static const yytype_int16 yycheck[] = 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, 322, 323, 324, 325, 326, - 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, + 327, 328, 329, 330, 331, -1, -1, 334, 335, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 356, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 375, 376, - 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 388, 389, 390, 391, 392, 393, 394, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 410, 411, 412, 413, 414, 415, -1, - -1, -1, -1, -1, -1, -1, -1, 424, -1, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + -1, -1, -1, -1, -1, -1, 353, 354, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 365, 366, + 367, 368, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 378, 379, 380, 381, -1, -1, -1, -1, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, - 457, 458, 459, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, - -1, -1, 322, 323, 324, 325, 326, 327, 328, -1, + 457, 458, 459, 460, 461, 462, 463, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 356, -1, -1, -1, + 356, -1, -1, -1, -1, -1, -1, -1, 364, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 375, 376, 377, 378, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 388, 389, - 390, 391, 392, 393, 394, -1, -1, -1, -1, -1, + -1, -1, 378, 379, 380, 381, 382, -1, -1, -1, + -1, -1, -1, -1, -1, 391, 392, 393, 394, 395, + 396, 397, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 413, 414, 415, + 416, 417, 418, 419, -1, -1, -1, -1, -1, -1, + -1, -1, 428, -1, 430, 431, 432, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, -1, -1, -1, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 410, 411, 412, 413, 414, 415, -1, -1, -1, -1, - -1, -1, -1, -1, 424, -1, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 378, 379, 380, 381, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 391, 392, 393, 394, + 395, 396, 397, 398, -1, -1, 401, -1, 403, 404, + -1, -1, 407, -1, -1, -1, -1, -1, 413, 414, + 415, 416, 417, 418, 419, -1, -1, -1, -1, -1, + -1, -1, -1, 428, -1, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, -1, -1, -1, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 364, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 378, 379, 380, 381, -1, -1, + -1, -1, -1, -1, -1, -1, 390, 391, 392, 393, + 394, 395, 396, 397, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 413, + 414, 415, 416, 417, 418, 419, -1, -1, -1, -1, + -1, -1, -1, -1, 428, -1, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, + 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -3769,20 +3609,556 @@ static const yytype_int16 yycheck[] = 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, 322, - 323, 324, 325, 326, 327, 328, -1, -1, -1, -1, + 323, 324, 325, 326, 327, 328, 329, 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 378, 379, 380, 381, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 391, 392, + 393, 394, 395, 396, 397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 375, 376, 377, 378, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 388, 389, 390, 391, 392, - 393, 394, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 410, 411, 412, - 413, 414, 415, -1, -1, -1, -1, -1, -1, -1, - -1, 424, -1, 426, 427, 428, 429, 430, 431, 432, + 413, 414, 415, 416, 417, 418, 419, -1, -1, -1, + -1, -1, -1, -1, -1, 428, -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 4, 5, 6, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 359, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 378, 379, 380, 381, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 391, + 392, 393, 394, 395, 396, 397, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 413, 414, 415, 416, 417, 418, 419, -1, -1, + -1, -1, -1, -1, -1, -1, 428, -1, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, + -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 359, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 378, 379, 380, + 381, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 391, 392, 393, 394, 395, 396, 397, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 413, 414, 415, 416, 417, 418, 419, -1, + -1, -1, -1, -1, -1, -1, -1, 428, -1, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, + -1, -1, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 378, 379, + 380, 381, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 391, 392, 393, 394, 395, 396, 397, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 413, 414, 415, 416, 417, 418, 419, + -1, -1, -1, -1, -1, -1, -1, -1, 428, -1, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, + 460, 461, 462, 463, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + -1, -1, -1, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, + 379, 380, 381, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 391, 392, 393, 394, 395, 396, 397, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 413, 414, 415, 416, 417, 418, + 419, -1, -1, -1, -1, -1, -1, -1, -1, 428, + -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, -1, -1, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, -1, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + -1, -1, -1, -1, -1, -1, 325, -1, -1, -1, + 329, 330, 331, -1, -1, 334, 335, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 353, 354, -1, -1, -1, 358, + 359, -1, -1, -1, -1, -1, 365, 366, 367, 368, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 386, 387, 388, + 389, 390, 391, -1, -1, -1, -1, 396, 397, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 420, 421, 422, 423, 424, 425, 426, 427, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 442, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, -1, -1, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, -1, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, + -1, -1, -1, -1, -1, 325, -1, -1, -1, 329, + 330, 331, -1, -1, 334, 335, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 353, 354, -1, -1, -1, 358, 359, + -1, -1, -1, -1, -1, 365, 366, 367, 368, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 386, 387, 388, 389, + 390, 391, -1, -1, -1, -1, 396, 397, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 420, 421, 422, 423, 424, 425, 426, 427, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 442, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + -1, -1, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, -1, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, + -1, -1, -1, -1, 325, -1, -1, -1, 329, 330, + 331, -1, -1, 334, 335, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 353, 354, -1, -1, 357, -1, -1, -1, + -1, -1, -1, -1, 365, 366, 367, 368, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 386, 387, 388, 389, 390, + 391, -1, -1, -1, -1, 396, 397, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 420, + 421, 422, 423, 424, 425, 426, 427, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 442, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, + -1, -1, -1, 325, -1, -1, -1, 329, 330, 331, + -1, -1, 334, 335, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 353, 354, -1, -1, -1, 358, -1, -1, -1, + -1, -1, -1, 365, 366, 367, 368, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 386, 387, 388, 389, 390, 391, + -1, -1, -1, -1, 396, 397, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 420, 421, + 422, 423, 424, 425, 426, 427, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 442, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, -1, -1, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, -1, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, -1, -1, -1, -1, + -1, -1, 325, -1, -1, -1, 329, 330, 331, -1, + -1, 334, 335, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 353, 354, -1, -1, 357, -1, -1, -1, -1, -1, + -1, -1, 365, 366, 367, 368, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 386, 387, 388, 389, 390, 391, -1, + -1, -1, -1, 396, 397, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 420, 421, 422, + 423, 424, 425, 426, 427, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 442, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, -1, -1, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, -1, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, -1, -1, -1, -1, -1, + -1, 325, -1, -1, -1, 329, 330, 331, -1, -1, + 334, 335, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 353, + 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 364, 365, 366, 367, 368, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 386, 387, 388, 389, 390, 391, -1, -1, + -1, -1, 396, 397, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 420, 421, 422, 423, + 424, 425, 426, 427, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 442, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, -1, -1, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, -1, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, -1, -1, -1, -1, -1, -1, + 325, -1, -1, -1, 329, 330, 331, -1, -1, 334, + 335, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 353, 354, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 365, 366, 367, 368, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 386, 387, 388, 389, 390, 391, -1, -1, -1, + -1, 396, 397, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 420, 421, 422, 423, 424, + 425, 426, 427, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 442, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, -1, -1, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, -1, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, -1, -1, -1, -1, -1, -1, 325, + -1, -1, -1, 329, 330, 331, -1, -1, 334, 335, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 353, 354, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 365, + 366, 367, 368, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 386, 387, 388, 389, 390, 391, -1, -1, -1, -1, + 396, 397, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 420, 421, 422, 423, 424, 425, + 426, 427, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 442, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, @@ -3815,405 +4191,57 @@ static const yytype_int16 yycheck[] = 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, - -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, + -1, -1, 329, 330, 331, -1, -1, 334, 335, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, -1, -1, 355, 356, - -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, + -1, -1, -1, -1, -1, -1, 353, 354, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 365, 366, + 367, 368, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 386, + 387, 388, 389, 390, 391, -1, -1, -1, -1, 396, + 397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, - 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, - 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, - -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, - -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, - 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, -1, 355, 356, -1, -1, -1, -1, -1, - 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, - -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, - 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, - -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, -1, 354, -1, -1, - -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, - 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, - 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, - -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, - -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, - 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, -1, 355, -1, -1, -1, -1, -1, -1, - 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, - -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, - 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, - -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, -1, 354, -1, -1, - -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, - 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, - 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, - -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, - -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, - 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 361, - 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, - -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, - 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, - -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, - 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, - 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, - -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, - -1, -1, -1, 325, -1, -1, -1, -1, -1, 331, - 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 350, 351, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 362, 363, 364, 365, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 383, 384, 385, 386, 387, 388, -1, -1, -1, - -1, 393, 394, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 416, 417, 418, 419, 420, 421, - 422, 423, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 438, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, -1, -1, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - -1, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, -1, -1, -1, -1, -1, -1, 325, -1, - -1, -1, -1, -1, 331, 332, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 350, 351, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 362, 363, 364, 365, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 383, 384, 385, 386, - 387, 388, -1, -1, -1, -1, 393, 394, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 416, - 417, 418, 419, 420, 421, 422, 423, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 438, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, - -1, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, -1, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, -1, -1, -1, - -1, -1, -1, 325, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 420, 421, 422, 423, 424, 425, 426, + 427, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 442, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, -1, -1, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, -1, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, -1, -1, -1, -1, -1, -1, 325, -1, -1, + -1, 329, 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 388, -1, -1, -1, - -1, 393, 394 + -1, -1, -1, 391, -1, -1, -1, -1, 396, 397 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -4252,143 +4280,144 @@ static const yytype_int16 yystos[] = 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 353, 361, 375, - 376, 377, 378, 379, 388, 389, 390, 391, 392, 393, - 394, 410, 411, 412, 413, 414, 415, 424, 426, 427, - 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 356, 364, 378, 379, 380, 381, 382, 391, 392, 393, + 394, 395, 396, 397, 413, 414, 415, 416, 417, 418, + 419, 428, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 491, 492, 495, 496, 497, 498, 502, 503, - 504, 505, 506, 507, 510, 511, 512, 513, 514, 516, - 521, 522, 523, 564, 565, 566, 568, 575, 579, 580, - 586, 589, 351, 351, 351, 351, 351, 351, 351, 351, - 353, 522, 355, 387, 351, 351, 361, 387, 361, 567, - 352, 358, 499, 500, 501, 511, 516, 358, 361, 387, - 361, 387, 512, 516, 369, 518, 519, 0, 565, 496, - 504, 511, 361, 495, 387, 571, 572, 590, 591, 384, - 387, 571, 384, 571, 384, 571, 384, 571, 384, 571, - 571, 590, 384, 571, 387, 569, 570, 516, 525, 355, - 387, 411, 508, 509, 387, 515, 353, 361, 517, 355, - 543, 568, 500, 499, 501, 387, 387, 351, 360, 517, - 355, 358, 361, 494, 331, 332, 350, 351, 362, 363, - 364, 365, 383, 384, 385, 386, 387, 416, 417, 418, - 419, 420, 421, 422, 423, 461, 462, 463, 465, 466, - 467, 468, 469, 470, 471, 472, 473, 514, 516, 520, - 517, 352, 387, 361, 360, 358, 352, 358, 352, 358, - 360, 358, 358, 358, 352, 358, 358, 358, 358, 358, - 358, 358, 352, 358, 352, 358, 351, 354, 358, 361, - 511, 516, 526, 527, 524, 360, 352, 358, 352, 358, - 354, 472, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 353, 361, 355, 356, 361, 395, - 396, 397, 398, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 425, 472, 485, 487, 489, 491, 495, - 514, 516, 532, 533, 534, 535, 536, 544, 545, 546, - 547, 550, 551, 554, 555, 556, 563, 568, 517, 360, - 517, 355, 487, 530, 360, 493, 387, 358, 361, 472, - 472, 489, 331, 332, 353, 357, 352, 352, 358, 394, - 487, 351, 472, 358, 370, 568, 350, 353, 384, 572, - 590, 387, 591, 350, 383, 384, 385, 386, 576, 577, - 384, 485, 490, 578, 384, 383, 384, 385, 386, 581, - 582, 384, 383, 384, 385, 386, 461, 583, 584, 384, - 350, 585, 384, 590, 387, 490, 587, 588, 384, 490, - 354, 570, 516, 387, 528, 529, 356, 527, 526, 490, - 509, 387, 366, 367, 368, 363, 365, 329, 330, 333, - 334, 369, 370, 335, 336, 373, 372, 371, 337, 339, - 338, 374, 354, 354, 485, 356, 537, 351, 361, 361, - 558, 351, 351, 361, 361, 489, 351, 489, 359, 361, - 361, 361, 361, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 360, 488, 358, 361, 356, 533, 547, - 551, 556, 530, 360, 356, 530, 531, 530, 526, 387, - 352, 464, 489, 387, 487, 472, 350, 384, 573, 574, - 352, 360, 352, 358, 352, 358, 352, 358, 358, 352, - 358, 352, 358, 352, 358, 358, 352, 358, 358, 352, - 358, 352, 358, 352, 352, 528, 517, 358, 361, 356, - 472, 472, 472, 474, 474, 475, 475, 476, 476, 476, - 476, 477, 477, 478, 479, 480, 481, 482, 483, 486, - 354, 544, 557, 533, 559, 489, 361, 489, 359, 487, - 487, 530, 356, 358, 356, 354, 354, 358, 354, 358, - 577, 576, 490, 578, 582, 581, 584, 583, 350, 585, - 587, 588, 361, 529, 489, 538, 489, 504, 549, 395, - 532, 545, 560, 352, 352, 356, 530, 350, 384, 352, - 352, 352, 352, 352, 352, 359, 356, 387, 352, 351, - 549, 561, 562, 540, 541, 542, 548, 552, 487, 360, - 534, 539, 543, 489, 361, 352, 399, 536, 534, 355, - 530, 352, 489, 539, 540, 544, 553, 361, 356 + 458, 459, 460, 461, 462, 463, 495, 496, 499, 500, + 501, 502, 506, 507, 508, 509, 510, 511, 514, 515, + 516, 517, 518, 520, 525, 526, 527, 568, 569, 570, + 572, 579, 583, 584, 590, 593, 354, 354, 354, 354, + 354, 354, 354, 354, 356, 526, 358, 390, 354, 354, + 364, 390, 364, 571, 355, 361, 503, 504, 505, 515, + 520, 361, 364, 390, 364, 390, 516, 520, 372, 522, + 523, 0, 569, 500, 508, 515, 364, 499, 390, 575, + 576, 594, 595, 387, 390, 575, 387, 575, 387, 575, + 387, 575, 387, 575, 575, 594, 387, 575, 390, 573, + 574, 520, 529, 358, 390, 414, 512, 513, 390, 519, + 356, 364, 521, 358, 547, 572, 504, 503, 505, 390, + 390, 354, 363, 521, 358, 361, 364, 498, 334, 335, + 353, 354, 365, 366, 367, 368, 386, 387, 388, 389, + 390, 420, 421, 422, 423, 424, 425, 426, 427, 465, + 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 518, 520, 524, 521, 355, 390, 364, 363, 361, + 355, 361, 355, 361, 363, 361, 361, 361, 355, 361, + 361, 361, 361, 361, 361, 361, 355, 361, 355, 361, + 354, 357, 361, 364, 515, 520, 530, 531, 528, 363, + 355, 361, 355, 361, 357, 476, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 356, 364, + 358, 359, 364, 398, 399, 400, 401, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 429, 476, 489, + 491, 493, 495, 499, 518, 520, 536, 537, 538, 539, + 540, 548, 549, 550, 551, 554, 555, 558, 559, 560, + 567, 572, 521, 363, 521, 358, 491, 534, 363, 497, + 390, 361, 364, 476, 476, 493, 334, 335, 356, 360, + 355, 355, 361, 397, 491, 354, 476, 361, 373, 572, + 353, 356, 387, 576, 594, 390, 595, 353, 386, 387, + 388, 389, 580, 581, 387, 489, 494, 582, 387, 386, + 387, 388, 389, 585, 586, 387, 386, 387, 388, 389, + 465, 587, 588, 387, 353, 589, 387, 594, 390, 494, + 591, 592, 387, 494, 357, 574, 520, 390, 532, 533, + 359, 531, 530, 494, 513, 390, 369, 370, 371, 366, + 368, 332, 333, 336, 337, 372, 373, 338, 339, 376, + 375, 374, 340, 342, 341, 377, 357, 357, 489, 359, + 541, 354, 364, 364, 562, 354, 354, 364, 364, 493, + 354, 493, 362, 364, 364, 364, 364, 343, 344, 345, + 346, 347, 348, 349, 350, 351, 352, 363, 492, 361, + 364, 359, 537, 551, 555, 560, 534, 363, 359, 534, + 535, 534, 530, 390, 355, 468, 493, 390, 491, 476, + 353, 387, 577, 578, 355, 363, 355, 361, 355, 361, + 355, 361, 361, 355, 361, 355, 361, 355, 361, 361, + 355, 361, 361, 355, 361, 355, 361, 355, 355, 532, + 521, 361, 364, 359, 476, 476, 476, 478, 478, 479, + 479, 480, 480, 480, 480, 481, 481, 482, 483, 484, + 485, 486, 487, 490, 357, 548, 561, 537, 563, 493, + 364, 493, 362, 491, 491, 534, 359, 361, 359, 357, + 357, 361, 357, 361, 581, 580, 494, 582, 586, 585, + 588, 587, 353, 589, 591, 592, 364, 533, 493, 542, + 493, 508, 553, 398, 536, 549, 564, 355, 355, 359, + 534, 353, 387, 355, 355, 355, 355, 355, 355, 362, + 359, 390, 355, 354, 553, 565, 566, 544, 545, 546, + 552, 556, 491, 363, 538, 543, 547, 493, 364, 355, + 402, 540, 538, 358, 534, 355, 493, 543, 544, 548, + 557, 364, 359 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int16 yyr1[] = { - 0, 460, 461, 462, 462, 462, 462, 462, 462, 462, - 462, 462, 462, 462, 462, 462, 462, 462, 463, 463, - 463, 463, 463, 463, 464, 465, 466, 467, 467, 468, - 468, 469, 469, 470, 471, 471, 471, 472, 472, 472, - 472, 473, 473, 473, 473, 474, 474, 474, 474, 475, - 475, 475, 476, 476, 476, 477, 477, 477, 477, 477, - 478, 478, 478, 479, 479, 480, 480, 481, 481, 482, - 482, 483, 483, 484, 484, 485, 486, 485, 487, 487, - 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, - 488, 489, 489, 490, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 493, 492, 494, 494, 495, - 495, 495, 495, 496, 496, 497, 497, 498, 499, 499, - 500, 500, 500, 500, 501, 502, 502, 502, 502, 502, - 503, 503, 503, 503, 503, 504, 504, 505, 506, 506, - 506, 506, 506, 506, 506, 506, 506, 506, 507, 508, - 508, 509, 509, 509, 510, 511, 511, 512, 512, 512, - 512, 512, 512, 512, 512, 512, 512, 512, 513, 513, - 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, - 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, - 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, - 513, 513, 513, 513, 513, 514, 515, 515, 516, 516, - 517, 517, 517, 517, 518, 518, 519, 520, 520, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 521, 522, 522, 522, 524, 523, - 525, 523, 526, 526, 527, 527, 528, 528, 529, 529, - 530, 530, 530, 530, 531, 531, 532, 533, 533, 534, - 534, 534, 534, 534, 534, 534, 534, 535, 536, 537, - 538, 536, 539, 539, 541, 540, 542, 540, 543, 543, - 544, 544, 545, 545, 546, 546, 547, 548, 548, 549, - 549, 550, 550, 552, 551, 553, 553, 554, 554, 555, - 555, 557, 556, 558, 556, 559, 556, 560, 560, 561, - 561, 562, 562, 563, 563, 563, 563, 563, 563, 563, - 563, 564, 564, 565, 565, 565, 567, 566, 568, 569, - 569, 570, 570, 571, 571, 572, 572, 573, 573, 574, - 574, 575, 575, 575, 575, 575, 575, 576, 576, 577, - 577, 577, 577, 577, 578, 578, 579, 579, 580, 580, - 580, 580, 580, 580, 580, 580, 581, 581, 582, 582, - 582, 582, 583, 583, 584, 584, 584, 584, 584, 585, - 585, 586, 586, 586, 586, 587, 587, 588, 589, 589, - 590, 590, 591, 591 + 0, 464, 465, 466, 466, 466, 466, 466, 466, 466, + 466, 466, 466, 466, 466, 466, 466, 466, 467, 467, + 467, 467, 467, 467, 468, 469, 470, 471, 471, 472, + 472, 473, 473, 474, 475, 475, 475, 476, 476, 476, + 476, 477, 477, 477, 477, 478, 478, 478, 478, 479, + 479, 479, 480, 480, 480, 481, 481, 481, 481, 481, + 482, 482, 482, 483, 483, 484, 484, 485, 485, 486, + 486, 487, 487, 488, 488, 489, 490, 489, 491, 491, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 493, 493, 494, 495, 495, 495, 495, 495, 495, + 495, 495, 495, 495, 495, 497, 496, 498, 498, 499, + 499, 499, 499, 500, 500, 501, 501, 502, 503, 503, + 504, 504, 504, 504, 505, 506, 506, 506, 506, 506, + 507, 507, 507, 507, 507, 508, 508, 509, 510, 510, + 510, 510, 510, 510, 510, 510, 510, 510, 511, 512, + 512, 513, 513, 513, 514, 515, 515, 516, 516, 516, + 516, 516, 516, 516, 516, 516, 516, 516, 517, 517, + 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + 517, 517, 517, 517, 517, 517, 518, 519, 519, 520, + 520, 521, 521, 521, 521, 522, 522, 523, 524, 524, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 526, + 526, 526, 528, 527, 529, 527, 530, 530, 531, 531, + 532, 532, 533, 533, 534, 534, 534, 534, 535, 535, + 536, 537, 537, 538, 538, 538, 538, 538, 538, 538, + 538, 539, 540, 541, 542, 540, 543, 543, 545, 544, + 546, 544, 547, 547, 548, 548, 549, 549, 550, 550, + 551, 552, 552, 553, 553, 554, 554, 556, 555, 557, + 557, 558, 558, 559, 559, 561, 560, 562, 560, 563, + 560, 564, 564, 565, 565, 566, 566, 567, 567, 567, + 567, 567, 567, 567, 567, 568, 568, 569, 569, 569, + 571, 570, 572, 573, 573, 574, 574, 575, 575, 576, + 576, 577, 577, 578, 578, 579, 579, 579, 579, 579, + 579, 580, 580, 581, 581, 581, 581, 581, 582, 582, + 583, 583, 584, 584, 584, 584, 584, 584, 584, 584, + 585, 585, 586, 586, 586, 586, 587, 587, 588, 588, + 588, 588, 588, 589, 589, 590, 590, 590, 590, 591, + 591, 592, 593, 593, 594, 594, 595, 595 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -4414,8 +4443,8 @@ static const yytype_int8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 1, 1, 1, 3, 2, 3, - 2, 3, 3, 4, 1, 0, 3, 1, 3, 1, + 1, 1, 1, 1, 4, 1, 1, 1, 3, 2, + 3, 2, 3, 3, 4, 1, 0, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -4447,23 +4476,23 @@ static const yytype_int8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, - 0, 5, 1, 2, 3, 4, 1, 3, 1, 2, - 1, 3, 4, 2, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, - 0, 5, 1, 1, 0, 2, 0, 2, 2, 3, - 1, 2, 1, 2, 1, 2, 5, 3, 1, 1, - 4, 1, 2, 0, 8, 0, 1, 3, 2, 1, - 2, 0, 6, 0, 8, 0, 7, 1, 1, 1, - 0, 2, 3, 2, 2, 2, 3, 2, 2, 2, - 2, 1, 2, 1, 1, 1, 0, 3, 5, 1, - 3, 1, 4, 1, 3, 5, 5, 1, 3, 1, - 3, 4, 6, 6, 8, 6, 8, 1, 3, 1, - 1, 1, 1, 1, 1, 3, 4, 6, 4, 6, - 6, 8, 6, 8, 6, 8, 1, 3, 1, 1, - 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, - 3, 6, 8, 4, 6, 1, 3, 1, 4, 6, - 1, 3, 3, 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 6, 0, 5, 1, 2, 3, 4, + 1, 3, 1, 2, 1, 3, 4, 2, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 0, 0, 5, 1, 1, 0, 2, + 0, 2, 2, 3, 1, 2, 1, 2, 1, 2, + 5, 3, 1, 1, 4, 1, 2, 0, 8, 0, + 1, 3, 2, 1, 2, 0, 6, 0, 8, 0, + 7, 1, 1, 1, 0, 2, 3, 2, 2, 2, + 3, 2, 2, 2, 2, 1, 2, 1, 1, 1, + 0, 3, 5, 1, 3, 1, 4, 1, 3, 5, + 5, 1, 3, 1, 3, 4, 6, 6, 8, 6, + 8, 1, 3, 1, 1, 1, 1, 1, 1, 3, + 4, 6, 4, 6, 6, 8, 6, 8, 6, 8, + 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, + 1, 1, 1, 1, 3, 6, 8, 4, 6, 1, + 3, 1, 4, 6, 1, 3, 3, 3 }; @@ -5209,260 +5238,260 @@ yyreduce: switch (yyn) { case 2: /* variable_identifier: IDENTIFIER */ -#line 393 "MachineIndependent/glslang.y" +#line 394 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 5217 "MachineIndependent/glslang_tab.cpp" +#line 5246 "MachineIndependent/glslang_tab.cpp" break; case 3: /* primary_expression: variable_identifier */ -#line 399 "MachineIndependent/glslang.y" +#line 400 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5225 "MachineIndependent/glslang_tab.cpp" +#line 5254 "MachineIndependent/glslang_tab.cpp" break; case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */ -#line 402 "MachineIndependent/glslang.y" +#line 403 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 5235 "MachineIndependent/glslang_tab.cpp" +#line 5264 "MachineIndependent/glslang_tab.cpp" break; case 5: /* primary_expression: FLOATCONSTANT */ -#line 407 "MachineIndependent/glslang.y" +#line 408 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 5243 "MachineIndependent/glslang_tab.cpp" +#line 5272 "MachineIndependent/glslang_tab.cpp" break; case 6: /* primary_expression: INTCONSTANT */ -#line 410 "MachineIndependent/glslang.y" +#line 411 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5251 "MachineIndependent/glslang_tab.cpp" +#line 5280 "MachineIndependent/glslang_tab.cpp" break; case 7: /* primary_expression: UINTCONSTANT */ -#line 413 "MachineIndependent/glslang.y" +#line 414 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5260 "MachineIndependent/glslang_tab.cpp" +#line 5289 "MachineIndependent/glslang_tab.cpp" break; case 8: /* primary_expression: BOOLCONSTANT */ -#line 417 "MachineIndependent/glslang.y" +#line 418 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 5268 "MachineIndependent/glslang_tab.cpp" +#line 5297 "MachineIndependent/glslang_tab.cpp" break; case 9: /* primary_expression: STRING_LITERAL */ -#line 421 "MachineIndependent/glslang.y" +#line 422 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 5276 "MachineIndependent/glslang_tab.cpp" +#line 5305 "MachineIndependent/glslang_tab.cpp" break; case 10: /* primary_expression: INT32CONSTANT */ -#line 424 "MachineIndependent/glslang.y" +#line 425 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5285 "MachineIndependent/glslang_tab.cpp" +#line 5314 "MachineIndependent/glslang_tab.cpp" break; case 11: /* primary_expression: UINT32CONSTANT */ -#line 428 "MachineIndependent/glslang.y" +#line 429 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5294 "MachineIndependent/glslang_tab.cpp" +#line 5323 "MachineIndependent/glslang_tab.cpp" break; case 12: /* primary_expression: INT64CONSTANT */ -#line 432 "MachineIndependent/glslang.y" +#line 433 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 5303 "MachineIndependent/glslang_tab.cpp" +#line 5332 "MachineIndependent/glslang_tab.cpp" break; case 13: /* primary_expression: UINT64CONSTANT */ -#line 436 "MachineIndependent/glslang.y" +#line 437 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 5312 "MachineIndependent/glslang_tab.cpp" +#line 5341 "MachineIndependent/glslang_tab.cpp" break; case 14: /* primary_expression: INT16CONSTANT */ -#line 440 "MachineIndependent/glslang.y" +#line 441 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5321 "MachineIndependent/glslang_tab.cpp" +#line 5350 "MachineIndependent/glslang_tab.cpp" break; case 15: /* primary_expression: UINT16CONSTANT */ -#line 444 "MachineIndependent/glslang.y" +#line 445 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5330 "MachineIndependent/glslang_tab.cpp" +#line 5359 "MachineIndependent/glslang_tab.cpp" break; case 16: /* primary_expression: DOUBLECONSTANT */ -#line 448 "MachineIndependent/glslang.y" +#line 449 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double literal"); if (! parseContext.symbolTable.atBuiltInLevel()) parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } -#line 5341 "MachineIndependent/glslang_tab.cpp" +#line 5370 "MachineIndependent/glslang_tab.cpp" break; case 17: /* primary_expression: FLOAT16CONSTANT */ -#line 454 "MachineIndependent/glslang.y" +#line 455 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 5350 "MachineIndependent/glslang_tab.cpp" +#line 5379 "MachineIndependent/glslang_tab.cpp" break; case 18: /* postfix_expression: primary_expression */ -#line 462 "MachineIndependent/glslang.y" +#line 463 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5358 "MachineIndependent/glslang_tab.cpp" +#line 5387 "MachineIndependent/glslang_tab.cpp" break; case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */ -#line 465 "MachineIndependent/glslang.y" +#line 466 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } -#line 5366 "MachineIndependent/glslang_tab.cpp" +#line 5395 "MachineIndependent/glslang_tab.cpp" break; case 20: /* postfix_expression: function_call */ -#line 468 "MachineIndependent/glslang.y" +#line 469 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5374 "MachineIndependent/glslang_tab.cpp" +#line 5403 "MachineIndependent/glslang_tab.cpp" break; case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */ -#line 471 "MachineIndependent/glslang.y" +#line 472 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } -#line 5382 "MachineIndependent/glslang_tab.cpp" +#line 5411 "MachineIndependent/glslang_tab.cpp" break; case 22: /* postfix_expression: postfix_expression INC_OP */ -#line 474 "MachineIndependent/glslang.y" +#line 475 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5392 "MachineIndependent/glslang_tab.cpp" +#line 5421 "MachineIndependent/glslang_tab.cpp" break; case 23: /* postfix_expression: postfix_expression DEC_OP */ -#line 479 "MachineIndependent/glslang.y" +#line 480 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5402 "MachineIndependent/glslang_tab.cpp" +#line 5431 "MachineIndependent/glslang_tab.cpp" break; case 24: /* integer_expression: expression */ -#line 487 "MachineIndependent/glslang.y" +#line 488 "MachineIndependent/glslang.y" { parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5411 "MachineIndependent/glslang_tab.cpp" +#line 5440 "MachineIndependent/glslang_tab.cpp" break; case 25: /* function_call: function_call_or_method */ -#line 494 "MachineIndependent/glslang.y" +#line 495 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 5420 "MachineIndependent/glslang_tab.cpp" +#line 5449 "MachineIndependent/glslang_tab.cpp" break; case 26: /* function_call_or_method: function_call_generic */ -#line 501 "MachineIndependent/glslang.y" +#line 502 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5428 "MachineIndependent/glslang_tab.cpp" +#line 5457 "MachineIndependent/glslang_tab.cpp" break; case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */ -#line 507 "MachineIndependent/glslang.y" +#line 508 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5437 "MachineIndependent/glslang_tab.cpp" +#line 5466 "MachineIndependent/glslang_tab.cpp" break; case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */ -#line 511 "MachineIndependent/glslang.y" +#line 512 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5446 "MachineIndependent/glslang_tab.cpp" +#line 5475 "MachineIndependent/glslang_tab.cpp" break; case 29: /* function_call_header_no_parameters: function_call_header VOID */ -#line 518 "MachineIndependent/glslang.y" +#line 519 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5454 "MachineIndependent/glslang_tab.cpp" +#line 5483 "MachineIndependent/glslang_tab.cpp" break; case 30: /* function_call_header_no_parameters: function_call_header */ -#line 521 "MachineIndependent/glslang.y" +#line 522 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5462 "MachineIndependent/glslang_tab.cpp" +#line 5491 "MachineIndependent/glslang_tab.cpp" break; case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */ -#line 527 "MachineIndependent/glslang.y" +#line 528 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -5470,11 +5499,11 @@ yyreduce: (yyval.interm).function = (yyvsp[-1].interm).function; (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } -#line 5474 "MachineIndependent/glslang_tab.cpp" +#line 5503 "MachineIndependent/glslang_tab.cpp" break; case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */ -#line 534 "MachineIndependent/glslang.y" +#line 535 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -5482,29 +5511,29 @@ yyreduce: (yyval.interm).function = (yyvsp[-2].interm).function; (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } -#line 5486 "MachineIndependent/glslang_tab.cpp" +#line 5515 "MachineIndependent/glslang_tab.cpp" break; case 33: /* function_call_header: function_identifier LEFT_PAREN */ -#line 544 "MachineIndependent/glslang.y" +#line 545 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5494 "MachineIndependent/glslang_tab.cpp" +#line 5523 "MachineIndependent/glslang_tab.cpp" break; case 34: /* function_identifier: type_specifier */ -#line 552 "MachineIndependent/glslang.y" +#line 553 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5504 "MachineIndependent/glslang_tab.cpp" +#line 5533 "MachineIndependent/glslang_tab.cpp" break; case 35: /* function_identifier: postfix_expression */ -#line 557 "MachineIndependent/glslang.y" +#line 558 "MachineIndependent/glslang.y" { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -5532,50 +5561,50 @@ yyreduce: (yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull); } } -#line 5536 "MachineIndependent/glslang_tab.cpp" +#line 5565 "MachineIndependent/glslang_tab.cpp" break; case 36: /* function_identifier: non_uniform_qualifier */ -#line 585 "MachineIndependent/glslang.y" +#line 586 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5546 "MachineIndependent/glslang_tab.cpp" +#line 5575 "MachineIndependent/glslang_tab.cpp" break; case 37: /* unary_expression: postfix_expression */ -#line 594 "MachineIndependent/glslang.y" +#line 595 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 5557 "MachineIndependent/glslang_tab.cpp" +#line 5586 "MachineIndependent/glslang_tab.cpp" break; case 38: /* unary_expression: INC_OP unary_expression */ -#line 600 "MachineIndependent/glslang.y" +#line 601 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5566 "MachineIndependent/glslang_tab.cpp" +#line 5595 "MachineIndependent/glslang_tab.cpp" break; case 39: /* unary_expression: DEC_OP unary_expression */ -#line 604 "MachineIndependent/glslang.y" +#line 605 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5575 "MachineIndependent/glslang_tab.cpp" +#line 5604 "MachineIndependent/glslang_tab.cpp" break; case 40: /* unary_expression: unary_operator unary_expression */ -#line 608 "MachineIndependent/glslang.y" +#line 609 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -5592,179 +5621,179 @@ yyreduce: (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 5596 "MachineIndependent/glslang_tab.cpp" +#line 5625 "MachineIndependent/glslang_tab.cpp" break; case 41: /* unary_operator: PLUS */ -#line 628 "MachineIndependent/glslang.y" +#line 629 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 5602 "MachineIndependent/glslang_tab.cpp" +#line 5631 "MachineIndependent/glslang_tab.cpp" break; case 42: /* unary_operator: DASH */ -#line 629 "MachineIndependent/glslang.y" +#line 630 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 5608 "MachineIndependent/glslang_tab.cpp" +#line 5637 "MachineIndependent/glslang_tab.cpp" break; case 43: /* unary_operator: BANG */ -#line 630 "MachineIndependent/glslang.y" +#line 631 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 5614 "MachineIndependent/glslang_tab.cpp" +#line 5643 "MachineIndependent/glslang_tab.cpp" break; case 44: /* unary_operator: TILDE */ -#line 631 "MachineIndependent/glslang.y" +#line 632 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 5621 "MachineIndependent/glslang_tab.cpp" +#line 5650 "MachineIndependent/glslang_tab.cpp" break; case 45: /* multiplicative_expression: unary_expression */ -#line 637 "MachineIndependent/glslang.y" +#line 638 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5627 "MachineIndependent/glslang_tab.cpp" +#line 5656 "MachineIndependent/glslang_tab.cpp" break; case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ -#line 638 "MachineIndependent/glslang.y" +#line 639 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5637 "MachineIndependent/glslang_tab.cpp" +#line 5666 "MachineIndependent/glslang_tab.cpp" break; case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ -#line 643 "MachineIndependent/glslang.y" +#line 644 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5647 "MachineIndependent/glslang_tab.cpp" +#line 5676 "MachineIndependent/glslang_tab.cpp" break; case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ -#line 648 "MachineIndependent/glslang.y" +#line 649 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5658 "MachineIndependent/glslang_tab.cpp" +#line 5687 "MachineIndependent/glslang_tab.cpp" break; case 49: /* additive_expression: multiplicative_expression */ -#line 657 "MachineIndependent/glslang.y" +#line 658 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5664 "MachineIndependent/glslang_tab.cpp" +#line 5693 "MachineIndependent/glslang_tab.cpp" break; case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */ -#line 658 "MachineIndependent/glslang.y" +#line 659 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5674 "MachineIndependent/glslang_tab.cpp" +#line 5703 "MachineIndependent/glslang_tab.cpp" break; case 51: /* additive_expression: additive_expression DASH multiplicative_expression */ -#line 663 "MachineIndependent/glslang.y" +#line 664 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5684 "MachineIndependent/glslang_tab.cpp" +#line 5713 "MachineIndependent/glslang_tab.cpp" break; case 52: /* shift_expression: additive_expression */ -#line 671 "MachineIndependent/glslang.y" +#line 672 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5690 "MachineIndependent/glslang_tab.cpp" +#line 5719 "MachineIndependent/glslang_tab.cpp" break; case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */ -#line 672 "MachineIndependent/glslang.y" +#line 673 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5701 "MachineIndependent/glslang_tab.cpp" +#line 5730 "MachineIndependent/glslang_tab.cpp" break; case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */ -#line 678 "MachineIndependent/glslang.y" +#line 679 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5712 "MachineIndependent/glslang_tab.cpp" +#line 5741 "MachineIndependent/glslang_tab.cpp" break; case 55: /* relational_expression: shift_expression */ -#line 687 "MachineIndependent/glslang.y" +#line 688 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5718 "MachineIndependent/glslang_tab.cpp" +#line 5747 "MachineIndependent/glslang_tab.cpp" break; case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ -#line 688 "MachineIndependent/glslang.y" +#line 689 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5728 "MachineIndependent/glslang_tab.cpp" +#line 5757 "MachineIndependent/glslang_tab.cpp" break; case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ -#line 693 "MachineIndependent/glslang.y" +#line 694 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5738 "MachineIndependent/glslang_tab.cpp" +#line 5767 "MachineIndependent/glslang_tab.cpp" break; case 58: /* relational_expression: relational_expression LE_OP shift_expression */ -#line 698 "MachineIndependent/glslang.y" +#line 699 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5748 "MachineIndependent/glslang_tab.cpp" +#line 5777 "MachineIndependent/glslang_tab.cpp" break; case 59: /* relational_expression: relational_expression GE_OP shift_expression */ -#line 703 "MachineIndependent/glslang.y" +#line 704 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5758 "MachineIndependent/glslang_tab.cpp" +#line 5787 "MachineIndependent/glslang_tab.cpp" break; case 60: /* equality_expression: relational_expression */ -#line 711 "MachineIndependent/glslang.y" +#line 712 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5764 "MachineIndependent/glslang_tab.cpp" +#line 5793 "MachineIndependent/glslang_tab.cpp" break; case 61: /* equality_expression: equality_expression EQ_OP relational_expression */ -#line 712 "MachineIndependent/glslang.y" +#line 713 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -5774,11 +5803,11 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5778 "MachineIndependent/glslang_tab.cpp" +#line 5807 "MachineIndependent/glslang_tab.cpp" break; case 62: /* equality_expression: equality_expression NE_OP relational_expression */ -#line 721 "MachineIndependent/glslang.y" +#line 722 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -5788,124 +5817,124 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5792 "MachineIndependent/glslang_tab.cpp" +#line 5821 "MachineIndependent/glslang_tab.cpp" break; case 63: /* and_expression: equality_expression */ -#line 733 "MachineIndependent/glslang.y" +#line 734 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5798 "MachineIndependent/glslang_tab.cpp" +#line 5827 "MachineIndependent/glslang_tab.cpp" break; case 64: /* and_expression: and_expression AMPERSAND equality_expression */ -#line 734 "MachineIndependent/glslang.y" +#line 735 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5809 "MachineIndependent/glslang_tab.cpp" +#line 5838 "MachineIndependent/glslang_tab.cpp" break; case 65: /* exclusive_or_expression: and_expression */ -#line 743 "MachineIndependent/glslang.y" +#line 744 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5815 "MachineIndependent/glslang_tab.cpp" +#line 5844 "MachineIndependent/glslang_tab.cpp" break; case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ -#line 744 "MachineIndependent/glslang.y" +#line 745 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5826 "MachineIndependent/glslang_tab.cpp" +#line 5855 "MachineIndependent/glslang_tab.cpp" break; case 67: /* inclusive_or_expression: exclusive_or_expression */ -#line 753 "MachineIndependent/glslang.y" +#line 754 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5832 "MachineIndependent/glslang_tab.cpp" +#line 5861 "MachineIndependent/glslang_tab.cpp" break; case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ -#line 754 "MachineIndependent/glslang.y" +#line 755 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5843 "MachineIndependent/glslang_tab.cpp" +#line 5872 "MachineIndependent/glslang_tab.cpp" break; case 69: /* logical_and_expression: inclusive_or_expression */ -#line 763 "MachineIndependent/glslang.y" +#line 764 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5849 "MachineIndependent/glslang_tab.cpp" +#line 5878 "MachineIndependent/glslang_tab.cpp" break; case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ -#line 764 "MachineIndependent/glslang.y" +#line 765 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5859 "MachineIndependent/glslang_tab.cpp" +#line 5888 "MachineIndependent/glslang_tab.cpp" break; case 71: /* logical_xor_expression: logical_and_expression */ -#line 772 "MachineIndependent/glslang.y" +#line 773 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5865 "MachineIndependent/glslang_tab.cpp" +#line 5894 "MachineIndependent/glslang_tab.cpp" break; case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ -#line 773 "MachineIndependent/glslang.y" +#line 774 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5875 "MachineIndependent/glslang_tab.cpp" +#line 5904 "MachineIndependent/glslang_tab.cpp" break; case 73: /* logical_or_expression: logical_xor_expression */ -#line 781 "MachineIndependent/glslang.y" +#line 782 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5881 "MachineIndependent/glslang_tab.cpp" +#line 5910 "MachineIndependent/glslang_tab.cpp" break; case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ -#line 782 "MachineIndependent/glslang.y" +#line 783 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5891 "MachineIndependent/glslang_tab.cpp" +#line 5920 "MachineIndependent/glslang_tab.cpp" break; case 75: /* conditional_expression: logical_or_expression */ -#line 790 "MachineIndependent/glslang.y" +#line 791 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5897 "MachineIndependent/glslang_tab.cpp" +#line 5926 "MachineIndependent/glslang_tab.cpp" break; case 76: /* $@1: %empty */ -#line 791 "MachineIndependent/glslang.y" +#line 792 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 5905 "MachineIndependent/glslang_tab.cpp" +#line 5934 "MachineIndependent/glslang_tab.cpp" break; case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ -#line 794 "MachineIndependent/glslang.y" +#line 795 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -5918,17 +5947,17 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 5922 "MachineIndependent/glslang_tab.cpp" +#line 5951 "MachineIndependent/glslang_tab.cpp" break; case 78: /* assignment_expression: conditional_expression */ -#line 809 "MachineIndependent/glslang.y" +#line 810 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5928 "MachineIndependent/glslang_tab.cpp" +#line 5957 "MachineIndependent/glslang_tab.cpp" break; case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */ -#line 810 "MachineIndependent/glslang.y" +#line 811 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); @@ -5942,119 +5971,119 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 5946 "MachineIndependent/glslang_tab.cpp" +#line 5975 "MachineIndependent/glslang_tab.cpp" break; case 80: /* assignment_operator: EQUAL */ -#line 826 "MachineIndependent/glslang.y" +#line 827 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 5955 "MachineIndependent/glslang_tab.cpp" +#line 5984 "MachineIndependent/glslang_tab.cpp" break; case 81: /* assignment_operator: MUL_ASSIGN */ -#line 830 "MachineIndependent/glslang.y" +#line 831 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 5964 "MachineIndependent/glslang_tab.cpp" +#line 5993 "MachineIndependent/glslang_tab.cpp" break; case 82: /* assignment_operator: DIV_ASSIGN */ -#line 834 "MachineIndependent/glslang.y" +#line 835 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 5973 "MachineIndependent/glslang_tab.cpp" +#line 6002 "MachineIndependent/glslang_tab.cpp" break; case 83: /* assignment_operator: MOD_ASSIGN */ -#line 838 "MachineIndependent/glslang.y" +#line 839 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 5983 "MachineIndependent/glslang_tab.cpp" +#line 6012 "MachineIndependent/glslang_tab.cpp" break; case 84: /* assignment_operator: ADD_ASSIGN */ -#line 843 "MachineIndependent/glslang.y" +#line 844 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 5992 "MachineIndependent/glslang_tab.cpp" +#line 6021 "MachineIndependent/glslang_tab.cpp" break; case 85: /* assignment_operator: SUB_ASSIGN */ -#line 847 "MachineIndependent/glslang.y" +#line 848 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 6001 "MachineIndependent/glslang_tab.cpp" +#line 6030 "MachineIndependent/glslang_tab.cpp" break; case 86: /* assignment_operator: LEFT_ASSIGN */ -#line 851 "MachineIndependent/glslang.y" +#line 852 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 6010 "MachineIndependent/glslang_tab.cpp" +#line 6039 "MachineIndependent/glslang_tab.cpp" break; case 87: /* assignment_operator: RIGHT_ASSIGN */ -#line 855 "MachineIndependent/glslang.y" +#line 856 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 6019 "MachineIndependent/glslang_tab.cpp" +#line 6048 "MachineIndependent/glslang_tab.cpp" break; case 88: /* assignment_operator: AND_ASSIGN */ -#line 859 "MachineIndependent/glslang.y" +#line 860 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 6028 "MachineIndependent/glslang_tab.cpp" +#line 6057 "MachineIndependent/glslang_tab.cpp" break; case 89: /* assignment_operator: XOR_ASSIGN */ -#line 863 "MachineIndependent/glslang.y" +#line 864 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 6037 "MachineIndependent/glslang_tab.cpp" +#line 6066 "MachineIndependent/glslang_tab.cpp" break; case 90: /* assignment_operator: OR_ASSIGN */ -#line 867 "MachineIndependent/glslang.y" +#line 868 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 6046 "MachineIndependent/glslang_tab.cpp" +#line 6075 "MachineIndependent/glslang_tab.cpp" break; case 91: /* expression: assignment_expression */ -#line 874 "MachineIndependent/glslang.y" +#line 875 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6054 "MachineIndependent/glslang_tab.cpp" +#line 6083 "MachineIndependent/glslang_tab.cpp" break; case 92: /* expression: expression COMMA assignment_expression */ -#line 877 "MachineIndependent/glslang.y" +#line 878 "MachineIndependent/glslang.y" { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -6063,30 +6092,30 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 6067 "MachineIndependent/glslang_tab.cpp" +#line 6096 "MachineIndependent/glslang_tab.cpp" break; case 93: /* constant_expression: conditional_expression */ -#line 888 "MachineIndependent/glslang.y" +#line 889 "MachineIndependent/glslang.y" { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6076 "MachineIndependent/glslang_tab.cpp" +#line 6105 "MachineIndependent/glslang_tab.cpp" break; case 94: /* declaration: function_prototype SEMICOLON */ -#line 895 "MachineIndependent/glslang.y" +#line 896 "MachineIndependent/glslang.y" { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6086 "MachineIndependent/glslang_tab.cpp" +#line 6115 "MachineIndependent/glslang_tab.cpp" break; case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ -#line 901 "MachineIndependent/glslang.y" +#line 902 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); (yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier @@ -6094,31 +6123,31 @@ yyreduce: (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6098 "MachineIndependent/glslang_tab.cpp" +#line 6127 "MachineIndependent/glslang_tab.cpp" break; case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ -#line 908 "MachineIndependent/glslang.y" +#line 909 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "SPIR-V execution mode qualifier"); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); (yyval.interm.intermNode) = 0; } -#line 6108 "MachineIndependent/glslang_tab.cpp" +#line 6137 "MachineIndependent/glslang_tab.cpp" break; case 97: /* declaration: init_declarator_list SEMICOLON */ -#line 914 "MachineIndependent/glslang.y" +#line 915 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 6118 "MachineIndependent/glslang_tab.cpp" +#line 6147 "MachineIndependent/glslang_tab.cpp" break; case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ -#line 919 "MachineIndependent/glslang.y" +#line 920 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope @@ -6126,75 +6155,75 @@ yyreduce: parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 6130 "MachineIndependent/glslang_tab.cpp" +#line 6159 "MachineIndependent/glslang_tab.cpp" break; case 99: /* declaration: block_structure SEMICOLON */ -#line 926 "MachineIndependent/glslang.y" +#line 927 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } -#line 6139 "MachineIndependent/glslang_tab.cpp" +#line 6168 "MachineIndependent/glslang_tab.cpp" break; case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */ -#line 930 "MachineIndependent/glslang.y" +#line 931 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 6148 "MachineIndependent/glslang_tab.cpp" - break; - - case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ -#line 934 "MachineIndependent/glslang.y" - { - parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); - (yyval.interm.intermNode) = 0; - } -#line 6157 "MachineIndependent/glslang_tab.cpp" - break; - - case 102: /* declaration: type_qualifier SEMICOLON */ -#line 938 "MachineIndependent/glslang.y" - { - parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); - parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); - (yyval.interm.intermNode) = 0; - } -#line 6167 "MachineIndependent/glslang_tab.cpp" - break; - - case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */ -#line 943 "MachineIndependent/glslang.y" - { - parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); - parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); - (yyval.interm.intermNode) = 0; - } #line 6177 "MachineIndependent/glslang_tab.cpp" break; + case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ +#line 935 "MachineIndependent/glslang.y" + { + parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); + (yyval.interm.intermNode) = 0; + } +#line 6186 "MachineIndependent/glslang_tab.cpp" + break; + + case 102: /* declaration: type_qualifier SEMICOLON */ +#line 939 "MachineIndependent/glslang.y" + { + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); + (yyval.interm.intermNode) = 0; + } +#line 6196 "MachineIndependent/glslang_tab.cpp" + break; + + case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */ +#line 944 "MachineIndependent/glslang.y" + { + parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); + (yyval.interm.intermNode) = 0; + } +#line 6206 "MachineIndependent/glslang_tab.cpp" + break; + case 104: /* declaration: type_qualifier IDENTIFIER identifier_list SEMICOLON */ -#line 948 "MachineIndependent/glslang.y" +#line 949 "MachineIndependent/glslang.y" { parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 6188 "MachineIndependent/glslang_tab.cpp" +#line 6217 "MachineIndependent/glslang_tab.cpp" break; case 105: /* $@2: %empty */ -#line 957 "MachineIndependent/glslang.y" +#line 958 "MachineIndependent/glslang.y" { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 6194 "MachineIndependent/glslang_tab.cpp" +#line 6223 "MachineIndependent/glslang_tab.cpp" break; case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */ -#line 957 "MachineIndependent/glslang.y" +#line 958 "MachineIndependent/glslang.y" { --parseContext.blockNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; @@ -6204,60 +6233,60 @@ yyreduce: (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 6208 "MachineIndependent/glslang_tab.cpp" +#line 6237 "MachineIndependent/glslang_tab.cpp" break; case 107: /* identifier_list: COMMA IDENTIFIER */ -#line 968 "MachineIndependent/glslang.y" +#line 969 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6217 "MachineIndependent/glslang_tab.cpp" +#line 6246 "MachineIndependent/glslang_tab.cpp" break; case 108: /* identifier_list: identifier_list COMMA IDENTIFIER */ -#line 972 "MachineIndependent/glslang.y" +#line 973 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6226 "MachineIndependent/glslang_tab.cpp" +#line 6255 "MachineIndependent/glslang_tab.cpp" break; case 109: /* function_prototype: function_declarator RIGHT_PAREN */ -#line 979 "MachineIndependent/glslang.y" +#line 980 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 6235 "MachineIndependent/glslang_tab.cpp" +#line 6264 "MachineIndependent/glslang_tab.cpp" break; case 110: /* function_prototype: function_declarator RIGHT_PAREN attribute */ -#line 983 "MachineIndependent/glslang.y" +#line 984 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); (yyval.interm).loc = (yyvsp[-1].lex).loc; parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6246 "MachineIndependent/glslang_tab.cpp" +#line 6275 "MachineIndependent/glslang_tab.cpp" break; case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN */ -#line 989 "MachineIndependent/glslang.y" +#line 990 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); } -#line 6257 "MachineIndependent/glslang_tab.cpp" +#line 6286 "MachineIndependent/glslang_tab.cpp" break; case 112: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */ -#line 995 "MachineIndependent/glslang.y" +#line 996 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); (yyval.interm).loc = (yyvsp[-1].lex).loc; @@ -6265,27 +6294,27 @@ yyreduce: parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6269 "MachineIndependent/glslang_tab.cpp" +#line 6298 "MachineIndependent/glslang_tab.cpp" break; case 113: /* function_declarator: function_header */ -#line 1005 "MachineIndependent/glslang.y" +#line 1006 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6277 "MachineIndependent/glslang_tab.cpp" +#line 6306 "MachineIndependent/glslang_tab.cpp" break; case 114: /* function_declarator: function_header_with_parameters */ -#line 1008 "MachineIndependent/glslang.y" +#line 1009 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6285 "MachineIndependent/glslang_tab.cpp" +#line 6314 "MachineIndependent/glslang_tab.cpp" break; case 115: /* function_header_with_parameters: function_header parameter_declaration */ -#line 1015 "MachineIndependent/glslang.y" +#line 1016 "MachineIndependent/glslang.y" { // Add the parameter (yyval.interm.function) = (yyvsp[-1].interm.function); @@ -6294,11 +6323,11 @@ yyreduce: else delete (yyvsp[0].interm).param.type; } -#line 6298 "MachineIndependent/glslang_tab.cpp" +#line 6327 "MachineIndependent/glslang_tab.cpp" break; case 116: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */ -#line 1023 "MachineIndependent/glslang.y" +#line 1024 "MachineIndependent/glslang.y" { // // Only first parameter of one-parameter functions can be void @@ -6316,11 +6345,11 @@ yyreduce: (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 6320 "MachineIndependent/glslang_tab.cpp" +#line 6349 "MachineIndependent/glslang_tab.cpp" break; case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ -#line 1043 "MachineIndependent/glslang.y" +#line 1044 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -6340,11 +6369,11 @@ yyreduce: function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 6344 "MachineIndependent/glslang_tab.cpp" +#line 6373 "MachineIndependent/glslang_tab.cpp" break; case 118: /* parameter_declarator: type_specifier IDENTIFIER */ -#line 1066 "MachineIndependent/glslang.y" +#line 1067 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6360,11 +6389,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 6364 "MachineIndependent/glslang_tab.cpp" +#line 6393 "MachineIndependent/glslang_tab.cpp" break; case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ -#line 1081 "MachineIndependent/glslang.y" +#line 1082 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6384,11 +6413,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 6388 "MachineIndependent/glslang_tab.cpp" +#line 6417 "MachineIndependent/glslang_tab.cpp" break; case 120: /* parameter_declaration: type_qualifier parameter_declarator */ -#line 1106 "MachineIndependent/glslang.y" +#line 1107 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6400,11 +6429,11 @@ yyreduce: parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6404 "MachineIndependent/glslang_tab.cpp" +#line 6433 "MachineIndependent/glslang_tab.cpp" break; case 121: /* parameter_declaration: parameter_declarator */ -#line 1117 "MachineIndependent/glslang.y" +#line 1118 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6412,11 +6441,11 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 6416 "MachineIndependent/glslang_tab.cpp" +#line 6445 "MachineIndependent/glslang_tab.cpp" break; case 122: /* parameter_declaration: type_qualifier parameter_type_specifier */ -#line 1127 "MachineIndependent/glslang.y" +#line 1128 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6427,11 +6456,11 @@ yyreduce: parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6431 "MachineIndependent/glslang_tab.cpp" +#line 6460 "MachineIndependent/glslang_tab.cpp" break; case 123: /* parameter_declaration: parameter_type_specifier */ -#line 1137 "MachineIndependent/glslang.y" +#line 1138 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6439,68 +6468,68 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 6443 "MachineIndependent/glslang_tab.cpp" +#line 6472 "MachineIndependent/glslang_tab.cpp" break; case 124: /* parameter_type_specifier: type_specifier */ -#line 1147 "MachineIndependent/glslang.y" +#line 1148 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 6454 "MachineIndependent/glslang_tab.cpp" +#line 6483 "MachineIndependent/glslang_tab.cpp" break; case 125: /* init_declarator_list: single_declaration */ -#line 1156 "MachineIndependent/glslang.y" +#line 1157 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 6462 "MachineIndependent/glslang_tab.cpp" +#line 6491 "MachineIndependent/glslang_tab.cpp" break; case 126: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ -#line 1159 "MachineIndependent/glslang.y" +#line 1160 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 6471 "MachineIndependent/glslang_tab.cpp" +#line 6500 "MachineIndependent/glslang_tab.cpp" break; case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ -#line 1163 "MachineIndependent/glslang.y" +#line 1164 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 6480 "MachineIndependent/glslang_tab.cpp" +#line 6509 "MachineIndependent/glslang_tab.cpp" break; case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ -#line 1167 "MachineIndependent/glslang.y" +#line 1168 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-5].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6490 "MachineIndependent/glslang_tab.cpp" +#line 6519 "MachineIndependent/glslang_tab.cpp" break; case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ -#line 1172 "MachineIndependent/glslang.y" +#line 1173 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6500 "MachineIndependent/glslang_tab.cpp" +#line 6529 "MachineIndependent/glslang_tab.cpp" break; case 130: /* single_declaration: fully_specified_type */ -#line 1180 "MachineIndependent/glslang.y" +#line 1181 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; @@ -6508,51 +6537,51 @@ yyreduce: parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 6512 "MachineIndependent/glslang_tab.cpp" +#line 6541 "MachineIndependent/glslang_tab.cpp" break; case 131: /* single_declaration: fully_specified_type IDENTIFIER */ -#line 1187 "MachineIndependent/glslang.y" +#line 1188 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-1].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 6522 "MachineIndependent/glslang_tab.cpp" +#line 6551 "MachineIndependent/glslang_tab.cpp" break; case 132: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ -#line 1192 "MachineIndependent/glslang.y" +#line 1193 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-2].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 6532 "MachineIndependent/glslang_tab.cpp" +#line 6561 "MachineIndependent/glslang_tab.cpp" break; case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ -#line 1197 "MachineIndependent/glslang.y" +#line 1198 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6542 "MachineIndependent/glslang_tab.cpp" +#line 6571 "MachineIndependent/glslang_tab.cpp" break; case 134: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 1202 "MachineIndependent/glslang.y" +#line 1203 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-3].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6552 "MachineIndependent/glslang_tab.cpp" +#line 6581 "MachineIndependent/glslang_tab.cpp" break; case 135: /* fully_specified_type: type_specifier */ -#line 1211 "MachineIndependent/glslang.y" +#line 1212 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -6563,11 +6592,11 @@ yyreduce: } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } -#line 6567 "MachineIndependent/glslang_tab.cpp" +#line 6596 "MachineIndependent/glslang_tab.cpp" break; case 136: /* fully_specified_type: type_qualifier type_specifier */ -#line 1221 "MachineIndependent/glslang.y" +#line 1222 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, false, &(yyvsp[0].interm.type)); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); @@ -6592,22 +6621,22 @@ yyreduce: (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 6596 "MachineIndependent/glslang_tab.cpp" +#line 6625 "MachineIndependent/glslang_tab.cpp" break; case 137: /* invariant_qualifier: INVARIANT */ -#line 1248 "MachineIndependent/glslang.y" +#line 1249 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 6607 "MachineIndependent/glslang_tab.cpp" +#line 6636 "MachineIndependent/glslang_tab.cpp" break; case 138: /* interpolation_qualifier: SMOOTH */ -#line 1257 "MachineIndependent/glslang.y" +#line 1258 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -6615,11 +6644,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 6619 "MachineIndependent/glslang_tab.cpp" +#line 6648 "MachineIndependent/glslang_tab.cpp" break; case 139: /* interpolation_qualifier: FLAT */ -#line 1264 "MachineIndependent/glslang.y" +#line 1265 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -6627,11 +6656,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 6631 "MachineIndependent/glslang_tab.cpp" +#line 6660 "MachineIndependent/glslang_tab.cpp" break; case 140: /* interpolation_qualifier: NOPERSPECTIVE */ -#line 1272 "MachineIndependent/glslang.y" +#line 1273 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); @@ -6639,11 +6668,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 6643 "MachineIndependent/glslang_tab.cpp" +#line 6672 "MachineIndependent/glslang_tab.cpp" break; case 141: /* interpolation_qualifier: EXPLICITINTERPAMD */ -#line 1279 "MachineIndependent/glslang.y" +#line 1280 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); @@ -6651,11 +6680,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.explicitInterp = true; } -#line 6655 "MachineIndependent/glslang_tab.cpp" +#line 6684 "MachineIndependent/glslang_tab.cpp" break; case 142: /* interpolation_qualifier: PERVERTEXNV */ -#line 1286 "MachineIndependent/glslang.y" +#line 1287 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6664,11 +6693,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexNV = true; } -#line 6668 "MachineIndependent/glslang_tab.cpp" +#line 6697 "MachineIndependent/glslang_tab.cpp" break; case 143: /* interpolation_qualifier: PERVERTEXEXT */ -#line 1294 "MachineIndependent/glslang.y" +#line 1295 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexEXT"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6677,11 +6706,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexEXT = true; } -#line 6681 "MachineIndependent/glslang_tab.cpp" +#line 6710 "MachineIndependent/glslang_tab.cpp" break; case 144: /* interpolation_qualifier: PERPRIMITIVENV */ -#line 1302 "MachineIndependent/glslang.y" +#line 1303 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); @@ -6692,11 +6721,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6696 "MachineIndependent/glslang_tab.cpp" +#line 6725 "MachineIndependent/glslang_tab.cpp" break; case 145: /* interpolation_qualifier: PERPRIMITIVEEXT */ -#line 1312 "MachineIndependent/glslang.y" +#line 1313 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveEXT"); @@ -6707,11 +6736,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6711 "MachineIndependent/glslang_tab.cpp" +#line 6740 "MachineIndependent/glslang_tab.cpp" break; case 146: /* interpolation_qualifier: PERVIEWNV */ -#line 1322 "MachineIndependent/glslang.y" +#line 1323 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); @@ -6719,11 +6748,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perViewNV = true; } -#line 6723 "MachineIndependent/glslang_tab.cpp" +#line 6752 "MachineIndependent/glslang_tab.cpp" break; case 147: /* interpolation_qualifier: PERTASKNV */ -#line 1329 "MachineIndependent/glslang.y" +#line 1330 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); @@ -6731,84 +6760,84 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perTaskNV = true; } -#line 6735 "MachineIndependent/glslang_tab.cpp" +#line 6764 "MachineIndependent/glslang_tab.cpp" break; case 148: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ -#line 1340 "MachineIndependent/glslang.y" +#line 1341 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 6743 "MachineIndependent/glslang_tab.cpp" +#line 6772 "MachineIndependent/glslang_tab.cpp" break; case 149: /* layout_qualifier_id_list: layout_qualifier_id */ -#line 1346 "MachineIndependent/glslang.y" +#line 1347 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6751 "MachineIndependent/glslang_tab.cpp" +#line 6780 "MachineIndependent/glslang_tab.cpp" break; case 150: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ -#line 1349 "MachineIndependent/glslang.y" +#line 1350 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6761 "MachineIndependent/glslang_tab.cpp" +#line 6790 "MachineIndependent/glslang_tab.cpp" break; case 151: /* layout_qualifier_id: IDENTIFIER */ -#line 1356 "MachineIndependent/glslang.y" +#line 1357 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 6770 "MachineIndependent/glslang_tab.cpp" +#line 6799 "MachineIndependent/glslang_tab.cpp" break; case 152: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ -#line 1360 "MachineIndependent/glslang.y" +#line 1361 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 6779 "MachineIndependent/glslang_tab.cpp" +#line 6808 "MachineIndependent/glslang_tab.cpp" break; case 153: /* layout_qualifier_id: SHARED */ -#line 1364 "MachineIndependent/glslang.y" +#line 1365 "MachineIndependent/glslang.y" { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 6789 "MachineIndependent/glslang_tab.cpp" +#line 6818 "MachineIndependent/glslang_tab.cpp" break; case 154: /* precise_qualifier: PRECISE */ -#line 1373 "MachineIndependent/glslang.y" +#line 1374 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 6800 "MachineIndependent/glslang_tab.cpp" +#line 6829 "MachineIndependent/glslang_tab.cpp" break; case 155: /* type_qualifier: single_type_qualifier */ -#line 1383 "MachineIndependent/glslang.y" +#line 1384 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6808 "MachineIndependent/glslang_tab.cpp" +#line 6837 "MachineIndependent/glslang_tab.cpp" break; case 156: /* type_qualifier: type_qualifier single_type_qualifier */ -#line 1386 "MachineIndependent/glslang.y" +#line 1387 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -6817,151 +6846,151 @@ yyreduce: (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6821 "MachineIndependent/glslang_tab.cpp" +#line 6850 "MachineIndependent/glslang_tab.cpp" break; case 157: /* single_type_qualifier: storage_qualifier */ -#line 1397 "MachineIndependent/glslang.y" +#line 1398 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6829 "MachineIndependent/glslang_tab.cpp" +#line 6858 "MachineIndependent/glslang_tab.cpp" break; case 158: /* single_type_qualifier: layout_qualifier */ -#line 1400 "MachineIndependent/glslang.y" +#line 1401 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6837 "MachineIndependent/glslang_tab.cpp" +#line 6866 "MachineIndependent/glslang_tab.cpp" break; case 159: /* single_type_qualifier: precision_qualifier */ -#line 1403 "MachineIndependent/glslang.y" +#line 1404 "MachineIndependent/glslang.y" { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6846 "MachineIndependent/glslang_tab.cpp" +#line 6875 "MachineIndependent/glslang_tab.cpp" break; case 160: /* single_type_qualifier: interpolation_qualifier */ -#line 1407 "MachineIndependent/glslang.y" +#line 1408 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6855 "MachineIndependent/glslang_tab.cpp" +#line 6884 "MachineIndependent/glslang_tab.cpp" break; case 161: /* single_type_qualifier: invariant_qualifier */ -#line 1411 "MachineIndependent/glslang.y" +#line 1412 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6864 "MachineIndependent/glslang_tab.cpp" +#line 6893 "MachineIndependent/glslang_tab.cpp" break; case 162: /* single_type_qualifier: precise_qualifier */ -#line 1416 "MachineIndependent/glslang.y" +#line 1417 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6873 "MachineIndependent/glslang_tab.cpp" +#line 6902 "MachineIndependent/glslang_tab.cpp" break; case 163: /* single_type_qualifier: non_uniform_qualifier */ -#line 1420 "MachineIndependent/glslang.y" +#line 1421 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6881 "MachineIndependent/glslang_tab.cpp" +#line 6910 "MachineIndependent/glslang_tab.cpp" break; case 164: /* single_type_qualifier: spirv_storage_class_qualifier */ -#line 1423 "MachineIndependent/glslang.y" +#line 1424 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].interm.type).loc, "spirv_storage_class"); parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6891 "MachineIndependent/glslang_tab.cpp" +#line 6920 "MachineIndependent/glslang_tab.cpp" break; case 165: /* single_type_qualifier: spirv_decorate_qualifier */ -#line 1428 "MachineIndependent/glslang.y" +#line 1429 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6900 "MachineIndependent/glslang_tab.cpp" +#line 6929 "MachineIndependent/glslang_tab.cpp" break; case 166: /* single_type_qualifier: SPIRV_BY_REFERENCE */ -#line 1432 "MachineIndependent/glslang.y" +#line 1433 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvByReference(); } -#line 6910 "MachineIndependent/glslang_tab.cpp" +#line 6939 "MachineIndependent/glslang_tab.cpp" break; case 167: /* single_type_qualifier: SPIRV_LITERAL */ -#line 1437 "MachineIndependent/glslang.y" +#line 1438 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvLiteral(); } -#line 6920 "MachineIndependent/glslang_tab.cpp" +#line 6949 "MachineIndependent/glslang_tab.cpp" break; case 168: /* storage_qualifier: CONST */ -#line 1446 "MachineIndependent/glslang.y" +#line 1447 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 6929 "MachineIndependent/glslang_tab.cpp" +#line 6958 "MachineIndependent/glslang_tab.cpp" break; case 169: /* storage_qualifier: INOUT */ -#line 1450 "MachineIndependent/glslang.y" +#line 1451 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 6939 "MachineIndependent/glslang_tab.cpp" +#line 6968 "MachineIndependent/glslang_tab.cpp" break; case 170: /* storage_qualifier: IN */ -#line 1455 "MachineIndependent/glslang.y" +#line 1456 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 6950 "MachineIndependent/glslang_tab.cpp" +#line 6979 "MachineIndependent/glslang_tab.cpp" break; case 171: /* storage_qualifier: OUT */ -#line 1461 "MachineIndependent/glslang.y" +#line 1462 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 6961 "MachineIndependent/glslang_tab.cpp" +#line 6990 "MachineIndependent/glslang_tab.cpp" break; case 172: /* storage_qualifier: CENTROID */ -#line 1467 "MachineIndependent/glslang.y" +#line 1468 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -6969,21 +6998,31 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 6973 "MachineIndependent/glslang_tab.cpp" +#line 7002 "MachineIndependent/glslang_tab.cpp" break; case 173: /* storage_qualifier: UNIFORM */ -#line 1474 "MachineIndependent/glslang.y" +#line 1475 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 6983 "MachineIndependent/glslang_tab.cpp" +#line 7012 "MachineIndependent/glslang_tab.cpp" break; - case 174: /* storage_qualifier: SHARED */ -#line 1479 "MachineIndependent/glslang.y" + case 174: /* storage_qualifier: TILEIMAGEEXT */ +#line 1480 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "tileImageEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqTileImageEXT; + } +#line 7022 "MachineIndependent/glslang_tab.cpp" + break; + + case 175: /* storage_qualifier: SHARED */ +#line 1485 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -6992,21 +7031,21 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 6996 "MachineIndependent/glslang_tab.cpp" +#line 7035 "MachineIndependent/glslang_tab.cpp" break; - case 175: /* storage_qualifier: BUFFER */ -#line 1487 "MachineIndependent/glslang.y" + case 176: /* storage_qualifier: BUFFER */ +#line 1493 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 7006 "MachineIndependent/glslang_tab.cpp" +#line 7045 "MachineIndependent/glslang_tab.cpp" break; - case 176: /* storage_qualifier: ATTRIBUTE */ -#line 1493 "MachineIndependent/glslang.y" + case 177: /* storage_qualifier: ATTRIBUTE */ +#line 1499 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -7019,11 +7058,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7023 "MachineIndependent/glslang_tab.cpp" +#line 7062 "MachineIndependent/glslang_tab.cpp" break; - case 177: /* storage_qualifier: VARYING */ -#line 1505 "MachineIndependent/glslang.y" + case 178: /* storage_qualifier: VARYING */ +#line 1511 "MachineIndependent/glslang.y" { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -7038,32 +7077,32 @@ yyreduce: else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7042 "MachineIndependent/glslang_tab.cpp" +#line 7081 "MachineIndependent/glslang_tab.cpp" break; - case 178: /* storage_qualifier: PATCH */ -#line 1519 "MachineIndependent/glslang.y" + case 179: /* storage_qualifier: PATCH */ +#line 1525 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 7053 "MachineIndependent/glslang_tab.cpp" +#line 7092 "MachineIndependent/glslang_tab.cpp" break; - case 179: /* storage_qualifier: SAMPLE */ -#line 1525 "MachineIndependent/glslang.y" + case 180: /* storage_qualifier: SAMPLE */ +#line 1531 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 7063 "MachineIndependent/glslang_tab.cpp" +#line 7102 "MachineIndependent/glslang_tab.cpp" break; - case 180: /* storage_qualifier: HITATTRNV */ -#line 1530 "MachineIndependent/glslang.y" + case 181: /* storage_qualifier: HITATTRNV */ +#line 1536 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7072,11 +7111,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7076 "MachineIndependent/glslang_tab.cpp" +#line 7115 "MachineIndependent/glslang_tab.cpp" break; - case 181: /* storage_qualifier: HITOBJECTATTRNV */ -#line 1538 "MachineIndependent/glslang.y" + case 182: /* storage_qualifier: HITOBJECTATTRNV */ +#line 1544 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask @@ -7085,11 +7124,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitObjectAttrNV; } -#line 7089 "MachineIndependent/glslang_tab.cpp" +#line 7128 "MachineIndependent/glslang_tab.cpp" break; - case 182: /* storage_qualifier: HITATTREXT */ -#line 1546 "MachineIndependent/glslang.y" + case 183: /* storage_qualifier: HITATTREXT */ +#line 1552 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7098,11 +7137,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7102 "MachineIndependent/glslang_tab.cpp" +#line 7141 "MachineIndependent/glslang_tab.cpp" break; - case 183: /* storage_qualifier: PAYLOADNV */ -#line 1554 "MachineIndependent/glslang.y" + case 184: /* storage_qualifier: PAYLOADNV */ +#line 1560 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7111,11 +7150,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7115 "MachineIndependent/glslang_tab.cpp" +#line 7154 "MachineIndependent/glslang_tab.cpp" break; - case 184: /* storage_qualifier: PAYLOADEXT */ -#line 1562 "MachineIndependent/glslang.y" + case 185: /* storage_qualifier: PAYLOADEXT */ +#line 1568 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7124,11 +7163,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7128 "MachineIndependent/glslang_tab.cpp" +#line 7167 "MachineIndependent/glslang_tab.cpp" break; - case 185: /* storage_qualifier: PAYLOADINNV */ -#line 1570 "MachineIndependent/glslang.y" + case 186: /* storage_qualifier: PAYLOADINNV */ +#line 1576 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7137,11 +7176,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7141 "MachineIndependent/glslang_tab.cpp" +#line 7180 "MachineIndependent/glslang_tab.cpp" break; - case 186: /* storage_qualifier: PAYLOADINEXT */ -#line 1578 "MachineIndependent/glslang.y" + case 187: /* storage_qualifier: PAYLOADINEXT */ +#line 1584 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7150,11 +7189,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7154 "MachineIndependent/glslang_tab.cpp" +#line 7193 "MachineIndependent/glslang_tab.cpp" break; - case 187: /* storage_qualifier: CALLDATANV */ -#line 1586 "MachineIndependent/glslang.y" + case 188: /* storage_qualifier: CALLDATANV */ +#line 1592 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7163,11 +7202,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7167 "MachineIndependent/glslang_tab.cpp" +#line 7206 "MachineIndependent/glslang_tab.cpp" break; - case 188: /* storage_qualifier: CALLDATAEXT */ -#line 1594 "MachineIndependent/glslang.y" + case 189: /* storage_qualifier: CALLDATAEXT */ +#line 1600 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7176,11 +7215,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7180 "MachineIndependent/glslang_tab.cpp" +#line 7219 "MachineIndependent/glslang_tab.cpp" break; - case 189: /* storage_qualifier: CALLDATAINNV */ -#line 1602 "MachineIndependent/glslang.y" + case 190: /* storage_qualifier: CALLDATAINNV */ +#line 1608 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); @@ -7188,11 +7227,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7192 "MachineIndependent/glslang_tab.cpp" +#line 7231 "MachineIndependent/glslang_tab.cpp" break; - case 190: /* storage_qualifier: CALLDATAINEXT */ -#line 1609 "MachineIndependent/glslang.y" + case 191: /* storage_qualifier: CALLDATAINEXT */ +#line 1615 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); @@ -7200,138 +7239,138 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7204 "MachineIndependent/glslang_tab.cpp" +#line 7243 "MachineIndependent/glslang_tab.cpp" break; - case 191: /* storage_qualifier: COHERENT */ -#line 1616 "MachineIndependent/glslang.y" + case 192: /* storage_qualifier: COHERENT */ +#line 1622 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 7213 "MachineIndependent/glslang_tab.cpp" +#line 7252 "MachineIndependent/glslang_tab.cpp" break; - case 192: /* storage_qualifier: DEVICECOHERENT */ -#line 1620 "MachineIndependent/glslang.y" + case 193: /* storage_qualifier: DEVICECOHERENT */ +#line 1626 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 7223 "MachineIndependent/glslang_tab.cpp" +#line 7262 "MachineIndependent/glslang_tab.cpp" break; - case 193: /* storage_qualifier: QUEUEFAMILYCOHERENT */ -#line 1625 "MachineIndependent/glslang.y" + case 194: /* storage_qualifier: QUEUEFAMILYCOHERENT */ +#line 1631 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 7233 "MachineIndependent/glslang_tab.cpp" +#line 7272 "MachineIndependent/glslang_tab.cpp" break; - case 194: /* storage_qualifier: WORKGROUPCOHERENT */ -#line 1630 "MachineIndependent/glslang.y" + case 195: /* storage_qualifier: WORKGROUPCOHERENT */ +#line 1636 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 7243 "MachineIndependent/glslang_tab.cpp" +#line 7282 "MachineIndependent/glslang_tab.cpp" break; - case 195: /* storage_qualifier: SUBGROUPCOHERENT */ -#line 1635 "MachineIndependent/glslang.y" + case 196: /* storage_qualifier: SUBGROUPCOHERENT */ +#line 1641 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 7253 "MachineIndependent/glslang_tab.cpp" +#line 7292 "MachineIndependent/glslang_tab.cpp" break; - case 196: /* storage_qualifier: NONPRIVATE */ -#line 1640 "MachineIndependent/glslang.y" + case 197: /* storage_qualifier: NONPRIVATE */ +#line 1646 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 7263 "MachineIndependent/glslang_tab.cpp" +#line 7302 "MachineIndependent/glslang_tab.cpp" break; - case 197: /* storage_qualifier: SHADERCALLCOHERENT */ -#line 1645 "MachineIndependent/glslang.y" + case 198: /* storage_qualifier: SHADERCALLCOHERENT */ +#line 1651 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); (yyval.interm.type).qualifier.shadercallcoherent = true; } -#line 7273 "MachineIndependent/glslang_tab.cpp" +#line 7312 "MachineIndependent/glslang_tab.cpp" break; - case 198: /* storage_qualifier: VOLATILE */ -#line 1650 "MachineIndependent/glslang.y" + case 199: /* storage_qualifier: VOLATILE */ +#line 1656 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 7282 "MachineIndependent/glslang_tab.cpp" +#line 7321 "MachineIndependent/glslang_tab.cpp" break; - case 199: /* storage_qualifier: RESTRICT */ -#line 1654 "MachineIndependent/glslang.y" + case 200: /* storage_qualifier: RESTRICT */ +#line 1660 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 7291 "MachineIndependent/glslang_tab.cpp" +#line 7330 "MachineIndependent/glslang_tab.cpp" break; - case 200: /* storage_qualifier: READONLY */ -#line 1658 "MachineIndependent/glslang.y" + case 201: /* storage_qualifier: READONLY */ +#line 1664 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 7300 "MachineIndependent/glslang_tab.cpp" +#line 7339 "MachineIndependent/glslang_tab.cpp" break; - case 201: /* storage_qualifier: WRITEONLY */ -#line 1662 "MachineIndependent/glslang.y" + case 202: /* storage_qualifier: WRITEONLY */ +#line 1668 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 7309 "MachineIndependent/glslang_tab.cpp" +#line 7348 "MachineIndependent/glslang_tab.cpp" break; - case 202: /* storage_qualifier: SUBROUTINE */ -#line 1666 "MachineIndependent/glslang.y" + case 203: /* storage_qualifier: SUBROUTINE */ +#line 1672 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 7320 "MachineIndependent/glslang_tab.cpp" +#line 7359 "MachineIndependent/glslang_tab.cpp" break; - case 203: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ -#line 1672 "MachineIndependent/glslang.y" + case 204: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ +#line 1678 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 7331 "MachineIndependent/glslang_tab.cpp" +#line 7370 "MachineIndependent/glslang_tab.cpp" break; - case 204: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ -#line 1678 "MachineIndependent/glslang.y" + case 205: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ +#line 1684 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskPayloadSharedEXT"); @@ -7339,48 +7378,48 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT; } -#line 7343 "MachineIndependent/glslang_tab.cpp" +#line 7382 "MachineIndependent/glslang_tab.cpp" break; - case 205: /* non_uniform_qualifier: NONUNIFORM */ -#line 1690 "MachineIndependent/glslang.y" + case 206: /* non_uniform_qualifier: NONUNIFORM */ +#line 1696 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 7352 "MachineIndependent/glslang_tab.cpp" +#line 7391 "MachineIndependent/glslang_tab.cpp" break; - case 206: /* type_name_list: IDENTIFIER */ -#line 1697 "MachineIndependent/glslang.y" + case 207: /* type_name_list: IDENTIFIER */ +#line 1703 "MachineIndependent/glslang.y" { // TODO } -#line 7360 "MachineIndependent/glslang_tab.cpp" +#line 7399 "MachineIndependent/glslang_tab.cpp" break; - case 207: /* type_name_list: type_name_list COMMA IDENTIFIER */ -#line 1700 "MachineIndependent/glslang.y" + case 208: /* type_name_list: type_name_list COMMA IDENTIFIER */ +#line 1706 "MachineIndependent/glslang.y" { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 7370 "MachineIndependent/glslang_tab.cpp" +#line 7409 "MachineIndependent/glslang_tab.cpp" break; - case 208: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ -#line 1709 "MachineIndependent/glslang.y" + case 209: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ +#line 1715 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); (yyval.interm.type).typeParameters = (yyvsp[0].interm.typeParameters); } -#line 7380 "MachineIndependent/glslang_tab.cpp" +#line 7419 "MachineIndependent/glslang_tab.cpp" break; - case 209: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ -#line 1714 "MachineIndependent/glslang.y" + case 210: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ +#line 1720 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-2].interm.type); @@ -7388,21 +7427,21 @@ yyreduce: (yyval.interm.type).typeParameters = (yyvsp[-1].interm.typeParameters); (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 7392 "MachineIndependent/glslang_tab.cpp" +#line 7431 "MachineIndependent/glslang_tab.cpp" break; - case 210: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ -#line 1724 "MachineIndependent/glslang.y" + case 211: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ +#line 1730 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 7402 "MachineIndependent/glslang_tab.cpp" +#line 7441 "MachineIndependent/glslang_tab.cpp" break; - case 211: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1729 "MachineIndependent/glslang.y" + case 212: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1735 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -7411,20 +7450,20 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7415 "MachineIndependent/glslang_tab.cpp" +#line 7454 "MachineIndependent/glslang_tab.cpp" break; - case 212: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ -#line 1737 "MachineIndependent/glslang.y" + case 213: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ +#line 1743 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 7424 "MachineIndependent/glslang_tab.cpp" +#line 7463 "MachineIndependent/glslang_tab.cpp" break; - case 213: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1741 "MachineIndependent/glslang.y" + case 214: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1747 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); @@ -7432,35 +7471,35 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7436 "MachineIndependent/glslang_tab.cpp" +#line 7475 "MachineIndependent/glslang_tab.cpp" break; - case 214: /* type_parameter_specifier_opt: type_parameter_specifier */ -#line 1751 "MachineIndependent/glslang.y" + case 215: /* type_parameter_specifier_opt: type_parameter_specifier */ +#line 1757 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); } -#line 7444 "MachineIndependent/glslang_tab.cpp" +#line 7483 "MachineIndependent/glslang_tab.cpp" break; - case 215: /* type_parameter_specifier_opt: %empty */ -#line 1754 "MachineIndependent/glslang.y" + case 216: /* type_parameter_specifier_opt: %empty */ +#line 1760 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = 0; } -#line 7452 "MachineIndependent/glslang_tab.cpp" +#line 7491 "MachineIndependent/glslang_tab.cpp" break; - case 216: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ -#line 1760 "MachineIndependent/glslang.y" + case 217: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ +#line 1766 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); } -#line 7460 "MachineIndependent/glslang_tab.cpp" +#line 7499 "MachineIndependent/glslang_tab.cpp" break; - case 217: /* type_parameter_specifier_list: unary_expression */ -#line 1766 "MachineIndependent/glslang.y" + case 218: /* type_parameter_specifier_list: unary_expression */ +#line 1772 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TArraySizes; @@ -7468,11 +7507,11 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 7472 "MachineIndependent/glslang_tab.cpp" +#line 7511 "MachineIndependent/glslang_tab.cpp" break; - case 218: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ -#line 1773 "MachineIndependent/glslang.y" + case 219: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ +#line 1779 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters); @@ -7480,300 +7519,300 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 7484 "MachineIndependent/glslang_tab.cpp" +#line 7523 "MachineIndependent/glslang_tab.cpp" break; - case 219: /* type_specifier_nonarray: VOID */ -#line 1783 "MachineIndependent/glslang.y" + case 220: /* type_specifier_nonarray: VOID */ +#line 1789 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 7493 "MachineIndependent/glslang_tab.cpp" +#line 7532 "MachineIndependent/glslang_tab.cpp" break; - case 220: /* type_specifier_nonarray: FLOAT */ -#line 1787 "MachineIndependent/glslang.y" + case 221: /* type_specifier_nonarray: FLOAT */ +#line 1793 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7502 "MachineIndependent/glslang_tab.cpp" +#line 7541 "MachineIndependent/glslang_tab.cpp" break; - case 221: /* type_specifier_nonarray: INT */ -#line 1791 "MachineIndependent/glslang.y" + case 222: /* type_specifier_nonarray: INT */ +#line 1797 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7511 "MachineIndependent/glslang_tab.cpp" +#line 7550 "MachineIndependent/glslang_tab.cpp" break; - case 222: /* type_specifier_nonarray: UINT */ -#line 1795 "MachineIndependent/glslang.y" + case 223: /* type_specifier_nonarray: UINT */ +#line 1801 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7521 "MachineIndependent/glslang_tab.cpp" - break; - - case 223: /* type_specifier_nonarray: BOOL */ -#line 1800 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - } -#line 7530 "MachineIndependent/glslang_tab.cpp" - break; - - case 224: /* type_specifier_nonarray: VEC2 */ -#line 1804 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); - } -#line 7540 "MachineIndependent/glslang_tab.cpp" - break; - - case 225: /* type_specifier_nonarray: VEC3 */ -#line 1809 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); - } -#line 7550 "MachineIndependent/glslang_tab.cpp" - break; - - case 226: /* type_specifier_nonarray: VEC4 */ -#line 1814 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(4); - } #line 7560 "MachineIndependent/glslang_tab.cpp" break; - case 227: /* type_specifier_nonarray: BVEC2 */ -#line 1819 "MachineIndependent/glslang.y" + case 224: /* type_specifier_nonarray: BOOL */ +#line 1806 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + } +#line 7569 "MachineIndependent/glslang_tab.cpp" + break; + + case 225: /* type_specifier_nonarray: VEC2 */ +#line 1810 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } +#line 7579 "MachineIndependent/glslang_tab.cpp" + break; + + case 226: /* type_specifier_nonarray: VEC3 */ +#line 1815 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } +#line 7589 "MachineIndependent/glslang_tab.cpp" + break; + + case 227: /* type_specifier_nonarray: VEC4 */ +#line 1820 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); + } +#line 7599 "MachineIndependent/glslang_tab.cpp" + break; + + case 228: /* type_specifier_nonarray: BVEC2 */ +#line 1825 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(2); } -#line 7570 "MachineIndependent/glslang_tab.cpp" +#line 7609 "MachineIndependent/glslang_tab.cpp" break; - case 228: /* type_specifier_nonarray: BVEC3 */ -#line 1824 "MachineIndependent/glslang.y" + case 229: /* type_specifier_nonarray: BVEC3 */ +#line 1830 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(3); } -#line 7580 "MachineIndependent/glslang_tab.cpp" +#line 7619 "MachineIndependent/glslang_tab.cpp" break; - case 229: /* type_specifier_nonarray: BVEC4 */ -#line 1829 "MachineIndependent/glslang.y" + case 230: /* type_specifier_nonarray: BVEC4 */ +#line 1835 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(4); } -#line 7590 "MachineIndependent/glslang_tab.cpp" +#line 7629 "MachineIndependent/glslang_tab.cpp" break; - case 230: /* type_specifier_nonarray: IVEC2 */ -#line 1834 "MachineIndependent/glslang.y" + case 231: /* type_specifier_nonarray: IVEC2 */ +#line 1840 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 7600 "MachineIndependent/glslang_tab.cpp" +#line 7639 "MachineIndependent/glslang_tab.cpp" break; - case 231: /* type_specifier_nonarray: IVEC3 */ -#line 1839 "MachineIndependent/glslang.y" + case 232: /* type_specifier_nonarray: IVEC3 */ +#line 1845 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 7610 "MachineIndependent/glslang_tab.cpp" +#line 7649 "MachineIndependent/glslang_tab.cpp" break; - case 232: /* type_specifier_nonarray: IVEC4 */ -#line 1844 "MachineIndependent/glslang.y" + case 233: /* type_specifier_nonarray: IVEC4 */ +#line 1850 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 7620 "MachineIndependent/glslang_tab.cpp" +#line 7659 "MachineIndependent/glslang_tab.cpp" break; - case 233: /* type_specifier_nonarray: UVEC2 */ -#line 1849 "MachineIndependent/glslang.y" - { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(2); - } -#line 7631 "MachineIndependent/glslang_tab.cpp" - break; - - case 234: /* type_specifier_nonarray: UVEC3 */ + case 234: /* type_specifier_nonarray: UVEC2 */ #line 1855 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 7642 "MachineIndependent/glslang_tab.cpp" +#line 7670 "MachineIndependent/glslang_tab.cpp" break; - case 235: /* type_specifier_nonarray: UVEC4 */ + case 235: /* type_specifier_nonarray: UVEC3 */ #line 1861 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); + } +#line 7681 "MachineIndependent/glslang_tab.cpp" + break; + + case 236: /* type_specifier_nonarray: UVEC4 */ +#line 1867 "MachineIndependent/glslang.y" + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 7653 "MachineIndependent/glslang_tab.cpp" +#line 7692 "MachineIndependent/glslang_tab.cpp" break; - case 236: /* type_specifier_nonarray: MAT2 */ -#line 1867 "MachineIndependent/glslang.y" + case 237: /* type_specifier_nonarray: MAT2 */ +#line 1873 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7663 "MachineIndependent/glslang_tab.cpp" +#line 7702 "MachineIndependent/glslang_tab.cpp" break; - case 237: /* type_specifier_nonarray: MAT3 */ -#line 1872 "MachineIndependent/glslang.y" + case 238: /* type_specifier_nonarray: MAT3 */ +#line 1878 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7673 "MachineIndependent/glslang_tab.cpp" +#line 7712 "MachineIndependent/glslang_tab.cpp" break; - case 238: /* type_specifier_nonarray: MAT4 */ -#line 1877 "MachineIndependent/glslang.y" + case 239: /* type_specifier_nonarray: MAT4 */ +#line 1883 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7683 "MachineIndependent/glslang_tab.cpp" +#line 7722 "MachineIndependent/glslang_tab.cpp" break; - case 239: /* type_specifier_nonarray: MAT2X2 */ -#line 1882 "MachineIndependent/glslang.y" + case 240: /* type_specifier_nonarray: MAT2X2 */ +#line 1888 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7693 "MachineIndependent/glslang_tab.cpp" +#line 7732 "MachineIndependent/glslang_tab.cpp" break; - case 240: /* type_specifier_nonarray: MAT2X3 */ -#line 1887 "MachineIndependent/glslang.y" + case 241: /* type_specifier_nonarray: MAT2X3 */ +#line 1893 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 7703 "MachineIndependent/glslang_tab.cpp" +#line 7742 "MachineIndependent/glslang_tab.cpp" break; - case 241: /* type_specifier_nonarray: MAT2X4 */ -#line 1892 "MachineIndependent/glslang.y" + case 242: /* type_specifier_nonarray: MAT2X4 */ +#line 1898 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 7713 "MachineIndependent/glslang_tab.cpp" +#line 7752 "MachineIndependent/glslang_tab.cpp" break; - case 242: /* type_specifier_nonarray: MAT3X2 */ -#line 1897 "MachineIndependent/glslang.y" + case 243: /* type_specifier_nonarray: MAT3X2 */ +#line 1903 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 7723 "MachineIndependent/glslang_tab.cpp" +#line 7762 "MachineIndependent/glslang_tab.cpp" break; - case 243: /* type_specifier_nonarray: MAT3X3 */ -#line 1902 "MachineIndependent/glslang.y" + case 244: /* type_specifier_nonarray: MAT3X3 */ +#line 1908 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7733 "MachineIndependent/glslang_tab.cpp" +#line 7772 "MachineIndependent/glslang_tab.cpp" break; - case 244: /* type_specifier_nonarray: MAT3X4 */ -#line 1907 "MachineIndependent/glslang.y" + case 245: /* type_specifier_nonarray: MAT3X4 */ +#line 1913 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7743 "MachineIndependent/glslang_tab.cpp" +#line 7782 "MachineIndependent/glslang_tab.cpp" break; - case 245: /* type_specifier_nonarray: MAT4X2 */ -#line 1912 "MachineIndependent/glslang.y" + case 246: /* type_specifier_nonarray: MAT4X2 */ +#line 1918 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7753 "MachineIndependent/glslang_tab.cpp" +#line 7792 "MachineIndependent/glslang_tab.cpp" break; - case 246: /* type_specifier_nonarray: MAT4X3 */ -#line 1917 "MachineIndependent/glslang.y" + case 247: /* type_specifier_nonarray: MAT4X3 */ +#line 1923 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7763 "MachineIndependent/glslang_tab.cpp" +#line 7802 "MachineIndependent/glslang_tab.cpp" break; - case 247: /* type_specifier_nonarray: MAT4X4 */ -#line 1922 "MachineIndependent/glslang.y" + case 248: /* type_specifier_nonarray: MAT4X4 */ +#line 1928 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7773 "MachineIndependent/glslang_tab.cpp" +#line 7812 "MachineIndependent/glslang_tab.cpp" break; - case 248: /* type_specifier_nonarray: DOUBLE */ -#line 1928 "MachineIndependent/glslang.y" + case 249: /* type_specifier_nonarray: DOUBLE */ +#line 1934 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7781,121 +7820,121 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7785 "MachineIndependent/glslang_tab.cpp" +#line 7824 "MachineIndependent/glslang_tab.cpp" break; - case 249: /* type_specifier_nonarray: FLOAT16_T */ -#line 1935 "MachineIndependent/glslang.y" + case 250: /* type_specifier_nonarray: FLOAT16_T */ +#line 1941 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 7795 "MachineIndependent/glslang_tab.cpp" +#line 7834 "MachineIndependent/glslang_tab.cpp" break; - case 250: /* type_specifier_nonarray: FLOAT32_T */ -#line 1940 "MachineIndependent/glslang.y" + case 251: /* type_specifier_nonarray: FLOAT32_T */ +#line 1946 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7805 "MachineIndependent/glslang_tab.cpp" +#line 7844 "MachineIndependent/glslang_tab.cpp" break; - case 251: /* type_specifier_nonarray: FLOAT64_T */ -#line 1945 "MachineIndependent/glslang.y" + case 252: /* type_specifier_nonarray: FLOAT64_T */ +#line 1951 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7815 "MachineIndependent/glslang_tab.cpp" +#line 7854 "MachineIndependent/glslang_tab.cpp" break; - case 252: /* type_specifier_nonarray: INT8_T */ -#line 1950 "MachineIndependent/glslang.y" + case 253: /* type_specifier_nonarray: INT8_T */ +#line 1956 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 7825 "MachineIndependent/glslang_tab.cpp" +#line 7864 "MachineIndependent/glslang_tab.cpp" break; - case 253: /* type_specifier_nonarray: UINT8_T */ -#line 1955 "MachineIndependent/glslang.y" + case 254: /* type_specifier_nonarray: UINT8_T */ +#line 1961 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 7835 "MachineIndependent/glslang_tab.cpp" +#line 7874 "MachineIndependent/glslang_tab.cpp" break; - case 254: /* type_specifier_nonarray: INT16_T */ -#line 1960 "MachineIndependent/glslang.y" + case 255: /* type_specifier_nonarray: INT16_T */ +#line 1966 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 7845 "MachineIndependent/glslang_tab.cpp" +#line 7884 "MachineIndependent/glslang_tab.cpp" break; - case 255: /* type_specifier_nonarray: UINT16_T */ -#line 1965 "MachineIndependent/glslang.y" + case 256: /* type_specifier_nonarray: UINT16_T */ +#line 1971 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 7855 "MachineIndependent/glslang_tab.cpp" +#line 7894 "MachineIndependent/glslang_tab.cpp" break; - case 256: /* type_specifier_nonarray: INT32_T */ -#line 1970 "MachineIndependent/glslang.y" + case 257: /* type_specifier_nonarray: INT32_T */ +#line 1976 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7865 "MachineIndependent/glslang_tab.cpp" +#line 7904 "MachineIndependent/glslang_tab.cpp" break; - case 257: /* type_specifier_nonarray: UINT32_T */ -#line 1975 "MachineIndependent/glslang.y" + case 258: /* type_specifier_nonarray: UINT32_T */ +#line 1981 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7875 "MachineIndependent/glslang_tab.cpp" +#line 7914 "MachineIndependent/glslang_tab.cpp" break; - case 258: /* type_specifier_nonarray: INT64_T */ -#line 1980 "MachineIndependent/glslang.y" + case 259: /* type_specifier_nonarray: INT64_T */ +#line 1986 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 7885 "MachineIndependent/glslang_tab.cpp" +#line 7924 "MachineIndependent/glslang_tab.cpp" break; - case 259: /* type_specifier_nonarray: UINT64_T */ -#line 1985 "MachineIndependent/glslang.y" + case 260: /* type_specifier_nonarray: UINT64_T */ +#line 1991 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 7895 "MachineIndependent/glslang_tab.cpp" +#line 7934 "MachineIndependent/glslang_tab.cpp" break; - case 260: /* type_specifier_nonarray: DVEC2 */ -#line 1990 "MachineIndependent/glslang.y" + case 261: /* type_specifier_nonarray: DVEC2 */ +#line 1996 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7904,11 +7943,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 7908 "MachineIndependent/glslang_tab.cpp" +#line 7947 "MachineIndependent/glslang_tab.cpp" break; - case 261: /* type_specifier_nonarray: DVEC3 */ -#line 1998 "MachineIndependent/glslang.y" + case 262: /* type_specifier_nonarray: DVEC3 */ +#line 2004 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7917,11 +7956,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 7921 "MachineIndependent/glslang_tab.cpp" +#line 7960 "MachineIndependent/glslang_tab.cpp" break; - case 262: /* type_specifier_nonarray: DVEC4 */ -#line 2006 "MachineIndependent/glslang.y" + case 263: /* type_specifier_nonarray: DVEC4 */ +#line 2012 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7930,414 +7969,375 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 7934 "MachineIndependent/glslang_tab.cpp" +#line 7973 "MachineIndependent/glslang_tab.cpp" break; - case 263: /* type_specifier_nonarray: F16VEC2 */ -#line 2014 "MachineIndependent/glslang.y" - { - parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(2); - } -#line 7945 "MachineIndependent/glslang_tab.cpp" - break; - - case 264: /* type_specifier_nonarray: F16VEC3 */ + case 264: /* type_specifier_nonarray: F16VEC2 */ #line 2020 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 7956 "MachineIndependent/glslang_tab.cpp" +#line 7984 "MachineIndependent/glslang_tab.cpp" break; - case 265: /* type_specifier_nonarray: F16VEC4 */ + case 265: /* type_specifier_nonarray: F16VEC3 */ #line 2026 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(3); + } +#line 7995 "MachineIndependent/glslang_tab.cpp" + break; + + case 266: /* type_specifier_nonarray: F16VEC4 */ +#line 2032 "MachineIndependent/glslang.y" + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(4); } -#line 7967 "MachineIndependent/glslang_tab.cpp" +#line 8006 "MachineIndependent/glslang_tab.cpp" break; - case 266: /* type_specifier_nonarray: F32VEC2 */ -#line 2032 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); - } -#line 7978 "MachineIndependent/glslang_tab.cpp" - break; - - case 267: /* type_specifier_nonarray: F32VEC3 */ + case 267: /* type_specifier_nonarray: F32VEC2 */ #line 2038 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 7989 "MachineIndependent/glslang_tab.cpp" +#line 8017 "MachineIndependent/glslang_tab.cpp" break; - case 268: /* type_specifier_nonarray: F32VEC4 */ + case 268: /* type_specifier_nonarray: F32VEC3 */ #line 2044 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } +#line 8028 "MachineIndependent/glslang_tab.cpp" + break; + + case 269: /* type_specifier_nonarray: F32VEC4 */ +#line 2050 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 8000 "MachineIndependent/glslang_tab.cpp" +#line 8039 "MachineIndependent/glslang_tab.cpp" break; - case 269: /* type_specifier_nonarray: F64VEC2 */ -#line 2050 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); - } -#line 8011 "MachineIndependent/glslang_tab.cpp" - break; - - case 270: /* type_specifier_nonarray: F64VEC3 */ + case 270: /* type_specifier_nonarray: F64VEC2 */ #line 2056 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8022 "MachineIndependent/glslang_tab.cpp" +#line 8050 "MachineIndependent/glslang_tab.cpp" break; - case 271: /* type_specifier_nonarray: F64VEC4 */ + case 271: /* type_specifier_nonarray: F64VEC3 */ #line 2062 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); + } +#line 8061 "MachineIndependent/glslang_tab.cpp" + break; + + case 272: /* type_specifier_nonarray: F64VEC4 */ +#line 2068 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 8033 "MachineIndependent/glslang_tab.cpp" +#line 8072 "MachineIndependent/glslang_tab.cpp" break; - case 272: /* type_specifier_nonarray: I8VEC2 */ -#line 2068 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(2); - } -#line 8044 "MachineIndependent/glslang_tab.cpp" - break; - - case 273: /* type_specifier_nonarray: I8VEC3 */ + case 273: /* type_specifier_nonarray: I8VEC2 */ #line 2074 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8055 "MachineIndependent/glslang_tab.cpp" +#line 8083 "MachineIndependent/glslang_tab.cpp" break; - case 274: /* type_specifier_nonarray: I8VEC4 */ + case 274: /* type_specifier_nonarray: I8VEC3 */ #line 2080 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); + } +#line 8094 "MachineIndependent/glslang_tab.cpp" + break; + + case 275: /* type_specifier_nonarray: I8VEC4 */ +#line 2086 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(4); } -#line 8066 "MachineIndependent/glslang_tab.cpp" +#line 8105 "MachineIndependent/glslang_tab.cpp" break; - case 275: /* type_specifier_nonarray: I16VEC2 */ -#line 2086 "MachineIndependent/glslang.y" - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(2); - } -#line 8077 "MachineIndependent/glslang_tab.cpp" - break; - - case 276: /* type_specifier_nonarray: I16VEC3 */ + case 276: /* type_specifier_nonarray: I16VEC2 */ #line 2092 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8088 "MachineIndependent/glslang_tab.cpp" +#line 8116 "MachineIndependent/glslang_tab.cpp" break; - case 277: /* type_specifier_nonarray: I16VEC4 */ + case 277: /* type_specifier_nonarray: I16VEC3 */ #line 2098 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); + } +#line 8127 "MachineIndependent/glslang_tab.cpp" + break; + + case 278: /* type_specifier_nonarray: I16VEC4 */ +#line 2104 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(4); } -#line 8099 "MachineIndependent/glslang_tab.cpp" +#line 8138 "MachineIndependent/glslang_tab.cpp" break; - case 278: /* type_specifier_nonarray: I32VEC2 */ -#line 2104 "MachineIndependent/glslang.y" - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(2); - } -#line 8110 "MachineIndependent/glslang_tab.cpp" - break; - - case 279: /* type_specifier_nonarray: I32VEC3 */ + case 279: /* type_specifier_nonarray: I32VEC2 */ #line 2110 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8121 "MachineIndependent/glslang_tab.cpp" +#line 8149 "MachineIndependent/glslang_tab.cpp" break; - case 280: /* type_specifier_nonarray: I32VEC4 */ + case 280: /* type_specifier_nonarray: I32VEC3 */ #line 2116 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); + } +#line 8160 "MachineIndependent/glslang_tab.cpp" + break; + + case 281: /* type_specifier_nonarray: I32VEC4 */ +#line 2122 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 8132 "MachineIndependent/glslang_tab.cpp" +#line 8171 "MachineIndependent/glslang_tab.cpp" break; - case 281: /* type_specifier_nonarray: I64VEC2 */ -#line 2122 "MachineIndependent/glslang.y" - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(2); - } -#line 8143 "MachineIndependent/glslang_tab.cpp" - break; - - case 282: /* type_specifier_nonarray: I64VEC3 */ + case 282: /* type_specifier_nonarray: I64VEC2 */ #line 2128 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8154 "MachineIndependent/glslang_tab.cpp" +#line 8182 "MachineIndependent/glslang_tab.cpp" break; - case 283: /* type_specifier_nonarray: I64VEC4 */ + case 283: /* type_specifier_nonarray: I64VEC3 */ #line 2134 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); + } +#line 8193 "MachineIndependent/glslang_tab.cpp" + break; + + case 284: /* type_specifier_nonarray: I64VEC4 */ +#line 2140 "MachineIndependent/glslang.y" + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 8165 "MachineIndependent/glslang_tab.cpp" +#line 8204 "MachineIndependent/glslang_tab.cpp" break; - case 284: /* type_specifier_nonarray: U8VEC2 */ -#line 2140 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint8; - (yyval.interm.type).setVector(2); - } -#line 8176 "MachineIndependent/glslang_tab.cpp" - break; - - case 285: /* type_specifier_nonarray: U8VEC3 */ + case 285: /* type_specifier_nonarray: U8VEC2 */ #line 2146 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8187 "MachineIndependent/glslang_tab.cpp" +#line 8215 "MachineIndependent/glslang_tab.cpp" break; - case 286: /* type_specifier_nonarray: U8VEC4 */ + case 286: /* type_specifier_nonarray: U8VEC3 */ #line 2152 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(3); + } +#line 8226 "MachineIndependent/glslang_tab.cpp" + break; + + case 287: /* type_specifier_nonarray: U8VEC4 */ +#line 2158 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 8198 "MachineIndependent/glslang_tab.cpp" +#line 8237 "MachineIndependent/glslang_tab.cpp" break; - case 287: /* type_specifier_nonarray: U16VEC2 */ -#line 2158 "MachineIndependent/glslang.y" - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(2); - } -#line 8209 "MachineIndependent/glslang_tab.cpp" - break; - - case 288: /* type_specifier_nonarray: U16VEC3 */ + case 288: /* type_specifier_nonarray: U16VEC2 */ #line 2164 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8220 "MachineIndependent/glslang_tab.cpp" +#line 8248 "MachineIndependent/glslang_tab.cpp" break; - case 289: /* type_specifier_nonarray: U16VEC4 */ + case 289: /* type_specifier_nonarray: U16VEC3 */ #line 2170 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(3); + } +#line 8259 "MachineIndependent/glslang_tab.cpp" + break; + + case 290: /* type_specifier_nonarray: U16VEC4 */ +#line 2176 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(4); } -#line 8231 "MachineIndependent/glslang_tab.cpp" +#line 8270 "MachineIndependent/glslang_tab.cpp" break; - case 290: /* type_specifier_nonarray: U32VEC2 */ -#line 2176 "MachineIndependent/glslang.y" - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(2); - } -#line 8242 "MachineIndependent/glslang_tab.cpp" - break; - - case 291: /* type_specifier_nonarray: U32VEC3 */ + case 291: /* type_specifier_nonarray: U32VEC2 */ #line 2182 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setVector(2); } -#line 8253 "MachineIndependent/glslang_tab.cpp" +#line 8281 "MachineIndependent/glslang_tab.cpp" break; - case 292: /* type_specifier_nonarray: U32VEC4 */ + case 292: /* type_specifier_nonarray: U32VEC3 */ #line 2188 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); + } +#line 8292 "MachineIndependent/glslang_tab.cpp" + break; + + case 293: /* type_specifier_nonarray: U32VEC4 */ +#line 2194 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 8264 "MachineIndependent/glslang_tab.cpp" +#line 8303 "MachineIndependent/glslang_tab.cpp" break; - case 293: /* type_specifier_nonarray: U64VEC2 */ -#line 2194 "MachineIndependent/glslang.y" + case 294: /* type_specifier_nonarray: U64VEC2 */ +#line 2200 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 8275 "MachineIndependent/glslang_tab.cpp" +#line 8314 "MachineIndependent/glslang_tab.cpp" break; - case 294: /* type_specifier_nonarray: U64VEC3 */ -#line 2200 "MachineIndependent/glslang.y" + case 295: /* type_specifier_nonarray: U64VEC3 */ +#line 2206 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 8286 "MachineIndependent/glslang_tab.cpp" +#line 8325 "MachineIndependent/glslang_tab.cpp" break; - case 295: /* type_specifier_nonarray: U64VEC4 */ -#line 2206 "MachineIndependent/glslang.y" + case 296: /* type_specifier_nonarray: U64VEC4 */ +#line 2212 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 8297 "MachineIndependent/glslang_tab.cpp" - break; - - case 296: /* type_specifier_nonarray: DMAT2 */ -#line 2212 "MachineIndependent/glslang.y" - { - parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); - if (! parseContext.symbolTable.atBuiltInLevel()) - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 2); - } -#line 8310 "MachineIndependent/glslang_tab.cpp" - break; - - case 297: /* type_specifier_nonarray: DMAT3 */ -#line 2220 "MachineIndependent/glslang.y" - { - parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); - if (! parseContext.symbolTable.atBuiltInLevel()) - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 3); - } -#line 8323 "MachineIndependent/glslang_tab.cpp" - break; - - case 298: /* type_specifier_nonarray: DMAT4 */ -#line 2228 "MachineIndependent/glslang.y" - { - parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); - if (! parseContext.symbolTable.atBuiltInLevel()) - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); - } #line 8336 "MachineIndependent/glslang_tab.cpp" break; - case 299: /* type_specifier_nonarray: DMAT2X2 */ -#line 2236 "MachineIndependent/glslang.y" - { + case 297: /* type_specifier_nonarray: DMAT2 */ +#line 2218 "MachineIndependent/glslang.y" + { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); @@ -8348,8 +8348,47 @@ yyreduce: #line 8349 "MachineIndependent/glslang_tab.cpp" break; - case 300: /* type_specifier_nonarray: DMAT2X3 */ -#line 2244 "MachineIndependent/glslang.y" + case 298: /* type_specifier_nonarray: DMAT3 */ +#line 2226 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); + } +#line 8362 "MachineIndependent/glslang_tab.cpp" + break; + + case 299: /* type_specifier_nonarray: DMAT4 */ +#line 2234 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); + } +#line 8375 "MachineIndependent/glslang_tab.cpp" + break; + + case 300: /* type_specifier_nonarray: DMAT2X2 */ +#line 2242 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); + } +#line 8388 "MachineIndependent/glslang_tab.cpp" + break; + + case 301: /* type_specifier_nonarray: DMAT2X3 */ +#line 2250 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8358,11 +8397,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8362 "MachineIndependent/glslang_tab.cpp" +#line 8401 "MachineIndependent/glslang_tab.cpp" break; - case 301: /* type_specifier_nonarray: DMAT2X4 */ -#line 2252 "MachineIndependent/glslang.y" + case 302: /* type_specifier_nonarray: DMAT2X4 */ +#line 2258 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8371,11 +8410,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8375 "MachineIndependent/glslang_tab.cpp" +#line 8414 "MachineIndependent/glslang_tab.cpp" break; - case 302: /* type_specifier_nonarray: DMAT3X2 */ -#line 2260 "MachineIndependent/glslang.y" + case 303: /* type_specifier_nonarray: DMAT3X2 */ +#line 2266 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8384,11 +8423,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8388 "MachineIndependent/glslang_tab.cpp" +#line 8427 "MachineIndependent/glslang_tab.cpp" break; - case 303: /* type_specifier_nonarray: DMAT3X3 */ -#line 2268 "MachineIndependent/glslang.y" + case 304: /* type_specifier_nonarray: DMAT3X3 */ +#line 2274 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8397,11 +8436,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8401 "MachineIndependent/glslang_tab.cpp" +#line 8440 "MachineIndependent/glslang_tab.cpp" break; - case 304: /* type_specifier_nonarray: DMAT3X4 */ -#line 2276 "MachineIndependent/glslang.y" + case 305: /* type_specifier_nonarray: DMAT3X4 */ +#line 2282 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8410,11 +8449,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8414 "MachineIndependent/glslang_tab.cpp" +#line 8453 "MachineIndependent/glslang_tab.cpp" break; - case 305: /* type_specifier_nonarray: DMAT4X2 */ -#line 2284 "MachineIndependent/glslang.y" + case 306: /* type_specifier_nonarray: DMAT4X2 */ +#line 2290 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8423,11 +8462,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8427 "MachineIndependent/glslang_tab.cpp" +#line 8466 "MachineIndependent/glslang_tab.cpp" break; - case 306: /* type_specifier_nonarray: DMAT4X3 */ -#line 2292 "MachineIndependent/glslang.y" + case 307: /* type_specifier_nonarray: DMAT4X3 */ +#line 2298 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8436,11 +8475,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8440 "MachineIndependent/glslang_tab.cpp" +#line 8479 "MachineIndependent/glslang_tab.cpp" break; - case 307: /* type_specifier_nonarray: DMAT4X4 */ -#line 2300 "MachineIndependent/glslang.y" + case 308: /* type_specifier_nonarray: DMAT4X4 */ +#line 2306 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8449,2228 +8488,2261 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8453 "MachineIndependent/glslang_tab.cpp" +#line 8492 "MachineIndependent/glslang_tab.cpp" break; - case 308: /* type_specifier_nonarray: F16MAT2 */ -#line 2308 "MachineIndependent/glslang.y" - { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); - } -#line 8464 "MachineIndependent/glslang_tab.cpp" - break; - - case 309: /* type_specifier_nonarray: F16MAT3 */ + case 309: /* type_specifier_nonarray: F16MAT2 */ #line 2314 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 8475 "MachineIndependent/glslang_tab.cpp" +#line 8503 "MachineIndependent/glslang_tab.cpp" break; - case 310: /* type_specifier_nonarray: F16MAT4 */ + case 310: /* type_specifier_nonarray: F16MAT3 */ #line 2320 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).setMatrix(3, 3); } -#line 8486 "MachineIndependent/glslang_tab.cpp" +#line 8514 "MachineIndependent/glslang_tab.cpp" break; - case 311: /* type_specifier_nonarray: F16MAT2X2 */ + case 311: /* type_specifier_nonarray: F16MAT4 */ #line 2326 "MachineIndependent/glslang.y" - { + { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).setMatrix(4, 4); } -#line 8497 "MachineIndependent/glslang_tab.cpp" +#line 8525 "MachineIndependent/glslang_tab.cpp" break; - case 312: /* type_specifier_nonarray: F16MAT2X3 */ + case 312: /* type_specifier_nonarray: F16MAT2X2 */ #line 2332 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 8508 "MachineIndependent/glslang_tab.cpp" +#line 8536 "MachineIndependent/glslang_tab.cpp" break; - case 313: /* type_specifier_nonarray: F16MAT2X4 */ + case 313: /* type_specifier_nonarray: F16MAT2X3 */ #line 2338 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 4); + (yyval.interm.type).setMatrix(2, 3); } -#line 8519 "MachineIndependent/glslang_tab.cpp" +#line 8547 "MachineIndependent/glslang_tab.cpp" break; - case 314: /* type_specifier_nonarray: F16MAT3X2 */ + case 314: /* type_specifier_nonarray: F16MAT2X4 */ #line 2344 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 2); + (yyval.interm.type).setMatrix(2, 4); } -#line 8530 "MachineIndependent/glslang_tab.cpp" +#line 8558 "MachineIndependent/glslang_tab.cpp" break; - case 315: /* type_specifier_nonarray: F16MAT3X3 */ + case 315: /* type_specifier_nonarray: F16MAT3X2 */ #line 2350 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).setMatrix(3, 2); } -#line 8541 "MachineIndependent/glslang_tab.cpp" +#line 8569 "MachineIndependent/glslang_tab.cpp" break; - case 316: /* type_specifier_nonarray: F16MAT3X4 */ + case 316: /* type_specifier_nonarray: F16MAT3X3 */ #line 2356 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).setMatrix(3, 3); } -#line 8552 "MachineIndependent/glslang_tab.cpp" +#line 8580 "MachineIndependent/glslang_tab.cpp" break; - case 317: /* type_specifier_nonarray: F16MAT4X2 */ + case 317: /* type_specifier_nonarray: F16MAT3X4 */ #line 2362 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).setMatrix(3, 4); } -#line 8563 "MachineIndependent/glslang_tab.cpp" +#line 8591 "MachineIndependent/glslang_tab.cpp" break; - case 318: /* type_specifier_nonarray: F16MAT4X3 */ + case 318: /* type_specifier_nonarray: F16MAT4X2 */ #line 2368 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(4, 2); } -#line 8574 "MachineIndependent/glslang_tab.cpp" +#line 8602 "MachineIndependent/glslang_tab.cpp" break; - case 319: /* type_specifier_nonarray: F16MAT4X4 */ + case 319: /* type_specifier_nonarray: F16MAT4X3 */ #line 2374 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 3); + } +#line 8613 "MachineIndependent/glslang_tab.cpp" + break; + + case 320: /* type_specifier_nonarray: F16MAT4X4 */ +#line 2380 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8585 "MachineIndependent/glslang_tab.cpp" +#line 8624 "MachineIndependent/glslang_tab.cpp" break; - case 320: /* type_specifier_nonarray: F32MAT2 */ -#line 2380 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); - } -#line 8596 "MachineIndependent/glslang_tab.cpp" - break; - - case 321: /* type_specifier_nonarray: F32MAT3 */ + case 321: /* type_specifier_nonarray: F32MAT2 */ #line 2386 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 8607 "MachineIndependent/glslang_tab.cpp" +#line 8635 "MachineIndependent/glslang_tab.cpp" break; - case 322: /* type_specifier_nonarray: F32MAT4 */ + case 322: /* type_specifier_nonarray: F32MAT3 */ #line 2392 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).setMatrix(3, 3); } -#line 8618 "MachineIndependent/glslang_tab.cpp" +#line 8646 "MachineIndependent/glslang_tab.cpp" break; - case 323: /* type_specifier_nonarray: F32MAT2X2 */ + case 323: /* type_specifier_nonarray: F32MAT4 */ #line 2398 "MachineIndependent/glslang.y" - { + { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).setMatrix(4, 4); } -#line 8629 "MachineIndependent/glslang_tab.cpp" +#line 8657 "MachineIndependent/glslang_tab.cpp" break; - case 324: /* type_specifier_nonarray: F32MAT2X3 */ + case 324: /* type_specifier_nonarray: F32MAT2X2 */ #line 2404 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 8640 "MachineIndependent/glslang_tab.cpp" +#line 8668 "MachineIndependent/glslang_tab.cpp" break; - case 325: /* type_specifier_nonarray: F32MAT2X4 */ + case 325: /* type_specifier_nonarray: F32MAT2X3 */ #line 2410 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 4); + (yyval.interm.type).setMatrix(2, 3); } -#line 8651 "MachineIndependent/glslang_tab.cpp" +#line 8679 "MachineIndependent/glslang_tab.cpp" break; - case 326: /* type_specifier_nonarray: F32MAT3X2 */ + case 326: /* type_specifier_nonarray: F32MAT2X4 */ #line 2416 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); + } +#line 8690 "MachineIndependent/glslang_tab.cpp" + break; + + case 327: /* type_specifier_nonarray: F32MAT3X2 */ +#line 2422 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 8662 "MachineIndependent/glslang_tab.cpp" +#line 8701 "MachineIndependent/glslang_tab.cpp" break; - case 327: /* type_specifier_nonarray: F32MAT3X3 */ -#line 2422 "MachineIndependent/glslang.y" + case 328: /* type_specifier_nonarray: F32MAT3X3 */ +#line 2428 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8673 "MachineIndependent/glslang_tab.cpp" +#line 8712 "MachineIndependent/glslang_tab.cpp" break; - case 328: /* type_specifier_nonarray: F32MAT3X4 */ -#line 2428 "MachineIndependent/glslang.y" + case 329: /* type_specifier_nonarray: F32MAT3X4 */ +#line 2434 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 8684 "MachineIndependent/glslang_tab.cpp" +#line 8723 "MachineIndependent/glslang_tab.cpp" break; - case 329: /* type_specifier_nonarray: F32MAT4X2 */ -#line 2434 "MachineIndependent/glslang.y" + case 330: /* type_specifier_nonarray: F32MAT4X2 */ +#line 2440 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 8695 "MachineIndependent/glslang_tab.cpp" +#line 8734 "MachineIndependent/glslang_tab.cpp" break; - case 330: /* type_specifier_nonarray: F32MAT4X3 */ -#line 2440 "MachineIndependent/glslang.y" + case 331: /* type_specifier_nonarray: F32MAT4X3 */ +#line 2446 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 8706 "MachineIndependent/glslang_tab.cpp" +#line 8745 "MachineIndependent/glslang_tab.cpp" break; - case 331: /* type_specifier_nonarray: F32MAT4X4 */ -#line 2446 "MachineIndependent/glslang.y" + case 332: /* type_specifier_nonarray: F32MAT4X4 */ +#line 2452 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8717 "MachineIndependent/glslang_tab.cpp" +#line 8756 "MachineIndependent/glslang_tab.cpp" break; - case 332: /* type_specifier_nonarray: F64MAT2 */ -#line 2452 "MachineIndependent/glslang.y" + case 333: /* type_specifier_nonarray: F64MAT2 */ +#line 2458 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8728 "MachineIndependent/glslang_tab.cpp" +#line 8767 "MachineIndependent/glslang_tab.cpp" break; - case 333: /* type_specifier_nonarray: F64MAT3 */ -#line 2458 "MachineIndependent/glslang.y" + case 334: /* type_specifier_nonarray: F64MAT3 */ +#line 2464 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8739 "MachineIndependent/glslang_tab.cpp" +#line 8778 "MachineIndependent/glslang_tab.cpp" break; - case 334: /* type_specifier_nonarray: F64MAT4 */ -#line 2464 "MachineIndependent/glslang.y" + case 335: /* type_specifier_nonarray: F64MAT4 */ +#line 2470 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8750 "MachineIndependent/glslang_tab.cpp" +#line 8789 "MachineIndependent/glslang_tab.cpp" break; - case 335: /* type_specifier_nonarray: F64MAT2X2 */ -#line 2470 "MachineIndependent/glslang.y" + case 336: /* type_specifier_nonarray: F64MAT2X2 */ +#line 2476 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8761 "MachineIndependent/glslang_tab.cpp" +#line 8800 "MachineIndependent/glslang_tab.cpp" break; - case 336: /* type_specifier_nonarray: F64MAT2X3 */ -#line 2476 "MachineIndependent/glslang.y" + case 337: /* type_specifier_nonarray: F64MAT2X3 */ +#line 2482 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8772 "MachineIndependent/glslang_tab.cpp" +#line 8811 "MachineIndependent/glslang_tab.cpp" break; - case 337: /* type_specifier_nonarray: F64MAT2X4 */ -#line 2482 "MachineIndependent/glslang.y" + case 338: /* type_specifier_nonarray: F64MAT2X4 */ +#line 2488 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8783 "MachineIndependent/glslang_tab.cpp" +#line 8822 "MachineIndependent/glslang_tab.cpp" break; - case 338: /* type_specifier_nonarray: F64MAT3X2 */ -#line 2488 "MachineIndependent/glslang.y" + case 339: /* type_specifier_nonarray: F64MAT3X2 */ +#line 2494 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8794 "MachineIndependent/glslang_tab.cpp" +#line 8833 "MachineIndependent/glslang_tab.cpp" break; - case 339: /* type_specifier_nonarray: F64MAT3X3 */ -#line 2494 "MachineIndependent/glslang.y" + case 340: /* type_specifier_nonarray: F64MAT3X3 */ +#line 2500 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8805 "MachineIndependent/glslang_tab.cpp" +#line 8844 "MachineIndependent/glslang_tab.cpp" break; - case 340: /* type_specifier_nonarray: F64MAT3X4 */ -#line 2500 "MachineIndependent/glslang.y" + case 341: /* type_specifier_nonarray: F64MAT3X4 */ +#line 2506 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8816 "MachineIndependent/glslang_tab.cpp" +#line 8855 "MachineIndependent/glslang_tab.cpp" break; - case 341: /* type_specifier_nonarray: F64MAT4X2 */ -#line 2506 "MachineIndependent/glslang.y" + case 342: /* type_specifier_nonarray: F64MAT4X2 */ +#line 2512 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8827 "MachineIndependent/glslang_tab.cpp" +#line 8866 "MachineIndependent/glslang_tab.cpp" break; - case 342: /* type_specifier_nonarray: F64MAT4X3 */ -#line 2512 "MachineIndependent/glslang.y" + case 343: /* type_specifier_nonarray: F64MAT4X3 */ +#line 2518 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8838 "MachineIndependent/glslang_tab.cpp" +#line 8877 "MachineIndependent/glslang_tab.cpp" break; - case 343: /* type_specifier_nonarray: F64MAT4X4 */ -#line 2518 "MachineIndependent/glslang.y" + case 344: /* type_specifier_nonarray: F64MAT4X4 */ +#line 2524 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8849 "MachineIndependent/glslang_tab.cpp" +#line 8888 "MachineIndependent/glslang_tab.cpp" break; - case 344: /* type_specifier_nonarray: ACCSTRUCTNV */ -#line 2524 "MachineIndependent/glslang.y" + case 345: /* type_specifier_nonarray: ACCSTRUCTNV */ +#line 2530 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8858 "MachineIndependent/glslang_tab.cpp" +#line 8897 "MachineIndependent/glslang_tab.cpp" break; - case 345: /* type_specifier_nonarray: ACCSTRUCTEXT */ -#line 2528 "MachineIndependent/glslang.y" + case 346: /* type_specifier_nonarray: ACCSTRUCTEXT */ +#line 2534 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8867 "MachineIndependent/glslang_tab.cpp" +#line 8906 "MachineIndependent/glslang_tab.cpp" break; - case 346: /* type_specifier_nonarray: RAYQUERYEXT */ -#line 2532 "MachineIndependent/glslang.y" + case 347: /* type_specifier_nonarray: RAYQUERYEXT */ +#line 2538 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtRayQuery; } -#line 8876 "MachineIndependent/glslang_tab.cpp" +#line 8915 "MachineIndependent/glslang_tab.cpp" break; - case 347: /* type_specifier_nonarray: ATOMIC_UINT */ -#line 2536 "MachineIndependent/glslang.y" + case 348: /* type_specifier_nonarray: ATOMIC_UINT */ +#line 2542 "MachineIndependent/glslang.y" { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 8886 "MachineIndependent/glslang_tab.cpp" +#line 8925 "MachineIndependent/glslang_tab.cpp" break; - case 348: /* type_specifier_nonarray: SAMPLER1D */ -#line 2541 "MachineIndependent/glslang.y" + case 349: /* type_specifier_nonarray: SAMPLER1D */ +#line 2547 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 8896 "MachineIndependent/glslang_tab.cpp" +#line 8935 "MachineIndependent/glslang_tab.cpp" break; - case 349: /* type_specifier_nonarray: SAMPLER2D */ -#line 2547 "MachineIndependent/glslang.y" + case 350: /* type_specifier_nonarray: SAMPLER2D */ +#line 2553 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 8906 "MachineIndependent/glslang_tab.cpp" +#line 8945 "MachineIndependent/glslang_tab.cpp" break; - case 350: /* type_specifier_nonarray: SAMPLER3D */ -#line 2552 "MachineIndependent/glslang.y" + case 351: /* type_specifier_nonarray: SAMPLER3D */ +#line 2558 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 8916 "MachineIndependent/glslang_tab.cpp" +#line 8955 "MachineIndependent/glslang_tab.cpp" break; - case 351: /* type_specifier_nonarray: SAMPLERCUBE */ -#line 2557 "MachineIndependent/glslang.y" + case 352: /* type_specifier_nonarray: SAMPLERCUBE */ +#line 2563 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 8926 "MachineIndependent/glslang_tab.cpp" +#line 8965 "MachineIndependent/glslang_tab.cpp" break; - case 352: /* type_specifier_nonarray: SAMPLER2DSHADOW */ -#line 2562 "MachineIndependent/glslang.y" + case 353: /* type_specifier_nonarray: SAMPLER2DSHADOW */ +#line 2568 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 8936 "MachineIndependent/glslang_tab.cpp" +#line 8975 "MachineIndependent/glslang_tab.cpp" break; - case 353: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ -#line 2567 "MachineIndependent/glslang.y" + case 354: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ +#line 2573 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 8946 "MachineIndependent/glslang_tab.cpp" +#line 8985 "MachineIndependent/glslang_tab.cpp" break; - case 354: /* type_specifier_nonarray: SAMPLER2DARRAY */ -#line 2572 "MachineIndependent/glslang.y" + case 355: /* type_specifier_nonarray: SAMPLER2DARRAY */ +#line 2578 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 8956 "MachineIndependent/glslang_tab.cpp" +#line 8995 "MachineIndependent/glslang_tab.cpp" break; - case 355: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ -#line 2577 "MachineIndependent/glslang.y" + case 356: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ +#line 2583 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 8966 "MachineIndependent/glslang_tab.cpp" +#line 9005 "MachineIndependent/glslang_tab.cpp" break; - case 356: /* type_specifier_nonarray: SAMPLER1DSHADOW */ -#line 2583 "MachineIndependent/glslang.y" + case 357: /* type_specifier_nonarray: SAMPLER1DSHADOW */ +#line 2589 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 8976 "MachineIndependent/glslang_tab.cpp" +#line 9015 "MachineIndependent/glslang_tab.cpp" break; - case 357: /* type_specifier_nonarray: SAMPLER1DARRAY */ -#line 2588 "MachineIndependent/glslang.y" + case 358: /* type_specifier_nonarray: SAMPLER1DARRAY */ +#line 2594 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 8986 "MachineIndependent/glslang_tab.cpp" +#line 9025 "MachineIndependent/glslang_tab.cpp" break; - case 358: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ -#line 2593 "MachineIndependent/glslang.y" + case 359: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ +#line 2599 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 8996 "MachineIndependent/glslang_tab.cpp" +#line 9035 "MachineIndependent/glslang_tab.cpp" break; - case 359: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ -#line 2598 "MachineIndependent/glslang.y" + case 360: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ +#line 2604 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 9006 "MachineIndependent/glslang_tab.cpp" +#line 9045 "MachineIndependent/glslang_tab.cpp" break; - case 360: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ -#line 2603 "MachineIndependent/glslang.y" + case 361: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ +#line 2609 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 9016 "MachineIndependent/glslang_tab.cpp" +#line 9055 "MachineIndependent/glslang_tab.cpp" break; - case 361: /* type_specifier_nonarray: F16SAMPLER1D */ -#line 2608 "MachineIndependent/glslang.y" + case 362: /* type_specifier_nonarray: F16SAMPLER1D */ +#line 2614 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); } -#line 9027 "MachineIndependent/glslang_tab.cpp" +#line 9066 "MachineIndependent/glslang_tab.cpp" break; - case 362: /* type_specifier_nonarray: F16SAMPLER2D */ -#line 2614 "MachineIndependent/glslang.y" + case 363: /* type_specifier_nonarray: F16SAMPLER2D */ +#line 2620 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); } -#line 9038 "MachineIndependent/glslang_tab.cpp" +#line 9077 "MachineIndependent/glslang_tab.cpp" break; - case 363: /* type_specifier_nonarray: F16SAMPLER3D */ -#line 2620 "MachineIndependent/glslang.y" + case 364: /* type_specifier_nonarray: F16SAMPLER3D */ +#line 2626 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); } -#line 9049 "MachineIndependent/glslang_tab.cpp" +#line 9088 "MachineIndependent/glslang_tab.cpp" break; - case 364: /* type_specifier_nonarray: F16SAMPLERCUBE */ -#line 2626 "MachineIndependent/glslang.y" + case 365: /* type_specifier_nonarray: F16SAMPLERCUBE */ +#line 2632 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); } -#line 9060 "MachineIndependent/glslang_tab.cpp" +#line 9099 "MachineIndependent/glslang_tab.cpp" break; - case 365: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ -#line 2632 "MachineIndependent/glslang.y" + case 366: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ +#line 2638 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); } -#line 9071 "MachineIndependent/glslang_tab.cpp" +#line 9110 "MachineIndependent/glslang_tab.cpp" break; - case 366: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ -#line 2638 "MachineIndependent/glslang.y" + case 367: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ +#line 2644 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); } -#line 9082 "MachineIndependent/glslang_tab.cpp" +#line 9121 "MachineIndependent/glslang_tab.cpp" break; - case 367: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ -#line 2644 "MachineIndependent/glslang.y" + case 368: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ +#line 2650 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); } -#line 9093 "MachineIndependent/glslang_tab.cpp" +#line 9132 "MachineIndependent/glslang_tab.cpp" break; - case 368: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ -#line 2650 "MachineIndependent/glslang.y" + case 369: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ +#line 2656 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); } -#line 9104 "MachineIndependent/glslang_tab.cpp" +#line 9143 "MachineIndependent/glslang_tab.cpp" break; - case 369: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ -#line 2656 "MachineIndependent/glslang.y" + case 370: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ +#line 2662 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); } -#line 9115 "MachineIndependent/glslang_tab.cpp" +#line 9154 "MachineIndependent/glslang_tab.cpp" break; - case 370: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ -#line 2662 "MachineIndependent/glslang.y" + case 371: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ +#line 2668 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); } -#line 9126 "MachineIndependent/glslang_tab.cpp" +#line 9165 "MachineIndependent/glslang_tab.cpp" break; - case 371: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ -#line 2668 "MachineIndependent/glslang.y" + case 372: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ +#line 2674 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); } -#line 9137 "MachineIndependent/glslang_tab.cpp" +#line 9176 "MachineIndependent/glslang_tab.cpp" break; - case 372: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ -#line 2674 "MachineIndependent/glslang.y" + case 373: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ +#line 2680 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); } -#line 9148 "MachineIndependent/glslang_tab.cpp" +#line 9187 "MachineIndependent/glslang_tab.cpp" break; - case 373: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ -#line 2680 "MachineIndependent/glslang.y" + case 374: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ +#line 2686 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); } -#line 9159 "MachineIndependent/glslang_tab.cpp" +#line 9198 "MachineIndependent/glslang_tab.cpp" break; - case 374: /* type_specifier_nonarray: ISAMPLER1D */ -#line 2686 "MachineIndependent/glslang.y" + case 375: /* type_specifier_nonarray: ISAMPLER1D */ +#line 2692 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 9169 "MachineIndependent/glslang_tab.cpp" +#line 9208 "MachineIndependent/glslang_tab.cpp" break; - case 375: /* type_specifier_nonarray: ISAMPLER2D */ -#line 2692 "MachineIndependent/glslang.y" + case 376: /* type_specifier_nonarray: ISAMPLER2D */ +#line 2698 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 9179 "MachineIndependent/glslang_tab.cpp" +#line 9218 "MachineIndependent/glslang_tab.cpp" break; - case 376: /* type_specifier_nonarray: ISAMPLER3D */ -#line 2697 "MachineIndependent/glslang.y" + case 377: /* type_specifier_nonarray: ISAMPLER3D */ +#line 2703 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 9189 "MachineIndependent/glslang_tab.cpp" +#line 9228 "MachineIndependent/glslang_tab.cpp" break; - case 377: /* type_specifier_nonarray: ISAMPLERCUBE */ -#line 2702 "MachineIndependent/glslang.y" + case 378: /* type_specifier_nonarray: ISAMPLERCUBE */ +#line 2708 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 9199 "MachineIndependent/glslang_tab.cpp" +#line 9238 "MachineIndependent/glslang_tab.cpp" break; - case 378: /* type_specifier_nonarray: ISAMPLER2DARRAY */ -#line 2707 "MachineIndependent/glslang.y" + case 379: /* type_specifier_nonarray: ISAMPLER2DARRAY */ +#line 2713 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 9209 "MachineIndependent/glslang_tab.cpp" +#line 9248 "MachineIndependent/glslang_tab.cpp" break; - case 379: /* type_specifier_nonarray: USAMPLER2D */ -#line 2712 "MachineIndependent/glslang.y" + case 380: /* type_specifier_nonarray: USAMPLER2D */ +#line 2718 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 9219 "MachineIndependent/glslang_tab.cpp" +#line 9258 "MachineIndependent/glslang_tab.cpp" break; - case 380: /* type_specifier_nonarray: USAMPLER3D */ -#line 2717 "MachineIndependent/glslang.y" + case 381: /* type_specifier_nonarray: USAMPLER3D */ +#line 2723 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 9229 "MachineIndependent/glslang_tab.cpp" +#line 9268 "MachineIndependent/glslang_tab.cpp" break; - case 381: /* type_specifier_nonarray: USAMPLERCUBE */ -#line 2722 "MachineIndependent/glslang.y" + case 382: /* type_specifier_nonarray: USAMPLERCUBE */ +#line 2728 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 9239 "MachineIndependent/glslang_tab.cpp" +#line 9278 "MachineIndependent/glslang_tab.cpp" break; - case 382: /* type_specifier_nonarray: ISAMPLER1DARRAY */ -#line 2728 "MachineIndependent/glslang.y" + case 383: /* type_specifier_nonarray: ISAMPLER1DARRAY */ +#line 2734 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 9249 "MachineIndependent/glslang_tab.cpp" +#line 9288 "MachineIndependent/glslang_tab.cpp" break; - case 383: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ -#line 2733 "MachineIndependent/glslang.y" + case 384: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ +#line 2739 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 9259 "MachineIndependent/glslang_tab.cpp" +#line 9298 "MachineIndependent/glslang_tab.cpp" break; - case 384: /* type_specifier_nonarray: USAMPLER1D */ -#line 2738 "MachineIndependent/glslang.y" + case 385: /* type_specifier_nonarray: USAMPLER1D */ +#line 2744 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 9269 "MachineIndependent/glslang_tab.cpp" +#line 9308 "MachineIndependent/glslang_tab.cpp" break; - case 385: /* type_specifier_nonarray: USAMPLER1DARRAY */ -#line 2743 "MachineIndependent/glslang.y" + case 386: /* type_specifier_nonarray: USAMPLER1DARRAY */ +#line 2749 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 9279 "MachineIndependent/glslang_tab.cpp" +#line 9318 "MachineIndependent/glslang_tab.cpp" break; - case 386: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ -#line 2748 "MachineIndependent/glslang.y" + case 387: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ +#line 2754 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 9289 "MachineIndependent/glslang_tab.cpp" +#line 9328 "MachineIndependent/glslang_tab.cpp" break; - case 387: /* type_specifier_nonarray: TEXTURECUBEARRAY */ -#line 2753 "MachineIndependent/glslang.y" + case 388: /* type_specifier_nonarray: TEXTURECUBEARRAY */ +#line 2759 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 9299 "MachineIndependent/glslang_tab.cpp" +#line 9338 "MachineIndependent/glslang_tab.cpp" break; - case 388: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ -#line 2758 "MachineIndependent/glslang.y" + case 389: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ +#line 2764 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 9309 "MachineIndependent/glslang_tab.cpp" +#line 9348 "MachineIndependent/glslang_tab.cpp" break; - case 389: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ -#line 2763 "MachineIndependent/glslang.y" + case 390: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ +#line 2769 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 9319 "MachineIndependent/glslang_tab.cpp" +#line 9358 "MachineIndependent/glslang_tab.cpp" break; - case 390: /* type_specifier_nonarray: USAMPLER2DARRAY */ -#line 2769 "MachineIndependent/glslang.y" + case 391: /* type_specifier_nonarray: USAMPLER2DARRAY */ +#line 2775 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 9329 "MachineIndependent/glslang_tab.cpp" +#line 9368 "MachineIndependent/glslang_tab.cpp" break; - case 391: /* type_specifier_nonarray: TEXTURE2D */ -#line 2774 "MachineIndependent/glslang.y" + case 392: /* type_specifier_nonarray: TEXTURE2D */ +#line 2780 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 9339 "MachineIndependent/glslang_tab.cpp" +#line 9378 "MachineIndependent/glslang_tab.cpp" break; - case 392: /* type_specifier_nonarray: TEXTURE3D */ -#line 2779 "MachineIndependent/glslang.y" + case 393: /* type_specifier_nonarray: TEXTURE3D */ +#line 2785 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 9349 "MachineIndependent/glslang_tab.cpp" +#line 9388 "MachineIndependent/glslang_tab.cpp" break; - case 393: /* type_specifier_nonarray: TEXTURE2DARRAY */ -#line 2784 "MachineIndependent/glslang.y" + case 394: /* type_specifier_nonarray: TEXTURE2DARRAY */ +#line 2790 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 9359 "MachineIndependent/glslang_tab.cpp" +#line 9398 "MachineIndependent/glslang_tab.cpp" break; - case 394: /* type_specifier_nonarray: TEXTURECUBE */ -#line 2789 "MachineIndependent/glslang.y" + case 395: /* type_specifier_nonarray: TEXTURECUBE */ +#line 2795 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 9369 "MachineIndependent/glslang_tab.cpp" +#line 9408 "MachineIndependent/glslang_tab.cpp" break; - case 395: /* type_specifier_nonarray: ITEXTURE2D */ -#line 2794 "MachineIndependent/glslang.y" + case 396: /* type_specifier_nonarray: ITEXTURE2D */ +#line 2800 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 9379 "MachineIndependent/glslang_tab.cpp" +#line 9418 "MachineIndependent/glslang_tab.cpp" break; - case 396: /* type_specifier_nonarray: ITEXTURE3D */ -#line 2799 "MachineIndependent/glslang.y" + case 397: /* type_specifier_nonarray: ITEXTURE3D */ +#line 2805 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 9389 "MachineIndependent/glslang_tab.cpp" +#line 9428 "MachineIndependent/glslang_tab.cpp" break; - case 397: /* type_specifier_nonarray: ITEXTURECUBE */ -#line 2804 "MachineIndependent/glslang.y" + case 398: /* type_specifier_nonarray: ITEXTURECUBE */ +#line 2810 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 9399 "MachineIndependent/glslang_tab.cpp" +#line 9438 "MachineIndependent/glslang_tab.cpp" break; - case 398: /* type_specifier_nonarray: ITEXTURE2DARRAY */ -#line 2809 "MachineIndependent/glslang.y" + case 399: /* type_specifier_nonarray: ITEXTURE2DARRAY */ +#line 2815 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 9409 "MachineIndependent/glslang_tab.cpp" +#line 9448 "MachineIndependent/glslang_tab.cpp" break; - case 399: /* type_specifier_nonarray: UTEXTURE2D */ -#line 2814 "MachineIndependent/glslang.y" + case 400: /* type_specifier_nonarray: UTEXTURE2D */ +#line 2820 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 9419 "MachineIndependent/glslang_tab.cpp" +#line 9458 "MachineIndependent/glslang_tab.cpp" break; - case 400: /* type_specifier_nonarray: UTEXTURE3D */ -#line 2819 "MachineIndependent/glslang.y" + case 401: /* type_specifier_nonarray: UTEXTURE3D */ +#line 2825 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 9429 "MachineIndependent/glslang_tab.cpp" +#line 9468 "MachineIndependent/glslang_tab.cpp" break; - case 401: /* type_specifier_nonarray: UTEXTURECUBE */ -#line 2824 "MachineIndependent/glslang.y" + case 402: /* type_specifier_nonarray: UTEXTURECUBE */ +#line 2830 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 9439 "MachineIndependent/glslang_tab.cpp" +#line 9478 "MachineIndependent/glslang_tab.cpp" break; - case 402: /* type_specifier_nonarray: UTEXTURE2DARRAY */ -#line 2829 "MachineIndependent/glslang.y" + case 403: /* type_specifier_nonarray: UTEXTURE2DARRAY */ +#line 2835 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 9449 "MachineIndependent/glslang_tab.cpp" +#line 9488 "MachineIndependent/glslang_tab.cpp" break; - case 403: /* type_specifier_nonarray: SAMPLER */ -#line 2834 "MachineIndependent/glslang.y" + case 404: /* type_specifier_nonarray: SAMPLER */ +#line 2840 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 9459 "MachineIndependent/glslang_tab.cpp" +#line 9498 "MachineIndependent/glslang_tab.cpp" break; - case 404: /* type_specifier_nonarray: SAMPLERSHADOW */ -#line 2839 "MachineIndependent/glslang.y" + case 405: /* type_specifier_nonarray: SAMPLERSHADOW */ +#line 2845 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 9469 "MachineIndependent/glslang_tab.cpp" +#line 9508 "MachineIndependent/glslang_tab.cpp" break; - case 405: /* type_specifier_nonarray: SAMPLER2DRECT */ -#line 2845 "MachineIndependent/glslang.y" + case 406: /* type_specifier_nonarray: SAMPLER2DRECT */ +#line 2851 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 9479 "MachineIndependent/glslang_tab.cpp" +#line 9518 "MachineIndependent/glslang_tab.cpp" break; - case 406: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ -#line 2850 "MachineIndependent/glslang.y" + case 407: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ +#line 2856 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 9489 "MachineIndependent/glslang_tab.cpp" +#line 9528 "MachineIndependent/glslang_tab.cpp" break; - case 407: /* type_specifier_nonarray: F16SAMPLER2DRECT */ -#line 2855 "MachineIndependent/glslang.y" + case 408: /* type_specifier_nonarray: F16SAMPLER2DRECT */ +#line 2861 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); } -#line 9500 "MachineIndependent/glslang_tab.cpp" +#line 9539 "MachineIndependent/glslang_tab.cpp" break; - case 408: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ -#line 2861 "MachineIndependent/glslang.y" + case 409: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ +#line 2867 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); } -#line 9511 "MachineIndependent/glslang_tab.cpp" +#line 9550 "MachineIndependent/glslang_tab.cpp" break; - case 409: /* type_specifier_nonarray: ISAMPLER2DRECT */ -#line 2867 "MachineIndependent/glslang.y" + case 410: /* type_specifier_nonarray: ISAMPLER2DRECT */ +#line 2873 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 9521 "MachineIndependent/glslang_tab.cpp" +#line 9560 "MachineIndependent/glslang_tab.cpp" break; - case 410: /* type_specifier_nonarray: USAMPLER2DRECT */ -#line 2872 "MachineIndependent/glslang.y" + case 411: /* type_specifier_nonarray: USAMPLER2DRECT */ +#line 2878 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 9531 "MachineIndependent/glslang_tab.cpp" +#line 9570 "MachineIndependent/glslang_tab.cpp" break; - case 411: /* type_specifier_nonarray: SAMPLERBUFFER */ -#line 2877 "MachineIndependent/glslang.y" + case 412: /* type_specifier_nonarray: SAMPLERBUFFER */ +#line 2883 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 9541 "MachineIndependent/glslang_tab.cpp" +#line 9580 "MachineIndependent/glslang_tab.cpp" break; - case 412: /* type_specifier_nonarray: F16SAMPLERBUFFER */ -#line 2882 "MachineIndependent/glslang.y" + case 413: /* type_specifier_nonarray: F16SAMPLERBUFFER */ +#line 2888 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); } -#line 9552 "MachineIndependent/glslang_tab.cpp" +#line 9591 "MachineIndependent/glslang_tab.cpp" break; - case 413: /* type_specifier_nonarray: ISAMPLERBUFFER */ -#line 2888 "MachineIndependent/glslang.y" + case 414: /* type_specifier_nonarray: ISAMPLERBUFFER */ +#line 2894 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 9562 "MachineIndependent/glslang_tab.cpp" +#line 9601 "MachineIndependent/glslang_tab.cpp" break; - case 414: /* type_specifier_nonarray: USAMPLERBUFFER */ -#line 2893 "MachineIndependent/glslang.y" + case 415: /* type_specifier_nonarray: USAMPLERBUFFER */ +#line 2899 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 9572 "MachineIndependent/glslang_tab.cpp" +#line 9611 "MachineIndependent/glslang_tab.cpp" break; - case 415: /* type_specifier_nonarray: SAMPLER2DMS */ -#line 2898 "MachineIndependent/glslang.y" + case 416: /* type_specifier_nonarray: SAMPLER2DMS */ +#line 2904 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 9582 "MachineIndependent/glslang_tab.cpp" +#line 9621 "MachineIndependent/glslang_tab.cpp" break; - case 416: /* type_specifier_nonarray: F16SAMPLER2DMS */ -#line 2903 "MachineIndependent/glslang.y" + case 417: /* type_specifier_nonarray: F16SAMPLER2DMS */ +#line 2909 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); } -#line 9593 "MachineIndependent/glslang_tab.cpp" +#line 9632 "MachineIndependent/glslang_tab.cpp" break; - case 417: /* type_specifier_nonarray: ISAMPLER2DMS */ -#line 2909 "MachineIndependent/glslang.y" + case 418: /* type_specifier_nonarray: ISAMPLER2DMS */ +#line 2915 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 9603 "MachineIndependent/glslang_tab.cpp" +#line 9642 "MachineIndependent/glslang_tab.cpp" break; - case 418: /* type_specifier_nonarray: USAMPLER2DMS */ -#line 2914 "MachineIndependent/glslang.y" + case 419: /* type_specifier_nonarray: USAMPLER2DMS */ +#line 2920 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 9613 "MachineIndependent/glslang_tab.cpp" +#line 9652 "MachineIndependent/glslang_tab.cpp" break; - case 419: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ -#line 2919 "MachineIndependent/glslang.y" + case 420: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ +#line 2925 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 9623 "MachineIndependent/glslang_tab.cpp" +#line 9662 "MachineIndependent/glslang_tab.cpp" break; - case 420: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ -#line 2924 "MachineIndependent/glslang.y" + case 421: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ +#line 2930 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); } -#line 9634 "MachineIndependent/glslang_tab.cpp" +#line 9673 "MachineIndependent/glslang_tab.cpp" break; - case 421: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ -#line 2930 "MachineIndependent/glslang.y" + case 422: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ +#line 2936 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 9644 "MachineIndependent/glslang_tab.cpp" +#line 9683 "MachineIndependent/glslang_tab.cpp" break; - case 422: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ -#line 2935 "MachineIndependent/glslang.y" + case 423: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ +#line 2941 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 9654 "MachineIndependent/glslang_tab.cpp" +#line 9693 "MachineIndependent/glslang_tab.cpp" break; - case 423: /* type_specifier_nonarray: TEXTURE1D */ -#line 2940 "MachineIndependent/glslang.y" + case 424: /* type_specifier_nonarray: TEXTURE1D */ +#line 2946 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 9664 "MachineIndependent/glslang_tab.cpp" +#line 9703 "MachineIndependent/glslang_tab.cpp" break; - case 424: /* type_specifier_nonarray: F16TEXTURE1D */ -#line 2945 "MachineIndependent/glslang.y" + case 425: /* type_specifier_nonarray: F16TEXTURE1D */ +#line 2951 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); } -#line 9675 "MachineIndependent/glslang_tab.cpp" +#line 9714 "MachineIndependent/glslang_tab.cpp" break; - case 425: /* type_specifier_nonarray: F16TEXTURE2D */ -#line 2951 "MachineIndependent/glslang.y" + case 426: /* type_specifier_nonarray: F16TEXTURE2D */ +#line 2957 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); } -#line 9686 "MachineIndependent/glslang_tab.cpp" +#line 9725 "MachineIndependent/glslang_tab.cpp" break; - case 426: /* type_specifier_nonarray: F16TEXTURE3D */ -#line 2957 "MachineIndependent/glslang.y" + case 427: /* type_specifier_nonarray: F16TEXTURE3D */ +#line 2963 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); } -#line 9697 "MachineIndependent/glslang_tab.cpp" +#line 9736 "MachineIndependent/glslang_tab.cpp" break; - case 427: /* type_specifier_nonarray: F16TEXTURECUBE */ -#line 2963 "MachineIndependent/glslang.y" + case 428: /* type_specifier_nonarray: F16TEXTURECUBE */ +#line 2969 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); } -#line 9708 "MachineIndependent/glslang_tab.cpp" +#line 9747 "MachineIndependent/glslang_tab.cpp" break; - case 428: /* type_specifier_nonarray: TEXTURE1DARRAY */ -#line 2969 "MachineIndependent/glslang.y" + case 429: /* type_specifier_nonarray: TEXTURE1DARRAY */ +#line 2975 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 9718 "MachineIndependent/glslang_tab.cpp" +#line 9757 "MachineIndependent/glslang_tab.cpp" break; - case 429: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ -#line 2974 "MachineIndependent/glslang.y" + case 430: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ +#line 2980 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); } -#line 9729 "MachineIndependent/glslang_tab.cpp" +#line 9768 "MachineIndependent/glslang_tab.cpp" break; - case 430: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ -#line 2980 "MachineIndependent/glslang.y" + case 431: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ +#line 2986 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); } -#line 9740 "MachineIndependent/glslang_tab.cpp" +#line 9779 "MachineIndependent/glslang_tab.cpp" break; - case 431: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ -#line 2986 "MachineIndependent/glslang.y" + case 432: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ +#line 2992 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); } -#line 9751 "MachineIndependent/glslang_tab.cpp" +#line 9790 "MachineIndependent/glslang_tab.cpp" break; - case 432: /* type_specifier_nonarray: ITEXTURE1D */ -#line 2992 "MachineIndependent/glslang.y" + case 433: /* type_specifier_nonarray: ITEXTURE1D */ +#line 2998 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 9761 "MachineIndependent/glslang_tab.cpp" +#line 9800 "MachineIndependent/glslang_tab.cpp" break; - case 433: /* type_specifier_nonarray: ITEXTURE1DARRAY */ -#line 2997 "MachineIndependent/glslang.y" + case 434: /* type_specifier_nonarray: ITEXTURE1DARRAY */ +#line 3003 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 9771 "MachineIndependent/glslang_tab.cpp" +#line 9810 "MachineIndependent/glslang_tab.cpp" break; - case 434: /* type_specifier_nonarray: UTEXTURE1D */ -#line 3002 "MachineIndependent/glslang.y" + case 435: /* type_specifier_nonarray: UTEXTURE1D */ +#line 3008 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 9781 "MachineIndependent/glslang_tab.cpp" +#line 9820 "MachineIndependent/glslang_tab.cpp" break; - case 435: /* type_specifier_nonarray: UTEXTURE1DARRAY */ -#line 3007 "MachineIndependent/glslang.y" + case 436: /* type_specifier_nonarray: UTEXTURE1DARRAY */ +#line 3013 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 9791 "MachineIndependent/glslang_tab.cpp" +#line 9830 "MachineIndependent/glslang_tab.cpp" break; - case 436: /* type_specifier_nonarray: TEXTURE2DRECT */ -#line 3012 "MachineIndependent/glslang.y" + case 437: /* type_specifier_nonarray: TEXTURE2DRECT */ +#line 3018 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 9801 "MachineIndependent/glslang_tab.cpp" +#line 9840 "MachineIndependent/glslang_tab.cpp" break; - case 437: /* type_specifier_nonarray: F16TEXTURE2DRECT */ -#line 3017 "MachineIndependent/glslang.y" + case 438: /* type_specifier_nonarray: F16TEXTURE2DRECT */ +#line 3023 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); } -#line 9812 "MachineIndependent/glslang_tab.cpp" +#line 9851 "MachineIndependent/glslang_tab.cpp" break; - case 438: /* type_specifier_nonarray: ITEXTURE2DRECT */ -#line 3023 "MachineIndependent/glslang.y" + case 439: /* type_specifier_nonarray: ITEXTURE2DRECT */ +#line 3029 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 9822 "MachineIndependent/glslang_tab.cpp" +#line 9861 "MachineIndependent/glslang_tab.cpp" break; - case 439: /* type_specifier_nonarray: UTEXTURE2DRECT */ -#line 3028 "MachineIndependent/glslang.y" + case 440: /* type_specifier_nonarray: UTEXTURE2DRECT */ +#line 3034 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 9832 "MachineIndependent/glslang_tab.cpp" +#line 9871 "MachineIndependent/glslang_tab.cpp" break; - case 440: /* type_specifier_nonarray: TEXTUREBUFFER */ -#line 3033 "MachineIndependent/glslang.y" + case 441: /* type_specifier_nonarray: TEXTUREBUFFER */ +#line 3039 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 9842 "MachineIndependent/glslang_tab.cpp" +#line 9881 "MachineIndependent/glslang_tab.cpp" break; - case 441: /* type_specifier_nonarray: F16TEXTUREBUFFER */ -#line 3038 "MachineIndependent/glslang.y" + case 442: /* type_specifier_nonarray: F16TEXTUREBUFFER */ +#line 3044 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); } -#line 9853 "MachineIndependent/glslang_tab.cpp" +#line 9892 "MachineIndependent/glslang_tab.cpp" break; - case 442: /* type_specifier_nonarray: ITEXTUREBUFFER */ -#line 3044 "MachineIndependent/glslang.y" + case 443: /* type_specifier_nonarray: ITEXTUREBUFFER */ +#line 3050 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 9863 "MachineIndependent/glslang_tab.cpp" +#line 9902 "MachineIndependent/glslang_tab.cpp" break; - case 443: /* type_specifier_nonarray: UTEXTUREBUFFER */ -#line 3049 "MachineIndependent/glslang.y" + case 444: /* type_specifier_nonarray: UTEXTUREBUFFER */ +#line 3055 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 9873 "MachineIndependent/glslang_tab.cpp" +#line 9912 "MachineIndependent/glslang_tab.cpp" break; - case 444: /* type_specifier_nonarray: TEXTURE2DMS */ -#line 3054 "MachineIndependent/glslang.y" + case 445: /* type_specifier_nonarray: TEXTURE2DMS */ +#line 3060 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 9883 "MachineIndependent/glslang_tab.cpp" +#line 9922 "MachineIndependent/glslang_tab.cpp" break; - case 445: /* type_specifier_nonarray: F16TEXTURE2DMS */ -#line 3059 "MachineIndependent/glslang.y" + case 446: /* type_specifier_nonarray: F16TEXTURE2DMS */ +#line 3065 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); } -#line 9894 "MachineIndependent/glslang_tab.cpp" +#line 9933 "MachineIndependent/glslang_tab.cpp" break; - case 446: /* type_specifier_nonarray: ITEXTURE2DMS */ -#line 3065 "MachineIndependent/glslang.y" + case 447: /* type_specifier_nonarray: ITEXTURE2DMS */ +#line 3071 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 9904 "MachineIndependent/glslang_tab.cpp" +#line 9943 "MachineIndependent/glslang_tab.cpp" break; - case 447: /* type_specifier_nonarray: UTEXTURE2DMS */ -#line 3070 "MachineIndependent/glslang.y" + case 448: /* type_specifier_nonarray: UTEXTURE2DMS */ +#line 3076 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 9914 "MachineIndependent/glslang_tab.cpp" +#line 9953 "MachineIndependent/glslang_tab.cpp" break; - case 448: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ -#line 3075 "MachineIndependent/glslang.y" + case 449: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ +#line 3081 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 9924 "MachineIndependent/glslang_tab.cpp" +#line 9963 "MachineIndependent/glslang_tab.cpp" break; - case 449: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ -#line 3080 "MachineIndependent/glslang.y" + case 450: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ +#line 3086 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); } -#line 9935 "MachineIndependent/glslang_tab.cpp" +#line 9974 "MachineIndependent/glslang_tab.cpp" break; - case 450: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ -#line 3086 "MachineIndependent/glslang.y" + case 451: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ +#line 3092 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 9945 "MachineIndependent/glslang_tab.cpp" +#line 9984 "MachineIndependent/glslang_tab.cpp" break; - case 451: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ -#line 3091 "MachineIndependent/glslang.y" + case 452: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ +#line 3097 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 9955 "MachineIndependent/glslang_tab.cpp" +#line 9994 "MachineIndependent/glslang_tab.cpp" break; - case 452: /* type_specifier_nonarray: IMAGE1D */ -#line 3096 "MachineIndependent/glslang.y" + case 453: /* type_specifier_nonarray: IMAGE1D */ +#line 3102 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 9965 "MachineIndependent/glslang_tab.cpp" +#line 10004 "MachineIndependent/glslang_tab.cpp" break; - case 453: /* type_specifier_nonarray: F16IMAGE1D */ -#line 3101 "MachineIndependent/glslang.y" + case 454: /* type_specifier_nonarray: F16IMAGE1D */ +#line 3107 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); } -#line 9976 "MachineIndependent/glslang_tab.cpp" +#line 10015 "MachineIndependent/glslang_tab.cpp" break; - case 454: /* type_specifier_nonarray: IIMAGE1D */ -#line 3107 "MachineIndependent/glslang.y" + case 455: /* type_specifier_nonarray: IIMAGE1D */ +#line 3113 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 9986 "MachineIndependent/glslang_tab.cpp" +#line 10025 "MachineIndependent/glslang_tab.cpp" break; - case 455: /* type_specifier_nonarray: UIMAGE1D */ -#line 3112 "MachineIndependent/glslang.y" + case 456: /* type_specifier_nonarray: UIMAGE1D */ +#line 3118 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 9996 "MachineIndependent/glslang_tab.cpp" +#line 10035 "MachineIndependent/glslang_tab.cpp" break; - case 456: /* type_specifier_nonarray: IMAGE2D */ -#line 3117 "MachineIndependent/glslang.y" + case 457: /* type_specifier_nonarray: IMAGE2D */ +#line 3123 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 10006 "MachineIndependent/glslang_tab.cpp" +#line 10045 "MachineIndependent/glslang_tab.cpp" break; - case 457: /* type_specifier_nonarray: F16IMAGE2D */ -#line 3122 "MachineIndependent/glslang.y" + case 458: /* type_specifier_nonarray: F16IMAGE2D */ +#line 3128 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); } -#line 10017 "MachineIndependent/glslang_tab.cpp" +#line 10056 "MachineIndependent/glslang_tab.cpp" break; - case 458: /* type_specifier_nonarray: IIMAGE2D */ -#line 3128 "MachineIndependent/glslang.y" + case 459: /* type_specifier_nonarray: IIMAGE2D */ +#line 3134 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 10027 "MachineIndependent/glslang_tab.cpp" +#line 10066 "MachineIndependent/glslang_tab.cpp" break; - case 459: /* type_specifier_nonarray: UIMAGE2D */ -#line 3133 "MachineIndependent/glslang.y" + case 460: /* type_specifier_nonarray: UIMAGE2D */ +#line 3139 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 10037 "MachineIndependent/glslang_tab.cpp" +#line 10076 "MachineIndependent/glslang_tab.cpp" break; - case 460: /* type_specifier_nonarray: IMAGE3D */ -#line 3138 "MachineIndependent/glslang.y" + case 461: /* type_specifier_nonarray: IMAGE3D */ +#line 3144 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 10047 "MachineIndependent/glslang_tab.cpp" +#line 10086 "MachineIndependent/glslang_tab.cpp" break; - case 461: /* type_specifier_nonarray: F16IMAGE3D */ -#line 3143 "MachineIndependent/glslang.y" + case 462: /* type_specifier_nonarray: F16IMAGE3D */ +#line 3149 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); } -#line 10058 "MachineIndependent/glslang_tab.cpp" +#line 10097 "MachineIndependent/glslang_tab.cpp" break; - case 462: /* type_specifier_nonarray: IIMAGE3D */ -#line 3149 "MachineIndependent/glslang.y" + case 463: /* type_specifier_nonarray: IIMAGE3D */ +#line 3155 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 10068 "MachineIndependent/glslang_tab.cpp" +#line 10107 "MachineIndependent/glslang_tab.cpp" break; - case 463: /* type_specifier_nonarray: UIMAGE3D */ -#line 3154 "MachineIndependent/glslang.y" + case 464: /* type_specifier_nonarray: UIMAGE3D */ +#line 3160 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 10078 "MachineIndependent/glslang_tab.cpp" +#line 10117 "MachineIndependent/glslang_tab.cpp" break; - case 464: /* type_specifier_nonarray: IMAGE2DRECT */ -#line 3159 "MachineIndependent/glslang.y" + case 465: /* type_specifier_nonarray: IMAGE2DRECT */ +#line 3165 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 10088 "MachineIndependent/glslang_tab.cpp" +#line 10127 "MachineIndependent/glslang_tab.cpp" break; - case 465: /* type_specifier_nonarray: F16IMAGE2DRECT */ -#line 3164 "MachineIndependent/glslang.y" + case 466: /* type_specifier_nonarray: F16IMAGE2DRECT */ +#line 3170 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); } -#line 10099 "MachineIndependent/glslang_tab.cpp" +#line 10138 "MachineIndependent/glslang_tab.cpp" break; - case 466: /* type_specifier_nonarray: IIMAGE2DRECT */ -#line 3170 "MachineIndependent/glslang.y" + case 467: /* type_specifier_nonarray: IIMAGE2DRECT */ +#line 3176 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 10109 "MachineIndependent/glslang_tab.cpp" +#line 10148 "MachineIndependent/glslang_tab.cpp" break; - case 467: /* type_specifier_nonarray: UIMAGE2DRECT */ -#line 3175 "MachineIndependent/glslang.y" + case 468: /* type_specifier_nonarray: UIMAGE2DRECT */ +#line 3181 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 10119 "MachineIndependent/glslang_tab.cpp" +#line 10158 "MachineIndependent/glslang_tab.cpp" break; - case 468: /* type_specifier_nonarray: IMAGECUBE */ -#line 3180 "MachineIndependent/glslang.y" + case 469: /* type_specifier_nonarray: IMAGECUBE */ +#line 3186 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 10129 "MachineIndependent/glslang_tab.cpp" +#line 10168 "MachineIndependent/glslang_tab.cpp" break; - case 469: /* type_specifier_nonarray: F16IMAGECUBE */ -#line 3185 "MachineIndependent/glslang.y" + case 470: /* type_specifier_nonarray: F16IMAGECUBE */ +#line 3191 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); } -#line 10140 "MachineIndependent/glslang_tab.cpp" +#line 10179 "MachineIndependent/glslang_tab.cpp" break; - case 470: /* type_specifier_nonarray: IIMAGECUBE */ -#line 3191 "MachineIndependent/glslang.y" + case 471: /* type_specifier_nonarray: IIMAGECUBE */ +#line 3197 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 10150 "MachineIndependent/glslang_tab.cpp" +#line 10189 "MachineIndependent/glslang_tab.cpp" break; - case 471: /* type_specifier_nonarray: UIMAGECUBE */ -#line 3196 "MachineIndependent/glslang.y" + case 472: /* type_specifier_nonarray: UIMAGECUBE */ +#line 3202 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 10160 "MachineIndependent/glslang_tab.cpp" +#line 10199 "MachineIndependent/glslang_tab.cpp" break; - case 472: /* type_specifier_nonarray: IMAGEBUFFER */ -#line 3201 "MachineIndependent/glslang.y" + case 473: /* type_specifier_nonarray: IMAGEBUFFER */ +#line 3207 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 10170 "MachineIndependent/glslang_tab.cpp" +#line 10209 "MachineIndependent/glslang_tab.cpp" break; - case 473: /* type_specifier_nonarray: F16IMAGEBUFFER */ -#line 3206 "MachineIndependent/glslang.y" + case 474: /* type_specifier_nonarray: F16IMAGEBUFFER */ +#line 3212 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); } -#line 10181 "MachineIndependent/glslang_tab.cpp" +#line 10220 "MachineIndependent/glslang_tab.cpp" break; - case 474: /* type_specifier_nonarray: IIMAGEBUFFER */ -#line 3212 "MachineIndependent/glslang.y" + case 475: /* type_specifier_nonarray: IIMAGEBUFFER */ +#line 3218 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 10191 "MachineIndependent/glslang_tab.cpp" +#line 10230 "MachineIndependent/glslang_tab.cpp" break; - case 475: /* type_specifier_nonarray: UIMAGEBUFFER */ -#line 3217 "MachineIndependent/glslang.y" + case 476: /* type_specifier_nonarray: UIMAGEBUFFER */ +#line 3223 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 10201 "MachineIndependent/glslang_tab.cpp" +#line 10240 "MachineIndependent/glslang_tab.cpp" break; - case 476: /* type_specifier_nonarray: IMAGE1DARRAY */ -#line 3222 "MachineIndependent/glslang.y" + case 477: /* type_specifier_nonarray: IMAGE1DARRAY */ +#line 3228 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 10211 "MachineIndependent/glslang_tab.cpp" +#line 10250 "MachineIndependent/glslang_tab.cpp" break; - case 477: /* type_specifier_nonarray: F16IMAGE1DARRAY */ -#line 3227 "MachineIndependent/glslang.y" + case 478: /* type_specifier_nonarray: F16IMAGE1DARRAY */ +#line 3233 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); } -#line 10222 "MachineIndependent/glslang_tab.cpp" +#line 10261 "MachineIndependent/glslang_tab.cpp" break; - case 478: /* type_specifier_nonarray: IIMAGE1DARRAY */ -#line 3233 "MachineIndependent/glslang.y" + case 479: /* type_specifier_nonarray: IIMAGE1DARRAY */ +#line 3239 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 10232 "MachineIndependent/glslang_tab.cpp" +#line 10271 "MachineIndependent/glslang_tab.cpp" break; - case 479: /* type_specifier_nonarray: UIMAGE1DARRAY */ -#line 3238 "MachineIndependent/glslang.y" + case 480: /* type_specifier_nonarray: UIMAGE1DARRAY */ +#line 3244 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 10242 "MachineIndependent/glslang_tab.cpp" +#line 10281 "MachineIndependent/glslang_tab.cpp" break; - case 480: /* type_specifier_nonarray: IMAGE2DARRAY */ -#line 3243 "MachineIndependent/glslang.y" + case 481: /* type_specifier_nonarray: IMAGE2DARRAY */ +#line 3249 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 10252 "MachineIndependent/glslang_tab.cpp" +#line 10291 "MachineIndependent/glslang_tab.cpp" break; - case 481: /* type_specifier_nonarray: F16IMAGE2DARRAY */ -#line 3248 "MachineIndependent/glslang.y" + case 482: /* type_specifier_nonarray: F16IMAGE2DARRAY */ +#line 3254 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); } -#line 10263 "MachineIndependent/glslang_tab.cpp" +#line 10302 "MachineIndependent/glslang_tab.cpp" break; - case 482: /* type_specifier_nonarray: IIMAGE2DARRAY */ -#line 3254 "MachineIndependent/glslang.y" + case 483: /* type_specifier_nonarray: IIMAGE2DARRAY */ +#line 3260 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 10273 "MachineIndependent/glslang_tab.cpp" +#line 10312 "MachineIndependent/glslang_tab.cpp" break; - case 483: /* type_specifier_nonarray: UIMAGE2DARRAY */ -#line 3259 "MachineIndependent/glslang.y" + case 484: /* type_specifier_nonarray: UIMAGE2DARRAY */ +#line 3265 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 10283 "MachineIndependent/glslang_tab.cpp" +#line 10322 "MachineIndependent/glslang_tab.cpp" break; - case 484: /* type_specifier_nonarray: IMAGECUBEARRAY */ -#line 3264 "MachineIndependent/glslang.y" + case 485: /* type_specifier_nonarray: IMAGECUBEARRAY */ +#line 3270 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 10293 "MachineIndependent/glslang_tab.cpp" +#line 10332 "MachineIndependent/glslang_tab.cpp" break; - case 485: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ -#line 3269 "MachineIndependent/glslang.y" + case 486: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ +#line 3275 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); } -#line 10304 "MachineIndependent/glslang_tab.cpp" +#line 10343 "MachineIndependent/glslang_tab.cpp" break; - case 486: /* type_specifier_nonarray: IIMAGECUBEARRAY */ -#line 3275 "MachineIndependent/glslang.y" + case 487: /* type_specifier_nonarray: IIMAGECUBEARRAY */ +#line 3281 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 10314 "MachineIndependent/glslang_tab.cpp" +#line 10353 "MachineIndependent/glslang_tab.cpp" break; - case 487: /* type_specifier_nonarray: UIMAGECUBEARRAY */ -#line 3280 "MachineIndependent/glslang.y" + case 488: /* type_specifier_nonarray: UIMAGECUBEARRAY */ +#line 3286 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 10324 "MachineIndependent/glslang_tab.cpp" +#line 10363 "MachineIndependent/glslang_tab.cpp" break; - case 488: /* type_specifier_nonarray: IMAGE2DMS */ -#line 3285 "MachineIndependent/glslang.y" + case 489: /* type_specifier_nonarray: IMAGE2DMS */ +#line 3291 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 10334 "MachineIndependent/glslang_tab.cpp" +#line 10373 "MachineIndependent/glslang_tab.cpp" break; - case 489: /* type_specifier_nonarray: F16IMAGE2DMS */ -#line 3290 "MachineIndependent/glslang.y" + case 490: /* type_specifier_nonarray: F16IMAGE2DMS */ +#line 3296 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); } -#line 10345 "MachineIndependent/glslang_tab.cpp" +#line 10384 "MachineIndependent/glslang_tab.cpp" break; - case 490: /* type_specifier_nonarray: IIMAGE2DMS */ -#line 3296 "MachineIndependent/glslang.y" + case 491: /* type_specifier_nonarray: IIMAGE2DMS */ +#line 3302 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 10355 "MachineIndependent/glslang_tab.cpp" +#line 10394 "MachineIndependent/glslang_tab.cpp" break; - case 491: /* type_specifier_nonarray: UIMAGE2DMS */ -#line 3301 "MachineIndependent/glslang.y" + case 492: /* type_specifier_nonarray: UIMAGE2DMS */ +#line 3307 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 10365 "MachineIndependent/glslang_tab.cpp" +#line 10404 "MachineIndependent/glslang_tab.cpp" break; - case 492: /* type_specifier_nonarray: IMAGE2DMSARRAY */ -#line 3306 "MachineIndependent/glslang.y" + case 493: /* type_specifier_nonarray: IMAGE2DMSARRAY */ +#line 3312 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 10375 "MachineIndependent/glslang_tab.cpp" +#line 10414 "MachineIndependent/glslang_tab.cpp" break; - case 493: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ -#line 3311 "MachineIndependent/glslang.y" + case 494: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ +#line 3317 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); } -#line 10386 "MachineIndependent/glslang_tab.cpp" +#line 10425 "MachineIndependent/glslang_tab.cpp" break; - case 494: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ -#line 3317 "MachineIndependent/glslang.y" + case 495: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ +#line 3323 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 10396 "MachineIndependent/glslang_tab.cpp" +#line 10435 "MachineIndependent/glslang_tab.cpp" break; - case 495: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ -#line 3322 "MachineIndependent/glslang.y" + case 496: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ +#line 3328 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 10406 "MachineIndependent/glslang_tab.cpp" +#line 10445 "MachineIndependent/glslang_tab.cpp" break; - case 496: /* type_specifier_nonarray: I64IMAGE1D */ -#line 3327 "MachineIndependent/glslang.y" + case 497: /* type_specifier_nonarray: I64IMAGE1D */ +#line 3333 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D); } -#line 10416 "MachineIndependent/glslang_tab.cpp" +#line 10455 "MachineIndependent/glslang_tab.cpp" break; - case 497: /* type_specifier_nonarray: U64IMAGE1D */ -#line 3332 "MachineIndependent/glslang.y" + case 498: /* type_specifier_nonarray: U64IMAGE1D */ +#line 3338 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D); } -#line 10426 "MachineIndependent/glslang_tab.cpp" +#line 10465 "MachineIndependent/glslang_tab.cpp" break; - case 498: /* type_specifier_nonarray: I64IMAGE2D */ -#line 3337 "MachineIndependent/glslang.y" + case 499: /* type_specifier_nonarray: I64IMAGE2D */ +#line 3343 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D); } -#line 10436 "MachineIndependent/glslang_tab.cpp" +#line 10475 "MachineIndependent/glslang_tab.cpp" break; - case 499: /* type_specifier_nonarray: U64IMAGE2D */ -#line 3342 "MachineIndependent/glslang.y" + case 500: /* type_specifier_nonarray: U64IMAGE2D */ +#line 3348 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D); } -#line 10446 "MachineIndependent/glslang_tab.cpp" +#line 10485 "MachineIndependent/glslang_tab.cpp" break; - case 500: /* type_specifier_nonarray: I64IMAGE3D */ -#line 3347 "MachineIndependent/glslang.y" + case 501: /* type_specifier_nonarray: I64IMAGE3D */ +#line 3353 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd3D); } -#line 10456 "MachineIndependent/glslang_tab.cpp" +#line 10495 "MachineIndependent/glslang_tab.cpp" break; - case 501: /* type_specifier_nonarray: U64IMAGE3D */ -#line 3352 "MachineIndependent/glslang.y" + case 502: /* type_specifier_nonarray: U64IMAGE3D */ +#line 3358 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd3D); } -#line 10466 "MachineIndependent/glslang_tab.cpp" +#line 10505 "MachineIndependent/glslang_tab.cpp" break; - case 502: /* type_specifier_nonarray: I64IMAGE2DRECT */ -#line 3357 "MachineIndependent/glslang.y" + case 503: /* type_specifier_nonarray: I64IMAGE2DRECT */ +#line 3363 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdRect); } -#line 10476 "MachineIndependent/glslang_tab.cpp" +#line 10515 "MachineIndependent/glslang_tab.cpp" break; - case 503: /* type_specifier_nonarray: U64IMAGE2DRECT */ -#line 3362 "MachineIndependent/glslang.y" + case 504: /* type_specifier_nonarray: U64IMAGE2DRECT */ +#line 3368 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdRect); } -#line 10486 "MachineIndependent/glslang_tab.cpp" +#line 10525 "MachineIndependent/glslang_tab.cpp" break; - case 504: /* type_specifier_nonarray: I64IMAGECUBE */ -#line 3367 "MachineIndependent/glslang.y" + case 505: /* type_specifier_nonarray: I64IMAGECUBE */ +#line 3373 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube); } -#line 10496 "MachineIndependent/glslang_tab.cpp" +#line 10535 "MachineIndependent/glslang_tab.cpp" break; - case 505: /* type_specifier_nonarray: U64IMAGECUBE */ -#line 3372 "MachineIndependent/glslang.y" + case 506: /* type_specifier_nonarray: U64IMAGECUBE */ +#line 3378 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube); } -#line 10506 "MachineIndependent/glslang_tab.cpp" +#line 10545 "MachineIndependent/glslang_tab.cpp" break; - case 506: /* type_specifier_nonarray: I64IMAGEBUFFER */ -#line 3377 "MachineIndependent/glslang.y" + case 507: /* type_specifier_nonarray: I64IMAGEBUFFER */ +#line 3383 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdBuffer); } -#line 10516 "MachineIndependent/glslang_tab.cpp" +#line 10555 "MachineIndependent/glslang_tab.cpp" break; - case 507: /* type_specifier_nonarray: U64IMAGEBUFFER */ -#line 3382 "MachineIndependent/glslang.y" + case 508: /* type_specifier_nonarray: U64IMAGEBUFFER */ +#line 3388 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdBuffer); } -#line 10526 "MachineIndependent/glslang_tab.cpp" +#line 10565 "MachineIndependent/glslang_tab.cpp" break; - case 508: /* type_specifier_nonarray: I64IMAGE1DARRAY */ -#line 3387 "MachineIndependent/glslang.y" + case 509: /* type_specifier_nonarray: I64IMAGE1DARRAY */ +#line 3393 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D, true); } -#line 10536 "MachineIndependent/glslang_tab.cpp" +#line 10575 "MachineIndependent/glslang_tab.cpp" break; - case 509: /* type_specifier_nonarray: U64IMAGE1DARRAY */ -#line 3392 "MachineIndependent/glslang.y" + case 510: /* type_specifier_nonarray: U64IMAGE1DARRAY */ +#line 3398 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D, true); } -#line 10546 "MachineIndependent/glslang_tab.cpp" +#line 10585 "MachineIndependent/glslang_tab.cpp" break; - case 510: /* type_specifier_nonarray: I64IMAGE2DARRAY */ -#line 3397 "MachineIndependent/glslang.y" + case 511: /* type_specifier_nonarray: I64IMAGE2DARRAY */ +#line 3403 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true); } -#line 10556 "MachineIndependent/glslang_tab.cpp" +#line 10595 "MachineIndependent/glslang_tab.cpp" break; - case 511: /* type_specifier_nonarray: U64IMAGE2DARRAY */ -#line 3402 "MachineIndependent/glslang.y" + case 512: /* type_specifier_nonarray: U64IMAGE2DARRAY */ +#line 3408 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true); } -#line 10566 "MachineIndependent/glslang_tab.cpp" +#line 10605 "MachineIndependent/glslang_tab.cpp" break; - case 512: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ -#line 3407 "MachineIndependent/glslang.y" + case 513: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ +#line 3413 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube, true); } -#line 10576 "MachineIndependent/glslang_tab.cpp" +#line 10615 "MachineIndependent/glslang_tab.cpp" break; - case 513: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ -#line 3412 "MachineIndependent/glslang.y" + case 514: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ +#line 3418 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube, true); } -#line 10586 "MachineIndependent/glslang_tab.cpp" +#line 10625 "MachineIndependent/glslang_tab.cpp" break; - case 514: /* type_specifier_nonarray: I64IMAGE2DMS */ -#line 3417 "MachineIndependent/glslang.y" + case 515: /* type_specifier_nonarray: I64IMAGE2DMS */ +#line 3423 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, false, false, true); } -#line 10596 "MachineIndependent/glslang_tab.cpp" +#line 10635 "MachineIndependent/glslang_tab.cpp" break; - case 515: /* type_specifier_nonarray: U64IMAGE2DMS */ -#line 3422 "MachineIndependent/glslang.y" + case 516: /* type_specifier_nonarray: U64IMAGE2DMS */ +#line 3428 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, false, false, true); } -#line 10606 "MachineIndependent/glslang_tab.cpp" +#line 10645 "MachineIndependent/glslang_tab.cpp" break; - case 516: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ -#line 3427 "MachineIndependent/glslang.y" + case 517: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ +#line 3433 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true, false, true); } -#line 10616 "MachineIndependent/glslang_tab.cpp" +#line 10655 "MachineIndependent/glslang_tab.cpp" break; - case 517: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ -#line 3432 "MachineIndependent/glslang.y" + case 518: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ +#line 3438 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true, false, true); } -#line 10626 "MachineIndependent/glslang_tab.cpp" +#line 10665 "MachineIndependent/glslang_tab.cpp" break; - case 518: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ -#line 3437 "MachineIndependent/glslang.y" + case 519: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ +#line 3443 "MachineIndependent/glslang.y" { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 10637 "MachineIndependent/glslang_tab.cpp" +#line 10676 "MachineIndependent/glslang_tab.cpp" break; - case 519: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ -#line 3443 "MachineIndependent/glslang.y" + case 520: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ +#line 3449 "MachineIndependent/glslang.y" { // GL_EXT_YUV_target (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.yuv = true; } -#line 10648 "MachineIndependent/glslang_tab.cpp" +#line 10687 "MachineIndependent/glslang_tab.cpp" break; - case 520: /* type_specifier_nonarray: SUBPASSINPUT */ -#line 3449 "MachineIndependent/glslang.y" + case 521: /* type_specifier_nonarray: ATTACHMENTEXT */ +#line 3455 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setAttachmentEXT(EbtFloat); + } +#line 10698 "MachineIndependent/glslang_tab.cpp" + break; + + case 522: /* type_specifier_nonarray: IATTACHMENTEXT */ +#line 3461 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setAttachmentEXT(EbtInt); + } +#line 10709 "MachineIndependent/glslang_tab.cpp" + break; + + case 523: /* type_specifier_nonarray: UATTACHMENTEXT */ +#line 3467 "MachineIndependent/glslang.y" + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setAttachmentEXT(EbtUint); + } +#line 10720 "MachineIndependent/glslang_tab.cpp" + break; + + case 524: /* type_specifier_nonarray: SUBPASSINPUT */ +#line 3473 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 10659 "MachineIndependent/glslang_tab.cpp" +#line 10731 "MachineIndependent/glslang_tab.cpp" break; - case 521: /* type_specifier_nonarray: SUBPASSINPUTMS */ -#line 3455 "MachineIndependent/glslang.y" + case 525: /* type_specifier_nonarray: SUBPASSINPUTMS */ +#line 3479 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 10670 "MachineIndependent/glslang_tab.cpp" +#line 10742 "MachineIndependent/glslang_tab.cpp" break; - case 522: /* type_specifier_nonarray: F16SUBPASSINPUT */ -#line 3461 "MachineIndependent/glslang.y" + case 526: /* type_specifier_nonarray: F16SUBPASSINPUT */ +#line 3485 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10678,11 +10750,11 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16); } -#line 10682 "MachineIndependent/glslang_tab.cpp" +#line 10754 "MachineIndependent/glslang_tab.cpp" break; - case 523: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ -#line 3468 "MachineIndependent/glslang.y" + case 527: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ +#line 3492 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10690,116 +10762,116 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); } -#line 10694 "MachineIndependent/glslang_tab.cpp" +#line 10766 "MachineIndependent/glslang_tab.cpp" break; - case 524: /* type_specifier_nonarray: ISUBPASSINPUT */ -#line 3475 "MachineIndependent/glslang.y" + case 528: /* type_specifier_nonarray: ISUBPASSINPUT */ +#line 3499 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 10705 "MachineIndependent/glslang_tab.cpp" +#line 10777 "MachineIndependent/glslang_tab.cpp" break; - case 525: /* type_specifier_nonarray: ISUBPASSINPUTMS */ -#line 3481 "MachineIndependent/glslang.y" + case 529: /* type_specifier_nonarray: ISUBPASSINPUTMS */ +#line 3505 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 10716 "MachineIndependent/glslang_tab.cpp" +#line 10788 "MachineIndependent/glslang_tab.cpp" break; - case 526: /* type_specifier_nonarray: USUBPASSINPUT */ -#line 3487 "MachineIndependent/glslang.y" + case 530: /* type_specifier_nonarray: USUBPASSINPUT */ +#line 3511 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 10727 "MachineIndependent/glslang_tab.cpp" +#line 10799 "MachineIndependent/glslang_tab.cpp" break; - case 527: /* type_specifier_nonarray: USUBPASSINPUTMS */ -#line 3493 "MachineIndependent/glslang.y" + case 531: /* type_specifier_nonarray: USUBPASSINPUTMS */ +#line 3517 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 10738 "MachineIndependent/glslang_tab.cpp" +#line 10810 "MachineIndependent/glslang_tab.cpp" break; - case 528: /* type_specifier_nonarray: FCOOPMATNV */ -#line 3499 "MachineIndependent/glslang.y" + case 532: /* type_specifier_nonarray: FCOOPMATNV */ +#line 3523 "MachineIndependent/glslang.y" { parseContext.fcoopmatCheck((yyvsp[0].lex).loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).coopmat = true; } -#line 10749 "MachineIndependent/glslang_tab.cpp" +#line 10821 "MachineIndependent/glslang_tab.cpp" break; - case 529: /* type_specifier_nonarray: ICOOPMATNV */ -#line 3505 "MachineIndependent/glslang.y" + case 533: /* type_specifier_nonarray: ICOOPMATNV */ +#line 3529 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheck((yyvsp[0].lex).loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).coopmat = true; } -#line 10760 "MachineIndependent/glslang_tab.cpp" +#line 10832 "MachineIndependent/glslang_tab.cpp" break; - case 530: /* type_specifier_nonarray: UCOOPMATNV */ -#line 3511 "MachineIndependent/glslang.y" + case 534: /* type_specifier_nonarray: UCOOPMATNV */ +#line 3535 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheck((yyvsp[0].lex).loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).coopmat = true; } -#line 10771 "MachineIndependent/glslang_tab.cpp" +#line 10843 "MachineIndependent/glslang_tab.cpp" break; - case 531: /* type_specifier_nonarray: spirv_type_specifier */ -#line 3517 "MachineIndependent/glslang.y" + case 535: /* type_specifier_nonarray: spirv_type_specifier */ +#line 3541 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 10780 "MachineIndependent/glslang_tab.cpp" +#line 10852 "MachineIndependent/glslang_tab.cpp" break; - case 532: /* type_specifier_nonarray: HITOBJECTNV */ -#line 3521 "MachineIndependent/glslang.y" + case 536: /* type_specifier_nonarray: HITOBJECTNV */ +#line 3545 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtHitObjectNV; } -#line 10789 "MachineIndependent/glslang_tab.cpp" +#line 10861 "MachineIndependent/glslang_tab.cpp" break; - case 533: /* type_specifier_nonarray: struct_specifier */ -#line 3526 "MachineIndependent/glslang.y" + case 537: /* type_specifier_nonarray: struct_specifier */ +#line 3550 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 10799 "MachineIndependent/glslang_tab.cpp" +#line 10871 "MachineIndependent/glslang_tab.cpp" break; - case 534: /* type_specifier_nonarray: TYPE_NAME */ -#line 3531 "MachineIndependent/glslang.y" + case 538: /* type_specifier_nonarray: TYPE_NAME */ +#line 3555 "MachineIndependent/glslang.y" { // // This is for user defined type names. The lexical phase looked up the @@ -10813,47 +10885,47 @@ yyreduce: } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 10817 "MachineIndependent/glslang_tab.cpp" +#line 10889 "MachineIndependent/glslang_tab.cpp" break; - case 535: /* precision_qualifier: HIGH_PRECISION */ -#line 3547 "MachineIndependent/glslang.y" + case 539: /* precision_qualifier: HIGH_PRECISION */ +#line 3571 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 10827 "MachineIndependent/glslang_tab.cpp" +#line 10899 "MachineIndependent/glslang_tab.cpp" break; - case 536: /* precision_qualifier: MEDIUM_PRECISION */ -#line 3552 "MachineIndependent/glslang.y" + case 540: /* precision_qualifier: MEDIUM_PRECISION */ +#line 3576 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 10837 "MachineIndependent/glslang_tab.cpp" +#line 10909 "MachineIndependent/glslang_tab.cpp" break; - case 537: /* precision_qualifier: LOW_PRECISION */ -#line 3557 "MachineIndependent/glslang.y" + case 541: /* precision_qualifier: LOW_PRECISION */ +#line 3581 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 10847 "MachineIndependent/glslang_tab.cpp" +#line 10919 "MachineIndependent/glslang_tab.cpp" break; - case 538: /* $@3: %empty */ -#line 3565 "MachineIndependent/glslang.y" + case 542: /* $@3: %empty */ +#line 3589 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 10853 "MachineIndependent/glslang_tab.cpp" +#line 10925 "MachineIndependent/glslang_tab.cpp" break; - case 539: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ -#line 3565 "MachineIndependent/glslang.y" + case 543: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ +#line 3589 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -10865,17 +10937,17 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10869 "MachineIndependent/glslang_tab.cpp" +#line 10941 "MachineIndependent/glslang_tab.cpp" break; - case 540: /* $@4: %empty */ -#line 3576 "MachineIndependent/glslang.y" + case 544: /* $@4: %empty */ +#line 3600 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 10875 "MachineIndependent/glslang_tab.cpp" +#line 10947 "MachineIndependent/glslang_tab.cpp" break; - case 541: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ -#line 3576 "MachineIndependent/glslang.y" + case 545: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ +#line 3600 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -10883,19 +10955,19 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10887 "MachineIndependent/glslang_tab.cpp" +#line 10959 "MachineIndependent/glslang_tab.cpp" break; - case 542: /* struct_declaration_list: struct_declaration */ -#line 3586 "MachineIndependent/glslang.y" + case 546: /* struct_declaration_list: struct_declaration */ +#line 3610 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 10895 "MachineIndependent/glslang_tab.cpp" +#line 10967 "MachineIndependent/glslang_tab.cpp" break; - case 543: /* struct_declaration_list: struct_declaration_list struct_declaration */ -#line 3589 "MachineIndependent/glslang.y" + case 547: /* struct_declaration_list: struct_declaration_list struct_declaration */ +#line 3613 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -10906,11 +10978,11 @@ yyreduce: (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 10910 "MachineIndependent/glslang_tab.cpp" +#line 10982 "MachineIndependent/glslang_tab.cpp" break; - case 544: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ -#line 3602 "MachineIndependent/glslang.y" + case 548: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ +#line 3626 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -10933,11 +11005,11 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 10937 "MachineIndependent/glslang_tab.cpp" +#line 11009 "MachineIndependent/glslang_tab.cpp" break; - case 545: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ -#line 3624 "MachineIndependent/glslang.y" + case 549: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ +#line 3648 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -10962,38 +11034,38 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 10966 "MachineIndependent/glslang_tab.cpp" +#line 11038 "MachineIndependent/glslang_tab.cpp" break; - case 546: /* struct_declarator_list: struct_declarator */ -#line 3651 "MachineIndependent/glslang.y" + case 550: /* struct_declarator_list: struct_declarator */ +#line 3675 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 10975 "MachineIndependent/glslang_tab.cpp" +#line 11047 "MachineIndependent/glslang_tab.cpp" break; - case 547: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ -#line 3655 "MachineIndependent/glslang.y" + case 551: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ +#line 3679 "MachineIndependent/glslang.y" { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 10983 "MachineIndependent/glslang_tab.cpp" +#line 11055 "MachineIndependent/glslang_tab.cpp" break; - case 548: /* struct_declarator: IDENTIFIER */ -#line 3661 "MachineIndependent/glslang.y" + case 552: /* struct_declarator: IDENTIFIER */ +#line 3685 "MachineIndependent/glslang.y" { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 10993 "MachineIndependent/glslang_tab.cpp" +#line 11065 "MachineIndependent/glslang_tab.cpp" break; - case 549: /* struct_declarator: IDENTIFIER array_specifier */ -#line 3666 "MachineIndependent/glslang.y" + case 553: /* struct_declarator: IDENTIFIER array_specifier */ +#line 3690 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -11002,246 +11074,246 @@ yyreduce: (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 11006 "MachineIndependent/glslang_tab.cpp" +#line 11078 "MachineIndependent/glslang_tab.cpp" break; - case 550: /* initializer: assignment_expression */ -#line 3677 "MachineIndependent/glslang.y" + case 554: /* initializer: assignment_expression */ +#line 3701 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11014 "MachineIndependent/glslang_tab.cpp" +#line 11086 "MachineIndependent/glslang_tab.cpp" break; - case 551: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ -#line 3681 "MachineIndependent/glslang.y" + case 555: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ +#line 3705 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 11025 "MachineIndependent/glslang_tab.cpp" +#line 11097 "MachineIndependent/glslang_tab.cpp" break; - case 552: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ -#line 3687 "MachineIndependent/glslang.y" + case 556: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ +#line 3711 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 11036 "MachineIndependent/glslang_tab.cpp" +#line 11108 "MachineIndependent/glslang_tab.cpp" break; - case 553: /* initializer: LEFT_BRACE RIGHT_BRACE */ -#line 3693 "MachineIndependent/glslang.y" + case 557: /* initializer: LEFT_BRACE RIGHT_BRACE */ +#line 3717 "MachineIndependent/glslang.y" { const char* initFeature = "empty { } initializer"; parseContext.profileRequires((yyvsp[-1].lex).loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); parseContext.profileRequires((yyvsp[-1].lex).loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); (yyval.interm.intermTypedNode) = parseContext.intermediate.makeAggregate((yyvsp[-1].lex).loc); } -#line 11047 "MachineIndependent/glslang_tab.cpp" +#line 11119 "MachineIndependent/glslang_tab.cpp" break; - case 554: /* initializer_list: initializer */ -#line 3704 "MachineIndependent/glslang.y" + case 558: /* initializer_list: initializer */ +#line 3728 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 11055 "MachineIndependent/glslang_tab.cpp" +#line 11127 "MachineIndependent/glslang_tab.cpp" break; - case 555: /* initializer_list: initializer_list COMMA initializer */ -#line 3707 "MachineIndependent/glslang.y" + case 559: /* initializer_list: initializer_list COMMA initializer */ +#line 3731 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11063 "MachineIndependent/glslang_tab.cpp" +#line 11135 "MachineIndependent/glslang_tab.cpp" break; - case 556: /* declaration_statement: declaration */ -#line 3714 "MachineIndependent/glslang.y" + case 560: /* declaration_statement: declaration */ +#line 3738 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11069 "MachineIndependent/glslang_tab.cpp" +#line 11141 "MachineIndependent/glslang_tab.cpp" break; - case 557: /* statement: compound_statement */ -#line 3718 "MachineIndependent/glslang.y" + case 561: /* statement: compound_statement */ +#line 3742 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11075 "MachineIndependent/glslang_tab.cpp" +#line 11147 "MachineIndependent/glslang_tab.cpp" break; - case 558: /* statement: simple_statement */ -#line 3719 "MachineIndependent/glslang.y" + case 562: /* statement: simple_statement */ +#line 3743 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11081 "MachineIndependent/glslang_tab.cpp" +#line 11153 "MachineIndependent/glslang_tab.cpp" break; - case 559: /* simple_statement: declaration_statement */ -#line 3725 "MachineIndependent/glslang.y" + case 563: /* simple_statement: declaration_statement */ +#line 3749 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11087 "MachineIndependent/glslang_tab.cpp" +#line 11159 "MachineIndependent/glslang_tab.cpp" break; - case 560: /* simple_statement: expression_statement */ -#line 3726 "MachineIndependent/glslang.y" + case 564: /* simple_statement: expression_statement */ +#line 3750 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11093 "MachineIndependent/glslang_tab.cpp" +#line 11165 "MachineIndependent/glslang_tab.cpp" break; - case 561: /* simple_statement: selection_statement */ -#line 3727 "MachineIndependent/glslang.y" + case 565: /* simple_statement: selection_statement */ +#line 3751 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11099 "MachineIndependent/glslang_tab.cpp" +#line 11171 "MachineIndependent/glslang_tab.cpp" break; - case 562: /* simple_statement: switch_statement */ -#line 3728 "MachineIndependent/glslang.y" + case 566: /* simple_statement: switch_statement */ +#line 3752 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11105 "MachineIndependent/glslang_tab.cpp" +#line 11177 "MachineIndependent/glslang_tab.cpp" break; - case 563: /* simple_statement: case_label */ -#line 3729 "MachineIndependent/glslang.y" + case 567: /* simple_statement: case_label */ +#line 3753 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11111 "MachineIndependent/glslang_tab.cpp" +#line 11183 "MachineIndependent/glslang_tab.cpp" break; - case 564: /* simple_statement: iteration_statement */ -#line 3730 "MachineIndependent/glslang.y" + case 568: /* simple_statement: iteration_statement */ +#line 3754 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11117 "MachineIndependent/glslang_tab.cpp" +#line 11189 "MachineIndependent/glslang_tab.cpp" break; - case 565: /* simple_statement: jump_statement */ -#line 3731 "MachineIndependent/glslang.y" + case 569: /* simple_statement: jump_statement */ +#line 3755 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11123 "MachineIndependent/glslang_tab.cpp" +#line 11195 "MachineIndependent/glslang_tab.cpp" break; - case 566: /* simple_statement: demote_statement */ -#line 3733 "MachineIndependent/glslang.y" + case 570: /* simple_statement: demote_statement */ +#line 3757 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11129 "MachineIndependent/glslang_tab.cpp" +#line 11201 "MachineIndependent/glslang_tab.cpp" break; - case 567: /* demote_statement: DEMOTE SEMICOLON */ -#line 3739 "MachineIndependent/glslang.y" + case 571: /* demote_statement: DEMOTE SEMICOLON */ +#line 3763 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "demote"); parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); } -#line 11139 "MachineIndependent/glslang_tab.cpp" +#line 11211 "MachineIndependent/glslang_tab.cpp" break; - case 568: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ -#line 3748 "MachineIndependent/glslang.y" + case 572: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ +#line 3772 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11145 "MachineIndependent/glslang_tab.cpp" +#line 11217 "MachineIndependent/glslang_tab.cpp" break; - case 569: /* $@5: %empty */ -#line 3749 "MachineIndependent/glslang.y" + case 573: /* $@5: %empty */ +#line 3773 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 11154 "MachineIndependent/glslang_tab.cpp" +#line 11226 "MachineIndependent/glslang_tab.cpp" break; - case 570: /* $@6: %empty */ -#line 3753 "MachineIndependent/glslang.y" + case 574: /* $@6: %empty */ +#line 3777 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 11163 "MachineIndependent/glslang_tab.cpp" +#line 11235 "MachineIndependent/glslang_tab.cpp" break; - case 571: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ -#line 3757 "MachineIndependent/glslang.y" + case 575: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ +#line 3781 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 11173 "MachineIndependent/glslang_tab.cpp" +#line 11245 "MachineIndependent/glslang_tab.cpp" break; - case 572: /* statement_no_new_scope: compound_statement_no_new_scope */ -#line 3765 "MachineIndependent/glslang.y" + case 576: /* statement_no_new_scope: compound_statement_no_new_scope */ +#line 3789 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11179 "MachineIndependent/glslang_tab.cpp" +#line 11251 "MachineIndependent/glslang_tab.cpp" break; - case 573: /* statement_no_new_scope: simple_statement */ -#line 3766 "MachineIndependent/glslang.y" + case 577: /* statement_no_new_scope: simple_statement */ +#line 3790 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11185 "MachineIndependent/glslang_tab.cpp" +#line 11257 "MachineIndependent/glslang_tab.cpp" break; - case 574: /* $@7: %empty */ -#line 3770 "MachineIndependent/glslang.y" + case 578: /* $@7: %empty */ +#line 3794 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 11193 "MachineIndependent/glslang_tab.cpp" +#line 11265 "MachineIndependent/glslang_tab.cpp" break; - case 575: /* statement_scoped: $@7 compound_statement */ -#line 3773 "MachineIndependent/glslang.y" + case 579: /* statement_scoped: $@7 compound_statement */ +#line 3797 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11202 "MachineIndependent/glslang_tab.cpp" +#line 11274 "MachineIndependent/glslang_tab.cpp" break; - case 576: /* $@8: %empty */ -#line 3777 "MachineIndependent/glslang.y" + case 580: /* $@8: %empty */ +#line 3801 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11212 "MachineIndependent/glslang_tab.cpp" +#line 11284 "MachineIndependent/glslang_tab.cpp" break; - case 577: /* statement_scoped: $@8 simple_statement */ -#line 3782 "MachineIndependent/glslang.y" + case 581: /* statement_scoped: $@8 simple_statement */ +#line 3806 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11223 "MachineIndependent/glslang_tab.cpp" +#line 11295 "MachineIndependent/glslang_tab.cpp" break; - case 578: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ -#line 3791 "MachineIndependent/glslang.y" + case 582: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ +#line 3815 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11231 "MachineIndependent/glslang_tab.cpp" +#line 11303 "MachineIndependent/glslang_tab.cpp" break; - case 579: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ -#line 3794 "MachineIndependent/glslang.y" + case 583: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ +#line 3818 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 11241 "MachineIndependent/glslang_tab.cpp" +#line 11313 "MachineIndependent/glslang_tab.cpp" break; - case 580: /* statement_list: statement */ -#line 3802 "MachineIndependent/glslang.y" + case 584: /* statement_list: statement */ +#line 3826 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -11250,11 +11322,11 @@ yyreduce: (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 11254 "MachineIndependent/glslang_tab.cpp" +#line 11326 "MachineIndependent/glslang_tab.cpp" break; - case 581: /* statement_list: statement_list statement */ -#line 3810 "MachineIndependent/glslang.y" + case 585: /* statement_list: statement_list statement */ +#line 3834 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -11263,77 +11335,77 @@ yyreduce: } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11267 "MachineIndependent/glslang_tab.cpp" +#line 11339 "MachineIndependent/glslang_tab.cpp" break; - case 582: /* expression_statement: SEMICOLON */ -#line 3821 "MachineIndependent/glslang.y" + case 586: /* expression_statement: SEMICOLON */ +#line 3845 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11273 "MachineIndependent/glslang_tab.cpp" +#line 11345 "MachineIndependent/glslang_tab.cpp" break; - case 583: /* expression_statement: expression SEMICOLON */ -#line 3822 "MachineIndependent/glslang.y" + case 587: /* expression_statement: expression SEMICOLON */ +#line 3846 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 11279 "MachineIndependent/glslang_tab.cpp" +#line 11351 "MachineIndependent/glslang_tab.cpp" break; - case 584: /* selection_statement: selection_statement_nonattributed */ -#line 3826 "MachineIndependent/glslang.y" + case 588: /* selection_statement: selection_statement_nonattributed */ +#line 3850 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11287 "MachineIndependent/glslang_tab.cpp" +#line 11359 "MachineIndependent/glslang_tab.cpp" break; - case 585: /* selection_statement: attribute selection_statement_nonattributed */ -#line 3830 "MachineIndependent/glslang.y" + case 589: /* selection_statement: attribute selection_statement_nonattributed */ +#line 3854 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11297 "MachineIndependent/glslang_tab.cpp" +#line 11369 "MachineIndependent/glslang_tab.cpp" break; - case 586: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ -#line 3838 "MachineIndependent/glslang.y" + case 590: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ +#line 3862 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 11306 "MachineIndependent/glslang_tab.cpp" +#line 11378 "MachineIndependent/glslang_tab.cpp" break; - case 587: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ -#line 3845 "MachineIndependent/glslang.y" + case 591: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ +#line 3869 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 11315 "MachineIndependent/glslang_tab.cpp" +#line 11387 "MachineIndependent/glslang_tab.cpp" break; - case 588: /* selection_rest_statement: statement_scoped */ -#line 3849 "MachineIndependent/glslang.y" + case 592: /* selection_rest_statement: statement_scoped */ +#line 3873 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 11324 "MachineIndependent/glslang_tab.cpp" +#line 11396 "MachineIndependent/glslang_tab.cpp" break; - case 589: /* condition: expression */ -#line 3857 "MachineIndependent/glslang.y" + case 593: /* condition: expression */ +#line 3881 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 11333 "MachineIndependent/glslang_tab.cpp" +#line 11405 "MachineIndependent/glslang_tab.cpp" break; - case 590: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 3861 "MachineIndependent/glslang.y" + case 594: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ +#line 3885 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -11344,29 +11416,29 @@ yyreduce: else (yyval.interm.intermTypedNode) = 0; } -#line 11348 "MachineIndependent/glslang_tab.cpp" +#line 11420 "MachineIndependent/glslang_tab.cpp" break; - case 591: /* switch_statement: switch_statement_nonattributed */ -#line 3874 "MachineIndependent/glslang.y" + case 595: /* switch_statement: switch_statement_nonattributed */ +#line 3898 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11356 "MachineIndependent/glslang_tab.cpp" +#line 11428 "MachineIndependent/glslang_tab.cpp" break; - case 592: /* switch_statement: attribute switch_statement_nonattributed */ -#line 3878 "MachineIndependent/glslang.y" + case 596: /* switch_statement: attribute switch_statement_nonattributed */ +#line 3902 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11366 "MachineIndependent/glslang_tab.cpp" +#line 11438 "MachineIndependent/glslang_tab.cpp" break; - case 593: /* $@9: %empty */ -#line 3886 "MachineIndependent/glslang.y" + case 597: /* $@9: %empty */ +#line 3910 "MachineIndependent/glslang.y" { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -11375,11 +11447,11 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 11379 "MachineIndependent/glslang_tab.cpp" +#line 11451 "MachineIndependent/glslang_tab.cpp" break; - case 594: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ -#line 3894 "MachineIndependent/glslang.y" + case 598: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ +#line 3918 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -11389,27 +11461,27 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11393 "MachineIndependent/glslang_tab.cpp" +#line 11465 "MachineIndependent/glslang_tab.cpp" break; - case 595: /* switch_statement_list: %empty */ -#line 3906 "MachineIndependent/glslang.y" + case 599: /* switch_statement_list: %empty */ +#line 3930 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11401 "MachineIndependent/glslang_tab.cpp" +#line 11473 "MachineIndependent/glslang_tab.cpp" break; - case 596: /* switch_statement_list: statement_list */ -#line 3909 "MachineIndependent/glslang.y" + case 600: /* switch_statement_list: statement_list */ +#line 3933 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11409 "MachineIndependent/glslang_tab.cpp" +#line 11481 "MachineIndependent/glslang_tab.cpp" break; - case 597: /* case_label: CASE expression COLON */ -#line 3915 "MachineIndependent/glslang.y" + case 601: /* case_label: CASE expression COLON */ +#line 3939 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11422,11 +11494,11 @@ yyreduce: (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 11426 "MachineIndependent/glslang_tab.cpp" +#line 11498 "MachineIndependent/glslang_tab.cpp" break; - case 598: /* case_label: DEFAULT COLON */ -#line 3927 "MachineIndependent/glslang.y" + case 602: /* case_label: DEFAULT COLON */ +#line 3951 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11436,29 +11508,29 @@ yyreduce: else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 11440 "MachineIndependent/glslang_tab.cpp" +#line 11512 "MachineIndependent/glslang_tab.cpp" break; - case 599: /* iteration_statement: iteration_statement_nonattributed */ -#line 3939 "MachineIndependent/glslang.y" + case 603: /* iteration_statement: iteration_statement_nonattributed */ +#line 3963 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11448 "MachineIndependent/glslang_tab.cpp" +#line 11520 "MachineIndependent/glslang_tab.cpp" break; - case 600: /* iteration_statement: attribute iteration_statement_nonattributed */ -#line 3943 "MachineIndependent/glslang.y" + case 604: /* iteration_statement: attribute iteration_statement_nonattributed */ +#line 3967 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11458 "MachineIndependent/glslang_tab.cpp" +#line 11530 "MachineIndependent/glslang_tab.cpp" break; - case 601: /* $@10: %empty */ -#line 3951 "MachineIndependent/glslang.y" + case 605: /* $@10: %empty */ +#line 3975 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -11467,11 +11539,11 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11471 "MachineIndependent/glslang_tab.cpp" +#line 11543 "MachineIndependent/glslang_tab.cpp" break; - case 602: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ -#line 3959 "MachineIndependent/glslang.y" + case 606: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ +#line 3983 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -11479,22 +11551,22 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11483 "MachineIndependent/glslang_tab.cpp" +#line 11555 "MachineIndependent/glslang_tab.cpp" break; - case 603: /* $@11: %empty */ -#line 3966 "MachineIndependent/glslang.y" + case 607: /* $@11: %empty */ +#line 3990 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11494 "MachineIndependent/glslang_tab.cpp" +#line 11566 "MachineIndependent/glslang_tab.cpp" break; - case 604: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ -#line 3972 "MachineIndependent/glslang.y" + case 608: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ +#line 3996 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -11507,22 +11579,22 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11511 "MachineIndependent/glslang_tab.cpp" +#line 11583 "MachineIndependent/glslang_tab.cpp" break; - case 605: /* $@12: %empty */ -#line 3984 "MachineIndependent/glslang.y" + case 609: /* $@12: %empty */ +#line 4008 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11522 "MachineIndependent/glslang_tab.cpp" +#line 11594 "MachineIndependent/glslang_tab.cpp" break; - case 606: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ -#line 3990 "MachineIndependent/glslang.y" + case 610: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ +#line 4014 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -11535,81 +11607,81 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11539 "MachineIndependent/glslang_tab.cpp" +#line 11611 "MachineIndependent/glslang_tab.cpp" break; - case 607: /* for_init_statement: expression_statement */ -#line 4005 "MachineIndependent/glslang.y" + case 611: /* for_init_statement: expression_statement */ +#line 4029 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11547 "MachineIndependent/glslang_tab.cpp" +#line 11619 "MachineIndependent/glslang_tab.cpp" break; - case 608: /* for_init_statement: declaration_statement */ -#line 4008 "MachineIndependent/glslang.y" + case 612: /* for_init_statement: declaration_statement */ +#line 4032 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11555 "MachineIndependent/glslang_tab.cpp" +#line 11627 "MachineIndependent/glslang_tab.cpp" break; - case 609: /* conditionopt: condition */ -#line 4014 "MachineIndependent/glslang.y" + case 613: /* conditionopt: condition */ +#line 4038 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11563 "MachineIndependent/glslang_tab.cpp" +#line 11635 "MachineIndependent/glslang_tab.cpp" break; - case 610: /* conditionopt: %empty */ -#line 4017 "MachineIndependent/glslang.y" + case 614: /* conditionopt: %empty */ +#line 4041 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = 0; } -#line 11571 "MachineIndependent/glslang_tab.cpp" +#line 11643 "MachineIndependent/glslang_tab.cpp" break; - case 611: /* for_rest_statement: conditionopt SEMICOLON */ -#line 4023 "MachineIndependent/glslang.y" + case 615: /* for_rest_statement: conditionopt SEMICOLON */ +#line 4047 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 11580 "MachineIndependent/glslang_tab.cpp" +#line 11652 "MachineIndependent/glslang_tab.cpp" break; - case 612: /* for_rest_statement: conditionopt SEMICOLON expression */ -#line 4027 "MachineIndependent/glslang.y" + case 616: /* for_rest_statement: conditionopt SEMICOLON expression */ +#line 4051 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 11589 "MachineIndependent/glslang_tab.cpp" +#line 11661 "MachineIndependent/glslang_tab.cpp" break; - case 613: /* jump_statement: CONTINUE SEMICOLON */ -#line 4034 "MachineIndependent/glslang.y" + case 617: /* jump_statement: CONTINUE SEMICOLON */ +#line 4058 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 11599 "MachineIndependent/glslang_tab.cpp" +#line 11671 "MachineIndependent/glslang_tab.cpp" break; - case 614: /* jump_statement: BREAK SEMICOLON */ -#line 4039 "MachineIndependent/glslang.y" + case 618: /* jump_statement: BREAK SEMICOLON */ +#line 4063 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 11609 "MachineIndependent/glslang_tab.cpp" +#line 11681 "MachineIndependent/glslang_tab.cpp" break; - case 615: /* jump_statement: RETURN SEMICOLON */ -#line 4044 "MachineIndependent/glslang.y" + case 619: /* jump_statement: RETURN SEMICOLON */ +#line 4068 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -11617,101 +11689,101 @@ yyreduce: if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 11621 "MachineIndependent/glslang_tab.cpp" +#line 11693 "MachineIndependent/glslang_tab.cpp" break; - case 616: /* jump_statement: RETURN expression SEMICOLON */ -#line 4051 "MachineIndependent/glslang.y" + case 620: /* jump_statement: RETURN expression SEMICOLON */ +#line 4075 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 11629 "MachineIndependent/glslang_tab.cpp" +#line 11701 "MachineIndependent/glslang_tab.cpp" break; - case 617: /* jump_statement: DISCARD SEMICOLON */ -#line 4054 "MachineIndependent/glslang.y" + case 621: /* jump_statement: DISCARD SEMICOLON */ +#line 4078 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 11638 "MachineIndependent/glslang_tab.cpp" +#line 11710 "MachineIndependent/glslang_tab.cpp" break; - case 618: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ -#line 4058 "MachineIndependent/glslang.y" + case 622: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ +#line 4082 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); } -#line 11647 "MachineIndependent/glslang_tab.cpp" +#line 11719 "MachineIndependent/glslang_tab.cpp" break; - case 619: /* jump_statement: TERMINATE_RAY SEMICOLON */ -#line 4063 "MachineIndependent/glslang.y" + case 623: /* jump_statement: TERMINATE_RAY SEMICOLON */ +#line 4087 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); } -#line 11656 "MachineIndependent/glslang_tab.cpp" +#line 11728 "MachineIndependent/glslang_tab.cpp" break; - case 620: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ -#line 4067 "MachineIndependent/glslang.y" + case 624: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ +#line 4091 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); } -#line 11665 "MachineIndependent/glslang_tab.cpp" +#line 11737 "MachineIndependent/glslang_tab.cpp" break; - case 621: /* translation_unit: external_declaration */ -#line 4077 "MachineIndependent/glslang.y" + case 625: /* translation_unit: external_declaration */ +#line 4101 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 11674 "MachineIndependent/glslang_tab.cpp" +#line 11746 "MachineIndependent/glslang_tab.cpp" break; - case 622: /* translation_unit: translation_unit external_declaration */ -#line 4081 "MachineIndependent/glslang.y" + case 626: /* translation_unit: translation_unit external_declaration */ +#line 4105 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 11685 "MachineIndependent/glslang_tab.cpp" +#line 11757 "MachineIndependent/glslang_tab.cpp" break; - case 623: /* external_declaration: function_definition */ -#line 4090 "MachineIndependent/glslang.y" + case 627: /* external_declaration: function_definition */ +#line 4114 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11693 "MachineIndependent/glslang_tab.cpp" +#line 11765 "MachineIndependent/glslang_tab.cpp" break; - case 624: /* external_declaration: declaration */ -#line 4093 "MachineIndependent/glslang.y" + case 628: /* external_declaration: declaration */ +#line 4117 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11701 "MachineIndependent/glslang_tab.cpp" +#line 11773 "MachineIndependent/glslang_tab.cpp" break; - case 625: /* external_declaration: SEMICOLON */ -#line 4097 "MachineIndependent/glslang.y" + case 629: /* external_declaration: SEMICOLON */ +#line 4121 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 11711 "MachineIndependent/glslang_tab.cpp" +#line 11783 "MachineIndependent/glslang_tab.cpp" break; - case 626: /* $@13: %empty */ -#line 4106 "MachineIndependent/glslang.y" + case 630: /* $@13: %empty */ +#line 4130 "MachineIndependent/glslang.y" { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); @@ -11724,11 +11796,11 @@ yyreduce: ++parseContext.statementNestingLevel; } } -#line 11728 "MachineIndependent/glslang_tab.cpp" +#line 11800 "MachineIndependent/glslang_tab.cpp" break; - case 627: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ -#line 4118 "MachineIndependent/glslang.y" + case 631: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ +#line 4142 "MachineIndependent/glslang.y" { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -11755,228 +11827,228 @@ yyreduce: --parseContext.statementNestingLevel; } } -#line 11759 "MachineIndependent/glslang_tab.cpp" - break; - - case 628: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ -#line 4148 "MachineIndependent/glslang.y" - { - (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); - } -#line 11767 "MachineIndependent/glslang_tab.cpp" - break; - - case 629: /* attribute_list: single_attribute */ -#line 4153 "MachineIndependent/glslang.y" - { - (yyval.interm.attributes) = (yyvsp[0].interm.attributes); - } -#line 11775 "MachineIndependent/glslang_tab.cpp" - break; - - case 630: /* attribute_list: attribute_list COMMA single_attribute */ -#line 4156 "MachineIndependent/glslang.y" - { - (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); - } -#line 11783 "MachineIndependent/glslang_tab.cpp" - break; - - case 631: /* single_attribute: IDENTIFIER */ -#line 4161 "MachineIndependent/glslang.y" - { - (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); - } -#line 11791 "MachineIndependent/glslang_tab.cpp" - break; - - case 632: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ -#line 4164 "MachineIndependent/glslang.y" - { - (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); - } -#line 11799 "MachineIndependent/glslang_tab.cpp" - break; - - case 633: /* spirv_requirements_list: spirv_requirements_parameter */ -#line 4171 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); - } -#line 11807 "MachineIndependent/glslang_tab.cpp" - break; - - case 634: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ -#line 4174 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); - } -#line 11815 "MachineIndependent/glslang_tab.cpp" - break; - - case 635: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ -#line 4179 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); - } -#line 11823 "MachineIndependent/glslang_tab.cpp" - break; - - case 636: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ -#line 4182 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); - } #line 11831 "MachineIndependent/glslang_tab.cpp" break; - case 637: /* spirv_extension_list: STRING_LITERAL */ -#line 4187 "MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + case 632: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ +#line 4172 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); } #line 11839 "MachineIndependent/glslang_tab.cpp" break; - case 638: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ -#line 4190 "MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + case 633: /* attribute_list: single_attribute */ +#line 4177 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } #line 11847 "MachineIndependent/glslang_tab.cpp" break; - case 639: /* spirv_capability_list: INTCONSTANT */ -#line 4195 "MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); + case 634: /* attribute_list: attribute_list COMMA single_attribute */ +#line 4180 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } #line 11855 "MachineIndependent/glslang_tab.cpp" break; - case 640: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ -#line 4198 "MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); + case 635: /* single_attribute: IDENTIFIER */ +#line 4185 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } #line 11863 "MachineIndependent/glslang_tab.cpp" break; - case 641: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ + case 636: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ +#line 4188 "MachineIndependent/glslang.y" + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); + } +#line 11871 "MachineIndependent/glslang_tab.cpp" + break; + + case 637: /* spirv_requirements_list: spirv_requirements_parameter */ +#line 4195 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); + } +#line 11879 "MachineIndependent/glslang_tab.cpp" + break; + + case 638: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ +#line 4198 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); + } +#line 11887 "MachineIndependent/glslang_tab.cpp" + break; + + case 639: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ #line 4203 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); + } +#line 11895 "MachineIndependent/glslang_tab.cpp" + break; + + case 640: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ +#line 4206 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); + } +#line 11903 "MachineIndependent/glslang_tab.cpp" + break; + + case 641: /* spirv_extension_list: STRING_LITERAL */ +#line 4211 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + } +#line 11911 "MachineIndependent/glslang_tab.cpp" + break; + + case 642: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ +#line 4214 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); + } +#line 11919 "MachineIndependent/glslang_tab.cpp" + break; + + case 643: /* spirv_capability_list: INTCONSTANT */ +#line 4219 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); + } +#line 11927 "MachineIndependent/glslang_tab.cpp" + break; + + case 644: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ +#line 4222 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); + } +#line 11935 "MachineIndependent/glslang_tab.cpp" + break; + + case 645: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4227 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11872 "MachineIndependent/glslang_tab.cpp" +#line 11944 "MachineIndependent/glslang_tab.cpp" break; - case 642: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4207 "MachineIndependent/glslang.y" + case 646: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4231 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11882 "MachineIndependent/glslang_tab.cpp" +#line 11954 "MachineIndependent/glslang_tab.cpp" break; - case 643: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4212 "MachineIndependent/glslang.y" + case 647: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4236 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11891 "MachineIndependent/glslang_tab.cpp" +#line 11963 "MachineIndependent/glslang_tab.cpp" break; - case 644: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4216 "MachineIndependent/glslang.y" + case 648: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4240 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11901 "MachineIndependent/glslang_tab.cpp" +#line 11973 "MachineIndependent/glslang_tab.cpp" break; - case 645: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4221 "MachineIndependent/glslang.y" + case 649: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ +#line 4245 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11910 "MachineIndependent/glslang_tab.cpp" +#line 11982 "MachineIndependent/glslang_tab.cpp" break; - case 646: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4225 "MachineIndependent/glslang.y" + case 650: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ +#line 4249 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11920 "MachineIndependent/glslang_tab.cpp" +#line 11992 "MachineIndependent/glslang_tab.cpp" break; - case 647: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ -#line 4232 "MachineIndependent/glslang.y" + case 651: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ +#line 4256 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 11928 "MachineIndependent/glslang_tab.cpp" +#line 12000 "MachineIndependent/glslang_tab.cpp" break; - case 648: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ -#line 4235 "MachineIndependent/glslang.y" + case 652: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ +#line 4259 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11936 "MachineIndependent/glslang_tab.cpp" +#line 12008 "MachineIndependent/glslang_tab.cpp" break; - case 649: /* spirv_execution_mode_parameter: FLOATCONSTANT */ -#line 4240 "MachineIndependent/glslang.y" + case 653: /* spirv_execution_mode_parameter: FLOATCONSTANT */ +#line 4264 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 11944 "MachineIndependent/glslang_tab.cpp" +#line 12016 "MachineIndependent/glslang_tab.cpp" break; - case 650: /* spirv_execution_mode_parameter: INTCONSTANT */ -#line 4243 "MachineIndependent/glslang.y" + case 654: /* spirv_execution_mode_parameter: INTCONSTANT */ +#line 4267 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 11952 "MachineIndependent/glslang_tab.cpp" +#line 12024 "MachineIndependent/glslang_tab.cpp" break; - case 651: /* spirv_execution_mode_parameter: UINTCONSTANT */ -#line 4246 "MachineIndependent/glslang.y" + case 655: /* spirv_execution_mode_parameter: UINTCONSTANT */ +#line 4270 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 11960 "MachineIndependent/glslang_tab.cpp" +#line 12032 "MachineIndependent/glslang_tab.cpp" break; - case 652: /* spirv_execution_mode_parameter: BOOLCONSTANT */ -#line 4249 "MachineIndependent/glslang.y" + case 656: /* spirv_execution_mode_parameter: BOOLCONSTANT */ +#line 4273 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 11968 "MachineIndependent/glslang_tab.cpp" +#line 12040 "MachineIndependent/glslang_tab.cpp" break; - case 653: /* spirv_execution_mode_parameter: STRING_LITERAL */ -#line 4252 "MachineIndependent/glslang.y" + case 657: /* spirv_execution_mode_parameter: STRING_LITERAL */ +#line 4276 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 11976 "MachineIndependent/glslang_tab.cpp" +#line 12048 "MachineIndependent/glslang_tab.cpp" break; - case 654: /* spirv_execution_mode_id_parameter_list: constant_expression */ -#line 4257 "MachineIndependent/glslang.y" + case 658: /* spirv_execution_mode_id_parameter_list: constant_expression */ +#line 4281 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -11986,11 +12058,11 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); } -#line 11990 "MachineIndependent/glslang_tab.cpp" +#line 12062 "MachineIndependent/glslang_tab.cpp" break; - case 655: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ -#line 4266 "MachineIndependent/glslang.y" + case 659: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ +#line 4290 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12000,343 +12072,343 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); } -#line 12004 "MachineIndependent/glslang_tab.cpp" +#line 12076 "MachineIndependent/glslang_tab.cpp" break; - case 656: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4277 "MachineIndependent/glslang.y" + case 660: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4301 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 12014 "MachineIndependent/glslang_tab.cpp" +#line 12086 "MachineIndependent/glslang_tab.cpp" break; - case 657: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4282 "MachineIndependent/glslang.y" + case 661: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4306 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 12025 "MachineIndependent/glslang_tab.cpp" +#line 12097 "MachineIndependent/glslang_tab.cpp" break; - case 658: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4290 "MachineIndependent/glslang.y" + case 662: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4314 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12034 "MachineIndependent/glslang_tab.cpp" +#line 12106 "MachineIndependent/glslang_tab.cpp" break; - case 659: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4294 "MachineIndependent/glslang.y" + case 663: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4318 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12044 "MachineIndependent/glslang_tab.cpp" +#line 12116 "MachineIndependent/glslang_tab.cpp" break; - case 660: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4299 "MachineIndependent/glslang.y" + case 664: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4323 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12053 "MachineIndependent/glslang_tab.cpp" +#line 12125 "MachineIndependent/glslang_tab.cpp" break; - case 661: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4303 "MachineIndependent/glslang.y" + case 665: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4327 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12063 "MachineIndependent/glslang_tab.cpp" +#line 12135 "MachineIndependent/glslang_tab.cpp" break; - case 662: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4308 "MachineIndependent/glslang.y" + case 666: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4332 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12072 "MachineIndependent/glslang_tab.cpp" +#line 12144 "MachineIndependent/glslang_tab.cpp" break; - case 663: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4312 "MachineIndependent/glslang.y" + case 667: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4336 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12082 "MachineIndependent/glslang_tab.cpp" +#line 12154 "MachineIndependent/glslang_tab.cpp" break; - case 664: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4317 "MachineIndependent/glslang.y" + case 668: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4341 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12091 "MachineIndependent/glslang_tab.cpp" +#line 12163 "MachineIndependent/glslang_tab.cpp" break; - case 665: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4321 "MachineIndependent/glslang.y" + case 669: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4345 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12101 "MachineIndependent/glslang_tab.cpp" +#line 12173 "MachineIndependent/glslang_tab.cpp" break; - case 666: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ -#line 4328 "MachineIndependent/glslang.y" + case 670: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ +#line 4352 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12109 "MachineIndependent/glslang_tab.cpp" +#line 12181 "MachineIndependent/glslang_tab.cpp" break; - case 667: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ -#line 4331 "MachineIndependent/glslang.y" + case 671: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ +#line 4355 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12117 "MachineIndependent/glslang_tab.cpp" +#line 12189 "MachineIndependent/glslang_tab.cpp" break; - case 668: /* spirv_decorate_parameter: FLOATCONSTANT */ -#line 4336 "MachineIndependent/glslang.y" + case 672: /* spirv_decorate_parameter: FLOATCONSTANT */ +#line 4360 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12125 "MachineIndependent/glslang_tab.cpp" +#line 12197 "MachineIndependent/glslang_tab.cpp" break; - case 669: /* spirv_decorate_parameter: INTCONSTANT */ -#line 4339 "MachineIndependent/glslang.y" + case 673: /* spirv_decorate_parameter: INTCONSTANT */ +#line 4363 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12133 "MachineIndependent/glslang_tab.cpp" +#line 12205 "MachineIndependent/glslang_tab.cpp" break; - case 670: /* spirv_decorate_parameter: UINTCONSTANT */ -#line 4342 "MachineIndependent/glslang.y" + case 674: /* spirv_decorate_parameter: UINTCONSTANT */ +#line 4366 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12141 "MachineIndependent/glslang_tab.cpp" +#line 12213 "MachineIndependent/glslang_tab.cpp" break; - case 671: /* spirv_decorate_parameter: BOOLCONSTANT */ -#line 4345 "MachineIndependent/glslang.y" + case 675: /* spirv_decorate_parameter: BOOLCONSTANT */ +#line 4369 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12149 "MachineIndependent/glslang_tab.cpp" +#line 12221 "MachineIndependent/glslang_tab.cpp" break; - case 672: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ -#line 4350 "MachineIndependent/glslang.y" + case 676: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ +#line 4374 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12157 "MachineIndependent/glslang_tab.cpp" +#line 12229 "MachineIndependent/glslang_tab.cpp" break; - case 673: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ -#line 4353 "MachineIndependent/glslang.y" + case 677: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ +#line 4377 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12165 "MachineIndependent/glslang_tab.cpp" +#line 12237 "MachineIndependent/glslang_tab.cpp" break; - case 674: /* spirv_decorate_id_parameter: variable_identifier */ -#line 4358 "MachineIndependent/glslang.y" + case 678: /* spirv_decorate_id_parameter: variable_identifier */ +#line 4382 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getAsConstantUnion() || (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode()) (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); else parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); } -#line 12176 "MachineIndependent/glslang_tab.cpp" +#line 12248 "MachineIndependent/glslang_tab.cpp" break; - case 675: /* spirv_decorate_id_parameter: FLOATCONSTANT */ -#line 4364 "MachineIndependent/glslang.y" + case 679: /* spirv_decorate_id_parameter: FLOATCONSTANT */ +#line 4388 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12184 "MachineIndependent/glslang_tab.cpp" +#line 12256 "MachineIndependent/glslang_tab.cpp" break; - case 676: /* spirv_decorate_id_parameter: INTCONSTANT */ -#line 4367 "MachineIndependent/glslang.y" + case 680: /* spirv_decorate_id_parameter: INTCONSTANT */ +#line 4391 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12192 "MachineIndependent/glslang_tab.cpp" +#line 12264 "MachineIndependent/glslang_tab.cpp" break; - case 677: /* spirv_decorate_id_parameter: UINTCONSTANT */ -#line 4370 "MachineIndependent/glslang.y" + case 681: /* spirv_decorate_id_parameter: UINTCONSTANT */ +#line 4394 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12200 "MachineIndependent/glslang_tab.cpp" +#line 12272 "MachineIndependent/glslang_tab.cpp" break; - case 678: /* spirv_decorate_id_parameter: BOOLCONSTANT */ -#line 4373 "MachineIndependent/glslang.y" + case 682: /* spirv_decorate_id_parameter: BOOLCONSTANT */ +#line 4397 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12208 "MachineIndependent/glslang_tab.cpp" +#line 12280 "MachineIndependent/glslang_tab.cpp" break; - case 679: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ -#line 4378 "MachineIndependent/glslang.y" + case 683: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ +#line 4402 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12217 "MachineIndependent/glslang_tab.cpp" +#line 12289 "MachineIndependent/glslang_tab.cpp" break; - case 680: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ -#line 4382 "MachineIndependent/glslang.y" + case 684: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ +#line 4406 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12225 "MachineIndependent/glslang_tab.cpp" +#line 12297 "MachineIndependent/glslang_tab.cpp" break; - case 681: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4387 "MachineIndependent/glslang.y" + case 685: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4411 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12234 "MachineIndependent/glslang_tab.cpp" +#line 12306 "MachineIndependent/glslang_tab.cpp" break; - case 682: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4391 "MachineIndependent/glslang.y" + case 686: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4415 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12244 "MachineIndependent/glslang_tab.cpp" +#line 12316 "MachineIndependent/glslang_tab.cpp" break; - case 683: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4396 "MachineIndependent/glslang.y" + case 687: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4420 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12253 "MachineIndependent/glslang_tab.cpp" +#line 12325 "MachineIndependent/glslang_tab.cpp" break; - case 684: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4400 "MachineIndependent/glslang.y" + case 688: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4424 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12263 "MachineIndependent/glslang_tab.cpp" +#line 12335 "MachineIndependent/glslang_tab.cpp" break; - case 685: /* spirv_type_parameter_list: spirv_type_parameter */ -#line 4407 "MachineIndependent/glslang.y" + case 689: /* spirv_type_parameter_list: spirv_type_parameter */ +#line 4431 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); } -#line 12271 "MachineIndependent/glslang_tab.cpp" +#line 12343 "MachineIndependent/glslang_tab.cpp" break; - case 686: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ -#line 4410 "MachineIndependent/glslang.y" + case 690: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ +#line 4434 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); } -#line 12279 "MachineIndependent/glslang_tab.cpp" +#line 12351 "MachineIndependent/glslang_tab.cpp" break; - case 687: /* spirv_type_parameter: constant_expression */ -#line 4415 "MachineIndependent/glslang.y" + case 691: /* spirv_type_parameter: constant_expression */ +#line 4439 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); } -#line 12287 "MachineIndependent/glslang_tab.cpp" +#line 12359 "MachineIndependent/glslang_tab.cpp" break; - case 688: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4420 "MachineIndependent/glslang.y" + case 692: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4444 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12295 "MachineIndependent/glslang_tab.cpp" +#line 12367 "MachineIndependent/glslang_tab.cpp" break; - case 689: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4423 "MachineIndependent/glslang.y" + case 693: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4447 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12304 "MachineIndependent/glslang_tab.cpp" +#line 12376 "MachineIndependent/glslang_tab.cpp" break; - case 690: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ -#line 4429 "MachineIndependent/glslang.y" + case 694: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ +#line 4453 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); } -#line 12312 "MachineIndependent/glslang_tab.cpp" +#line 12384 "MachineIndependent/glslang_tab.cpp" break; - case 691: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4432 "MachineIndependent/glslang.y" + case 695: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ +#line 4456 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } -#line 12320 "MachineIndependent/glslang_tab.cpp" +#line 12392 "MachineIndependent/glslang_tab.cpp" break; - case 692: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ -#line 4437 "MachineIndependent/glslang.y" + case 696: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ +#line 4461 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } -#line 12328 "MachineIndependent/glslang_tab.cpp" +#line 12400 "MachineIndependent/glslang_tab.cpp" break; - case 693: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4440 "MachineIndependent/glslang.y" + case 697: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ +#line 4464 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } -#line 12336 "MachineIndependent/glslang_tab.cpp" +#line 12408 "MachineIndependent/glslang_tab.cpp" break; -#line 12340 "MachineIndependent/glslang_tab.cpp" +#line 12412 "MachineIndependent/glslang_tab.cpp" default: break; } @@ -12561,5 +12633,5 @@ yyreturn: return yyresult; } -#line 4445 "MachineIndependent/glslang.y" +#line 4469 "MachineIndependent/glslang.y" diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index 6d168d011..d2dd5e353 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -380,137 +380,141 @@ extern int yydebug; SPIRV_STORAGE_CLASS = 581, /* SPIRV_STORAGE_CLASS */ SPIRV_BY_REFERENCE = 582, /* SPIRV_BY_REFERENCE */ SPIRV_LITERAL = 583, /* SPIRV_LITERAL */ - LEFT_OP = 584, /* LEFT_OP */ - RIGHT_OP = 585, /* RIGHT_OP */ - INC_OP = 586, /* INC_OP */ - DEC_OP = 587, /* DEC_OP */ - LE_OP = 588, /* LE_OP */ - GE_OP = 589, /* GE_OP */ - EQ_OP = 590, /* EQ_OP */ - NE_OP = 591, /* NE_OP */ - AND_OP = 592, /* AND_OP */ - OR_OP = 593, /* OR_OP */ - XOR_OP = 594, /* XOR_OP */ - MUL_ASSIGN = 595, /* MUL_ASSIGN */ - DIV_ASSIGN = 596, /* DIV_ASSIGN */ - ADD_ASSIGN = 597, /* ADD_ASSIGN */ - MOD_ASSIGN = 598, /* MOD_ASSIGN */ - LEFT_ASSIGN = 599, /* LEFT_ASSIGN */ - RIGHT_ASSIGN = 600, /* RIGHT_ASSIGN */ - AND_ASSIGN = 601, /* AND_ASSIGN */ - XOR_ASSIGN = 602, /* XOR_ASSIGN */ - OR_ASSIGN = 603, /* OR_ASSIGN */ - SUB_ASSIGN = 604, /* SUB_ASSIGN */ - STRING_LITERAL = 605, /* STRING_LITERAL */ - LEFT_PAREN = 606, /* LEFT_PAREN */ - RIGHT_PAREN = 607, /* RIGHT_PAREN */ - LEFT_BRACKET = 608, /* LEFT_BRACKET */ - RIGHT_BRACKET = 609, /* RIGHT_BRACKET */ - LEFT_BRACE = 610, /* LEFT_BRACE */ - RIGHT_BRACE = 611, /* RIGHT_BRACE */ - DOT = 612, /* DOT */ - COMMA = 613, /* COMMA */ - COLON = 614, /* COLON */ - EQUAL = 615, /* EQUAL */ - SEMICOLON = 616, /* SEMICOLON */ - BANG = 617, /* BANG */ - DASH = 618, /* DASH */ - TILDE = 619, /* TILDE */ - PLUS = 620, /* PLUS */ - STAR = 621, /* STAR */ - SLASH = 622, /* SLASH */ - PERCENT = 623, /* PERCENT */ - LEFT_ANGLE = 624, /* LEFT_ANGLE */ - RIGHT_ANGLE = 625, /* RIGHT_ANGLE */ - VERTICAL_BAR = 626, /* VERTICAL_BAR */ - CARET = 627, /* CARET */ - AMPERSAND = 628, /* AMPERSAND */ - QUESTION = 629, /* QUESTION */ - INVARIANT = 630, /* INVARIANT */ - HIGH_PRECISION = 631, /* HIGH_PRECISION */ - MEDIUM_PRECISION = 632, /* MEDIUM_PRECISION */ - LOW_PRECISION = 633, /* LOW_PRECISION */ - PRECISION = 634, /* PRECISION */ - PACKED = 635, /* PACKED */ - RESOURCE = 636, /* RESOURCE */ - SUPERP = 637, /* SUPERP */ - FLOATCONSTANT = 638, /* FLOATCONSTANT */ - INTCONSTANT = 639, /* INTCONSTANT */ - UINTCONSTANT = 640, /* UINTCONSTANT */ - BOOLCONSTANT = 641, /* BOOLCONSTANT */ - IDENTIFIER = 642, /* IDENTIFIER */ - TYPE_NAME = 643, /* TYPE_NAME */ - CENTROID = 644, /* CENTROID */ - IN = 645, /* IN */ - OUT = 646, /* OUT */ - INOUT = 647, /* INOUT */ - STRUCT = 648, /* STRUCT */ - VOID = 649, /* VOID */ - WHILE = 650, /* WHILE */ - BREAK = 651, /* BREAK */ - CONTINUE = 652, /* CONTINUE */ - DO = 653, /* DO */ - ELSE = 654, /* ELSE */ - FOR = 655, /* FOR */ - IF = 656, /* IF */ - DISCARD = 657, /* DISCARD */ - RETURN = 658, /* RETURN */ - SWITCH = 659, /* SWITCH */ - CASE = 660, /* CASE */ - DEFAULT = 661, /* DEFAULT */ - TERMINATE_INVOCATION = 662, /* TERMINATE_INVOCATION */ - TERMINATE_RAY = 663, /* TERMINATE_RAY */ - IGNORE_INTERSECTION = 664, /* IGNORE_INTERSECTION */ - UNIFORM = 665, /* UNIFORM */ - SHARED = 666, /* SHARED */ - BUFFER = 667, /* BUFFER */ - FLAT = 668, /* FLAT */ - SMOOTH = 669, /* SMOOTH */ - LAYOUT = 670, /* LAYOUT */ - DOUBLECONSTANT = 671, /* DOUBLECONSTANT */ - INT16CONSTANT = 672, /* INT16CONSTANT */ - UINT16CONSTANT = 673, /* UINT16CONSTANT */ - FLOAT16CONSTANT = 674, /* FLOAT16CONSTANT */ - INT32CONSTANT = 675, /* INT32CONSTANT */ - UINT32CONSTANT = 676, /* UINT32CONSTANT */ - INT64CONSTANT = 677, /* INT64CONSTANT */ - UINT64CONSTANT = 678, /* UINT64CONSTANT */ - SUBROUTINE = 679, /* SUBROUTINE */ - DEMOTE = 680, /* DEMOTE */ - PAYLOADNV = 681, /* PAYLOADNV */ - PAYLOADINNV = 682, /* PAYLOADINNV */ - HITATTRNV = 683, /* HITATTRNV */ - CALLDATANV = 684, /* CALLDATANV */ - CALLDATAINNV = 685, /* CALLDATAINNV */ - PAYLOADEXT = 686, /* PAYLOADEXT */ - PAYLOADINEXT = 687, /* PAYLOADINEXT */ - HITATTREXT = 688, /* HITATTREXT */ - CALLDATAEXT = 689, /* CALLDATAEXT */ - CALLDATAINEXT = 690, /* CALLDATAINEXT */ - PATCH = 691, /* PATCH */ - SAMPLE = 692, /* SAMPLE */ - NONUNIFORM = 693, /* NONUNIFORM */ - COHERENT = 694, /* COHERENT */ - VOLATILE = 695, /* VOLATILE */ - RESTRICT = 696, /* RESTRICT */ - READONLY = 697, /* READONLY */ - WRITEONLY = 698, /* WRITEONLY */ - DEVICECOHERENT = 699, /* DEVICECOHERENT */ - QUEUEFAMILYCOHERENT = 700, /* QUEUEFAMILYCOHERENT */ - WORKGROUPCOHERENT = 701, /* WORKGROUPCOHERENT */ - SUBGROUPCOHERENT = 702, /* SUBGROUPCOHERENT */ - NONPRIVATE = 703, /* NONPRIVATE */ - SHADERCALLCOHERENT = 704, /* SHADERCALLCOHERENT */ - NOPERSPECTIVE = 705, /* NOPERSPECTIVE */ - EXPLICITINTERPAMD = 706, /* EXPLICITINTERPAMD */ - PERVERTEXEXT = 707, /* PERVERTEXEXT */ - PERVERTEXNV = 708, /* PERVERTEXNV */ - PERPRIMITIVENV = 709, /* PERPRIMITIVENV */ - PERVIEWNV = 710, /* PERVIEWNV */ - PERTASKNV = 711, /* PERTASKNV */ - PERPRIMITIVEEXT = 712, /* PERPRIMITIVEEXT */ - TASKPAYLOADWORKGROUPEXT = 713, /* TASKPAYLOADWORKGROUPEXT */ - PRECISE = 714 /* PRECISE */ + ATTACHMENTEXT = 584, /* ATTACHMENTEXT */ + IATTACHMENTEXT = 585, /* IATTACHMENTEXT */ + UATTACHMENTEXT = 586, /* UATTACHMENTEXT */ + LEFT_OP = 587, /* LEFT_OP */ + RIGHT_OP = 588, /* RIGHT_OP */ + INC_OP = 589, /* INC_OP */ + DEC_OP = 590, /* DEC_OP */ + LE_OP = 591, /* LE_OP */ + GE_OP = 592, /* GE_OP */ + EQ_OP = 593, /* EQ_OP */ + NE_OP = 594, /* NE_OP */ + AND_OP = 595, /* AND_OP */ + OR_OP = 596, /* OR_OP */ + XOR_OP = 597, /* XOR_OP */ + MUL_ASSIGN = 598, /* MUL_ASSIGN */ + DIV_ASSIGN = 599, /* DIV_ASSIGN */ + ADD_ASSIGN = 600, /* ADD_ASSIGN */ + MOD_ASSIGN = 601, /* MOD_ASSIGN */ + LEFT_ASSIGN = 602, /* LEFT_ASSIGN */ + RIGHT_ASSIGN = 603, /* RIGHT_ASSIGN */ + AND_ASSIGN = 604, /* AND_ASSIGN */ + XOR_ASSIGN = 605, /* XOR_ASSIGN */ + OR_ASSIGN = 606, /* OR_ASSIGN */ + SUB_ASSIGN = 607, /* SUB_ASSIGN */ + STRING_LITERAL = 608, /* STRING_LITERAL */ + LEFT_PAREN = 609, /* LEFT_PAREN */ + RIGHT_PAREN = 610, /* RIGHT_PAREN */ + LEFT_BRACKET = 611, /* LEFT_BRACKET */ + RIGHT_BRACKET = 612, /* RIGHT_BRACKET */ + LEFT_BRACE = 613, /* LEFT_BRACE */ + RIGHT_BRACE = 614, /* RIGHT_BRACE */ + DOT = 615, /* DOT */ + COMMA = 616, /* COMMA */ + COLON = 617, /* COLON */ + EQUAL = 618, /* EQUAL */ + SEMICOLON = 619, /* SEMICOLON */ + BANG = 620, /* BANG */ + DASH = 621, /* DASH */ + TILDE = 622, /* TILDE */ + PLUS = 623, /* PLUS */ + STAR = 624, /* STAR */ + SLASH = 625, /* SLASH */ + PERCENT = 626, /* PERCENT */ + LEFT_ANGLE = 627, /* LEFT_ANGLE */ + RIGHT_ANGLE = 628, /* RIGHT_ANGLE */ + VERTICAL_BAR = 629, /* VERTICAL_BAR */ + CARET = 630, /* CARET */ + AMPERSAND = 631, /* AMPERSAND */ + QUESTION = 632, /* QUESTION */ + INVARIANT = 633, /* INVARIANT */ + HIGH_PRECISION = 634, /* HIGH_PRECISION */ + MEDIUM_PRECISION = 635, /* MEDIUM_PRECISION */ + LOW_PRECISION = 636, /* LOW_PRECISION */ + PRECISION = 637, /* PRECISION */ + PACKED = 638, /* PACKED */ + RESOURCE = 639, /* RESOURCE */ + SUPERP = 640, /* SUPERP */ + FLOATCONSTANT = 641, /* FLOATCONSTANT */ + INTCONSTANT = 642, /* INTCONSTANT */ + UINTCONSTANT = 643, /* UINTCONSTANT */ + BOOLCONSTANT = 644, /* BOOLCONSTANT */ + IDENTIFIER = 645, /* IDENTIFIER */ + TYPE_NAME = 646, /* TYPE_NAME */ + CENTROID = 647, /* CENTROID */ + IN = 648, /* IN */ + OUT = 649, /* OUT */ + INOUT = 650, /* INOUT */ + STRUCT = 651, /* STRUCT */ + VOID = 652, /* VOID */ + WHILE = 653, /* WHILE */ + BREAK = 654, /* BREAK */ + CONTINUE = 655, /* CONTINUE */ + DO = 656, /* DO */ + ELSE = 657, /* ELSE */ + FOR = 658, /* FOR */ + IF = 659, /* IF */ + DISCARD = 660, /* DISCARD */ + RETURN = 661, /* RETURN */ + SWITCH = 662, /* SWITCH */ + CASE = 663, /* CASE */ + DEFAULT = 664, /* DEFAULT */ + TERMINATE_INVOCATION = 665, /* TERMINATE_INVOCATION */ + TERMINATE_RAY = 666, /* TERMINATE_RAY */ + IGNORE_INTERSECTION = 667, /* IGNORE_INTERSECTION */ + UNIFORM = 668, /* UNIFORM */ + SHARED = 669, /* SHARED */ + BUFFER = 670, /* BUFFER */ + TILEIMAGEEXT = 671, /* TILEIMAGEEXT */ + FLAT = 672, /* FLAT */ + SMOOTH = 673, /* SMOOTH */ + LAYOUT = 674, /* LAYOUT */ + DOUBLECONSTANT = 675, /* DOUBLECONSTANT */ + INT16CONSTANT = 676, /* INT16CONSTANT */ + UINT16CONSTANT = 677, /* UINT16CONSTANT */ + FLOAT16CONSTANT = 678, /* FLOAT16CONSTANT */ + INT32CONSTANT = 679, /* INT32CONSTANT */ + UINT32CONSTANT = 680, /* UINT32CONSTANT */ + INT64CONSTANT = 681, /* INT64CONSTANT */ + UINT64CONSTANT = 682, /* UINT64CONSTANT */ + SUBROUTINE = 683, /* SUBROUTINE */ + DEMOTE = 684, /* DEMOTE */ + PAYLOADNV = 685, /* PAYLOADNV */ + PAYLOADINNV = 686, /* PAYLOADINNV */ + HITATTRNV = 687, /* HITATTRNV */ + CALLDATANV = 688, /* CALLDATANV */ + CALLDATAINNV = 689, /* CALLDATAINNV */ + PAYLOADEXT = 690, /* PAYLOADEXT */ + PAYLOADINEXT = 691, /* PAYLOADINEXT */ + HITATTREXT = 692, /* HITATTREXT */ + CALLDATAEXT = 693, /* CALLDATAEXT */ + CALLDATAINEXT = 694, /* CALLDATAINEXT */ + PATCH = 695, /* PATCH */ + SAMPLE = 696, /* SAMPLE */ + NONUNIFORM = 697, /* NONUNIFORM */ + COHERENT = 698, /* COHERENT */ + VOLATILE = 699, /* VOLATILE */ + RESTRICT = 700, /* RESTRICT */ + READONLY = 701, /* READONLY */ + WRITEONLY = 702, /* WRITEONLY */ + DEVICECOHERENT = 703, /* DEVICECOHERENT */ + QUEUEFAMILYCOHERENT = 704, /* QUEUEFAMILYCOHERENT */ + WORKGROUPCOHERENT = 705, /* WORKGROUPCOHERENT */ + SUBGROUPCOHERENT = 706, /* SUBGROUPCOHERENT */ + NONPRIVATE = 707, /* NONPRIVATE */ + SHADERCALLCOHERENT = 708, /* SHADERCALLCOHERENT */ + NOPERSPECTIVE = 709, /* NOPERSPECTIVE */ + EXPLICITINTERPAMD = 710, /* EXPLICITINTERPAMD */ + PERVERTEXEXT = 711, /* PERVERTEXEXT */ + PERVERTEXNV = 712, /* PERVERTEXNV */ + PERPRIMITIVENV = 713, /* PERPRIMITIVENV */ + PERVIEWNV = 714, /* PERVIEWNV */ + PERTASKNV = 715, /* PERTASKNV */ + PERPRIMITIVEEXT = 716, /* PERPRIMITIVEEXT */ + TASKPAYLOADWORKGROUPEXT = 717, /* TASKPAYLOADWORKGROUPEXT */ + PRECISE = 718 /* PRECISE */ }; typedef enum yytokentype yytoken_kind_t; #endif @@ -558,7 +562,7 @@ union YYSTYPE glslang::TArraySizes* typeParameters; } interm; -#line 562 "MachineIndependent/glslang_tab.cpp.h" +#line 566 "MachineIndependent/glslang_tab.cpp.h" }; typedef union YYSTYPE YYSTYPE; diff --git a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp index 91d5b954e..b79bd464d 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -663,6 +663,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpSubpassLoad: out.debug << "subpassLoad"; break; case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; + case EOpColorAttachmentReadEXT: out.debug << "colorAttachmentReadEXT"; break; + case EOpConstructReference: out.debug << "Construct reference type"; break; case EOpDeclare: out.debug << "Declare"; break; @@ -1060,6 +1062,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSubpassLoad: out.debug << "subpassLoad"; break; case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; + case EOpColorAttachmentReadEXT: out.debug << "colorAttachmentReadEXT"; break; + case EOpTraceNV: out.debug << "traceNV"; break; case EOpTraceRayMotionNV: out.debug << "traceRayMotionNV"; break; case EOpTraceKHR: out.debug << "traceRayKHR"; break; @@ -1097,6 +1101,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpRayQueryGetWorldRayOrigin: out.debug << "rayQueryGetWorldRayOriginEXT"; break; case EOpRayQueryGetIntersectionObjectToWorld: out.debug << "rayQueryGetIntersectionObjectToWorldEXT"; break; case EOpRayQueryGetIntersectionWorldToObject: out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break; + case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: out.debug << "rayQueryGetIntersectionTriangleVertexPositionsEXT"; break; case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break; case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break; @@ -1140,6 +1145,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node #ifndef GLSLANG_WEB case EOpSpirvInst: out.debug << "spirv_instruction"; break; #endif + case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break; + case EOpDepthAttachmentReadEXT: out.debug << "depthAttachmentReadEXT"; break; default: out.debug.message(EPrefixError, "Bad aggregation op"); } @@ -1544,6 +1551,12 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) infoSink.debug << "using early_fragment_tests\n"; if (postDepthCoverage) infoSink.debug << "using post_depth_coverage\n"; + if (nonCoherentColorAttachmentReadEXT) + infoSink.debug << "using non_coherent_color_attachment_readEXT\n"; + if (nonCoherentDepthAttachmentReadEXT) + infoSink.debug << "using non_coherent_depth_attachment_readEXT\n"; + if (nonCoherentStencilAttachmentReadEXT) + infoSink.debug << "using non_coherent_stencil_attachment_readEXT\n"; if (depthLayout != EldNone) infoSink.debug << "using " << TQualifier::getLayoutDepthString(depthLayout) << "\n"; if (blendEquations != 0) { diff --git a/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp index 3a4cb567b..3230d8f4b 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -271,6 +271,9 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(earlyFragmentTests); MERGE_TRUE(postDepthCoverage); + MERGE_TRUE(nonCoherentColorAttachmentReadEXT); + MERGE_TRUE(nonCoherentDepthAttachmentReadEXT); + MERGE_TRUE(nonCoherentStencilAttachmentReadEXT); if (depthLayout == EldNone) depthLayout = unit.depthLayout; @@ -1617,7 +1620,7 @@ bool TIntermediate::userOutputUsed() const return found; } -// Accumulate locations used for inputs, outputs, and uniforms, payload and callable data +// Accumulate locations used for inputs, outputs, and uniforms, payload, callable data, and tileImageEXT // and check for collisions as the accumulation is done. // // Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. @@ -1639,6 +1642,8 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ set = 2; else if (qualifier.storage == EvqBuffer) set = 3; + else if (qualifier.storage == EvqTileImageEXT) + set = 4; else if (qualifier.isAnyPayload()) setRT = 0; else if (qualifier.isAnyCallable()) @@ -1731,7 +1736,10 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ } // combine location and component ranges - TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.getIndex() : 0); + TBasicType basicTy = type.getBasicType(); + if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT()) + basicTy = type.getSampler().type; + TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0); // check for collisions, except for vertex inputs on desktop targeting OpenGL if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0) @@ -1762,6 +1770,19 @@ int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TTyp } } + // check typeCollision between tileImageEXT and out + if (set == 4 || set == 1) { + // if the set is "tileImageEXT", check against "out" and vice versa + int againstSet = (set == 4) ? 1 : 4; + for (size_t r = 0; r < usedIo[againstSet].size(); ++r) { + if (range.location.overlap(usedIo[againstSet][r].location) && type.getBasicType() != usedIo[againstSet][r].basicType) { + // aliased-type mismatch + typeCollision = true; + return std::max(range.location.start, usedIo[againstSet][r].location.start); + } + } + } + return -1; // no collision } diff --git a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h index 0c5699760..2aa766a5e 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +++ b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h @@ -321,7 +321,12 @@ public: inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false),texCoordBuiltinRedeclared(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), interlockOrdering(EioNone), pointMode(false), earlyFragmentTests(false), - postDepthCoverage(false), earlyAndLateFragmentTestsAMD(false), depthLayout(EldNone), stencilLayout(ElsNone), + postDepthCoverage(false), earlyAndLateFragmentTestsAMD(false), + nonCoherentColorAttachmentReadEXT(false), + nonCoherentDepthAttachmentReadEXT(false), + nonCoherentStencilAttachmentReadEXT(false), + depthLayout(EldNone), + stencilLayout(ElsNone), hlslFunctionality1(false), blendEquations(0), xfbMode(false), multiStream(false), layoutOverrideCoverage(false), @@ -638,6 +643,9 @@ public: bool getXfbMode() const { return false; } bool isMultiStream() const { return false; } TLayoutGeometry getOutputPrimitive() const { return ElgNone; } + bool getNonCoherentColorAttachmentReadEXT() const { return false; } + bool getNonCoherentDepthAttachmentReadEXT() const { return false; } + bool getNonCoherentStencilAttachmentReadEXT() const { return false; } bool getPostDepthCoverage() const { return false; } bool getEarlyFragmentTests() const { return false; } TLayoutDepth getDepth() const { return EldNone; } @@ -894,6 +902,12 @@ public: return true; } TLayoutGeometry getOutputPrimitive() const { return outputPrimitive; } + void setNonCoherentColorAttachmentReadEXT() { nonCoherentColorAttachmentReadEXT = true; } + bool getNonCoherentColorAttachmentReadEXT() const { return nonCoherentColorAttachmentReadEXT; } + void setNonCoherentDepthAttachmentReadEXT() { nonCoherentDepthAttachmentReadEXT = true; } + bool getNonCoherentDepthAttachmentReadEXT() const { return nonCoherentDepthAttachmentReadEXT; } + void setNonCoherentStencilAttachmentReadEXT() { nonCoherentStencilAttachmentReadEXT = true; } + bool getNonCoherentStencilAttachmentReadEXT() const { return nonCoherentStencilAttachmentReadEXT; } void setPostDepthCoverage() { postDepthCoverage = true; } bool getPostDepthCoverage() const { return postDepthCoverage; } void setEarlyFragmentTests() { earlyFragmentTests = true; } @@ -1215,6 +1229,9 @@ protected: bool earlyFragmentTests; bool postDepthCoverage; bool earlyAndLateFragmentTestsAMD; + bool nonCoherentColorAttachmentReadEXT; + bool nonCoherentDepthAttachmentReadEXT; + bool nonCoherentStencilAttachmentReadEXT; TLayoutDepth depthLayout; TLayoutStencil stencilLayout; bool hlslFunctionality1; diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index ac1ea7a8e..121bfca31 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -85,9 +85,6 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif -#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) -#define snprintf sprintf_s -#endif #include #include From a3598c6d2834bb392f4d465ece240327fbda15bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 14 May 2023 08:48:16 -0700 Subject: [PATCH 85/86] Updated spirv-cross. --- 3rdparty/spirv-cross/spirv_cross.cpp | 45 +++- 3rdparty/spirv-cross/spirv_cross.hpp | 2 + 3rdparty/spirv-cross/spirv_glsl.cpp | 354 ++++++++++++++++++++++--- 3rdparty/spirv-cross/spirv_glsl.hpp | 17 +- 3rdparty/spirv-cross/spirv_msl.cpp | 14 +- 3rdparty/spirv-cross/spirv_reflect.cpp | 2 +- 6 files changed, 393 insertions(+), 41 deletions(-) diff --git a/3rdparty/spirv-cross/spirv_cross.cpp b/3rdparty/spirv-cross/spirv_cross.cpp index edc98f81e..49cc83868 100644 --- a/3rdparty/spirv-cross/spirv_cross.cpp +++ b/3rdparty/spirv-cross/spirv_cross.cpp @@ -5445,18 +5445,55 @@ void Compiler::analyze_interlocked_resource_usage() } bool Compiler::type_is_array_of_pointers(const SPIRType &type) const +{ + if (!type_is_top_level_array(type)) + return false; + + // BDA types must have parent type hierarchy. + if (!type.parent_type) + return false; + + // Punch through all array layers. + auto *parent = &get(type.parent_type); + while (type_is_top_level_array(*parent)) + parent = &get(parent->parent_type); + + return type_is_top_level_pointer(*parent); +} + +bool Compiler::type_is_top_level_pointer(const SPIRType &type) const { if (!type.pointer) return false; - // If parent type has same pointer depth, we must have an array of pointers. - return type.pointer_depth == get(type.parent_type).pointer_depth; + // Function pointers, should not be hit by valid SPIR-V. + // Parent type will be SPIRFunction instead. + if (type.basetype == SPIRType::Unknown) + return false; + + // Some types are synthesized in-place without complete type hierarchy and might not have parent types, + // but these types are never array-of-pointer or any complicated BDA type, infer reasonable defaults. + if (type.parent_type) + return type.pointer_depth > get(type.parent_type).pointer_depth; + else + return true; } bool Compiler::type_is_top_level_physical_pointer(const SPIRType &type) const { - return type.pointer && type.storage == StorageClassPhysicalStorageBuffer && - type.pointer_depth > get(type.parent_type).pointer_depth; + return type_is_top_level_pointer(type) && type.storage == StorageClassPhysicalStorageBuffer; +} + +bool Compiler::type_is_top_level_array(const SPIRType &type) const +{ + if (type.array.empty()) + return false; + + // If we have pointer and array, we infer pointer-to-array as it's the only meaningful thing outside BDA. + if (type.parent_type) + return type.array.size() > get(type.parent_type).array.size(); + else + return !type.pointer; } bool Compiler::flush_phi_required(BlockID from, BlockID to) const diff --git a/3rdparty/spirv-cross/spirv_cross.hpp b/3rdparty/spirv-cross/spirv_cross.hpp index ea98ee60d..b99b7ae7a 100644 --- a/3rdparty/spirv-cross/spirv_cross.hpp +++ b/3rdparty/spirv-cross/spirv_cross.hpp @@ -1145,6 +1145,8 @@ protected: bool type_is_array_of_pointers(const SPIRType &type) const; bool type_is_top_level_physical_pointer(const SPIRType &type) const; + bool type_is_top_level_pointer(const SPIRType &type) const; + bool type_is_top_level_array(const SPIRType &type) const; bool type_is_block_like(const SPIRType &type) const; bool type_is_opaque_value(const SPIRType &type) const; diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index f4ceab6ae..e03111673 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #ifndef _WIN32 #include @@ -1521,7 +1522,7 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bits { // If using PhysicalStorageBufferEXT storage class, this is a pointer, // and is 64-bit. - if (type.storage == StorageClassPhysicalStorageBufferEXT) + if (type_is_top_level_physical_pointer(type)) { if (!type.pointer) SPIRV_CROSS_THROW("Types in PhysicalStorageBufferEXT must be pointers."); @@ -1536,8 +1537,7 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bits else SPIRV_CROSS_THROW("AddressingModelPhysicalStorageBuffer64EXT must be used for PhysicalStorageBufferEXT."); } - - if (!type.array.empty()) + else if (type_is_top_level_array(type)) { uint32_t minimum_alignment = 1; if (packing_is_vec4_padded(packing)) @@ -1643,7 +1643,19 @@ uint32_t CompilerGLSL::type_to_packed_array_stride(const SPIRType &type, const B uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing) { - if (!type.array.empty()) + // If using PhysicalStorageBufferEXT storage class, this is a pointer, + // and is 64-bit. + if (type_is_top_level_physical_pointer(type)) + { + if (!type.pointer) + SPIRV_CROSS_THROW("Types in PhysicalStorageBufferEXT must be pointers."); + + if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64EXT) + return 8; + else + SPIRV_CROSS_THROW("AddressingModelPhysicalStorageBuffer64EXT must be used for PhysicalStorageBufferEXT."); + } + else if (type_is_top_level_array(type)) { uint32_t packed_size = to_array_size_literal(type) * type_to_packed_array_stride(type, flags, packing); @@ -1655,19 +1667,6 @@ uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, const Bitset &f return packed_size; } - // If using PhysicalStorageBufferEXT storage class, this is a pointer, - // and is 64-bit. - if (type.storage == StorageClassPhysicalStorageBufferEXT) - { - if (!type.pointer) - SPIRV_CROSS_THROW("Types in PhysicalStorageBufferEXT must be pointers."); - - if (ir.addressing_model == AddressingModelPhysicalStorageBuffer64EXT) - return 8; - else - SPIRV_CROSS_THROW("AddressingModelPhysicalStorageBuffer64EXT must be used for PhysicalStorageBufferEXT."); - } - uint32_t size = 0; if (type.basetype == SPIRType::Struct) @@ -1834,8 +1833,9 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin } // Verify array stride rules. - if (!memb_type.array.empty() && type_to_packed_array_stride(memb_type, member_flags, packing) != - type_struct_member_array_stride(type, i)) + if (type_is_top_level_array(memb_type) && + type_to_packed_array_stride(memb_type, member_flags, packing) != + type_struct_member_array_stride(type, i)) { if (failed_validation_index) *failed_validation_index = i; @@ -3993,6 +3993,169 @@ void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) } } +void CompilerGLSL::emit_subgroup_arithmetic_workaround(const std::string &func, Op op, GroupOperation group_op) +{ + std::string result; + switch (group_op) + { + case GroupOperationReduce: + result = "reduction"; + break; + + case GroupOperationExclusiveScan: + result = "excl_scan"; + break; + + case GroupOperationInclusiveScan: + result = "incl_scan"; + break; + + default: + SPIRV_CROSS_THROW("Unsupported workaround for arithmetic group operation"); + } + + struct TypeInfo + { + std::string type; + std::string identity; + }; + + std::vector type_infos; + switch (op) + { + case OpGroupNonUniformIAdd: + { + type_infos.emplace_back(TypeInfo{ "uint", "0u" }); + type_infos.emplace_back(TypeInfo{ "uvec2", "uvec2(0u)" }); + type_infos.emplace_back(TypeInfo{ "uvec3", "uvec3(0u)" }); + type_infos.emplace_back(TypeInfo{ "uvec4", "uvec4(0u)" }); + type_infos.emplace_back(TypeInfo{ "int", "0" }); + type_infos.emplace_back(TypeInfo{ "ivec2", "ivec2(0)" }); + type_infos.emplace_back(TypeInfo{ "ivec3", "ivec3(0)" }); + type_infos.emplace_back(TypeInfo{ "ivec4", "ivec4(0)" }); + break; + } + + case OpGroupNonUniformFAdd: + { + type_infos.emplace_back(TypeInfo{ "float", "0.0f" }); + type_infos.emplace_back(TypeInfo{ "vec2", "vec2(0.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec3", "vec3(0.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec4", "vec4(0.0f)" }); + // ARB_gpu_shader_fp64 is required in GL4.0 which in turn is required by NV_thread_shuffle + type_infos.emplace_back(TypeInfo{ "double", "0.0LF" }); + type_infos.emplace_back(TypeInfo{ "dvec2", "dvec2(0.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec3", "dvec3(0.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec4", "dvec4(0.0LF)" }); + break; + } + + case OpGroupNonUniformIMul: + { + type_infos.emplace_back(TypeInfo{ "uint", "1u" }); + type_infos.emplace_back(TypeInfo{ "uvec2", "uvec2(1u)" }); + type_infos.emplace_back(TypeInfo{ "uvec3", "uvec3(1u)" }); + type_infos.emplace_back(TypeInfo{ "uvec4", "uvec4(1u)" }); + type_infos.emplace_back(TypeInfo{ "int", "1" }); + type_infos.emplace_back(TypeInfo{ "ivec2", "ivec2(1)" }); + type_infos.emplace_back(TypeInfo{ "ivec3", "ivec3(1)" }); + type_infos.emplace_back(TypeInfo{ "ivec4", "ivec4(1)" }); + break; + } + + case OpGroupNonUniformFMul: + { + type_infos.emplace_back(TypeInfo{ "float", "1.0f" }); + type_infos.emplace_back(TypeInfo{ "vec2", "vec2(1.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec3", "vec3(1.0f)" }); + type_infos.emplace_back(TypeInfo{ "vec4", "vec4(1.0f)" }); + type_infos.emplace_back(TypeInfo{ "double", "0.0LF" }); + type_infos.emplace_back(TypeInfo{ "dvec2", "dvec2(1.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec3", "dvec3(1.0LF)" }); + type_infos.emplace_back(TypeInfo{ "dvec4", "dvec4(1.0LF)" }); + break; + } + + default: + SPIRV_CROSS_THROW("Unsupported workaround for arithmetic group operation"); + } + + const bool op_is_addition = op == OpGroupNonUniformIAdd || op == OpGroupNonUniformFAdd; + const bool op_is_multiplication = op == OpGroupNonUniformIMul || op == OpGroupNonUniformFMul; + std::string op_symbol; + if (op_is_addition) + { + op_symbol = "+="; + } + else if (op_is_multiplication) + { + op_symbol = "*="; + } + + for (const TypeInfo &t : type_infos) + { + statement(t.type, " ", func, "(", t.type, " v)"); + begin_scope(); + statement(t.type, " ", result, " = ", t.identity, ";"); + statement("uvec4 active_threads = subgroupBallot(true);"); + statement("if (subgroupBallotBitCount(active_threads) == gl_SubgroupSize)"); + begin_scope(); + statement("uint total = gl_SubgroupSize / 2u;"); + statement(result, " = v;"); + statement("for (uint i = 1u; i <= total; i <<= 1u)"); + begin_scope(); + statement("bool valid;"); + if (group_op == GroupOperationReduce) + { + statement(t.type, " s = shuffleXorNV(", result, ", i, gl_SubgroupSize, valid);"); + } + else if (group_op == GroupOperationExclusiveScan || group_op == GroupOperationInclusiveScan) + { + statement(t.type, " s = shuffleUpNV(", result, ", i, gl_SubgroupSize, valid);"); + } + if (op_is_addition || op_is_multiplication) + { + statement(result, " ", op_symbol, " valid ? s : ", t.identity, ";"); + } + end_scope(); + if (group_op == GroupOperationExclusiveScan) + { + statement(result, " = shuffleUpNV(", result, ", 1u, gl_SubgroupSize);"); + statement("if (subgroupElect())"); + begin_scope(); + statement(result, " = ", t.identity, ";"); + end_scope(); + } + end_scope(); + statement("else"); + begin_scope(); + if (group_op == GroupOperationExclusiveScan) + { + statement("uint total = subgroupBallotBitCount(gl_SubgroupLtMask);"); + } + else if (group_op == GroupOperationInclusiveScan) + { + statement("uint total = subgroupBallotBitCount(gl_SubgroupLeMask);"); + } + statement("for (uint i = 0u; i < gl_SubgroupSize; ++i)"); + begin_scope(); + statement("bool valid = subgroupBallotBitExtract(active_threads, i);"); + statement(t.type, " s = shuffleNV(v, i, gl_SubgroupSize);"); + if (group_op == GroupOperationExclusiveScan || group_op == GroupOperationInclusiveScan) + { + statement("valid = valid && (i < total);"); + } + if (op_is_addition || op_is_multiplication) + { + statement(result, " ", op_symbol, " valid ? s : ", t.identity, ";"); + } + end_scope(); + end_scope(); + statement("return ", result, ";"); + end_scope(); + } +} + void CompilerGLSL::emit_extension_workarounds(spv::ExecutionModel model) { static const char *workaround_types[] = { "int", "ivec2", "ivec3", "ivec4", "uint", "uvec2", "uvec3", "uvec4", @@ -4396,6 +4559,57 @@ void CompilerGLSL::emit_extension_workarounds(spv::ExecutionModel model) statement("#endif"); statement(""); } + + auto arithmetic_feature_helper = + [&](Supp::Feature feat, std::string func_name, spv::Op op, spv::GroupOperation group_op) + { + if (shader_subgroup_supporter.is_feature_requested(feat)) + { + auto exts = Supp::get_candidates_for_feature(feat, result); + for (auto &e : exts) + { + const char *name = Supp::get_extension_name(e); + statement(&e == &exts.front() ? "#if" : "#elif", " defined(", name, ")"); + + switch (e) + { + case Supp::NV_shader_thread_shuffle: + emit_subgroup_arithmetic_workaround(func_name, op, group_op); + break; + default: + break; + } + } + statement("#endif"); + statement(""); + } + }; + + arithmetic_feature_helper(Supp::SubgroupArithmeticIAddReduce, "subgroupAdd", OpGroupNonUniformIAdd, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticIAddExclusiveScan, "subgroupExclusiveAdd", + OpGroupNonUniformIAdd, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticIAddInclusiveScan, "subgroupInclusiveAdd", + OpGroupNonUniformIAdd, GroupOperationInclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFAddReduce, "subgroupAdd", OpGroupNonUniformFAdd, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticFAddExclusiveScan, "subgroupExclusiveAdd", + OpGroupNonUniformFAdd, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFAddInclusiveScan, "subgroupInclusiveAdd", + OpGroupNonUniformFAdd, GroupOperationInclusiveScan); + + arithmetic_feature_helper(Supp::SubgroupArithmeticIMulReduce, "subgroupMul", OpGroupNonUniformIMul, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticIMulExclusiveScan, "subgroupExclusiveMul", + OpGroupNonUniformIMul, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticIMulInclusiveScan, "subgroupInclusiveMul", + OpGroupNonUniformIMul, GroupOperationInclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFMulReduce, "subgroupMul", OpGroupNonUniformFMul, + GroupOperationReduce); + arithmetic_feature_helper(Supp::SubgroupArithmeticFMulExclusiveScan, "subgroupExclusiveMul", + OpGroupNonUniformFMul, GroupOperationExclusiveScan); + arithmetic_feature_helper(Supp::SubgroupArithmeticFMulInclusiveScan, "subgroupInclusiveMul", + OpGroupNonUniformFMul, GroupOperationInclusiveScan); } if (!workaround_ubo_load_overload_types.empty()) @@ -7109,7 +7323,7 @@ string CompilerGLSL::to_combined_image_sampler(VariableID image_id, VariableID s } } -bool CompilerGLSL::is_supported_subgroup_op_in_opengl(spv::Op op) +bool CompilerGLSL::is_supported_subgroup_op_in_opengl(spv::Op op, const uint32_t *ops) { switch (op) { @@ -7128,6 +7342,22 @@ bool CompilerGLSL::is_supported_subgroup_op_in_opengl(spv::Op op) case OpGroupNonUniformBallotBitExtract: case OpGroupNonUniformInverseBallot: return true; + case OpGroupNonUniformIAdd: + case OpGroupNonUniformFAdd: + case OpGroupNonUniformIMul: + case OpGroupNonUniformFMul: + { + const GroupOperation operation = static_cast(ops[3]); + if (operation == GroupOperationReduce || operation == GroupOperationInclusiveScan || + operation == GroupOperationExclusiveScan) + { + return true; + } + else + { + return false; + } + } default: return false; } @@ -7522,7 +7752,7 @@ bool CompilerGLSL::expression_is_constant_null(uint32_t id) const bool CompilerGLSL::expression_is_non_value_type_array(uint32_t ptr) { auto &type = expression_type(ptr); - if (type.array.empty()) + if (!type_is_top_level_array(get_pointee_type(type))) return false; if (!backend.array_is_value_type) @@ -8725,7 +8955,7 @@ void CompilerGLSL::emit_subgroup_op(const Instruction &i) const uint32_t *ops = stream(i); auto op = static_cast(i.op); - if (!options.vulkan_semantics && !is_supported_subgroup_op_in_opengl(op)) + if (!options.vulkan_semantics && !is_supported_subgroup_op_in_opengl(op, ops)) SPIRV_CROSS_THROW("This subgroup operation is only supported in Vulkan semantics."); // If we need to do implicit bitcasts, make sure we do it with the correct type. @@ -8793,12 +9023,34 @@ void CompilerGLSL::emit_subgroup_op(const Instruction &i) } break; - case OpGroupNonUniformFAdd: - case OpGroupNonUniformFMul: + // clang-format off +#define GLSL_GROUP_OP(OP)\ + case OpGroupNonUniform##OP:\ + {\ + auto operation = static_cast(ops[3]);\ + if (operation == GroupOperationClusteredReduce)\ + require_extension_internal("GL_KHR_shader_subgroup_clustered");\ + else if (operation == GroupOperationReduce)\ + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupArithmetic##OP##Reduce);\ + else if (operation == GroupOperationExclusiveScan)\ + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupArithmetic##OP##ExclusiveScan);\ + else if (operation == GroupOperationInclusiveScan)\ + request_subgroup_feature(ShaderSubgroupSupportHelper::SubgroupArithmetic##OP##InclusiveScan);\ + else\ + SPIRV_CROSS_THROW("Invalid group operation.");\ + break;\ + } + + GLSL_GROUP_OP(IAdd) + GLSL_GROUP_OP(FAdd) + GLSL_GROUP_OP(IMul) + GLSL_GROUP_OP(FMul) + +#undef GLSL_GROUP_OP + // clang-format on + case OpGroupNonUniformFMin: case OpGroupNonUniformFMax: - case OpGroupNonUniformIAdd: - case OpGroupNonUniformIMul: case OpGroupNonUniformSMin: case OpGroupNonUniformSMax: case OpGroupNonUniformUMin: @@ -17667,6 +17919,7 @@ const char *CompilerGLSL::ShaderSubgroupSupportHelper::get_extension_name(Candid static const char *const retval[CandidateCount] = { "GL_KHR_shader_subgroup_ballot", "GL_KHR_shader_subgroup_basic", "GL_KHR_shader_subgroup_vote", + "GL_KHR_shader_subgroup_arithmetic", "GL_NV_gpu_shader_5", "GL_NV_shader_thread_group", "GL_NV_shader_thread_shuffle", @@ -17715,6 +17968,21 @@ CompilerGLSL::ShaderSubgroupSupportHelper::FeatureVector CompilerGLSL::ShaderSub return { SubgroupMask }; case SubgroupBallotBitCount: return { SubgroupBallot }; + case SubgroupArithmeticIAddReduce: + case SubgroupArithmeticIAddInclusiveScan: + case SubgroupArithmeticFAddReduce: + case SubgroupArithmeticFAddInclusiveScan: + case SubgroupArithmeticIMulReduce: + case SubgroupArithmeticIMulInclusiveScan: + case SubgroupArithmeticFMulReduce: + case SubgroupArithmeticFMulInclusiveScan: + return { SubgroupSize, SubgroupBallot, SubgroupBallotBitCount, SubgroupMask, SubgroupBallotBitExtract }; + case SubgroupArithmeticIAddExclusiveScan: + case SubgroupArithmeticFAddExclusiveScan: + case SubgroupArithmeticIMulExclusiveScan: + case SubgroupArithmeticFMulExclusiveScan: + return { SubgroupSize, SubgroupBallot, SubgroupBallotBitCount, + SubgroupMask, SubgroupElect, SubgroupBallotBitExtract }; default: return {}; } @@ -17728,11 +17996,15 @@ CompilerGLSL::ShaderSubgroupSupportHelper::FeatureMask CompilerGLSL::ShaderSubgr bool CompilerGLSL::ShaderSubgroupSupportHelper::can_feature_be_implemented_without_extensions(Feature feature) { - static const bool retval[FeatureCount] = { false, false, false, false, false, false, - true, // SubgroupBalloFindLSB_MSB - false, false, false, false, - true, // SubgroupMemBarrier - replaced with workgroup memory barriers - false, false, true, false }; + static const bool retval[FeatureCount] = { + false, false, false, false, false, false, + true, // SubgroupBalloFindLSB_MSB + false, false, false, false, + true, // SubgroupMemBarrier - replaced with workgroup memory barriers + false, false, true, false, + false, false, false, false, false, false, // iadd, fadd + false, false, false, false, false, false, // imul , fmul + }; return retval[feature]; } @@ -17744,7 +18016,11 @@ CompilerGLSL::ShaderSubgroupSupportHelper::Candidate CompilerGLSL::ShaderSubgrou KHR_shader_subgroup_ballot, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_vote, KHR_shader_subgroup_vote, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, KHR_shader_subgroup_basic, - KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot + KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, KHR_shader_subgroup_ballot, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, + KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, KHR_shader_subgroup_arithmetic, }; return extensions[feature]; @@ -17840,6 +18116,19 @@ CompilerGLSL::ShaderSubgroupSupportHelper::CandidateVector CompilerGLSL::ShaderS return { NV_shader_thread_group }; case SubgroupBallotBitCount: return {}; + case SubgroupArithmeticIAddReduce: + case SubgroupArithmeticIAddExclusiveScan: + case SubgroupArithmeticIAddInclusiveScan: + case SubgroupArithmeticFAddReduce: + case SubgroupArithmeticFAddExclusiveScan: + case SubgroupArithmeticFAddInclusiveScan: + case SubgroupArithmeticIMulReduce: + case SubgroupArithmeticIMulExclusiveScan: + case SubgroupArithmeticIMulInclusiveScan: + case SubgroupArithmeticFMulReduce: + case SubgroupArithmeticFMulExclusiveScan: + case SubgroupArithmeticFMulInclusiveScan: + return { KHR_shader_subgroup_arithmetic, NV_shader_thread_shuffle }; default: return {}; } @@ -17864,6 +18153,7 @@ CompilerGLSL::ShaderSubgroupSupportHelper::Result::Result() weights[KHR_shader_subgroup_ballot] = big_num; weights[KHR_shader_subgroup_basic] = big_num; weights[KHR_shader_subgroup_vote] = big_num; + weights[KHR_shader_subgroup_arithmetic] = big_num; } void CompilerGLSL::request_workaround_wrapper_overload(TypeID id) diff --git a/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/spirv-cross/spirv_glsl.hpp index 0b40ed801..d6e2477e0 100644 --- a/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/3rdparty/spirv-cross/spirv_glsl.hpp @@ -292,6 +292,7 @@ protected: KHR_shader_subgroup_ballot, KHR_shader_subgroup_basic, KHR_shader_subgroup_vote, + KHR_shader_subgroup_arithmetic, NV_gpu_shader_5, NV_shader_thread_group, NV_shader_thread_shuffle, @@ -324,7 +325,18 @@ protected: SubgroupInverseBallot_InclBitCount_ExclBitCout = 13, SubgroupBallotBitExtract = 14, SubgroupBallotBitCount = 15, - + SubgroupArithmeticIAddReduce = 16, + SubgroupArithmeticIAddExclusiveScan = 17, + SubgroupArithmeticIAddInclusiveScan = 18, + SubgroupArithmeticFAddReduce = 19, + SubgroupArithmeticFAddExclusiveScan = 20, + SubgroupArithmeticFAddInclusiveScan = 21, + SubgroupArithmeticIMulReduce = 22, + SubgroupArithmeticIMulExclusiveScan = 23, + SubgroupArithmeticIMulInclusiveScan = 24, + SubgroupArithmeticFMulReduce = 25, + SubgroupArithmeticFMulExclusiveScan = 26, + SubgroupArithmeticFMulInclusiveScan = 27, FeatureCount }; @@ -358,7 +370,7 @@ protected: }; // TODO remove this function when all subgroup ops are supported (or make it always return true) - static bool is_supported_subgroup_op_in_opengl(spv::Op op); + static bool is_supported_subgroup_op_in_opengl(spv::Op op, const uint32_t *ops); void reset(uint32_t iteration_count); void emit_function(SPIRFunction &func, const Bitset &return_flags); @@ -627,6 +639,7 @@ protected: void emit_struct(SPIRType &type); void emit_resources(); void emit_extension_workarounds(spv::ExecutionModel model); + void emit_subgroup_arithmetic_workaround(const std::string &func, spv::Op op, spv::GroupOperation group_op); void emit_polyfills(uint32_t polyfills, bool relaxed); void emit_buffer_block_native(const SPIRVariable &var); void emit_buffer_reference_block(uint32_t type_id, bool forward_declaration); diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index 3791264a4..3f03f1c28 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -9603,7 +9603,7 @@ bool CompilerMSL::maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs) { // We only care about assignments of an entire array auto &type = expression_type(id_rhs); - if (type.array.size() == 0) + if (!type_is_top_level_array(get_pointee_type(type))) return false; auto *var = maybe_get(id_lhs); @@ -14550,7 +14550,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member) string type_name; // Pointer? - if (type.pointer) + if (type_is_top_level_pointer(type) || type_is_array_of_pointers(type)) { assert(type.pointer_depth > 0); @@ -14573,7 +14573,17 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member) while (type_is_pointer(*p_parent_type)) p_parent_type = &get(p_parent_type->parent_type); + // If we're emitting BDA, just use the templated type. + // Emitting builtin arrays need a lot of cooperation with other code to ensure + // the C-style nesting works right. + // FIXME: This is somewhat of a hack. + bool old_is_using_builtin_array = is_using_builtin_array; + if (type_is_top_level_physical_pointer(type)) + is_using_builtin_array = false; + type_name = join(type_address_space, " ", type_to_glsl(*p_parent_type, id)); + + is_using_builtin_array = old_is_using_builtin_array; } switch (type.basetype) diff --git a/3rdparty/spirv-cross/spirv_reflect.cpp b/3rdparty/spirv-cross/spirv_reflect.cpp index 0bd224e6c..9fcd3bc09 100644 --- a/3rdparty/spirv-cross/spirv_reflect.cpp +++ b/3rdparty/spirv-cross/spirv_reflect.cpp @@ -292,7 +292,7 @@ bool CompilerReflection::type_is_reference(const SPIRType &type) const { // Physical pointers and arrays of physical pointers need to refer to the pointee's type. return type_is_top_level_physical_pointer(type) || - (!type.array.empty() && type_is_top_level_physical_pointer(get(type.parent_type))); + (type_is_array_of_pointers(type) && type.storage == StorageClassPhysicalStorageBuffer); } void CompilerReflection::emit_types() From 2d3a057a684aaad133c2a69327f5d173c01d85a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 14 May 2023 08:48:28 -0700 Subject: [PATCH 86/86] Updated spirv-tools. --- .../include/generated/build-version.inc | 2 +- .../opt/aggressive_dead_code_elim_pass.cpp | 3 +- .../source/opt/convert_to_half_pass.cpp | 8 + .../source/opt/convert_to_half_pass.h | 1 + .../source/opt/scalar_replacement_pass.cpp | 162 +++++++++--------- .../source/opt/scalar_replacement_pass.h | 17 ++ .../spirv-tools/source/opt/type_manager.cpp | 4 +- 3rdparty/spirv-tools/source/opt/types.cpp | 3 +- 3rdparty/spirv-tools/source/opt/types.h | 14 +- 9 files changed, 121 insertions(+), 93 deletions(-) diff --git a/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/spirv-tools/include/generated/build-version.inc index b04070ca6..49fb2f5db 100644 --- a/3rdparty/spirv-tools/include/generated/build-version.inc +++ b/3rdparty/spirv-tools/include/generated/build-version.inc @@ -1 +1 @@ -"v2023.2", "SPIRV-Tools v2023.2 v2022.4-192-ge472626b" +"v2023.2", "SPIRV-Tools v2023.2 v2022.4-196-g1b88382e" diff --git a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp index 51a65245f..16456386b 100644 --- a/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp @@ -156,7 +156,8 @@ bool AggressiveDCEPass::AllExtensionsSupported() const { "Expecting an import of an extension's instruction set."); const std::string extension_name = inst.GetInOperand(0).AsString(); if (spvtools::utils::starts_with(extension_name, "NonSemantic.") && - extension_name != "NonSemantic.Shader.DebugInfo.100") { + (extension_name != "NonSemantic.Shader.DebugInfo.100") && + (extension_name != "NonSemantic.DebugPrintf")) { return false; } } diff --git a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp index 7a4c1f409..2c4a631e1 100644 --- a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp @@ -39,6 +39,13 @@ bool ConvertToHalfPass::IsFloat(Instruction* inst, uint32_t width) { return Pass::IsFloat(ty_id, width); } +bool ConvertToHalfPass::IsStruct(Instruction* inst) { + uint32_t ty_id = inst->type_id(); + if (ty_id == 0) return false; + Instruction* ty_inst = Pass::GetBaseType(ty_id); + return (ty_inst->opcode() == spv::Op::OpTypeStruct); +} + bool ConvertToHalfPass::IsDecoratedRelaxed(Instruction* inst) { uint32_t r_id = inst->result_id(); for (auto r_inst : get_decoration_mgr()->GetDecorationsFor(r_id, false)) @@ -294,6 +301,7 @@ bool ConvertToHalfPass::CloseRelaxInst(Instruction* inst) { bool relax = true; inst->ForEachInId([&relax, this](uint32_t* idp) { Instruction* op_inst = get_def_use_mgr()->GetDef(*idp); + if (IsStruct(op_inst)) relax = false; if (!IsFloat(op_inst, 32)) return; if (!IsRelaxed(*idp)) relax = false; }); diff --git a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h index feabfba3e..24a478ffc 100644 --- a/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h +++ b/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h @@ -45,6 +45,7 @@ class ConvertToHalfPass : public Pass { // Return true if |inst| returns scalar, vector or matrix type with base // float and |width| bool IsFloat(Instruction* inst, uint32_t width); + bool IsStruct(Instruction* inst); // Return true if |inst| is decorated with RelaxedPrecision bool IsDecoratedRelaxed(Instruction* inst); diff --git a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp index ae1a2a363..38c8aeccc 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp +++ b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp @@ -466,9 +466,9 @@ void ScalarReplacementPass::TransferAnnotations( } void ScalarReplacementPass::CreateVariable( - uint32_t typeId, Instruction* varInst, uint32_t index, + uint32_t type_id, Instruction* var_inst, uint32_t index, std::vector* replacements) { - uint32_t ptrId = GetOrCreatePointerType(typeId); + uint32_t ptr_id = GetOrCreatePointerType(type_id); uint32_t id = TakeNextId(); if (id == 0) { @@ -476,51 +476,22 @@ void ScalarReplacementPass::CreateVariable( } std::unique_ptr variable( - new Instruction(context(), spv::Op::OpVariable, ptrId, id, + new Instruction(context(), spv::Op::OpVariable, ptr_id, id, std::initializer_list{ {SPV_OPERAND_TYPE_STORAGE_CLASS, {uint32_t(spv::StorageClass::Function)}}})); - BasicBlock* block = context()->get_instr_block(varInst); + BasicBlock* block = context()->get_instr_block(var_inst); block->begin().InsertBefore(std::move(variable)); Instruction* inst = &*block->begin(); // If varInst was initialized, make sure to initialize its replacement. - GetOrCreateInitialValue(varInst, index, inst); + GetOrCreateInitialValue(var_inst, index, inst); get_def_use_mgr()->AnalyzeInstDefUse(inst); context()->set_instr_block(inst, block); - // Copy decorations from the member to the new variable. - Instruction* typeInst = GetStorageType(varInst); - for (auto dec_inst : - get_decoration_mgr()->GetDecorationsFor(typeInst->result_id(), false)) { - uint32_t decoration; - if (dec_inst->opcode() != spv::Op::OpMemberDecorate) { - continue; - } - - if (dec_inst->GetSingleWordInOperand(1) != index) { - continue; - } - - decoration = dec_inst->GetSingleWordInOperand(2u); - switch (spv::Decoration(decoration)) { - case spv::Decoration::RelaxedPrecision: { - std::unique_ptr new_dec_inst( - new Instruction(context(), spv::Op::OpDecorate, 0, 0, {})); - new_dec_inst->AddOperand(Operand(SPV_OPERAND_TYPE_ID, {id})); - for (uint32_t i = 2; i < dec_inst->NumInOperandWords(); ++i) { - new_dec_inst->AddOperand(Operand(dec_inst->GetInOperand(i))); - } - context()->AddAnnotationInst(std::move(new_dec_inst)); - } break; - default: - break; - } - } - - // Update the DebugInfo debug information. - inst->UpdateDebugInfoFrom(varInst); + CopyDecorationsToVariable(var_inst, inst, index); + inst->UpdateDebugInfoFrom(var_inst); replacements->push_back(inst); } @@ -529,52 +500,11 @@ uint32_t ScalarReplacementPass::GetOrCreatePointerType(uint32_t id) { auto iter = pointee_to_pointer_.find(id); if (iter != pointee_to_pointer_.end()) return iter->second; - analysis::Type* pointeeTy; - std::unique_ptr pointerTy; - std::tie(pointeeTy, pointerTy) = - context()->get_type_mgr()->GetTypeAndPointerType( - id, spv::StorageClass::Function); - uint32_t ptrId = 0; - if (pointeeTy->IsUniqueType()) { - // Non-ambiguous type, just ask the type manager for an id. - ptrId = context()->get_type_mgr()->GetTypeInstruction(pointerTy.get()); - pointee_to_pointer_[id] = ptrId; - return ptrId; - } - - // Ambiguous type. We must perform a linear search to try and find the right - // type. - for (auto global : context()->types_values()) { - if (global.opcode() == spv::Op::OpTypePointer && - spv::StorageClass(global.GetSingleWordInOperand(0u)) == - spv::StorageClass::Function && - global.GetSingleWordInOperand(1u) == id) { - if (get_decoration_mgr()->GetDecorationsFor(id, false).empty()) { - // Only reuse a decoration-less pointer of the correct type. - ptrId = global.result_id(); - break; - } - } - } - - if (ptrId != 0) { - pointee_to_pointer_[id] = ptrId; - return ptrId; - } - - ptrId = TakeNextId(); - context()->AddType(MakeUnique( - context(), spv::Op::OpTypePointer, 0, ptrId, - std::initializer_list{{SPV_OPERAND_TYPE_STORAGE_CLASS, - {uint32_t(spv::StorageClass::Function)}}, - {SPV_OPERAND_TYPE_ID, {id}}})); - Instruction* ptr = &*--context()->types_values_end(); - get_def_use_mgr()->AnalyzeInstDefUse(ptr); - pointee_to_pointer_[id] = ptrId; - // Register with the type manager if necessary. - context()->get_type_mgr()->RegisterType(ptrId, *pointerTy); - - return ptrId; + analysis::TypeManager* type_mgr = context()->get_type_mgr(); + uint32_t ptr_type_id = + type_mgr->FindPointerToType(id, spv::StorageClass::Function); + pointee_to_pointer_[id] = ptr_type_id; + return ptr_type_id; } void ScalarReplacementPass::GetOrCreateInitialValue(Instruction* source, @@ -761,6 +691,8 @@ bool ScalarReplacementPass::CheckTypeAnnotations( case spv::Decoration::AlignmentId: case spv::Decoration::MaxByteOffset: case spv::Decoration::RelaxedPrecision: + case spv::Decoration::AliasedPointer: + case spv::Decoration::RestrictPointer: break; default: return false; @@ -781,6 +713,8 @@ bool ScalarReplacementPass::CheckAnnotations(const Instruction* varInst) const { case spv::Decoration::Alignment: case spv::Decoration::AlignmentId: case spv::Decoration::MaxByteOffset: + case spv::Decoration::AliasedPointer: + case spv::Decoration::RestrictPointer: break; default: return false; @@ -1011,5 +945,69 @@ uint64_t ScalarReplacementPass::GetMaxLegalIndex( return 0; } +void ScalarReplacementPass::CopyDecorationsToVariable(Instruction* from, + Instruction* to, + uint32_t member_index) { + CopyPointerDecorationsToVariable(from, to); + CopyNecessaryMemberDecorationsToVariable(from, to, member_index); +} + +void ScalarReplacementPass::CopyPointerDecorationsToVariable(Instruction* from, + Instruction* to) { + // The RestrictPointer and AliasedPointer decorations are copied to all + // members even if the new variable does not contain a pointer. It does + // not hurt to do so. + for (auto dec_inst : + get_decoration_mgr()->GetDecorationsFor(from->result_id(), false)) { + uint32_t decoration; + decoration = dec_inst->GetSingleWordInOperand(1u); + switch (spv::Decoration(decoration)) { + case spv::Decoration::AliasedPointer: + case spv::Decoration::RestrictPointer: { + std::unique_ptr new_dec_inst(dec_inst->Clone(context())); + new_dec_inst->SetInOperand(0, {to->result_id()}); + context()->AddAnnotationInst(std::move(new_dec_inst)); + } break; + default: + break; + } + } +} + +void ScalarReplacementPass::CopyNecessaryMemberDecorationsToVariable( + Instruction* from, Instruction* to, uint32_t member_index) { + Instruction* type_inst = GetStorageType(from); + for (auto dec_inst : + get_decoration_mgr()->GetDecorationsFor(type_inst->result_id(), false)) { + uint32_t decoration; + if (dec_inst->opcode() == spv::Op::OpMemberDecorate) { + if (dec_inst->GetSingleWordInOperand(1) != member_index) { + continue; + } + + decoration = dec_inst->GetSingleWordInOperand(2u); + switch (spv::Decoration(decoration)) { + case spv::Decoration::ArrayStride: + case spv::Decoration::Alignment: + case spv::Decoration::AlignmentId: + case spv::Decoration::MaxByteOffset: + case spv::Decoration::MaxByteOffsetId: + case spv::Decoration::RelaxedPrecision: { + std::unique_ptr new_dec_inst( + new Instruction(context(), spv::Op::OpDecorate, 0, 0, {})); + new_dec_inst->AddOperand( + Operand(SPV_OPERAND_TYPE_ID, {to->result_id()})); + for (uint32_t i = 2; i < dec_inst->NumInOperandWords(); ++i) { + new_dec_inst->AddOperand(Operand(dec_inst->GetInOperand(i))); + } + context()->AddAnnotationInst(std::move(new_dec_inst)); + } break; + default: + break; + } + } + } +} + } // namespace opt } // namespace spvtools diff --git a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h index 0bcd2a4e4..c73ecfd98 100644 --- a/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h +++ b/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h @@ -262,9 +262,26 @@ class ScalarReplacementPass : public MemPass { // that we will be willing to split. bool IsLargerThanSizeLimit(uint64_t length) const; + // Copies all relevant decorations from `from` to `to`. This includes + // decorations applied to the variable, and to the members of the type. + // It is assumed that `to` is a variable that is intended to replace the + // `member_index`th member of `from`. + void CopyDecorationsToVariable(Instruction* from, Instruction* to, + uint32_t member_index); + + // Copies pointer related decoration from `from` to `to` if they exist. + void CopyPointerDecorationsToVariable(Instruction* from, Instruction* to); + + // Copies decorations that are needed from the `member_index` of `from` to + // `to, if there was one. + void CopyNecessaryMemberDecorationsToVariable(Instruction* from, + Instruction* to, + uint32_t member_index); + // Limit on the number of members in an object that will be replaced. // 0 means there is no limit. uint32_t max_num_elements_; + // This has to be big enough to fit "scalar-replacement=" followed by a // uint32_t number written in decimal (so 10 digits), and then a // terminating nul. diff --git a/3rdparty/spirv-tools/source/opt/type_manager.cpp b/3rdparty/spirv-tools/source/opt/type_manager.cpp index 6e4c054ef..1b1aeadc8 100644 --- a/3rdparty/spirv-tools/source/opt/type_manager.cpp +++ b/3rdparty/spirv-tools/source/opt/type_manager.cpp @@ -178,7 +178,7 @@ void TypeManager::RemoveId(uint32_t id) { if (iter == id_to_type_.end()) return; auto& type = iter->second; - if (!type->IsUniqueType(true)) { + if (!type->IsUniqueType()) { auto tIter = type_to_id_.find(type); if (tIter != type_to_id_.end() && tIter->second == id) { // |type| currently maps to |id|. @@ -437,7 +437,7 @@ uint32_t TypeManager::FindPointerToType(uint32_t type_id, spv::StorageClass storage_class) { Type* pointeeTy = GetType(type_id); Pointer pointerTy(pointeeTy, storage_class); - if (pointeeTy->IsUniqueType(true)) { + if (pointeeTy->IsUniqueType()) { // Non-ambiguous type. Get the pointer type through the type manager. return GetTypeInstruction(&pointerTy); } diff --git a/3rdparty/spirv-tools/source/opt/types.cpp b/3rdparty/spirv-tools/source/opt/types.cpp index 2f1836281..49eec9b74 100644 --- a/3rdparty/spirv-tools/source/opt/types.cpp +++ b/3rdparty/spirv-tools/source/opt/types.cpp @@ -84,10 +84,9 @@ bool Type::HasSameDecorations(const Type* that) const { return CompareTwoVectors(decorations_, that->decorations_); } -bool Type::IsUniqueType(bool allowVariablePointers) const { +bool Type::IsUniqueType() const { switch (kind_) { case kPointer: - return !allowVariablePointers; case kStruct: case kArray: case kRuntimeArray: diff --git a/3rdparty/spirv-tools/source/opt/types.h b/3rdparty/spirv-tools/source/opt/types.h index 1f329373b..26c058c6f 100644 --- a/3rdparty/spirv-tools/source/opt/types.h +++ b/3rdparty/spirv-tools/source/opt/types.h @@ -148,12 +148,16 @@ class Type { // Returns a clone of |this| minus any decorations. std::unique_ptr RemoveDecorations() const; - // Returns true if this type must be unique. + // Returns true if this cannot hash to the same value as another type in the + // module. For example, structs are not unique types because the module could + // have two types // - // If variable pointers are allowed, then pointers are not required to be - // unique. - // TODO(alanbaker): Update this if variable pointers become a core feature. - bool IsUniqueType(bool allowVariablePointers = false) const; + // %1 = OpTypeStruct %int + // %2 = OpTypeStruct %int + // + // The only way to distinguish these types is the result id. The type manager + // will hash them to the same value. + bool IsUniqueType() const; bool operator==(const Type& other) const;